Thanks for great suggestion guys!

I used Arquillian before in the projects where I didn't used the Deltaspike
Test Control and I used Deltaspike Test Control in projects without
persistence - quite liked it (and it is similar to the Camel CDI tests that
are part of the project as well). Using separated persistence.xml in tests
was my first take on this, but when i did it the test faild with this:

INFO: [failed] com.kaltire.mix.cra.ConfigTest#null message: On a thread
without an initialized context nor a classloader mapping a deployed app

java.lang.IllegalStateException: On a thread without an initialized context
nor a classloader mapping a deployed app

        at
org.apache.openejb.cdi.ThreadSingletonServiceImpl.get(ThreadSingletonServiceImpl.java:292)
        at
org.apache.openejb.cdi.ThreadSingletonServiceImpl.getContext(ThreadSingletonServiceImpl.java:261)
        at
org.apache.openejb.cdi.ThreadSingletonServiceImpl.get(ThreadSingletonServiceImpl.java:321)
        at
org.apache.openejb.cdi.ThreadSingletonServiceImpl.get(ThreadSingletonServiceImpl.java:64)
        at
org.apache.webbeans.config.WebBeansFinder.getSingletonInstance(WebBeansFinder.java:51)
        at
org.apache.webbeans.config.WebBeansContext.getInstance(WebBeansContext.java:185)
        at
org.apache.webbeans.config.WebBeansContext.currentInstance(WebBeansContext.java:203)
        at
org.apache.deltaspike.cdise.openejb.OpenEjbContainerControl.boot(OpenEjbContainerControl.java:109)
        at
org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner$ContainerAwareTestContext.applyBeforeClassConfig(CdiTestRunner.java:468)
        at
org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner$BeforeClassStatement.evaluate(CdiTestRunner.java:371)
        at
org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner$AfterClassStatement.evaluate(CdiTestRunner.java:398)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
        at
org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner.run(CdiTestRunner.java:144)
        at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
        at
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:117)
        at
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42)
        at
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:262)
        at 
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:84)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)

There is not much info for me to derive what's the problem.



--
View this message in context: 
http://tomee-openejb.979440.n4.nabble.com/persistence-xml-for-unit-tests-tp4679874p4679894.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Reply via email to