You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by xeseo <xe...@gmail.com> on 2012/09/19 09:11:16 UTC

Mutiple module share the same container?

Hi,
In my project, several modules are under same pom project.
Like:
Parent (pom)
 |
 | ---- module A (jar)
 | ---- module B (jar)
 | ---- module C (jar)

We're using openEJB as embeded container for unit test. However, each module
will have to own its own jndi.properties, and during the Maven install
procedure, the container will init three times and cost lots of time.
Obviously, there will be more modules in the future. Then the test will cost
more time initializing the container.

So is it possible that different modules share the same container? Use one
centralized jndi.properties to replace all.
Do anyone have the idea?

Thanks,



--
View this message in context: http://openejb.979440.n4.nabble.com/Mutiple-module-share-the-same-container-tp4657506.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Mutiple module share the same container?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
jndi.properties is used at startup so by container

BTW starting 3 times the container for a project is not an issue (startup
is an issue for a bunch of tests but it is fast enough to be done by
module...excepted if each module has a single test ;)). You can still use
different configuration in a single module define surefire multiple time if
you need it (sample here:
http://svn.apache.org/repos/asf/openejb/trunk/openejb/examples/multi-jpa-provider-testing/pom.xml
)

*Romain Manni-Bucau*
*Twitter: @rmannibucau*
*Blog: http://rmannibucau.wordpress.com*




2012/9/19 Edison Xu <xe...@gmail.com>

> Actually, I'm not using arquillian for unit test. That will be the next
> option.
> Currently, I'm trying to write unit test cases following the instructions
> of
> openEJB, and it works.
> But as I mentioned, there'll be 3 jndi.properties under each child
> project's
> root of the classpath.
> And if I run clean install for the parent project, it will run the three
> child module with the unit test.
> So... three times container initialization will occur.
>
> By using Arquillian, it is possible to point a embedded container to run
> all
> test suites. But does openEJB support the shared jndi.properties and only
> initialize the container once for all?
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Re-Mutiple-module-share-the-same-container-tp4657508p4657514.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Mutiple module share the same container?

Posted by Edison Xu <xe...@gmail.com>.
Actually, I'm not using arquillian for unit test. That will be the next
option.
Currently, I'm trying to write unit test cases following the instructions of
openEJB, and it works.
But as I mentioned, there'll be 3 jndi.properties under each child project's
root of the classpath.
And if I run clean install for the parent project, it will run the three
child module with the unit test.
So... three times container initialization will occur.

By using Arquillian, it is possible to point a embedded container to run all
test suites. But does openEJB support the shared jndi.properties and only
initialize the container once for all?



--
View this message in context: http://openejb.979440.n4.nabble.com/Re-Mutiple-module-share-the-same-container-tp4657508p4657514.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Mutiple module share the same container?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi,

sharing some code could have helped but i think i got your point. Using the
openejb embedded arquillian adapter does the trick normally. It is
available on the snapshot and soon in the next release.

<artifactId>arquillian-openejb-embedded-4</artifactId>

<groupId>org.apache.openejb</groupId>

<version>1.1.1-SNAPSHOT</version>


*Romain Manni-Bucau*
*Twitter: @rmannibucau*
*Blog: http://rmannibucau.wordpress.com*




2012/9/19 xeseo <xe...@gmail.com>

> Hi,
> In my project, several modules are under same pom project.
> Like:
> Parent (pom)
>  |
>  | ---- module A (jar)
>  | ---- module B (jar)
>  | ---- module C (jar)
>
> We're using openEJB as embeded container for unit test. However, each
> module
> will have to own its own jndi.properties, and during the Maven install
> procedure, the container will init three times and cost lots of time.
> Obviously, there will be more modules in the future. Then the test will
> cost
> more time initializing the container.
>
> So is it possible that different modules share the same container? Use one
> centralized jndi.properties to replace all.
> Do anyone have the idea?
>
> Thanks,
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Mutiple-module-share-the-same-container-tp4657506.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>