0

I'm writing an android JUnit5 test, and have a scenario where I need to mark a @Test as "Error" instead of "Failure", I'm wondering if that is possible.

I was using gradle to run the test, ./gradlew cDAT.
For instance, the following code is expected to show as error, but instead it shows failure anyway:

@Test
   void test03() {
      throw new ArithmeticException();
}

Any help is appreciated!

MadHatter
  • 301
  • 3
  • 12
  • Demo test result as `failures="0" errors="0" skipped="0"`. Since there is `errors="0"`, I think it's possible to mark a test as 'Error'. – MadHatter Apr 29 '20 at 09:31
  • This might help: https://stackoverflow.com/questions/3425995/whats-the-difference-between-failure-and-error-in-junit – eee May 05 '20 at 21:25
  • Yeah thanks for your comment, I tried something like this: @Test void test03() { throw new ArithmeticException(); } It still shows as a 'failure' instead of an 'error'. I not sure what led to this. While in my scenario I need to set the test as 'error'. – MadHatter May 07 '20 at 09:12
  • I'm sorry for the formatting, the markdown is a mess in the comment. – MadHatter May 07 '20 at 09:18

0 Answers0