开发者

What can terminate a test in JUnit

开发者 https://www.devze.com 2023-03-17 08:33 出处:网络
I\'m trying to use findbugs as a library for my program (but the problem is not strictly related to findbugs). I\'ve wrote several tests to configure and call some functions of findbugs. But strangely

I'm trying to use findbugs as a library for my program (but the problem is not strictly related to findbugs). I've wrote several tests to configure and call some functions of findbugs. But strangely one of my test always failed, and it is reported as "test terminated" with the following icon:

What can terminate a test in JUnit

Looking to the code, I see nor System.exit() neither fork to explain why the test ends as "terminated". If I look at the code (below), the function execute of findBugs runs (with output), finished without special instructions and then the test is terminated (the second println is not called). Any ideas what are the reasons for a terminated test ?

@Test
public void testFindBugExecute()开发者_如何学C throws IOException, InterruptedException {

    // [ configuration stuff ] 

    System.out.println("BOUM1");

    // launch the analyze
    findBugs.execute();

    System.out.println("BOUM2");
}

note: Looking with the debugger, I see that the second println is called (but without output).


Self-response: the behavior of the library and the associated tests is coherent. The error came from wrong output from JUnit, as the findbugs library mess the output stream. Thus the parsing of the test traces by Intellij is not working well.

0

精彩评论

暂无评论...
验证码 换一张
取 消