`
struts
  • 浏览: 76658 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

网址5

    博客分类:
  • java
阅读更多
http://www.online-edu.org/html/index.html

http://www.comsharp.com

<path id="cpath">
<pathelement location="lib/testng-5.8-jdk15.jar" />
<pathelement location="lib/commons-lang-2.3.jar" />
<pathelement location="lib/log4j-1.2.9.jar" />
</path>
<target name="compiletesng">
<echo message="compiling tests" />
<mkdir dir="classes" />
<javac debug="true" source="1.5" classpathref="cpath" srcdir="testng" destdir="classes" />
</target>
<!-- RUN TESTS-->
<taskdef name="testng" classname="com.beust.testng.TestNGAntTask" classpathref="cpath" />


<taskdef classpathref="cobertura.classpath" resource="tasks.properties" />

<!-- Instrument classes -->
<target name="instrumenttt" depends="compile">
  <mkdir dir="${instrumented.dir}"/>
  <delete file="cobertura.ser" />
  <cobertura-instrument todir="${instrumented.dir}"
   datafile="cobertura.ser">
    <fileset dir="${classes.dir}">
      <include name="**/*.class" />
      <exclude name="**/*Example.class" />
    </fileset>
  </cobertura-instrument>
</target>

<target name="test.coverage" depends="instrumenttt,compiletesng">
    <testng outputDir="test-output" verbose="2">
        <classpath>
             <pathelement location="${instrumented.dir}" />
             <pathelement location="${classes.dir}" />
             <path refid="cobertura.classpath"/>
        </classpath>
        <sysproperty key="net.sourceforge.cobertura.datafile"
         file="cobertura.ser" />
    <classfileset dir="${classes.dir}" includes="**/*Example.class" />
    <xmlfileset dir="./" includes="testng.xml" />
    </testng>
</target>

<target  name="cobertura.report" depends="test.coverage">
  <mkdir dir="${coverage.html.dir}"/>
  <cobertura-report format="html"
                    destdir="${coverage.html.dir}"
                    srcdir="${src.dir}"
                    datafile="cobertura.ser" />
</target>


http://my.safaribooksonline.com/9780596527938/I_sect13_d1e21236
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics