Can you tell me if there’s a way to dis- and enable junit.framework.Assert commands inline to ignore them?
Code example just to show what i mean:
junitOff(); // first method I need help with
assertTrue(false); //would normally cause an AssertionError
junitOn(); // second method I need help with
System.out.println("Broke through asserTrue without Error")
I know it would be possible to use try/catch but that’s not what I’m looking for because I can not go on with execution in the line after the assert…
I don’t see any way to do this. Looking at the junit code you see:
And
fail()is:I see no ways to turn on a switch or otherwise disable it from throwing an
AssertionError.For the record, if you are talking about the
assertJava primitive then that can be disabled but only at compile-time with the-easwitch.