Author: hdu
Date: Fri Dec 13 11:01:23 2013
New Revision: 1550687

URL: http://svn.apache.org/r1550687
Log:
#i123847# provide a "Test Date" line in autotest result pages

Modified:
    
openoffice/trunk/test/testcommon/source/org/openoffice/test/common/XMLReporter.java
    
openoffice/trunk/test/testcommon/source/org/openoffice/test/common/XMLReporter.xsl

Modified: 
openoffice/trunk/test/testcommon/source/org/openoffice/test/common/XMLReporter.java
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/test/testcommon/source/org/openoffice/test/common/XMLReporter.java?rev=1550687&r1=1550686&r2=1550687&view=diff
==============================================================================
--- 
openoffice/trunk/test/testcommon/source/org/openoffice/test/common/XMLReporter.java
 (original)
+++ 
openoffice/trunk/test/testcommon/source/org/openoffice/test/common/XMLReporter.java
 Fri Dec 13 11:01:23 2013
@@ -22,6 +22,8 @@ package org.openoffice.test.common;
 
 import java.io.File;
 import java.io.InputStream;
+import java.text.SimpleDateFormat;
+import java.util.Date;
 import java.util.Map.Entry;
 import java.util.Set;
 
@@ -188,7 +190,10 @@ public class XMLReporter extends RunList
                                prop.setAttribute("value", "" + e.getValue());
                                props.appendChild(prop);
                        }
-                       
+
+                       SimpleDateFormat dateFormat = new SimpleDateFormat( 
"yyyy-MM-dd HH-mm-ss");
+                       System.setProperty( "info.test.date", 
dateFormat.format( new Date()));
+
                        FileUtil.storeXML(doc, file);
                        File htmlFile = new File(outputDir, "result.html");
                        InputStream is = 
getClass().getResourceAsStream("XMLReporter.xsl");

Modified: 
openoffice/trunk/test/testcommon/source/org/openoffice/test/common/XMLReporter.xsl
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/test/testcommon/source/org/openoffice/test/common/XMLReporter.xsl?rev=1550687&r1=1550686&r2=1550687&view=diff
==============================================================================
--- 
openoffice/trunk/test/testcommon/source/org/openoffice/test/common/XMLReporter.xsl
 (original)
+++ 
openoffice/trunk/test/testcommon/source/org/openoffice/test/common/XMLReporter.xsl
 Fri Dec 13 11:01:23 2013
@@ -55,6 +55,7 @@ th.Error {background:#FF0000;}
                <div class="header">Information</div>
                <div style="padding: 6px">
                <table class="infoTable"  width="100%">
+               <tr><th>Test Date</th><td><span 
id="info.test.date">Unknown</span></td></tr>
                <tr><th>Build ID</th><td><span 
id="info.app.buildid">Unknown</span> (<span 
id="info.app.AllLanguages"></span>)</td></tr>
                <tr><th>Revision</th><td 
id="info.app.Revision">Unknown</td></tr>
                <tr><th>OS</th><td><span id="info.os.name">Unknown</span>-<span 
id="info.os.version">Unknown</span>-<span 
id="info.os.arch">Unknown</span></td></tr>
@@ -134,6 +135,7 @@ function refresh() {
                props[e.getAttribute("name")] = e.getAttribute("value");
        }
        
+       $('info.test.date').innerHTML = props['info.test.date'] || 'Unknown';
        $('info.app.buildid').innerHTML = props['info.app.buildid'] || 
'Unknown';
        $('info.app.AllLanguages').innerHTML = props['info.app.AllLanguages'] 
|| '';
        $('info.os.name').innerHTML = props['info.os.name'] || 'Unknown';


Reply via email to