ant build是成功的,但是在任何项目目录中都没有html文件

时间:2013-06-10 18:12:06

标签: selenium ant selenium-webdriver

用于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>

输出就像这样

  

Buildfile:D:\ Eclipse Indigo \ shiva \ build.xml

 Test_class:
        [mkdir] Created dir: D:\Eclipse Indigo\shiva\junit
        [junit] Running shiva_Pack.Test_class
        [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 18.048 sec
        [junit] Output:
        [junit] Start Class
        [junit] Hello World
        [junit] After Class
    BUILD SUCCESSFUL


    Total time: 19 seconds

我的html文件在哪里?

1 个答案:

答案 0 :(得分:0)

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

我认为你应该致电

ant Test_class junitreport

当你打电话给ant时,你的命令行是什么?