Uploaded image for project: 'Arquillian'
  1. Arquillian
  2. ARQ-1427

Arquillian Spock test fails with NPE when a subclass of spock.lang.Specification is used

    XMLWordPrintable

    Details

      Description

      If an arquillian spock test is extended from a subclass of spock.lang.Specification the test can't be executed and fails with a NPE.

      MySpecification.groovy
       
      abstract class MySpecification extends spock.lang.Specification{
      }
      
      SpockSpecSubclassIt.groovy
       
      @ArquillianSpecification
      class SpockSpecSubclassIt extends MySpecification {
         @Deployment
         static WebArchive deployment() {
            ShrinkWrap.create( WebArchive.class )
         }
      
         void 'test'() {
            expect:
               'foo' != 'bar'
         }
      }
      
      Exception
      java.lang.NullPointerException
      	at org.jboss.arquillian.container.test.impl.client.ContainerEventController.lookup(ContainerEventController.java:164)
      	at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createContext(ContainerEventController.java:146)
      	at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createBeforeContext(ContainerEventController.java:124)
      	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
      	at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:89)
      	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
      	at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75)
      	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
      	at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60)
      	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
      	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.test.impl.EventTestRunnerAdaptor.before(EventTestRunnerAdaptor.java:95)
      	at org.jboss.arquillian.spock.ArquillianInterceptor.interceptSetupMethod(ArquillianInterceptor.java:77)
      	at org.spockframework.runtime.extension.AbstractMethodInterceptor.intercept(AbstractMethodInterceptor.java:28)
      	at org.spockframework.runtime.extension.MethodInvocation.proceed(MethodInvocation.java:84)
      	at org.spockframework.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:138)
      	at org.spockframework.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:138)
      	at org.spockframework.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:138)
      	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)
      
      java.lang.NullPointerException
      	at org.jboss.arquillian.container.test.impl.client.ContainerEventController.lookup(ContainerEventController.java:164)
      	at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createContext(ContainerEventController.java:146)
      	at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createAfterContext(ContainerEventController.java:134)
      	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
      	at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:89)
      	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
      	at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75)
      	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
      	at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60)
      	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
      	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
      	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.test.impl.EventTestRunnerAdaptor.after(EventTestRunnerAdaptor.java:103)
      	at org.jboss.arquillian.spock.ArquillianInterceptor.interceptCleanupMethod(ArquillianInterceptor.java:89)
      	at org.spockframework.runtime.extension.AbstractMethodInterceptor.intercept(AbstractMethodInterceptor.java:31)
      	at org.spockframework.runtime.extension.MethodInvocation.proceed(MethodInvocation.java:84)
      	at org.spockframework.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:138)
      	at org.spockframework.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:138)
      	at org.spockframework.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:138)
      	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)
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                kpiwko Karel Piwko
                Reporter:
                luc4 foo bar
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: