0 Replies Latest reply on Feb 12, 2013 10:23 AM by maverickdrools

    Guvnor + Arquillian + JUnit

    maverickdrools Newbie

      Hi,

       

      Trying to write a JUnit similar to one of the Guvnor Examples which uses Arquillian. I get an exception when I try to run the test as:

       

      java.lang.RuntimeException: Could not create new instance of class org.jboss.arquillian.test.impl.EventTestRunnerAdaptor

                at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:160)

                at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:111)

                at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:97)

                at org.jboss.arquillian.test.spi.TestRunnerAdaptorBuilder.build(TestRunnerAdaptorBuilder.java:52)

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

                at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)

                at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)

                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

      Caused by: java.lang.reflect.InvocationTargetException

                at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

                at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

                at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

                at java.lang.reflect.Constructor.newInstance(Constructor.java:513)

                at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:156)

                ... 10 more

      Caused by: org.jboss.arquillian.container.impl.ContainerCreationException: Could not create Container jboss7

                at org.jboss.arquillian.container.impl.LocalContainerRegistry.create(LocalContainerRegistry.java:85)

                at org.jboss.arquillian.container.impl.client.container.ContainerRegistryCreator.createRegistry(ContainerRegistryCreator.java:76)

                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:94)

                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:135)

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

                at org.jboss.arquillian.core.impl.ManagerImpl.bindAndFire(ManagerImpl.java:236)

                at org.jboss.arquillian.core.impl.InstanceImpl.set(InstanceImpl.java:74)

                at org.jboss.arquillian.config.impl.extension.ConfigurationRegistrar.loadConfiguration(ConfigurationRegistrar.java:68)

                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:94)

                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:135)

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

                at org.jboss.arquillian.core.impl.ManagerImpl.start(ManagerImpl.java:261)

                at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.<init>(EventTestRunnerAdaptor.java:56)

                ... 15 more

      Caused by: java.lang.IllegalArgumentException: DeployableContainer must be specified

                at org.jboss.arquillian.core.spi.Validate.notNull(Validate.java:44)

                at org.jboss.arquillian.container.impl.ContainerImpl.<init>(ContainerImpl.java:71)

                at org.jboss.arquillian.container.impl.LocalContainerRegistry.create(LocalContainerRegistry.java:76)

                ... 39 more

       

      My JUnit extends a class which has @RunWith(Arquillian.class) and I guess the above exception is being thrown while resolving dependencies for Arquillian jars due to which I'm unable to hit even the first line of my JUnit in debug mode.

       

      Was wondering if anyone has encountered such an exception and what might be a possible resolution for this. My pom file has the following with respect to Arquillian:

       

      <dependency>

                                    <groupId>org.jboss.arquillian.junit</groupId>

                                    <artifactId>arquillian-junit-core</artifactId>

                                    <version>1.0.3.Final</version>

                          </dependency>

       

      <dependency>

                                    <groupId>org.jboss.arquillian.core</groupId>

                                    <artifactId>arquillian-core-impl-base</artifactId>

                                    <version>1.0.3.Final</version>

                          </dependency>

       

      <dependency>

                                    <groupId>org.jboss.arquillian.test</groupId>

                                    <artifactId>arquillian-test-impl-base</artifactId>

                                    <version>1.0.3.Final</version>

                          </dependency>

       

                  <dependency>

                                    <groupId>org.jboss.arquillian.test</groupId>

                                    <artifactId>arquillian-test-spi</artifactId>

                                    <version>1.0.3.Final</version>

                          </dependency>

       

                          <dependency>

                                    <groupId>org.jboss.arquillian.container</groupId>

                                    <artifactId>arquillian-container-impl-base</artifactId>

                                    <version>1.0.3.Final</version>

                          </dependency>

       

                          <dependency>

                                    <groupId>org.jboss.arquillian.junit</groupId>

                                    <artifactId>arquillian-junit-container</artifactId>

                                    <version>1.0.3.Final</version>

                          </dependency>

       

                          <dependency>

                                    <groupId>org.jboss.arquillian.junit</groupId>

                                    <artifactId>arquillian-junit-standalone</artifactId>

                                    <version>1.0.3.Final</version>

                          </dependency>

       

                          <dependency>

                                    <groupId>org.jboss.arquillian</groupId>

                                    <artifactId>arquillian-bom</artifactId>

                                    <type>pom</type>

                                    <version>1.0.3.Final</version>

                                    <scope>import</scope>

                          </dependency>

       

      Guvnor is running in Tomcat 6.0

       

      Thanks