ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject <junitreport> slowed down by <properties>
Date Tue, 23 Mar 2004 16:31:53 GMT
Others have reported this, but the fact that the XML logger
for <junit> records the Java System properties used by that
one test case considerably slows down the transform, and also
takes lots of space.

One of my projects forks 309 testcases. With <properties>, it
adds up to 6.5 MB aggregated file. Without, it's 600 KB!!!
Seems to me the properties are always the same for all tests,
at least they should be before the test runs.

But the kicker is about the transform speed! By pre-processing
the XML files to remove the <properties> element before the
aggregation, it transforms in 61 seconds instead of 217 sec!

BTW, I was pre-processing into .xmls files, and using the
appropriate <fileset> in <junitreport>, but that task further
restricts the fileset to only files ending with .xml, so it
took me a while to figure out why my .xmls files were not used.

ALSO, <style> is *very* verbose, putting out a message for every
single file it transforms, instead of something of the like of
<javac> or <copy> that just say how many files they'll process.

To preprocess the file:

    <mkdir dir="build/logs/tests-no-properties" />
    <style basedir="build/logs/tests"
destdir="build/logs/tests-no-properties"
           style="config/strip-test-properties.xsl" extension=".xml">
      <include name="TEST-*.xml" />
    </style>

The strip-test-properties.xsl stylesheet:

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:output method="xml" />

  <xsl:template match="/ | node() | @* | comment() |
processing-instruction()">
    <xsl:copy>
      <xsl:apply-templates select="@* | node()" />
    </xsl:copy>
  </xsl:template>

  <!-- do not output the <properties> element! -->
  <xsl:template match="properties">
    <properties/>
  </xsl:template>

</xsl:stylesheet>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message