Плагин Maven Surefire 2.7.2 этого не делает.Используете ли вы JUnit 3 или 4?
Такой тест не печатает ни одной трассировки стека ни в выводе maven, ни в файле отчета:
@Test(expected = NumberFormatException.class)
public void testForExpectedExceptionWithAnnotation()
throws Exception {
Integer.parseInt("This should blow up...");
}
В тесте jUnit 3как это также не будет печатать трассировку стека.Ваш тест таков ?:
public testForExpectedException() throws Exception{
try{
Integer.parseInt("This should blow up...");
}catch(NumberFormatException e){
//Just ignore it or do some asserts you could need
}
fail("Exceptions not thrown");
}