-
1. Re: jboss-as-arquillian-container-manager 7.1.1.Final not working with @Asynchronous
m1ckey Sep 29, 2012 12:10 PM (in response to m1ckey)1 of 1 people found this helpfulI guess this is a known issue... ARQ-626.
Here's my workaround: http://blog.m1key.me/2012/09/arquillian-and-asynchronous.html
-
2. Re: jboss-as-arquillian-container-manager 7.1.1.Final not working with @Asynchronous
aslak Sep 30, 2012 10:45 AM (in response to m1ckey)What's the error?
-
3. Re: jboss-as-arquillian-container-manager 7.1.1.Final not working with @Asynchronous
aslak Sep 30, 2012 11:58 AM (in response to aslak)There is nothing broken with Async in Arquillian pr say. The problem you're facing is that when you call a Async method the execution in the TestClass continues (as defined by @Async, it's executed in a different Thread). If you don't wait for the Async method to finish 'somehow', Arquillian will finish the Test execution and undeploy the deployment. The NoClassDefFound error could come becasue the classes that is suppose to receive the Async call are now undeployed and no longer available in the container.
-
4. Re: jboss-as-arquillian-container-manager 7.1.1.Final not working with @Asynchronous
m1ckey Sep 30, 2012 12:01 PM (in response to aslak)This could be right, because the tests that was actually working was parsing a significantly smaller file - so maybe undeployment has not happened yet. What is the proposed solution then?
-
5. Re: jboss-as-arquillian-container-manager 7.1.1.Final not working with @Asynchronous
aslak Sep 30, 2012 12:13 PM (in response to m1ckey)1 of 1 people found this helpfulYou need to wait somehow..
This is a example using CDI to deploy special/alternative test Beans of the same type to handle around/invoke type latches on Async methods:
-
6. Re: jboss-as-arquillian-container-manager 7.1.1.Final not working with @Asynchronous
m1ckey Sep 30, 2012 12:15 PM (in response to aslak)Hmm, yes. This is not ideal, but I can see what the problem is now. Thanks, Aslak!