乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      build-example.xml(ant+junit測試報告)

       moonboat 2008-01-31

      <?xml version="1.0" encoding="GB2312" ?>

      <!-- 一個項目,可包含很多任務組(target) -->
      <project default="gen-report-coverage" basedir=".">

          <!--設置Java類被注入字節(jié)碼后存放的路徑-->
          <property name="bin.instrument.dir" value="${basedir}/out/instrbin"/>
          <!--設置覆蓋率元數(shù)據(jù)和報告的路徑-->
          <property name="coverage.dir" value="${basedir}/out/coverage"/>
          <!--設置junit報告的路徑 -->
          <property name="junitReport.dir" value="${basedir}/out/junitReport"/>
          <!--設置主題代碼源路徑-->
          <property name="src.main.dir" value="${basedir}/../src/mcc">
          </property>
          <!--設置測試代碼源路徑-->
          <property name="src.test.dir" value="${basedir}/java">
          </property>
          <!--設置主題代碼bin路徑-->
          <property name="bin.main.dir" value="${basedir}/out/srcbin">
          </property>
          <!--設置測試代碼bin路徑-->
          <property name="bin.test.dir" value="${basedir}/out/testbin">
          </property>

          <property name="lib.dir" value="${basedir}/lib">
          </property>

          <path id="compile.path">
              <pathelement location="${bin.main.dir}"/>
              <pathelement location="${basedir}\..\lib\ganymed.jar"/>
              <pathelement location="${basedir}\..\lib\junit-3.8.1.jar"/>
              <pathelement location="${basedir}\..\lib\svnClientAdapter1.3.jar"/>
              <pathelement location="${basedir}\..\lib\svnjavahl.jar"/>
              <pathelement location="${basedir}\..\lib\svnkit.jar"/>
          </path>

          <!--指示 emma.jar 和emma_ant.jar 的路徑-->
          <path id="emma.lib">
              <pathelement location="${lib.dir}/emma.jar"/>
              <pathelement location="${lib.dir}/emma_ant.jar"/>
          </path>

          <path id="compile.classes">
              <pathelement path="${bin.main.dir}"/>
          </path>

          <!--允許emma-->
          <property name="emma.enabled" value="true"/>

          <taskdef resource="emma_ant.properties" classpathref="emma.lib"/>

          <!-- 項目中的一個任務組,可包含很多任務(task:javac,java...) -->
          <target name="init">
              <delete dir="${bin.main.dir}"/>
              <delete dir="${bin.test.dir}"/>
              <delete dir="${bin.instrument.dir}"/>
              <delete dir="${coverage.dir}"/>
              <delete dir="${junitReport.dir}"/>
              <mkdir dir="${bin.main.dir}"/>
              <mkdir dir="${bin.test.dir}"/>
              <mkdir dir="${bin.instrument.dir}"/>
              <mkdir dir="${coverage.dir}"/>
              <mkdir dir="${junitReport.dir}"/>
          </target>

          <!--編譯源代碼-->
          <target name="compile-src.main" depends="init">
              <javac destdir="${bin.main.dir}" debug="on">
                  <src path="${src.main.dir}"></src>
                  <classpath refid="compile.path"></classpath>
              </javac>
              <copy todir="${bin.main.dir}">
                  <fileset dir="${src.main.dir}">
                      <exclude name="**/*.java"/>
                  </fileset>
              </copy>
          </target>

          <!--編譯測試代碼-->
          <target name="compile-src.test" depends="compile-src.main">
              <javac destdir="${bin.test.dir}" debug="on">
                  <src path="${src.test.dir}"/>
                  <classpath refid="compile.path"></classpath>
              </javac>
              <copy todir="${bin.test.dir}">
                  <fileset dir="${src.test.dir}">
                      <exclude name="**/*.java"/>
                  </fileset>
              </copy>
          </target>

          <!--對編譯在路徑bin.main.dir中的Java類注入字節(jié)碼,
          并且把注入字節(jié)碼的新Java類存放到路徑bin.instrument.dir-->
          <!--覆蓋率的元數(shù)據(jù)存放在路徑coverage.dir中-->

          <target name="instrument" depends="compile-src.test">
              <emma enabled="${emma.enabled}" verbosity="info">
                  <instr instrpathref="compile.classes"
                         destdir="${bin.instrument.dir}"
                         metadatafile="${coverage.dir}/metadata.emma"
                         merge="true">
                  </instr>
              </emma>
              <!--<copy todir="${bin.instrument.dir}">-->
              <!--<fileset dir="${bin.main.dir}">-->
              <!--<exclude name="**/*.java"/>-->
              <!--</fileset>-->
              <!--</copy>-->
          </target>

          <!--執(zhí)行測試用例同時生成junit測試報告和emma代碼覆蓋率報告-->
          <target name="test" depends="instrument">
              <junit fork="true" forkmode="once"
                     printsummary="withOutAndErr"
                     errorproperty="test.error"
                     showoutput="on">
                  <!--指明代碼覆蓋率的元數(shù)據(jù)的存放位置-->
                  <jvmarg
                          value="-Demma.coverage.out.file=${coverage.dir}/metadata.emma"/>
                  <jvmarg value="-Demma.coverage.out.merge=true"/>

                  <classpath location="${bin.instrument.dir}"/>
                  <classpath location="${bin.test.dir}"/>
                  <classpath refid="emma.lib"/>
                  <classpath refid="compile.path"/>

                  <formatter type="xml"/>
                  <!--執(zhí)行所有以TestSuite結(jié)尾的junit測試用例-->
                  <batchtest todir="${junitReport.dir}" haltonfailure="no">
                      <fileset dir="${bin.test.dir}">
                          <include name="**/*TestSuite.class"/>
                      </fileset>
                  </batchtest>
              </junit>
          </target>

          <target name="gen-report-junit" depends="test">
              <!--生成junit測試報告-->
              <junitreport todir="${junitReport.dir}">
                  <fileset dir="${junitReport.dir}">
                      <include name="*"/>
                  </fileset>
                  <report format="frames" todir="${junitReport.dir}"/>
              </junitreport>
          </target>

          <!--生成代碼覆蓋率報告-->
          <target name="gen-report-coverage" depends="test">
              <!--如果屬性emma.enabled的值是true,就生成代碼覆蓋率報告 -->
              <emma enabled="${emma.enabled}">
                  <report sourcepath="${src.main.dir}"
                          sort="+line,+block,+name,+method,+class"
                          metrics="method:100,block:90,line:90,class:100">
                      <fileset dir="${coverage.dir}">
                          <include name="metadata.emma"/>
                      </fileset>
                      <html outfile="${coverage.dir}/coverage.html"
                            depth="method"/>
                  </report>
              </emma>
          </target>
      </project>

        本站是提供個人知識管理的網(wǎng)絡存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊一鍵舉報。
        轉(zhuǎn)藏 分享 獻花(0

        0條評論

        發(fā)表

        請遵守用戶 評論公約

        類似文章 更多