The Maven Surefire 2.7.2 plugin does not. Are you using JUnit 3 or 4?
A test like this does not output a single stack, neither to the output of maven, nor to the report file:
@Test(expected = NumberFormatException.class)
public void testForExpectedExceptionWithAnnotation()
throws Exception {
Integer.parseInt("This should blow up...");
}
In jUnit 3, such a test will also not print stacktrace. Your test looks like this:
public testForExpectedException() throws Exception{
try{
Integer.parseInt("This should blow up...");
}catch(NumberFormatException e){
}
fail("Exceptions not thrown");
}
source
share