incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liu...@apache.org
Subject svn commit: r1395863 - in /incubator/ooo/trunk/test: testcommon/source/org/openoffice/test/common/SystemUtil.java testcommon/source/org/openoffice/test/common/XMLReporter.xsl testuno/source/pvt/uno/Conversion.java
Date Tue, 09 Oct 2012 05:55:12 GMT
Author: liuzhe
Date: Tue Oct  9 05:55:11 2012
New Revision: 1395863

URL: http://svn.apache.org/viewvc?rev=1395863&view=rev
Log:
Update conversion mode pvt case

Modified:
    incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/SystemUtil.java
    incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/XMLReporter.xsl
    incubator/ooo/trunk/test/testuno/source/pvt/uno/Conversion.java

Modified: incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/SystemUtil.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/SystemUtil.java?rev=1395863&r1=1395862&r2=1395863&view=diff
==============================================================================
--- incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/SystemUtil.java
(original)
+++ incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/SystemUtil.java
Tue Oct  9 05:55:11 2012
@@ -275,7 +275,8 @@ public class SystemUtil {
 	 */
 	public static void sleep(double second) {
 		try {
-			Thread.sleep((long) (second * 1000));
+			if (second > 0)
+				Thread.sleep((long) (second * 1000));
 		} catch (InterruptedException e) {
 		}
 	}

Modified: incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/XMLReporter.xsl
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/XMLReporter.xsl?rev=1395863&r1=1395862&r2=1395863&view=diff
==============================================================================
--- incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/XMLReporter.xsl
(original)
+++ incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/XMLReporter.xsl
Tue Oct  9 05:55:11 2012
@@ -42,9 +42,9 @@ tr.Failure {color:#F27D15;}
 tr.Ignored {color:#F4C700;}
 tr.Error {color:#FC130F;}
 th.Success {background:#118811;}
-th.Failure {background: #F27D15;}
+th.Failure {background: #FF8888;}
 th.Ignored {background:#F4C700;}
-th.Error {background:#FC130F;}
+th.Error {background:#FF0000;}
 	</style>
 	<title>JUnit Report</title>
 </head>
@@ -153,11 +153,13 @@ function refresh() {
 		var status = 'Success', message = '', screenshot= '';
 		if (c = $$(e, 'failure')) {
 			status = 'Failure';
-			message = text(c.getAttribute("message"));
+			message = '<div>' + text(c.getAttribute("message")) + '</div>';
+			message += '<pre>' + text(c.innerHTML) + '</pre>';
 			screenshot = '<a href="screenshot/' + e.getAttribute("name") + '.png">Screenshot</a>';
 		} else if (c = $$(e, 'error')) {
 			status = 'Error';
-			message = text(c.getAttribute("message"));
+			message = '<div>' + text(c.getAttribute("message")) + '</div>';
+			message += '<pre>' + text(c.innerHTML) + '</pre>';
 			screenshot = '<a href="screenshot/' + e.getAttribute("name") + '.png">Screenshot</a>';
 		} else if (c = $$(e, 'ignored')) {
 			status = 'Ignored';

Modified: incubator/ooo/trunk/test/testuno/source/pvt/uno/Conversion.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testuno/source/pvt/uno/Conversion.java?rev=1395863&r1=1395862&r2=1395863&view=diff
==============================================================================
--- incubator/ooo/trunk/test/testuno/source/pvt/uno/Conversion.java (original)
+++ incubator/ooo/trunk/test/testuno/source/pvt/uno/Conversion.java Tue Oct  9 05:55:11 2012
@@ -35,14 +35,14 @@ import org.junit.runner.RunWith;
 import org.openoffice.test.OpenOffice;
 import org.openoffice.test.common.DataSheet;
 import org.openoffice.test.common.FileProvider;
-import org.openoffice.test.common.SystemUtil;
-import org.openoffice.test.common.Testspace;
 import org.openoffice.test.common.FileProvider.FileFilter;
 import org.openoffice.test.common.FileProvider.FileRepeat;
 import org.openoffice.test.common.FileProvider.FileRepos;
 import org.openoffice.test.common.FileUtil;
 import org.openoffice.test.common.Logger;
+import org.openoffice.test.common.Testspace;
 import org.openoffice.test.uno.UnoApp;
+
 import com.sun.star.beans.PropertyValue;
 import com.sun.star.document.MacroExecMode;
 import com.sun.star.lang.XComponent;
@@ -57,7 +57,7 @@ public class Conversion {
 	public Logger log = Logger.getLogger(this);
 
 	@FileRepos
-	public static String repos = System.getProperty("conversion.repos", getDataPath("conversion_pvt"));
+	public static String repos = System.getProperty("conversion.repos", getDataPath("uno"));
 	@FileFilter
 	public static String filter = System.getProperty("conversion.filter", 
 			  "-f .*(doc|dot|odt|ott)$ writer_pdf_Export pdf " 
@@ -77,7 +77,7 @@ public class Conversion {
 	
 	public static int nLevelInfo = Integer.parseInt(System.getProperty("conversion.limitationcheck",
"0"));	// Level info: starts from 1, 0 means no need for limitation check
 
-	public static int nSleep = Integer.parseInt(System.getProperty("conversion.sleep", "3"));
// Sleep before loadComponentFromURL and storeToURL
+	public static long nSleep = Long.parseLong(System.getProperty("conversion.sleep", "0"));
// Sleep before loadComponentFromURL and storeToURL
 	
 	private static OpenOffice aoo = new OpenOffice();
 	
@@ -94,7 +94,7 @@ public class Conversion {
 	    app = new UnoApp(aoo);
 	    Testspace.prepareDataFile("limit_cfg.ini", aoo.getHome().toString()+"/program");	//
Move limitation check file to installation dir
 		result = new DataSheet(getFile("output/" + Conversion.class.getName()+ ".xml"));
-		result.addRow("data", "File","Scenario","File Size","No","Time Consumed After Closing","Time
Consumed After Saving","Time Consumed After Loading");
+		result.addRow("data", "File","Scenario", "No", "Time Consumed After Closing","Time Consumed
After Saving","Time Consumed After Loading", "File Size", "Exported File Size");
 	}
 	
 	@AfterClass
@@ -142,7 +142,7 @@ public class Conversion {
 	
 	@After
 	public void after() throws Exception{
-		result.addRow("data", sourceFileId, scenario, sourceFile.length(), counter % repeat , closeTime,
saveTime, loadTime);
+		result.addRow("data", sourceFileId, scenario, counter % repeat , closeTime, saveTime, loadTime,
sourceFile.length(), targetFile.length());
 		log.info("Result [After Closing: " + closeTime + "] [After Saving: " + saveTime + "] [After
Loading: " + loadTime + "]");
 		if (closeTime < 0) {
 			app.close();
@@ -157,12 +157,13 @@ public class Conversion {
 		p.Value= value;
 		return p;
 	}
+
 	
 	@Test(timeout=10 * 60000)
 	public void testConversion() throws Exception {
 		try {
-			// convert
-			SystemUtil.sleep(nSleep);	// Sleep before loadComponentFromURL
+			if (nSleep > 0)
+				Thread.sleep(nSleep);
 			long start = System.currentTimeMillis();
 			XComponent doc = app.loadDocumentFromURL(sourceFileUrl, 
 					propertyValue("Hidden", true),
@@ -173,7 +174,8 @@ public class Conversion {
 	
 			loadTime = System.currentTimeMillis() - start;
 			
-			SystemUtil.sleep(nSleep);	// Sleep before storeToURL
+			if (nSleep > 0)
+				Thread.sleep(nSleep);
 			app.saveDocumentToURL(doc, targetFileUrl, 
 					propertyValue( "FilterName", targetFilterName),
 					propertyValue( "Overwrite", true));



Mime
View raw message