Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/339.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 什么可以终止JUnit中的测试_Java_Junit_Intellij Idea_Findbugs - Fatal编程技术网

Java 什么可以终止JUnit中的测试

Java 什么可以终止JUnit中的测试,java,junit,intellij-idea,findbugs,Java,Junit,Intellij Idea,Findbugs,我正试图将其用作我的程序的库(但这个问题与findbugs没有严格的关系)。我已经编写了几个测试来配置和调用findbugs的一些函数。但奇怪的是,我的一个测试总是失败,它被报告为“测试终止”,并显示以下图标: 查看代码,我看到norSystem.exit()nor fork解释了为什么测试以“终止”结束。如果我看下面的代码,findBugs的函数execute运行(带输出),在没有特殊指令的情况下完成,然后测试终止(第二个println未被调用)。知道终止测试的原因吗 @Test publi

我正试图将其用作我的程序的库(但这个问题与findbugs没有严格的关系)。我已经编写了几个测试来配置和调用findbugs的一些函数。但奇怪的是,我的一个测试总是失败,它被报告为“测试终止”,并显示以下图标:

查看代码,我看到nor
System.exit()
nor fork解释了为什么测试以“终止”结束。如果我看下面的代码,findBugs的函数execute运行(带输出),在没有特殊指令的情况下完成,然后测试终止(第二个
println
未被调用)。知道终止测试的原因吗

@Test
public void testFindBugExecute() throws IOException, InterruptedException {

    // [ configuration stuff ] 

    System.out.println("BOUM1");

    // launch the analyze
    findBugs.execute();

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

注意:通过调试器查看,我看到调用了第二个println(但没有输出)。

自我响应:库和相关测试的行为是一致的。错误来自JUnit的错误输出,因为findbugs库弄乱了输出流。因此,Intellij对测试跟踪的解析无法正常工作