You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by amber <am...@hotmail.fr> on 2015/04/17 11:25:02 UTC
openEJB perfs
Hello,
since we upgrade to 4.7.x ours tests are very slow. It's because we
start/stop properly OpenEJB (not the cas before ^^) :
@BeforeClass
public static void start() {
Properties p = new Properties();
...
// some hsqldb settings
...
container = EJBContainer.createEJBContainer();
}
@Before
public void inject() throws NamingException {
container.getContext().bind("inject", this);
}
@AfterClass
public static void stop() {
container.close();
}
works nice , but...too slow with many junit class (each class doing this
sequence start/stop with its own parameters)
Is there a way to improve perfs ?
thx
--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/openEJB-perfs-tp4674462.html
Sent from the TomEE Users mailing list archive at Nabble.com.
Re: openEJB perfs
Posted by Romain Manni-Bucau <rm...@gmail.com>.
if first test is very slow maybe we scan more jars than before in your
setup, configuring it would maybe help
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>
2015-04-21 15:55 GMT+02:00 amber <am...@hotmail.fr>:
> ok Romain, working now ^^
>
> Note : I tried the 2 methods :
>
> 1/
> ...
> @ManagedBean
> public class CourseTest {
>
> @Rule
> public EJBContainerRule r = new EJBContainerRule();
> @Before
> public void init()
> {
> r.inject(this);
> }
> ...
>
> => The first @test is always very slow, the others are ok
>
>
> 2/
> ...
> @ManagedBean
> public class CourseTest2 {
> @ClassRule
> public static final EJBContainerRule r = new EJBContainerRule();
>
> @Test
> public void test() {
> r.inject(this);
> ...
>
> ==> is quick on all tests, but the deawback is to put r.inject(this) on
> each test
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/openEJB-perfs-tp4674462p4674553.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>
Re: openEJB perfs
Posted by amber <am...@hotmail.fr>.
ok Romain, working now ^^
Note : I tried the 2 methods :
1/
...
@ManagedBean
public class CourseTest {
@Rule
public EJBContainerRule r = new EJBContainerRule();
@Before
public void init()
{
r.inject(this);
}
...
=> The first @test is always very slow, the others are ok
2/
...
@ManagedBean
public class CourseTest2 {
@ClassRule
public static final EJBContainerRule r = new EJBContainerRule();
@Test
public void test() {
r.inject(this);
...
==> is quick on all tests, but the deawback is to put r.inject(this) on
each test
--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/openEJB-perfs-tp4674462p4674553.html
Sent from the TomEE Users mailing list archive at Nabble.com.
Re: openEJB perfs
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Right cause the runner = the test so it is found automatically. To skip it
and only pick up @Managedbean tests add a property:
@org.apache.openejb.junit.jee.config.Property(key =
"openejb.additionnal.callers", value = "org.junit.Assert")
The value being anything which will get scanned but you can ignore.
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>
2015-04-21 11:15 GMT+02:00 amber <am...@hotmail.fr>:
> ok, my bad, back to junit 4.11 (works better!)
>
> but still problems with@ManagedBean, based on this article
> <
> https://rmannibucau.wordpress.com/2014/04/24/ejbcontainerrunner-or-test-with-ejbcontainer-easily/
> >
> I got now this error :
>
> Avertissement - WARN ... EjbModule1275312335: The application
> [EjbModule1275312335] uses @Inject but CDI is not enabled. Maybe youd need
> to add a beans.xml file.
> Avertissement - 1 warning for EjbModule(path=EjbModule1275312335)
> Infos - Enterprise application "C:\J2EE\JEE6\projects\cdi-basic" loaded.
> Infos - Assembling app: C:\J2EE\JEE6\projects\cdi-basic
> Infos -
>
> Jndi(name="java:global/cdi-basic/CourseTest!org.superbiz.cdi.basic.CourseTest")
> Infos - Jndi(name="java:global/cdi-basic/CourseTest")
> Infos -
> Jndi(name="java:global/cdi-basic/Course!org.superbiz.cdi.basic.Course")
> Infos - Jndi(name="java:global/cdi-basic/Course")
> Grave - Jndi name could not be bound; it may be taken by another ejb.
>
> Jndi(name=openejb/Deployment/CourseTest/org.superbiz.cdi.basic.CourseTest!LocalBeanHome)
> Infos - Undeploying app: C:\J2EE\JEE6\projects\cdi-basic
>
> new zip joined :
>
> cdi-basic.zip
> <http://tomee-openejb.979440.n4.nabble.com/file/n4674550/cdi-basic.zip>
>
>
>
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/openEJB-perfs-tp4674462p4674550.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>
Re: openEJB perfs
Posted by amber <am...@hotmail.fr>.
ok, my bad, back to junit 4.11 (works better!)
but still problems with@ManagedBean, based on this article
<https://rmannibucau.wordpress.com/2014/04/24/ejbcontainerrunner-or-test-with-ejbcontainer-easily/>
I got now this error :
Avertissement - WARN ... EjbModule1275312335: The application
[EjbModule1275312335] uses @Inject but CDI is not enabled. Maybe youd need
to add a beans.xml file.
Avertissement - 1 warning for EjbModule(path=EjbModule1275312335)
Infos - Enterprise application "C:\J2EE\JEE6\projects\cdi-basic" loaded.
Infos - Assembling app: C:\J2EE\JEE6\projects\cdi-basic
Infos -
Jndi(name="java:global/cdi-basic/CourseTest!org.superbiz.cdi.basic.CourseTest")
Infos - Jndi(name="java:global/cdi-basic/CourseTest")
Infos -
Jndi(name="java:global/cdi-basic/Course!org.superbiz.cdi.basic.Course")
Infos - Jndi(name="java:global/cdi-basic/Course")
Grave - Jndi name could not be bound; it may be taken by another ejb.
Jndi(name=openejb/Deployment/CourseTest/org.superbiz.cdi.basic.CourseTest!LocalBeanHome)
Infos - Undeploying app: C:\J2EE\JEE6\projects\cdi-basic
new zip joined :
cdi-basic.zip
<http://tomee-openejb.979440.n4.nabble.com/file/n4674550/cdi-basic.zip>
--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/openEJB-perfs-tp4674462p4674550.html
Sent from the TomEE Users mailing list archive at Nabble.com.
Re: openEJB perfs
Posted by Romain Manni-Bucau <rm...@gmail.com>.
PS: https://issues.apache.org/jira/browse/TOMEE-1553
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>
2015-04-21 10:20 GMT+02:00 Romain Manni-Bucau <rm...@gmail.com>:
> try to use junit 4.11
>
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> | Blog
> <http://rmannibucau.wordpress.com> | Github
> <https://github.com/rmannibucau> | LinkedIn
> <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> <http://www.tomitribe.com>
>
> 2015-04-21 9:34 GMT+02:00 amber <am...@hotmail.fr>:
>
>> Here a sample that reflects my errors :
>>
>> cdi-basic.zip
>> <http://tomee-openejb.979440.n4.nabble.com/file/n4674547/cdi-basic.zip>
>>
>> -------------------------------------------------------
>> T E S T S
>> -------------------------------------------------------
>> Running org.superbiz.cdi.basic.CourseTest
>> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.09 sec
>> <<<
>> FAILURE!
>> initializationError(org.superbiz.cdi.basic.CourseTest) Time elapsed: 0.01
>> sec <<< ERROR!
>> java.lang.UnsupportedOperationException
>> at
>> java.util.Collections$UnmodifiableList.set(Collections.java:1213)
>> at java.util.Collections.swap(Collections.java:532)
>> at java.util.Collections.shuffle(Collections.java:500)
>> at java.util.Collections.shuffle(Collections.java:469)
>> at
>>
>> org.apache.openejb.junit.jee.EJBContainerRunner.computeTestMethods(EJBContainerRunner.java:54)
>> at
>>
>> org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:190)
>> at
>>
>> org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:128)
>> at org.junit.runners.ParentRunner.validate(ParentRunner.java:416)
>> at org.junit.runners.ParentRunner.<init>(ParentRunner.java:84)
>> at
>>
>> org.junit.runners.BlockJUnit4ClassRunner.<init>(BlockJUnit4ClassRunner.java:65)
>> at
>>
>> org.apache.openejb.junit.jee.EJBContainerRunner.<init>(EJBContainerRunner.java:37)
>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>> Method)
>> at
>>
>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
>> at
>>
>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>> at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
>> at
>>
>> org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
>> at
>>
>> org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
>> at
>>
>> org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
>> at
>>
>> org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java
>> :26)
>> at
>>
>> org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
>> at
>> org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)
>> at
>>
>> org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:250)
>> at
>>
>> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
>> at
>>
>> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>>
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>> at
>>
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> at java.lang.reflect.Method.invoke(Method.java:606)
>> at
>>
>> org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
>> at
>>
>> org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
>> at
>>
>> org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
>> at
>>
>> org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
>> at
>> org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
>>
>>
>> Results :
>>
>> Tests in error:
>> initializationError(org.superbiz.cdi.basic.CourseTest)
>>
>>
>>
>> --
>> View this message in context:
>> http://tomee-openejb.979440.n4.nabble.com/openEJB-perfs-tp4674462p4674547.html
>> Sent from the TomEE Users mailing list archive at Nabble.com.
>>
>
>
Re: openEJB perfs
Posted by Romain Manni-Bucau <rm...@gmail.com>.
try to use junit 4.11
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>
2015-04-21 9:34 GMT+02:00 amber <am...@hotmail.fr>:
> Here a sample that reflects my errors :
>
> cdi-basic.zip
> <http://tomee-openejb.979440.n4.nabble.com/file/n4674547/cdi-basic.zip>
>
> -------------------------------------------------------
> T E S T S
> -------------------------------------------------------
> Running org.superbiz.cdi.basic.CourseTest
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.09 sec
> <<<
> FAILURE!
> initializationError(org.superbiz.cdi.basic.CourseTest) Time elapsed: 0.01
> sec <<< ERROR!
> java.lang.UnsupportedOperationException
> at
> java.util.Collections$UnmodifiableList.set(Collections.java:1213)
> at java.util.Collections.swap(Collections.java:532)
> at java.util.Collections.shuffle(Collections.java:500)
> at java.util.Collections.shuffle(Collections.java:469)
> at
>
> org.apache.openejb.junit.jee.EJBContainerRunner.computeTestMethods(EJBContainerRunner.java:54)
> at
>
> org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:190)
> at
>
> org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:128)
> at org.junit.runners.ParentRunner.validate(ParentRunner.java:416)
> at org.junit.runners.ParentRunner.<init>(ParentRunner.java:84)
> at
>
> org.junit.runners.BlockJUnit4ClassRunner.<init>(BlockJUnit4ClassRunner.java:65)
> at
>
> org.apache.openejb.junit.jee.EJBContainerRunner.<init>(EJBContainerRunner.java:37)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> at
>
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
> at
>
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
> at
>
> org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
> at
>
> org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
> at
>
> org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
> at
>
> org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java
> :26)
> at
>
> org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
> at
> org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)
> at
>
> org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:250)
> at
>
> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
> at
>
> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at
>
> org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
> at
>
> org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
> at
>
> org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
> at
>
> org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
> at
> org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
>
>
> Results :
>
> Tests in error:
> initializationError(org.superbiz.cdi.basic.CourseTest)
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/openEJB-perfs-tp4674462p4674547.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>
Re: openEJB perfs
Posted by amber <am...@hotmail.fr>.
Here a sample that reflects my errors :
cdi-basic.zip
<http://tomee-openejb.979440.n4.nabble.com/file/n4674547/cdi-basic.zip>
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.superbiz.cdi.basic.CourseTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.09 sec <<<
FAILURE!
initializationError(org.superbiz.cdi.basic.CourseTest) Time elapsed: 0.01
sec <<< ERROR!
java.lang.UnsupportedOperationException
at java.util.Collections$UnmodifiableList.set(Collections.java:1213)
at java.util.Collections.swap(Collections.java:532)
at java.util.Collections.shuffle(Collections.java:500)
at java.util.Collections.shuffle(Collections.java:469)
at
org.apache.openejb.junit.jee.EJBContainerRunner.computeTestMethods(EJBContainerRunner.java:54)
at
org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:190)
at
org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:128)
at org.junit.runners.ParentRunner.validate(ParentRunner.java:416)
at org.junit.runners.ParentRunner.<init>(ParentRunner.java:84)
at
org.junit.runners.BlockJUnit4ClassRunner.<init>(BlockJUnit4ClassRunner.java:65)
at
org.apache.openejb.junit.jee.EJBContainerRunner.<init>(EJBContainerRunner.java:37)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at
org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
at
org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
at
org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at
org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java
:26)
at
org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at
org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)
at
org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:250)
at
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at
org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Results :
Tests in error:
initializationError(org.superbiz.cdi.basic.CourseTest)
--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/openEJB-perfs-tp4674462p4674547.html
Sent from the TomEE Users mailing list archive at Nabble.com.
Re: openEJB perfs
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Mayne share more - logs and a sample - to let us understand what you are
facing.
Le 17 avr. 2015 16:44, "amber" <am...@hotmail.fr> a écrit :
> I have the beans.xml file.
>
> Get errors only when I launch tests from a package : Avertissement - an
> error occured while injecting the class 'com.app.Foo': null
>
> running single test on Foo works fine
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/openEJB-perfs-tp4674462p4674468.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>
Re: openEJB perfs
Posted by amber <am...@hotmail.fr>.
I have the beans.xml file.
Get errors only when I launch tests from a package : Avertissement - an
error occured while injecting the class 'com.app.Foo': null
running single test on Foo works fine
--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/openEJB-perfs-tp4674462p4674468.html
Sent from the TomEE Users mailing list archive at Nabble.com.
Re: openEJB perfs
Posted by Romain Manni-Bucau <rm...@gmail.com>.
if you have a META-INF/beans.xml in src/test/resources it should work even
without managed bean
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>
2015-04-17 15:35 GMT+02:00 amber <am...@hotmail.fr>:
> got CDI errors (like you said here
> <
> https://rmannibucau.wordpress.com/2014/05/22/ejbcontainer-openejb-and-single-startstop-by-test-jvm/
> >
> )
> but @ManagedBean give me more errors ^^
>
> I 'am trying to switch to openejb-junit
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/openEJB-perfs-tp4674462p4674466.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>
Re: openEJB perfs
Posted by amber <am...@hotmail.fr>.
got CDI errors (like you said here
<https://rmannibucau.wordpress.com/2014/05/22/ejbcontainer-openejb-and-single-startstop-by-test-jvm/>
)
but @ManagedBean give me more errors ^^
I 'am trying to switch to openejb-junit
--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/openEJB-perfs-tp4674462p4674466.html
Sent from the TomEE Users mailing list archive at Nabble.com.
Re: openEJB perfs
Posted by Romain Manni-Bucau <rm...@gmail.com>.
p.setProperty(OpenEjbContainer.OPENEJB_EJBCONTAINER_CLOSE
,OpenEjbContainer.OPENEJB_EJBCONTAINER_CLOSE_SINGLE);
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>
2015-04-17 12:58 GMT+02:00 amber <am...@hotmail.fr>:
> yes, each class's test start/stop , some have common settings
>
> How do set this property ? like this
> p.setProperty(OpenEjbContainer.OPENEJB_EJBCONTAINER_CLOSE_SINGLE
> ,"single-jvm"); ?
>
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/openEJB-perfs-tp4674462p4674464.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>
Re: openEJB perfs
Posted by amber <am...@hotmail.fr>.
yes, each class's test start/stop , some have common settings
How do set this property ? like this
p.setProperty(OpenEjbContainer.OPENEJB_EJBCONTAINER_CLOSE_SINGLE
,"single-jvm"); ?
--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/openEJB-perfs-tp4674462p4674464.html
Sent from the TomEE Users mailing list archive at Nabble.com.
Re: openEJB perfs
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi
do you need to start/stop by test? If you add to properties "
openejb.ejbcontainer.close=single-jvm"
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>
2015-04-17 11:25 GMT+02:00 amber <am...@hotmail.fr>:
> Hello,
>
> since we upgrade to 4.7.x ours tests are very slow. It's because we
> start/stop properly OpenEJB (not the cas before ^^) :
>
> @BeforeClass
> public static void start() {
> Properties p = new Properties();
>
> ...
> // some hsqldb settings
> ...
> container = EJBContainer.createEJBContainer();
> }
>
> @Before
> public void inject() throws NamingException {
> container.getContext().bind("inject", this);
> }
>
> @AfterClass
> public static void stop() {
> container.close();
> }
>
> works nice , but...too slow with many junit class (each class doing this
> sequence start/stop with its own parameters)
>
> Is there a way to improve perfs ?
>
> thx
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/openEJB-perfs-tp4674462.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>