Well, the ApplicationComposer lifecycle is linked to the class lifecycle =
we deploy/undeploy the app by test. This allows us to get finer integration
with frameworks like mockito (compared to arquillian for instance) and to
do real unit testing without side effects between tests.

IMO if you want a single deployment go with arquillian openejb embedded.

@Module, @Configuration... needs to be instance methods and not static but
what can be commonly done is to prepare the returned values in @BeforeClass
and just return the already computed model in @Module.

Would be great to see what is slow for you, i used it a lot and was pretty
fast. Maybe you use this tool for something it is not designed for, do you
have more details about it? maybe the startup logs?

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/7/30 Chris Owens <[email protected]>

> In an applicationComposer environment, how can I set up the EJB "plumbing"
> once for several JUnit tests?
>
> I would normally use a static @BeforeClass method to set things up and a
> static @AfterClass method to tear things down, but I don't understand how
> these would interact with the @Module annotation in ApplicationComposer.  I
> have searched but cannot find any comprehensive documentation on
> ApplicationComposer or @Module.
>
>
> Following the general pattern  here
> <http://tomee.apache.org/examples-trunk/application-composer/>  , I have
> set
> up some tests using application composer, as follows:
>
>
>
> What this code does, though is set up a persistence context once for each
> test, and then tear it down afterward.  The result is horribly slow
> testing.
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/ApplicationComposer-one-set-up-for-multiple-tests-tp4664421.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Reply via email to