-
1. Re: ConversationScoped in Arquillian with WeldEmbedded
nickarls Jun 19, 2010 2:39 AM (in response to nfeybesse.nfeybesse.middlewarefactory.com)Personally, I think the conversation scope should be enabled in Arquillian (until someone from the ARQ-team says otherwise).
You could try @Injecting BeanManager, casting it to BeanManagerImpl, acquire the conversation context and activating it manually. Another way might be using the static Container and get the ContextLifecycle service and move on from there but I'm not sure if the static is set correctly in an Arq-test...
-
2. Re: ConversationScoped in Arquillian with WeldEmbedded
nfeybesse.nfeybesse.middlewarefactory.com Jun 19, 2010 3:24 AM (in response to nfeybesse.nfeybesse.middlewarefactory.com)Thanks Nicklas,
Container.instance().services().get(ContextLifecycle.class).setupConversationContext();
seams to work.
NF
-
3. Re: ConversationScoped in Arquillian with WeldEmbedded
dan.j.allen Jun 19, 2010 8:31 PM (in response to nfeybesse.nfeybesse.middlewarefactory.com)I ran into the same problem when writing Arquillian tests for the Seam 3 booking example. We need to add this support both in Weld Embedded and in the remote containers. The reason we still need it in the remote containers is because the remote execution of the test goes through a custom servlet, not the JSF servlet. So we have the same problem...no conversation context.
I encourage you to come over to the Arquillian forums to discuss this issue.
-
4. Re: ConversationScoped in Arquillian with WeldEmbedded
dan.j.allen Jun 19, 2010 8:32 PM (in response to nfeybesse.nfeybesse.middlewarefactory.com)Here's the JIRA. https://jira.jboss.org/browse/ARQ-185
-
5. Re: ConversationScoped in Arquillian with WeldEmbedded
nfeybesse.nfeybesse.middlewarefactory.com Jun 24, 2010 3:23 PM (in response to nfeybesse.nfeybesse.middlewarefactory.com)I think my problem was a bug in TestNG.
@Test with a timeOut is the problem.
@AfterMethod is called before the Run() method in class Arquillian.java and close the conversation scope.
Without
timeOut
all is ok and Conversation Scope is activated.See : My Link
NF
-
6. Re: ConversationScoped in Arquillian with WeldEmbedded
sviluppatorefico Sep 19, 2012 4:06 AM (in response to nfeybesse.nfeybesse.middlewarefactory.com)What is the
ContextLifecycle.class ?
Triing so inside a test, it seems work:
import org.jboss.weld.Container;
import org.jboss.weld.context.http.HttpConversationContext;
.........
Container.instance().deploymentManager().instance()
.select(HttpConversationContext.class).get().activate();
-
7. Re: ConversationScoped in Arquillian with WeldEmbedded
yasharbi May 15, 2014 5:22 AM (in response to sviluppatorefico)thanks Luca , your solution is working for me.
I just copied you code in @Before in my test class , and it is working fine