Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.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&;Jacoco覆盖错误_Java_Junit_Ant_Jacoco_Jacoco Maven Plugin - Fatal编程技术网

Java 蚂蚁公司;JUnit&;Jacoco覆盖错误

Java 蚂蚁公司;JUnit&;Jacoco覆盖错误,java,junit,ant,jacoco,jacoco-maven-plugin,Java,Junit,Ant,Jacoco,Jacoco Maven Plugin,我想在“Ant”构建中使用“Jacoco”和“Junit”。然而,我使用了简单的代码进行测试,Jacoco没有涵盖任何内容。构建运行良好,执行运行良好,Junit也会向我显示结果,但是Jacoco不能 <target name="cov-test" depends ="build"> <jacoco:coverage> <junit showoutput="true" printsummary="on" enabletestlistenere

我想在“Ant”构建中使用“Jacoco”和“Junit”。然而,我使用了简单的代码进行测试,Jacoco没有涵盖任何内容。构建运行良好,执行运行良好,Junit也会向我显示结果,但是Jacoco不能

<target name="cov-test" depends ="build">
    <jacoco:coverage>
        <junit showoutput="true" printsummary="on" enabletestlistenerevents="true" fork="true">
            <classpath path="classes" />
            <classpath path="lib/junit.jar" />
            <classpath path="lib/hamcrest-core.jar" />

            <formatter type="plain" usefile="false" />

            <test name="SimpleTest">
            </test>
        </junit>
    </jacoco:coverage>

    <jacoco:coverage>
        <java classname="SimpleTest" fork="true">
            <classpath path="classes" />
            <classpath path="lib/junit.jar" />
            <classpath path="lib/hamcrest-core.jar" />
        </java>
    </jacoco:coverage>
</target>

<target name="cov-report" depends="cov-test">
    <jacoco:report>
        <executiondata>
            <fileset file="jacoco.exec" />
        </executiondata>

        <structure name="SimpleTest">
            <classfiles>
                <fileset dir="classes" />
            </classfiles>
            <sourcefiles>
                <fileset dir="src" />
            </sourcefiles>
        </structure>

        <html destdir="report" />
    </jacoco:report>

</target>

谢谢你的帮助

我不知道我为什么要解决这个问题。 但是,问题是目录的位置。 在目录定位方面,不应该有任何其他语言。 例如,我在上运行此xml

C://

然后运行良好, 然而

C://한국어//试验


然后它就不能正常运行。

我不知道我为什么要解决这个问题。 但是,问题是目录的位置。 在目录定位方面,不应该有任何其他语言。 例如,我在上运行此xml

C://

然后运行良好, 然而

C://한국어//试验

那它就跑不好了

public class Simple 
{
public Simple() {
}

public int exec(int i) {
    if (i > 0)
        return i ;
    return i * -1 ;
}
}

   public class SimpleTest
   {
    @Test
    public void testSimple1() {
    Simple s = new Simple() ;
    assertTrue(s.exec(-1) == 1) ;
}

    @Test
    public void testSimple2() {
    Simple s = new Simple() ;
    assertTrue(s.exec(1) == 1) ;
}

   public static void main(String [] args) {
    SimpleTest s = new SimpleTest() ;

    //s.testSimple1() ;
    //s.testSimple2() ;
}
}