0 Replies Latest reply on Jul 2, 2014 3:46 PM by bsanders1979

    Container test "breaks" after adding @WarpTest to class

    bsanders1979

      Greetings,

      I am working to utilize Arquillian Core (TestNG), Spring, and Warp to build my testing environment and am running into an issue for which I cannot seem to find any clear-cut answers. In short, the @WarpTest annotation causes testAuthentication() to fail. Unless I'm misunderstanding something, the docs clearly state that placing container and client tests in the same class is perfectly acceptable. Please advise. Thanks!

       

      Versions...

      Core - 1.1.5.Final

      Warp - 1.0.0.Alpha7

      Spring Extension - 1.0.0.Beta3

      Drone - 1.2.4.Final

       

      The exception (omitted 130 frames):...

      java.lang.NullPointerException

        at org.jboss.arquillian.warp.impl.server.test.LifecycleTestClassExecutor.beforeTest(LifecycleTestClassExecutor.java:59)

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

        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.warp.impl.server.test.LifecycleTestEnrichmentWatcher.rememberFieldValues(LifecycleTestEnrichmentWatcher.java:52)

        ...

       

      The code...

      public void beforeTest(@Observes(precedence = 100) EventContext<Before> context) {

        Object inspectionObject = context.getEvent().getTestInstance();

        if (!executedInspections.contains(inspectionObject)) {

          executedInspections.add(inspectionObject); //executedInspections is null

          beforeClass.fire(new BeforeClass(inspectionObject.getClass()));

        }

        context.proceed();

      }


      The Test...

      @SpringWebConfiguration

      @WarpTest

      public class TestLoginViewModel extends Arquillian {

       

        @Deployment

        public static Archive<?> createArchive() {

          return ShrinkWrap

            .create(WebArchive.class)

          ;

        }

       

        @Test

        public void testAuthentication() {

        }

       

        @Test

        @RunAsClient

        public void testClientAuthentication() {

        }

      }