View | Details | Raw Unified | Return to bug 52323
Collapse All | Expand All

(-)build.properties.default (+9 lines)
Lines 61-66 Link Here
61
compile.target=1.7
61
compile.target=1.7
62
compile.debug=true
62
compile.debug=true
63
63
64
cobertura.enabled=false
65
64
base-apache.loc.1=http://www.apache.org/dist
66
base-apache.loc.1=http://www.apache.org/dist
65
base-apache.loc.2=http://archive.apache.org/dist
67
base-apache.loc.2=http://archive.apache.org/dist
66
base-commons.loc.1=${base-apache.loc.1}/commons
68
base-commons.loc.1=${base-apache.loc.1}/commons
Lines 239-243 Link Here
239
dojo-js.loc=http://download.dojotoolkit.org/release-1.1.1/dojo-release-1.1.1.tar.gz
241
dojo-js.loc=http://download.dojotoolkit.org/release-1.1.1/dojo-release-1.1.1.tar.gz
240
dojo-js.jar=${dojo-js.home}/dojo/dojo.js
242
dojo-js.jar=${dojo-js.home}/dojo/dojo.js
241
243
244
# ----- Cobertura code coverage tool -----
245
cobertura.version=2.0.3
246
cobertura.home=${base.path}/cobertura-${cobertura.version}
247
cobertura.jar=${cobertura.home}/cobertura-${cobertura.version}.jar
248
cobertura.lib=${cobertura.home}/lib
249
cobertura.loc=${base-sf.loc}/cobertura/cobertura-2.0.3-bin.tar.gz
250
242
# ----- JVM settings for unit tests
251
# ----- JVM settings for unit tests
243
java.net.preferIPv4Stack=false
252
java.net.preferIPv4Stack=false
(-)build.xml (-4 / +71 lines)
Lines 185-190 Link Here
185
    <pathelement location="${tomcat.classes}"/>
185
    <pathelement location="${tomcat.classes}"/>
186
  </path>
186
  </path>
187
187
188
  <path id="cobertura.classpath">
189
    <fileset dir="${cobertura.home}">
190
      <include name="cobertura-${cobertura.version}.jar" />
191
      <include name="lib/**/*.jar" />
192
    </fileset>
193
  </path>
194
188
  <path id="tomcat.test.classpath">
195
  <path id="tomcat.test.classpath">
189
    <pathelement location="${tomcat.build}/webapps/examples/WEB-INF/classes"/>
196
    <pathelement location="${tomcat.build}/webapps/examples/WEB-INF/classes"/>
190
    <pathelement location="${test.classes}"/>
197
    <pathelement location="${test.classes}"/>
Lines 1268-1286 Link Here
1268
  </target>
1275
  </target>
1269
1276
1270
  <target name="test-bio" description="Runs the JUnit test cases for BIO. Does not stop on errors."
1277
  <target name="test-bio" description="Runs the JUnit test cases for BIO. Does not stop on errors."
1271
          depends="test-compile,deploy" if="${execute.test.bio}">
1278
          depends="test-compile,deploy,cobertura-instrument" if="${execute.test.bio}">
1272
    <runtests protocol="org.apache.coyote.http11.Http11Protocol"
1279
    <runtests protocol="org.apache.coyote.http11.Http11Protocol"
1273
              extension=".BIO" />
1280
              extension=".BIO" />
1274
  </target>
1281
  </target>
1275
1282
1276
  <target name="test-nio" description="Runs the JUnit test cases for NIO. Does not stop on errors."
1283
  <target name="test-nio" description="Runs the JUnit test cases for NIO. Does not stop on errors."
1277
          depends="test-compile,deploy" if="${execute.test.nio}">
1284
          depends="test-compile,deploy,cobertura-instrument" if="${execute.test.nio}">
1278
    <runtests protocol="org.apache.coyote.http11.Http11NioProtocol"
1285
    <runtests protocol="org.apache.coyote.http11.Http11NioProtocol"
1279
              extension=".NIO" />
1286
              extension=".NIO" />
1280
  </target>
1287
  </target>
1281
1288
1282
  <target name="test-apr" description="Runs the JUnit test cases for APR. Does not stop on errors."
1289
  <target name="test-apr" description="Runs the JUnit test cases for APR. Does not stop on errors."
1283
          depends="test-compile,deploy,test-apr-exists"
1290
          depends="test-compile,deploy,test-apr-exists,cobertura-instrument"
1284
          if="${apr.exists}">
1291
          if="${apr.exists}">
1285
    <runtests protocol="org.apache.coyote.http11.Http11AprProtocol"
1292
    <runtests protocol="org.apache.coyote.http11.Http11AprProtocol"
1286
              extension=".APR" />
1293
              extension=".APR" />
Lines 1300-1306 Link Here
1300
               description="The extension to use to distinguish the output"/>
1307
               description="The extension to use to distinguish the output"/>
1301
1308
1302
    <sequential>
1309
    <sequential>
1303
      <junit printsummary="yes" fork="yes" dir="." showoutput="yes"
1310
      <junit printsummary="yes" fork="yes" forkmode="once" dir="." showoutput="yes"
1304
        errorproperty="test.result.error"
1311
        errorproperty="test.result.error"
1305
        failureproperty="test.result.failure"
1312
        failureproperty="test.result.failure"
1306
        haltonfailure="${test.haltonfailure}" >
1313
        haltonfailure="${test.haltonfailure}" >
Lines 1311-1322 Link Here
1311
        <jvmarg value="-Djava.net.preferIPv4Stack=${java.net.preferIPv4Stack}"/>
1318
        <jvmarg value="-Djava.net.preferIPv4Stack=${java.net.preferIPv4Stack}"/>
1312
        <jvmarg value="-Dorg.apache.tomcat.util.net.NioSelectorShared=${org.apache.tomcat.util.net.NioSelectorShared}"/>
1319
        <jvmarg value="-Dorg.apache.tomcat.util.net.NioSelectorShared=${org.apache.tomcat.util.net.NioSelectorShared}"/>
1313
1320
1321
        <!-- The instrumented classes must appear first on the classpath -->
1322
        <classpath location="${tomcat.classes.instrumented}" />
1314
        <classpath refid="tomcat.test.classpath" />
1323
        <classpath refid="tomcat.test.classpath" />
1324
        <classpath refid="cobertura.classpath"/>
1315
1325
1316
        <sysproperty key="tomcat.test.temp" value="${test.temp}" />
1326
        <sysproperty key="tomcat.test.temp" value="${test.temp}" />
1317
        <sysproperty key="tomcat.test.tomcatbuild" value="${tomcat.build}" />
1327
        <sysproperty key="tomcat.test.tomcatbuild" value="${tomcat.build}" />
1318
        <sysproperty key="tomcat.test.protocol" value="@{protocol}" />
1328
        <sysproperty key="tomcat.test.protocol" value="@{protocol}" />
1319
        <sysproperty key="tomcat.test.accesslog" value="${test.accesslog}" />
1329
        <sysproperty key="tomcat.test.accesslog" value="${test.accesslog}" />
1330
        <!-- File for Cobertura to write coverage results to -->
1331
        <sysproperty key="net.sourceforge.cobertura.datafile" file="${cobertura.datafile}" />
1320
1332
1321
        <formatter type="${junit.formatter.type}"
1333
        <formatter type="${junit.formatter.type}"
1322
                   usefile="${junit.formatter.usefile}"
1334
                   usefile="${junit.formatter.usefile}"
Lines 1338-1343 Link Here
1338
    </sequential>
1350
    </sequential>
1339
  </macrodef>
1351
  </macrodef>
1340
1352
1353
  <target name="cobertura-enable"  if="cobertura.enabled"
1354
          depends="download-cobertura"
1355
          description="Enables the Cobertura code coverage tool">
1356
1357
    <taskdef classpathref="cobertura.classpath" resource="tasks.properties" />
1358
    <property name="cobertura.out" value="${tomcat.build}/coverage"/>
1359
    <property name="cobertura.datafile" value="${cobertura.out}/cobertura.ser"/>
1360
    <property name="tomcat.classes.instrumented" value="${tomcat.classes}-instrumented"/>
1361
1362
  </target>
1363
1364
  <target name="cobertura-instrument"
1365
          depends="cobertura-enable,compile" if="cobertura.enabled"
1366
          description="Adds Cobertura instrumentation to the compiled bytecode">
1367
1368
    <cobertura-instrument datafile="${cobertura.datafile}" todir="${tomcat.classes.instrumented}">
1369
      <fileset dir="${tomcat.classes}">
1370
        <include name="**/*.class"/>
1371
        <exclude name="**/*ClassLoaderLogManager*.class"/>
1372
        <exclude name="**/FileHandler.class"/>
1373
        <exclude name="**/*AsyncFileHandler*.class"/>
1374
        <exclude name="**/*OneLineFormatter*.class"/>
1375
        <exclude name="**/*DateFormatCache*.class"/>
1376
      </fileset>
1377
      <auxClasspath path="${jdt.jar}" />
1378
    </cobertura-instrument>
1379
1380
  </target>
1381
1382
  <!-- Default Cobertura report format -->
1383
  <property name="cobertura.report.format" value="html"/>
1384
1385
  <target name="cobertura-report" depends="cobertura-enable"
1386
          description="Creates report from gathered Cobertura results">
1387
1388
    <cobertura-report srcdir="${basedir}/java" destdir="${cobertura.out}"
1389
                      datafile="${cobertura.datafile}"
1390
                      format="${cobertura.report.format}"/>
1391
1392
  </target>
1393
1341
  <target name="extras-prepare" >
1394
  <target name="extras-prepare" >
1342
    <mkdir dir="${tomcat.extras}"/>
1395
    <mkdir dir="${tomcat.extras}"/>
1343
    <mkdir dir="${tomcat.extras.sources}"/>
1396
    <mkdir dir="${tomcat.extras.sources}"/>
Lines 2595-2601 Link Here
2595
2648
2596
  </target>
2649
  </target>
2597
2650
2651
  <target name="download-cobertura"
2652
          description="Download the Cobertura code coverage tool" >
2598
2653
2654
    <antcall target="downloadgz">
2655
      <param name="sourcefile" value="${cobertura.loc}"/>
2656
      <param name="destfile" value="${cobertura.jar}"/>
2657
    </antcall>
2658
2659
    <antcall target="downloadgz">
2660
      <param name="sourcefile" value="${cobertura.loc}"/>
2661
      <param name="destfile" value="${cobertura.lib}"/>
2662
    </antcall>
2663
2664
  </target>
2665
2599
  <!-- =============== Targets for dependencies that need to =============== -->
2666
  <!-- =============== Targets for dependencies that need to =============== -->
2600
  <!-- ================  be built rather than used directly ================ -->
2667
  <!-- ================  be built rather than used directly ================ -->
2601
2668

Return to bug 52323