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

When using @Test expected exception, the internal state of the TestResult is unknown - JUnit

XMLWordPrintable

      When using the ExpectedException feature in the TestFrameworks the internal TestResult object in Arquillian is in an unknown state. Arquillian catches the thrown exception, but the actual validation of it is done in the test framework after Arquillian is done with the test invocation. Arquillian can only know that a Exception has been thrown, but not if it is expected or not.

      JUnit
      @Test(expected=Exception.class)

      TestNG
      @Test(expectedException=Exception.class)
      @ExpectedException(Exception.class)

      Follow up with TestNG and JUnit to see how this can be done..

            aslak@redhat.com Aslak Knutsen
            aslak@redhat.com Aslak Knutsen
            Votes:
            4 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: