1 2 Previous Next 20 Replies Latest reply on Mar 29, 2012 1:14 PM by alexh_97 Go to original post
      • 15. Re: On dbunit integration
        tcmartin24

        All related config files and Test class code are here: http://pastebin.com/RSSjfvN4
        I'm not using a beans.xml file.  I had A LOT of trouble finding a working combination of dependencies in my pom to just get my basic EJB-injected test to run yesterday, so I wouldn't be too surprised if that's where the issue is.  Oh, and here's the stack trace:

         

        java.lang.IllegalArgumentException: ArquillianServletRunner not found. Could not determine ContextRoot from ProtocolMetadata, please contact DeployableContainer developer.

                at org.jboss.arquillian.protocol.servlet.ServletUtil.determineBaseURI(ServletUtil.java:68)

                at org.jboss.arquillian.protocol.servlet.BaseServletProtocol.getExecutor(BaseServletProtocol.java:58)

                at org.jboss.arquillian.protocol.servlet.BaseServletProtocol.getExecutor(BaseServletProtocol.java:32)

                at org.jboss.arquillian.container.test.impl.execution.RemoteTestExecuter.getContainerMethodExecutor(RemoteTestExecuter.java:136)

                at org.jboss.arquillian.container.test.impl.execution.RemoteTestExecuter.execute(RemoteTestExecuter.java:119)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

                at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:134)

                at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:114)

                at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)

                at org.jboss.arquillian.container.test.impl.execution.ClientTestExecuter.execute(ClientTestExecuter.java:57)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

                at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createContext(ContainerEventController.java:130)

                at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createTestContext(ContainerEventController.java:117)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

                at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:89)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

                at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

                at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)

                at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

                at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:134)

                at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.test(EventTestRunnerAdaptor.java:111)

                at org.jboss.arquillian.junit.Arquillian$6.evaluate(Arquillian.java:239)

                at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:202)

                at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:290)

                at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:45)

                at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:216)

                at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)

                at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)

                at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)

                at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

                at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

                at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

                at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

                at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

                at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:161)

                at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:290)

                at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:45)

                at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:175)

                at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

                at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:123)

        • 16. Re: On dbunit integration
          tcmartin24

          Ok, I have some further insight.  It looks like I was getting that exception because I had two persistence contexts defined (which my EJB that I'm testing, needs).  I temporarily removed the need for the second persistence context from my EJB, persistence.xml and EJBTest class, and I no longer get any exception.  However, I must specify a unitName in the test's injected PersistenceContext or else I get an exception:

           

          Exception while preparing the app : Could not resolve a persistence unit corresponding to the persistence-context-ref-name [org.xxx.cdr.service.xxx.businessservice.EJBTest/cisonlnEM] in the scope of the module called [test]. Please verify your application.

           

          If I go ahead and specify a unitName, I don't get any exception, but, my persistence context is null during the test.  If I specify a made-up name for the unitName or don't specify any unitName (as in the example), I still get the:

           

          java.lang.IllegalArgumentException: ArquillianServletRunner not found. Could not determine ContextRoot from ProtocolMetadata, please contact DeployableContainer developer.

                  at org.jboss.arquillian.protocol.servlet.ServletUtil.determineBaseURI(ServletUtil.java:68)

                  at org.jboss.arquillian.protocol.servlet.BaseServletProtocol.getExecutor(BaseServletProtocol.java:58)

                  at org.jboss.arquillian.protocol.servlet.BaseServletProtocol.getExecutor(BaseServletProtocol.java:32)

                  at org.jboss.arquillian.container.test.impl.execution.RemoteTestExecuter.getContainerMethodExecutor(RemoteTestExecuter.java:136)

                  at org.jboss.arquillian.container.test.impl.execution.RemoteTestExecuter.execute(RemoteTestExecuter.java:119)

           

          Thanks,
          Terry

          • 17. Re: On dbunit integration
            bmajsak

            I think for injecting PersistenceContext to the Arquillian test you still need to have CDI enabled - which means adding empty beans.xml to your test deployment.

             

            With regards to multiple datasources I will have a look at it soon. Thanks for pointing it out.

            • 18. Re: On dbunit integration
              alexh_97

              Bartosz,

               

              Sorry to stirr up an old thread.  Has there been any new developments in support for multiple persistence contexts/datasources?  I'm in the same boat as Terry and wanted to see what's up with this before I consider moving my tests over to use this extension.

               

              Thanks!

              - Alex

              • 19. Re: On dbunit integration
                bmajsak

                Hi Alex,

                 

                in the current version it's not yet supported, but it's on my high prio list and once I'm done with Alpha4 it will be the first thing for Alpha5. Maybe you would like to contribute? I'll help as much as I can. Would be awesome to move things forward faster

                 

                Cheers,

                Bartosz

                • 20. Re: On dbunit integration
                  alexh_97

                  Bartosz,

                   

                  Thanks for a quick response!  I'd love to contribute, but I doubt I will reallistically have time to devote to this.  Ping me when you get to starting Alpha5 - I'll see what I can do.

                   

                  - Alex

                  1 2 Previous Next