You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by li...@apache.org on 2012/09/27 10:31:05 UTC

svn commit: r1390888 - in /incubator/ooo/trunk/test: testcommon/source/org/openoffice/test/ testcommon/source/org/openoffice/test/common/ testcommon/source/org/openoffice/test/vcl/widgets/ testgui/source/bvt/gui/ testgui/source/pvt/gui/ testuno/source/...

Author: liuzhe
Date: Thu Sep 27 08:31:05 2012
New Revision: 1390888

URL: http://svn.apache.org/viewvc?rev=1390888&view=rev
Log:
Added PVT GUI tests

Added:
    incubator/ooo/trunk/test/testgui/source/pvt/gui/Benchmark.java
      - copied, changed from r1389673, incubator/ooo/trunk/test/testgui/source/pvt/gui/Benchmark.java
Modified:
    incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/OpenOffice.java
    incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/DataSheet.java
    incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/vcl/widgets/VclApp.java
    incubator/ooo/trunk/test/testgui/source/bvt/gui/BasicFunctionTest.java
    incubator/ooo/trunk/test/testgui/source/bvt/gui/FileTypeTest.java
    incubator/ooo/trunk/test/testuno/source/pvt/uno/Conversion.java

Modified: incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/OpenOffice.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/OpenOffice.java?rev=1390888&r1=1390887&r2=1390888&view=diff
==============================================================================
--- incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/OpenOffice.java (original)
+++ incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/OpenOffice.java Thu Sep 27 08:31:05 2012
@@ -28,6 +28,7 @@ import java.net.URL;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.Map.Entry;
 import java.util.Properties;
 import java.util.Set;
@@ -83,8 +84,9 @@ public class OpenOffice {
 	
 	private Properties versionProps = null;
 	
-	private String id = "-"+UUID.randomUUID().toString().replace("-", "");
+	private String id = UUID.randomUUID().toString().replace("-", "");
 	
+	private String processPattern = ".*soffice\\.bin.*" + id + ".*|.*soffice\\.exe.*" + id + ".*-env.*";
 	
 	public OpenOffice() {
 		this(null);
@@ -147,7 +149,7 @@ public class OpenOffice {
 		//
 		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
 		System.setProperty("info.app.date", dateFormat.format(new Date(versionFile.lastModified())));
-		addArgs(id);
+		addArgs("-" + id);
 	}
 
 	public static OpenOffice getDefault() {
@@ -349,5 +351,11 @@ public class OpenOffice {
 		return true;
 	}
 	
-	
+	public HashMap<String, Object> getPerfData() {
+		HashMap<String, Object> proccessInfo = SystemUtil.findProcess(processPattern);
+		String pid = (String) proccessInfo.get("pid");
+		if (pid == null)
+			throw new RuntimeException("Can not find performance data");
+		return SystemUtil.getProcessPerfData(pid);
+	}
 }

Modified: incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/DataSheet.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/DataSheet.java?rev=1390888&r1=1390887&r2=1390888&view=diff
==============================================================================
--- incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/DataSheet.java (original)
+++ incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/DataSheet.java Thu Sep 27 08:31:05 2012
@@ -26,6 +26,7 @@ import java.util.Date;
 
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
 
 /**
  * The class can be used to output data into an Microsoft Excel 2003 XML file.
@@ -35,14 +36,29 @@ import org.w3c.dom.Element;
 public class DataSheet {
 	private File file = null;
 	private Document doc = null;
-	private Element tableEl = null;
+	private Element workBookEl = null;
 	private static final SimpleDateFormat DATEFORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS");
-	public DataSheet(File file, String sheetName) {
+	
+	public DataSheet(File file) {
+		this(file, false);
+	}
+	
+	public DataSheet(File file, boolean append) {
 		this.file = file;
-		if (sheetName == null)
-			sheetName = "data";
+		
+		if (append && file.exists()) {
+			doc = FileUtil.parseXML(file.getAbsolutePath());
+			if (doc != null) {
+				NodeList nodes = doc.getElementsByTagName("Workbook");
+				if (nodes.getLength() > 0) {
+					workBookEl = (Element) nodes.item(0);
+					return;
+				}
+			}
+		} 
+		
 		doc = FileUtil.newXML();
-		Element workBookEl = doc.createElement("Workbook");
+		workBookEl = doc.createElement("Workbook");
 		workBookEl.setAttribute("xmlns", "urn:schemas-microsoft-com:office:spreadsheet");
 		workBookEl.setAttribute("xmlns:ss", "urn:schemas-microsoft-com:office:spreadsheet");
 		doc.appendChild(workBookEl);
@@ -54,14 +70,29 @@ public class DataSheet {
 //		Element numberFormatEl = doc.createElement("NumberFormat");
 //		styleEl.appendChild(numberFormatEl);
 //		numberFormatEl.setAttribute("ss:Format", "General Date");
+		
+	}
+	
+	
+	private Element getTableElement(String sheetName) {
+		NodeList nodes = workBookEl.getElementsByTagName("Worksheet");
+		for (int i = 0; i < nodes.getLength(); i++) {
+			Element e = (Element) nodes.item(0);
+			if (sheetName.equals(e.getAttribute("ss:Name"))){
+				return (Element) e.getElementsByTagName("Table").item(0);
+			}
+		}
+		
 		Element worksheetEl = doc.createElement("Worksheet");
 		worksheetEl.setAttribute("ss:Name", sheetName);
 		workBookEl.appendChild(worksheetEl);
-		tableEl = doc.createElement("Table");
+		Element tableEl = doc.createElement("Table");
 		worksheetEl.appendChild(tableEl);
+		return tableEl;
 	}
 	
-	public void addRow(Object... datas) {
+	public void addRow(String sheetName, Object... datas) {
+		Element tableEl = getTableElement(sheetName);
 		Element rowEl = doc.createElement("Row");
 		for (Object o : datas) {
 			Element cellEl = doc.createElement("Cell");
@@ -86,9 +117,4 @@ public class DataSheet {
 		tableEl.appendChild(rowEl);
 		FileUtil.storeXML(doc, file);
 	}
-	
-	public static void main(String... args) {
-		File file = new File("/home/lz/test.xml");
-		new DataSheet(file, "Benchmark").addRow(1,2,"String String", new Date());
-	}
 }

Modified: incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/vcl/widgets/VclApp.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/vcl/widgets/VclApp.java?rev=1390888&r1=1390887&r2=1390888&view=diff
==============================================================================
--- incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/vcl/widgets/VclApp.java (original)
+++ incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/vcl/widgets/VclApp.java Thu Sep 27 08:31:05 2012
@@ -21,8 +21,6 @@
 
 package org.openoffice.test.vcl.widgets;
 
-import static org.openoffice.test.common.SystemUtil.*;
-
 import java.io.IOException;
 
 import org.openoffice.test.OpenOffice;
@@ -40,23 +38,20 @@ import org.openoffice.test.vcl.client.Wi
  */
 public class VclApp {
 	
-	private static VclApp defaultInstance = null;
-
 	protected CommunicationManager communicationManager = null;
 
 	protected CommandCaller caller = null;
 	
 	protected OpenOffice openOffice = null;
 	
+	/**
+	 * 
+	 * @param openOffice
+	 */
 	public VclApp(OpenOffice openOffice) {
-//		this("localhost", openOffice.getAutomationPort());
-		this("127.0.0.1", openOffice.getAutomationPort());	// In case "localhost" is modified incorrectly
 		this.openOffice = openOffice;
-	}
-	
-	public VclApp(String host, int port) {
-		communicationManager = new CommunicationManager(host, port);
-		caller = new CommandCaller(communicationManager);
+		this.communicationManager = new CommunicationManager("127.0.0.1", openOffice.getAutomationPort());
+		this.caller = new CommandCaller(communicationManager);
 		new Handshaker(communicationManager);
 	}
 
@@ -65,59 +60,73 @@ public class VclApp {
 	}
 	
 	public void clean() {
-		OpenOffice.killAll();
-		if (openOffice != null) 
-			openOffice.cleanUserInstallation();
+		openOffice.kill();
+		openOffice.cleanUserInstallation();
 	}
 	
 	public void start() {
-		if (openOffice != null) {
-			// workaround for crash when connect to automation server too early
-			double sleep = openOffice.getUserInstallation().exists() ? 3 : 10;
-			if (openOffice.start()) 
-				sleep(sleep);
-		}
-		
-		communicationManager.start();
+		openOffice.start();
+		//wait for UI to be ready
+		new Condition() {
+
+			@Override
+			public boolean value() {
+				try {
+					String tree = (String) caller.callCommand(Constant.RC_WinTree);
+					return tree.length() > 0;
+				} catch (Exception e) {
+					return false;
+				}
+				
+			}
+			
+		}.waitForTrue("Can't connect to automation server!", 20, 1);
 	}
 	
-	public void start(boolean isCleanUserInstallation) { 
-		if (isCleanUserInstallation) 
+	public void start(boolean clean) { 
+		if (clean) 
 			clean();
 		start();
 	}
 	
-	public OpenOffice getOpenOffice() {
-		return this.openOffice;
+	/**
+	 * Quit the application, if failed, one exception will be thrown
+	 */
+	public void quit() {
+		dispatch(".uno:Quit");
+		if (openOffice != null) {
+			new Condition() {
+				@Override
+				public boolean value() {
+					return !openOffice.isRunning();
+				}
+
+			}.waitForTrue("OpenOffice can't quit!", 5, 1);
+		}
 	}
 	
-	public void close() {
+	public void stop() {
 		if (openOffice != null) {
 			if (!openOffice.isRunning()) 
 				return;
 		}
 		
 		try {
-			dispatch(".uno:Quit");
+			quit();
 		} catch(Exception e) {
-			
-		}
-
-		if (openOffice != null) {
-			if (!new Condition() {
-				@Override
-				public boolean value() {
-					return !openOffice.isRunning();
-				}
-
-			}.test(5, 1)) {
-				openOffice.kill();
-			}
+			openOffice.kill();
 		}
 		
 		communicationManager.stop();
 	}
 	
+	/**
+	 * @deprecated use stop
+	 */
+	public void close() {
+		stop();
+	}
+	
 	
 	/**
 	 * Activate the document window at the given index

Modified: incubator/ooo/trunk/test/testgui/source/bvt/gui/BasicFunctionTest.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testgui/source/bvt/gui/BasicFunctionTest.java?rev=1390888&r1=1390887&r2=1390888&view=diff
==============================================================================
--- incubator/ooo/trunk/test/testgui/source/bvt/gui/BasicFunctionTest.java (original)
+++ incubator/ooo/trunk/test/testgui/source/bvt/gui/BasicFunctionTest.java Thu Sep 27 08:31:05 2012
@@ -53,20 +53,21 @@ public class BasicFunctionTest {
 	public Logger log = Logger.getLogger(this);
 
 	@BeforeClass
-	public static void beforeClass() throws Exception {
+	public static void beforeClass() {
 		app.clean();
 	}
 
 	@AfterClass
-	public static void afterClass() throws Exception {
-		app.close();
+	public static void afterClass() {
+		app.stop();
 	}
 	
 	@Before
 	public void before() {
-		app.close();
+		app.stop();
 		app.start();
 	}
+	
 
 	@Test
 	public void smokeTest() {

Modified: incubator/ooo/trunk/test/testgui/source/bvt/gui/FileTypeTest.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testgui/source/bvt/gui/FileTypeTest.java?rev=1390888&r1=1390887&r2=1390888&view=diff
==============================================================================
--- incubator/ooo/trunk/test/testgui/source/bvt/gui/FileTypeTest.java (original)
+++ incubator/ooo/trunk/test/testgui/source/bvt/gui/FileTypeTest.java Thu Sep 27 08:31:05 2012
@@ -52,18 +52,18 @@ public class FileTypeTest {
 	public Logger log = Logger.getLogger(this);
 
 	@BeforeClass
-	public static void beforeClass() throws Exception {
+	public static void beforeClass() {
 		app.clean();
 	}
-	
+
 	@AfterClass
-	public static void afterClass() throws Exception {
-		app.close();
+	public static void afterClass() {
+		app.stop();
 	}
 	
 	@Before
 	public void before() {
-		app.close();
+		app.stop();
 		app.start();
 	}
 	

Copied: incubator/ooo/trunk/test/testgui/source/pvt/gui/Benchmark.java (from r1389673, incubator/ooo/trunk/test/testgui/source/pvt/gui/Benchmark.java)
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testgui/source/pvt/gui/Benchmark.java?p2=incubator/ooo/trunk/test/testgui/source/pvt/gui/Benchmark.java&p1=incubator/ooo/trunk/test/testgui/source/pvt/gui/Benchmark.java&r1=1389673&r2=1390888&rev=1390888&view=diff
==============================================================================
--- incubator/ooo/trunk/test/testgui/source/pvt/gui/Benchmark.java (original)
+++ incubator/ooo/trunk/test/testgui/source/pvt/gui/Benchmark.java Thu Sep 27 08:31:05 2012
@@ -44,7 +44,6 @@ import org.openoffice.test.common.Condit
 import org.openoffice.test.common.DataSheet;
 import org.openoffice.test.common.GraphicsUtil;
 import org.openoffice.test.common.Logger;
-import org.openoffice.test.common.SystemUtil;
 
 
 public class Benchmark {
@@ -56,7 +55,9 @@ public class Benchmark {
 	
 	private static DataSheet result;
 	
-	private static final double INTERVAL = 0.1;
+	private static final double INTERVAL = 0.1; 
+	
+	private static int repeat = 8;
 	
 	public Benchmark() {
 
@@ -64,104 +65,131 @@ public class Benchmark {
 	
 	@BeforeClass
 	public static void beforeClass() throws Exception {
-		result = new DataSheet(getFile("output/pvt_gui_benchmark.xml"), "benckmark");
 		OpenOffice.killAll();
-		result.addRow("Scenario", "No", "Consumed Time", "Memory(VSZ)", "Memory(RSS)", "Handles(Windows Only)");
+		result = new DataSheet(getFile("output/pvt_gui_benchmark.xml"), true);
+		result.addRow("data", "Scenario", "No", "Consumed Time", "Memory(VSZ)", "Memory(RSS)", "Handles(Windows Only)");
 	}
 	
 	@AfterClass
 	public static void afterClass() throws Exception {
-		app.close();
-	}
-	
-	private HashMap<String, Object> getPerfData() {
-		HashMap<String, Object> proccessInfo = SystemUtil.findProcess(".*(soffice\\.bin|soffice\\.exe .*-env).*");
-		String pid = (String) proccessInfo.get("pid");
-		return SystemUtil.getProcessPerfData(pid);
+		app.stop();
 	}
 	
 	private void addRecord(int i, long start, long end) {
-		HashMap<String, Object>  perf = getPerfData();
-		result.addRow(testname.getMethodName(), i, (end - start), perf.get("vsz"), perf.get("rss"), perf.get("handles"));
+		sleep(2);
+		HashMap<String, Object>  perf = aoo.getPerfData();
+		result.addRow("data", testname.getMethodName(), i, (end - start), perf.get("vsz"), perf.get("rss"), perf.get("handles"));
 	}
 	
 	@Test
 	public void coolStartup() throws Exception {
-		aoo.kill();
-		aoo.cleanUserInstallation();
-		aoo.start();
-		long start = System.currentTimeMillis();
-		startcenter.waitForExistence(120, INTERVAL);
-		long end = System.currentTimeMillis();
-		sleep(2);
-		addRecord(0, start, end);
-		app.close();
+		app.stop();
+		for (int i = 0; i < repeat; i++) {
+			aoo.cleanUserInstallation();
+			assertFalse("User profile exists", aoo.getUserInstallation().exists());
+			aoo.start();
+			long start = System.currentTimeMillis();
+			startcenter.waitForExistence(120, INTERVAL);
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+			app.quit();
+		}
 	}
 	
 	@Test
 	public void warmStartup() throws Exception {
-		for (int i = 0; i < 8; i++) {
-			aoo.kill();//make sure app is closed
+		// Make sure we has generated user profile
+		app.start(true);
+		app.quit();
+		
+		for (int i = 0; i < repeat; i++) {
+			assertTrue("User profile exists", aoo.getUserInstallation().exists());
 			aoo.start();
 			long start = System.currentTimeMillis();
 			startcenter.waitForExistence(120, INTERVAL);
 			long end = System.currentTimeMillis();
-			sleep(2);
 			addRecord(i, start, end);
-			app.close();
+			app.quit();
 		}
 	}
 
 	@Test
 	public void newTextDocument() {
-		for (int i = 0; i < 8; i++) {
-			aoo.kill();//make sure app is closed
-			aoo.start();
-			startCenterWriterButton.waitForExistence(120, 1);
-			sleep(2);
+		app.start(true);
+		app.quit();
+		
+		for (int i = 0; i < repeat; i++) {
+			app.start();
 			startCenterWriterButton.click(0.5, 0.5);
 			long start = System.currentTimeMillis();
 			writer.waitForExistence(60, INTERVAL);
 			long end = System.currentTimeMillis();
-			sleep(2);
 			addRecord(i, start, end);
-			app.close();
+			app.quit();
 		}
 	}
 
 	@Test
 	public void newSpreadsheet() {
-		for (int i = 0; i < 8; i++) {
-			aoo.kill();//make sure app is closed
-			aoo.start();
-			startCenterCalcButton.waitForExistence(120, 1);
-			sleep(2);
+		app.start(true);
+		app.quit();
+		for (int i = 0; i < repeat; i++) {
+			app.start();
 			startCenterCalcButton.click(0.5, 0.5);
 			long start = System.currentTimeMillis();
 			calc.waitForExistence(60, INTERVAL);
 			long end = System.currentTimeMillis();
-			sleep(2);
 			addRecord(i, start, end);
-			app.close();
+			app.quit();
 		}
 	}
 	
 	@Test
 	public void newPresentation() {
-		for (int i = 0; i < 8; i++) {
-			aoo.kill();//make sure app is closed
-			aoo.start();
-			startCenterImpressButton.waitForExistence(120, 1);
-			sleep(2);
+		app.start(true);
+		app.quit();
+		for (int i = 0; i < repeat; i++) {
+			app.start();
 			startCenterImpressButton.click(0.5, 0.5);
-			sleep(1);
 			presentationWizard.click(0.9, 0.95);
 			long start = System.currentTimeMillis();
 			impress.waitForExistence(60, INTERVAL);
 			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+			app.quit();
+		}
+	}
+	
+	@Test
+	public void slideShow() {
+		app.start(true);
+		app.quit();
+		
+		String path = prepareData("pvt/slideshow.odp");
+		final Rectangle rect = GraphicsUtil.getScreenRectangle();
+		// when slide show is running, top-center area will be filled with green
+		rect.setRect(rect.getCenterX(), 2, 2, 2);
+		for (int i = 0; i < repeat; i++) {
+			app.start();
+			open(path);
+			impress.waitForExistence(60, 1);
 			sleep(2);
+			assertFalse("Slideshow control exists", slideShow.exists());
+			assertFalse("Slideshow is not started", GraphicsUtil.isFilledWith(0xFF00FF00, rect));
+			typeKeys("<F5>");
+			long start = System.currentTimeMillis();
+			new Condition() {
+				@Override
+				public boolean value() {
+					return GraphicsUtil.isFilledWith(0xFF00FF00, rect);
+				}
+				
+			}.waitForTrue("", 120, INTERVAL);
+			long end = System.currentTimeMillis();
 			addRecord(i, start, end);
-			app.close();
+			slideShow.typeKeys("<esc>");
+			sleep(2);
+			app.quit();
 		}
 	}
 	
@@ -216,42 +244,34 @@ public class Benchmark {
 	}
 	
 	@Test
-	public void loadFinishComplexODT() {
-		loadFinish("pvt/complex_800p.odt", "Page 1 / 8[0-9]{2}");
+	public void loadFinishComplexDOCX() {
+		loadFinish("pvt/complex_400p.doc", "Page 1 / 4[0-9]{2}");
 	}
 	
 	@Test
-	public void loadFinishComplexXLS() {
-		loadFinish("pvt/sc_complex_13sh_4kcell.xls", "Sheet 2 / 13");
+	public void loadFinishComplexODT() {
+		loadFinish("pvt/complex_800p.odt", "Page 1 / 8[0-9]{2}");
 	}
 	
 	@Test
 	public void loadFinishComplexODS() {
-		loadFinish("pvt/sc_complex_13sh_4kcell_new_odf1.2.ods", "Sheet 6 / 13");
+		loadFinish("pvt/complex_19s.odt", "Sheet 8 / 19");
 	}
-
 	
 	@Test
 	public void loadFinishComplexODP() {
-		loadFinish("pvt/sd_complex_51p_odf1.2.odp", "Slide 1 / 51");
-	}
-	
-	@Test
-	public void loadFinishComplexPPT() {
-		loadFinish("pvt/sd_complex_51p.ppt", "Slide 1 / 51");
+		loadFinish("pvt/complex_150p.odp", "Slide 1 / 150");
 	}
 	
 	public void loadFinish(String file, final String indicator) {
 		final int openIndicatorIndex = file.matches(".*\\.(odp|ppt|pptx)$") ? 4 : 0;
 		String path = prepareData(file);
-		aoo.kill();
-		app.start();
-		startcenter.waitForExistence(10, 1);
-		sleep(2); // Give some seconds to AOO relax. We want data more stable.
+		app.stop();
 		for (int i = 0; i < 8; i++) {
+			app.start();
 			app.dispatch(".uno:Open");
 			filePickerPath.setText(path);
-			sleep(2);
+			sleep(1);
 			filePickerOpen.click(0.5, 0.5);
 			long start = System.currentTimeMillis();
 			new Condition() {
@@ -267,12 +287,10 @@ public class Benchmark {
 				
 			}.waitForTrue("", 120, INTERVAL);
 			long end = System.currentTimeMillis();
-			sleep(2);
 			addRecord(i, start, end);
 			discard();
+			app.quit();
 		}
-	
-		app.close();
 	}
 	
 	@Test
@@ -306,13 +324,8 @@ public class Benchmark {
 	}
 	
 	@Test
-	public void saveComplexXLS() {
-		save("pvt/sc_complex_13sh_4kcell.xls", "Sheet 2 / 13");
-	}
-	
-	@Test
 	public void saveComplexODS() {
-		save("pvt/sc_complex_13sh_4kcell_new_odf1.2.ods", "Sheet 6 / 13");
+		save("pvt/complex_19s.ods", "Sheet 8 / 19");
 	}
 	
 	@Test
@@ -327,24 +340,19 @@ public class Benchmark {
 	
 	@Test
 	public void saveComplexODP() {
-		save("pvt/sd_complex_51p_odf1.2.odp", "Slide 1 / 51");
-	}
-	
-	@Test
-	public void saveComplexPPT() {
-		save("pvt/sd_complex_51p.ppt", "Slide 1 / 51");
+		save("pvt/complex_150p.odp", "Slide 1 / 150");
 	}
 	
 	public void save(String file, final String openIndicator) {
 		boolean alienFormat = file.matches(".*\\.(doc|xls|ppt|docx|xlsx|pptx)$");
 		final int openIndicatorIndex = file.matches(".*\\.(odp|ppt|pptx)$") ? 4 : 0;
 		final int saveIndicatorIndex = file.matches(".*\\.(odt|doc|docx)$") ? 5 : file.matches(".*\\.(ods|xls|xlsx)$") ? 4 : 2;
-		aoo.kill();
-		app.start();
+		app.stop();
 		String picture = prepareData("image/red_64x64.bmp");
-		for (int i = 0; i < 8; i++) {
+		for (int i = 0; i < repeat; i++) {
 			String dir = "temp/file" + i;
 			getFile(dir).mkdirs();
+			app.start();
 			open(prepareData(file, dir));
 			new Condition() {
 				@Override
@@ -383,44 +391,9 @@ public class Benchmark {
 				
 			}.waitForTrue("", 120, INTERVAL);
 			long end = System.currentTimeMillis();
-			sleep(2);
-			addRecord(i, start, end);
-			close();
-		}
-	
-		app.close();
-	}
-
-	@Test
-	public void slideShow() {
-		aoo.kill();
-		app.start();
-		String path = prepareData("pvt/sd_slideshow.odp");
-		final Rectangle rect = GraphicsUtil.getScreenRectangle();
-		// when slide show is running, top-center area will be filled with green
-		rect.setRect(rect.getCenterX(), 2, 2, 2);
-		for (int i = 0; i < 8; i++) {
-			open(path);
-			impress.waitForExistence(60, 1);
-			sleep(2);
-			assertFalse("Slideshow control exists", slideShow.exists());
-			assertFalse("Slideshow is not started", GraphicsUtil.isFilledWith(0xFF00FF00, rect));
-			typeKeys("<F5>");
-			long start = System.currentTimeMillis();
-			new Condition() {
-				@Override
-				public boolean value() {
-					return GraphicsUtil.isFilledWith(0xFF00FF00, rect);
-				}
-				
-			}.waitForTrue("", 120, INTERVAL);
-			long end = System.currentTimeMillis();
-			sleep(2);
 			addRecord(i, start, end);
-			slideShow.typeKeys("<esc>");
-			sleep(2);
 			close();
-		}
-		app.close();
+			app.stop();
+		}	
 	}
 }

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=1390888&r1=1390887&r2=1390888&view=diff
==============================================================================
--- incubator/ooo/trunk/test/testuno/source/pvt/uno/Conversion.java (original)
+++ incubator/ooo/trunk/test/testuno/source/pvt/uno/Conversion.java Thu Sep 27 08:31:05 2012
@@ -87,8 +87,8 @@ public class Conversion {
 		aoo.setUnoUrl(OpenOffice.DEFAULT_UNO_URL);
 		aoo.addArgs("-invisible", "-conversionmode", "-hidemenu");
 	    app = new UnoApp(aoo);
-		result = new DataSheet(getFile("output/pvt_uno_conversion.xml"), "conversion");
-		result.addRow("File","Scenario","File Size","Time Consumed After Closing","Time Consumed After Saving","Time Consumed After Loading");
+		result = new DataSheet(getFile("output/pvt_uno_conversion.xml"));
+		result.addRow("data", "File","Scenario","File Size","Time Consumed After Closing","Time Consumed After Saving","Time Consumed After Loading");
 	}
 	
 	@AfterClass
@@ -136,7 +136,7 @@ public class Conversion {
 	
 	@After
 	public void after() throws Exception{
-		result.addRow(sourceFileId, scenario, sourceFile.length(), closeTime, saveTime, loadTime);
+		result.addRow("data", sourceFileId, scenario, sourceFile.length(), closeTime, saveTime, loadTime);
 		log.info("Result [After Closing: " + closeTime + "] [After Saving: " + saveTime + "] [After Loading: " + loadTime + "]");
 		if (closeTime < 0) {
 			app.close();