Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.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
通过ANT生成的空白JUnit报告_Ant_Junit - Fatal编程技术网

通过ANT生成的空白JUnit报告

通过ANT生成的空白JUnit报告,ant,junit,Ant,Junit,徖 REOPRT已生成,但为空,尝试了前面提到的不同解决方案,但仍然无法获取。我认为testcase未执行,我是否在build.xml中插入了错误内容 检查下面的命令提示日志 C:\Users\Vaibhav\Eclipse\u Workspace\WebDriverTests>ant run 构建文件:C:\Users\Vaibhav\Eclipse\u Workspace\WebDriverTests \build.xml 运行: [junitreport]正在将D:\reports\TES

REOPRT已生成,但为空,尝试了前面提到的不同解决方案,但仍然无法获取。

我认为testcase未执行,我是否在build.xml中插入了错误内容 检查下面的命令提示日志 C:\Users\Vaibhav\Eclipse\u Workspace\WebDriverTests>ant run

构建文件:C:\Users\Vaibhav\Eclipse\u Workspace\WebDriverTests \build.xml

运行:

[junitreport]正在将D:\reports\TESTS-TestSuites.xml处理为C:\Users\Vaibhav\AppData\Local\Temp\null526641997

[junitreport]加载样式表jar:file:/C:/apache-ant-1.9.4/lib/ant-junit.jar

!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl

[junitreport]转换时间:524ms

[junitreport]正在删除:C:\Users\Vaibhav\AppData\Local\Temp\null526641997

建设成功 总时间:1秒

  <property name="wspace.home" value="${basedir}"/>
  <property name="wspace.jars" value="D:\\softwares\\jars"/>
  <property name="test.dest" value="${wspace.home}/build"/>
  <property name="test.src" value="${wspace.home}/src"/>
  <property name="test.reportsDir" value="D:\reports"/>


  <path id="testcase.path">


    <pathelement location="${test.dest}"/>

    <fileset dir="${wspace.jars}">
        <include name="*.jar"/>
    </fileset>

  </path>


   <target name="setClassPath" unless="test.classpath">
        <path id="classpath_jars">
            <fileset dir="${wspace.jars}" includes="*.jar"/>
        </path>
        <pathconvert pathsep="."
            property="test.classpath"
            refid="classpath_jars"/>
    </target>

    <target name="init" depends="setClassPath">
        <tstamp>
            <format property="start.time" pattern="MM/dd/yyyy hh:mm aa" />
        </tstamp>
        <condition property="ANT"
            value="${env.ANT_HOME}/bin/ant.bat"
            else="${env.ANT_HOME}/bin/ant">
            <os family="windows" />
        </condition>

    </target>

    <!--  all -->
    <target name="all">
    </target>

    <!--  clean -->

    <target name="clean">
        <delete dir="${test.dest}"/>
    </target>

    <!--  compile -->
    <target name="compile" depends="init, clean">
        <delete includeemptydirs="true" quiet="true">
            <fileset dir="${test.dest}" includes="**/*"/>
        </delete>

        <echo message="making directory..."/>
        <mkdir dir="${test.dest}"/>
        <echo message="classpath-----: ${test.classpath}"/>
        <echo message="compiling..."/>
        <javac
            debug="true"
            destdir="${test.dest}"
            srcdir="${test.src}"
            target="1.5"
            classpath="${test.classpath}"
        >
        </javac>
    </target>


    <!--  build -->
    <target name="build" depends="init">
    </target>


    <target name="usage">
        <echo>
            ant run will execute the test
        </echo>
    </target>


    <path id="test.c">
            <fileset dir="${wspace.jars}" includes="*.jars"/>
    </path>




    <!--  run -->
    <target name="run">
        <delete includeemptydirs="true" quiet="true">
                <fileset dir="${test.reportsDir}" includes="**/*"/>
        </delete>
        <java jar="${wspace.jars}" fork="true" spawn="true"/>
        <junit fork="yes" haltonfailure="no" printsummary="yes">
            <classpath refid="testcase.path"/>

        <!-- <classpath ="&{test.classpath}"/> -->
        <batchtest todir="${test.reportsDir}" fork="true">
        <fileset dir="${test.dest}">


            <include name="TestSuite.class"/>


        </fileset>
        </batchtest>

        <formatter type="xml"/>
        <classpath refid="testcase.path"/>
    </junit>
        <junitreport todir="${test.reportsDir}">
            <fileset dir="${test.reportsDir}">
            <include name="TEST-.xml" />
            </fileset>
            <report todir="${test.reportsDir}"/>
        </junitreport>
        </target>

    </project>