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

NullPointerException when timeout is set in @Test when using JUnit

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.1.4.Final
    • 1.0.0.Final, 1.0.1.Final, 1.1.3.Final
    • None
    • None
    • Hide

      The code

      import org.jboss.arquillian.junit.Arquillian;
      import org.junit.Test;
      import org.junit.runner.RunWith;
      
      @RunWith(Arquillian.class)
      public class TestTimeout {
      
          @Test(timeout = 3000)
          public void test() throws Exception {
              Thread.sleep(1000);
          }
      
      }
      

      can be used to reproduce this bug.

      Show
      The code import org.jboss.arquillian.junit.Arquillian; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(Arquillian.class) public class TestTimeout { @Test(timeout = 3000) public void test() throws Exception { Thread .sleep(1000); } } can be used to reproduce this bug.

      When defining a timeout in @Test of JUnit Arquillian throws a NullPointerException:

      java.lang.NullPointerException
      	at org.jboss.arquillian.junit.Arquillian$6.evaluate(Arquillian.java:263)
      	at org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOfTimeout.java:62)
      

      The code to reproduce this:

      import org.jboss.arquillian.junit.Arquillian;
      import org.junit.Test;
      import org.junit.runner.RunWith;
      
      @RunWith(Arquillian.class)
      public class TestTimeout {
      
          @Test(timeout = 3000)
          public void test() throws Exception {
              Thread.sleep(1000);
          }
      
      }
      

            aslak@redhat.com Aslak Knutsen
            Rick-Rainer.Ludwig Rick-Rainer Ludwig (Inactive)
            Votes:
            7 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: