0

ant 和输出的 XML 构建文件:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Eclipse auto-generated file.
          Any modifications will be overwritten.
          To include a user specific buildfile here, simply create one in the same
          directory with the processing instruction <?eclipse.ant.import?>
          as the first entry and export the buildfile again. -->
<project basedir="." default="Test_class" name="shiva">
    <property environment="env"/>
    <property name="ECLIPSE_HOME" value="G:/eclipse/eclipse-SDK-3.7.2-win32-x86_64/eclipse"/>
    <property name="junit.output.dir" value="junit"/>
    <property name="debuglevel" value="source,lines,vars"/>
    <property name="target" value="1.7"/>
    <property name="source" value="1.7"/>
    <path id="JUnit 4.libraryclasspath">
    <pathelement location="${ECLIPSE_HOME}/plugins/org.junit_4.8.2.v4_8_2_v20110321-1705/junit.jar"/>
    <pathelement location="${ECLIPSE_HOME}/plugins/org.hamcrest.core_1.1.0.v20090501071000.jar"/>
    </path>
    <path id="shiva.classpath">
    <pathelement location="bin"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/apache-mime4j-0.6.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/bsh-1.3.0.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/cglib-nodep-2.1_3.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/commons-codec-1.6.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/commons-collections-3.2.1.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/commons-exec-1.1.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/commons-io-2.2.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/commons-jxpath-1.3.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/commons-lang3-3.1.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/commons-logging-1.1.1.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/cssparser-0.9.9.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/guava-14.0.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/hamcrest-core-1.3.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/hamcrest-library-1.3.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/htmlunit-2.12.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/htmlunit-core-js-2.12.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/httpclient-4.2.1.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/httpcore-4.2.1.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/httpmime-4.2.1.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/ini4j-0.5.2.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/jcommander-1.29.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/jetty-websocket-8.1.8.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/jna-3.4.0.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/jna-platform-3.4.0.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/json-20080701.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/junit-dep-4.11.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/nekohtml-1.9.17.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/netty-3.5.7.Final.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/operadriver-1.2.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/phantomjsdriver-1.0.3.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/protobuf-java-2.4.1.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/sac-1.3.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/serializer-2.7.1.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/testng-6.8.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/xalan-2.7.1.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/xercesImpl-2.10.0.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/libs/xml-apis-1.4.01.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/selenium-java-2.32.0.jar"/>
    <pathelement location="C:/Users/shiva/Desktop/Appln For Work/selenium-java-2.32.0/selenium-2.32.0/selenium-java-2.32.0-srcs.jar"/>
    <path refid="JUnit 4.libraryclasspath"/>
    </path>
    <target name="init">
    <mkdir dir="bin"/>
    <copy includeemptydirs="false" todir="bin">
        <fileset dir="src">
        <exclude name="**/*.java"/>
        </fileset>
    </copy>
    </target>
    <target name="clean">
    <delete dir="bin"/>
    </target>
    <target depends="clean" name="cleanall"/>
    <target depends="build-subprojects,build-project" name="build"/>
    <target name="build-subprojects"/>
    <target depends="init" name="build-project">
    <echo message="${ant.project.name}: ${ant.file}"/>
    <javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}">
        <src path="src"/>
        <classpath refid="shiva.classpath"/>
    </javac>
    </target>
    <target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
    <target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
    <copy todir="${ant.library.dir}">
        <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
    </copy>
    <unzip dest="${ant.library.dir}">
        <patternset includes="jdtCompilerAdapter.jar"/>
        <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
    </unzip>
    </target>
    <target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
    <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
    <antcall target="build"/>
    </target>
    <target name="Test_class">
    <mkdir dir="${junit.output.dir}"/>
    <junit fork="yes" printsummary="withOutAndErr">
        <formatter type="xml"/>
        <test name="shiva_Pack.Test_class" todir="${junit.output.dir}"/>
        <classpath refid="shiva.classpath"/>
    </junit>
    </target>
    <target name="junitreport">
    <junitreport todir="${junit.output.dir}">
        <fileset dir="${junit.output.dir}">
        <include name="TEST-*.xml"/>
        </fileset>
        <report format="frames" todir="${junit.output.dir}"/>
    </junitreport>
    </target>
</project>

输出是这样的

构建文件:D:\Eclipse Indigo\shiva\build.xml

测试类:
        [mkdir] 创建目录:D:\Eclipse Indigo\shiva\junit
        [junit] 运行 shiva_Pack.Test_class
        [junit] 测试运行:1,失败:0,错误:0,经过时间:18.048 秒
        [junit] 输出:
        [junit] 开课
        [junit] 你好世界
        [junit] 课后
    构建成功


    总时间:19秒

我的 html 文件在哪里?

4

1 回答 1

0

你的蚂蚁任务没有依赖,你在叫什么?

我想你应该打电话

ant Test_class junitreport

当你调用 ant 时,你的命令行是什么?

于 2013-06-10T18:22:43.890 回答