You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by fu...@apache.org on 2007/01/05 08:04:50 UTC

svn commit: r492923 - in /db/derby/code/trunk: build.xml tools/ant/xsl/ tools/ant/xsl/sysinfo_junitreport.xsl

Author: fuzzylogic
Date: Thu Jan  4 23:04:48 2007
New Revision: 492923

URL: http://svn.apache.org/viewvc?view=rev&rev=492923
Log:
DERBY-2044: Add time, date, jvm, and sysinfo output into the junitreport HTML.

Added:
    db/derby/code/trunk/tools/ant/xsl/
    db/derby/code/trunk/tools/ant/xsl/sysinfo_junitreport.xsl   (with props)
Modified:
    db/derby/code/trunk/build.xml

Modified: db/derby/code/trunk/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/build.xml?view=diff&rev=492923&r1=492922&r2=492923
==============================================================================
--- db/derby/code/trunk/build.xml (original)
+++ db/derby/code/trunk/build.xml Thu Jan  4 23:04:48 2007
@@ -1649,9 +1649,19 @@
 <!-- =================================================================== -->
 
   <target name="junit-init">
-    <tstamp prefix="derby.junit"/>
+    <tstamp prefix="derby.junit">
+      <format property="standardtime" pattern="yyyy-MM-dd hh:mm aa zzz"/>
+    </tstamp>
     <property name="derby.junit.jvm" value="java"/>
-    <mkdir dir="junit_${derby.junit.DSTAMP}_${derby.junit.TSTAMP}/testout"/>
+    <property name="derby.junit.timestamp" value="${derby.junit.DSTAMP}_${derby.junit.TSTAMP}"/>
+    <mkdir dir="junit_${derby.junit.timestamp}/testout"/>
+  </target>
+
+  <target name="junit-sysinfo" depends="junit-init">
+    <java classname="org.apache.derby.tools.sysinfo"
+          output="junit_${derby.junit.timestamp}/sysinfo.txt">
+        <classpath path="${out.dir}"/>
+    </java>
   </target>
 
   <target name="junit-clean">
@@ -1665,9 +1675,10 @@
            fork="yes" forkmode="once"
            jvm="${derby.junit.jvm}"
            showoutput="yes"
-           dir="junit_${derby.junit.DSTAMP}_${derby.junit.TSTAMP}/testout">
+           dir="junit_${derby.junit.timestamp}/testout">
       <formatter type="xml"/>
-      <test name="${derby.junit.testname}" todir="junit_${derby.junit.DSTAMP}_${derby.junit.TSTAMP}"/>
+      <test name="${derby.junit.testname}" 
+            todir="junit_${derby.junit.timestamp}"/>
       <classpath>
         <pathelement path="${out.dir}"/>
         <pathelement path="${junit}"/>
@@ -1708,15 +1719,29 @@
     </antcall>
   </target>
 
-  <target name="junitreport" depends="junit-all"> 
-    <junitreport todir="junit_${derby.junit.DSTAMP}_${derby.junit.TSTAMP}">
-      <fileset dir="junit_${derby.junit.DSTAMP}_${derby.junit.TSTAMP}">
+  <target name="junitreport" depends="junit-sysinfo,junit-all">
+    <junitreport todir="junit_${derby.junit.timestamp}">
+      <fileset dir="junit_${derby.junit.timestamp}">
         <include name="TEST-*.xml"/>
       </fileset>
-      <report format="frames" todir="junit_${derby.junit.DSTAMP}_${derby.junit.TSTAMP}"/>
+      <report format="frames" todir="junit_${derby.junit.timestamp}"/>
     </junitreport>
-  </target>   
- 
+
+    <!-- fix up unterminated elements in overview-frame.html -->
+    <replace token="href=&quot;stylesheet.css&quot;&gt;"
+             value="href=&quot;stylesheet.css&quot;/&gt;&lt;/META&gt;"
+             file="junit_${derby.junit.timestamp}/overview-frame.html"/>
+    <replace token="Unit Test Results"
+             value="Apache Derby Test Results - ${derby.junit.standardtime}&lt;br&gt;JVM: ${java.vm.vendor} ${java.vm.version}"
+             file="junit_${derby.junit.timestamp}/overview-summary.html"/>
+
+    <xslt style="${basedir}/tools/ant/xsl/sysinfo_junitreport.xsl"
+          in="junit_${derby.junit.timestamp}/overview-frame.html"
+          out="junit_${derby.junit.timestamp}/overview-frame2.html"/>
+    <move file="junit_${derby.junit.timestamp}/overview-frame2.html"
+          tofile="junit_${derby.junit.timestamp}/overview-frame.html"/>
+  </target>
+
   <target name="l10ncheck"> 
     <ant dir="${derbysrc.dir}/../tools/l10n"/>
   </target>   

Added: db/derby/code/trunk/tools/ant/xsl/sysinfo_junitreport.xsl
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/tools/ant/xsl/sysinfo_junitreport.xsl?view=auto&rev=492923
==============================================================================
--- db/derby/code/trunk/tools/ant/xsl/sysinfo_junitreport.xsl (added)
+++ db/derby/code/trunk/tools/ant/xsl/sysinfo_junitreport.xsl Thu Jan  4 23:04:48 2007
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<!--
+ |   XSL Stylesheet for inserting a link to sysinfo output into junitreport
+ |   output HTML files.
+ |-->
+
+<xsl:output method="xml" encoding="utf-8"/>
+
+<!-- copy everything -->
+<xsl:template match="*|@*">
+  <xsl:copy>
+    <xsl:apply-templates select="@*"/>
+    <xsl:apply-templates select="node()"/>
+  </xsl:copy>
+</xsl:template>
+
+<!-- insert sysinfo link into first h2 element. -->
+<xsl:template match="h2[1]">
+  <xsl:copy>
+    <xsl:copy-of select="*"/><br/>
+    <a href="sysinfo.txt" target="classFrame">sysinfo</a>
+  </xsl:copy>
+</xsl:template>
+
+</xsl:stylesheet>

Propchange: db/derby/code/trunk/tools/ant/xsl/sysinfo_junitreport.xsl
------------------------------------------------------------------------------
    svn:eol-style = native