incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wan...@apache.org
Subject svn commit: r1396930 - in /incubator/ooo/trunk/test/testgui: data/svt/ source/svt/gui/ source/svt/gui/sc/ source/svt/gui/sd/ source/svt/gui/sw/ source/testlib/gui/
Date Thu, 11 Oct 2012 07:03:10 GMT
Author: wanglf
Date: Thu Oct 11 07:03:08 2012
New Revision: 1396930

URL: http://svn.apache.org/viewvc?rev=1396930&view=rev
Log:
add svt cases in test/testgui. inlcude cases in svt.gui and sample files in testgui/data/svt

Added:
    incubator/ooo/trunk/test/testgui/data/svt/
    incubator/ooo/trunk/test/testgui/data/svt/64K_Chart1.ods   (with props)
    incubator/ooo/trunk/test/testgui/data/svt/64K_Chart2.ods   (with props)
    incubator/ooo/trunk/test/testgui/data/svt/64K_Chart3.ods   (with props)
    incubator/ooo/trunk/test/testgui/data/svt/64K_Chart4.ods   (with props)
    incubator/ooo/trunk/test/testgui/data/svt/64K_Chart5.ods   (with props)
    incubator/ooo/trunk/test/testgui/data/svt/64K_Chart6.ods   (with props)
    incubator/ooo/trunk/test/testgui/data/svt/DarkBlue.otp   (with props)
    incubator/ooo/trunk/test/testgui/data/svt/OlEinODP.odp   (with props)
    incubator/ooo/trunk/test/testgui/data/svt/howtouse.odt   (with props)
    incubator/ooo/trunk/test/testgui/data/svt/sickness_self-certification_meory issue.odt   (with props)
    incubator/ooo/trunk/test/testgui/data/svt/swdesign.odt   (with props)
    incubator/ooo/trunk/test/testgui/source/svt/gui/sc/BasicFuncOnCalc.java
    incubator/ooo/trunk/test/testgui/source/svt/gui/sd/BasicFuncOnImpress.java
    incubator/ooo/trunk/test/testgui/source/svt/gui/sw/BasicFuncOnWriter.java
    incubator/ooo/trunk/test/testgui/source/svt/gui/sw/FileTypeAboutWriter.java
Removed:
    incubator/ooo/trunk/test/testgui/source/svt/gui/LongRun.java
    incubator/ooo/trunk/test/testgui/source/svt/gui/sc/OperationOnNewSC.java
    incubator/ooo/trunk/test/testgui/source/svt/gui/sc/OperationOnSampleFile.java
    incubator/ooo/trunk/test/testgui/source/svt/gui/sc/SwitchFilesContainingChart.java
    incubator/ooo/trunk/test/testgui/source/svt/gui/sd/DragOLEObject.java
    incubator/ooo/trunk/test/testgui/source/svt/gui/sd/OperationOnNewSD.java
    incubator/ooo/trunk/test/testgui/source/svt/gui/sd/SwitchDiffViewsOnOdpFile.java
    incubator/ooo/trunk/test/testgui/source/svt/gui/sw/OperationOnNewSW.java
    incubator/ooo/trunk/test/testgui/source/svt/gui/sw/OperationOnSample1.java
    incubator/ooo/trunk/test/testgui/source/svt/gui/sw/OperationOnSample2.java
Modified:
    incubator/ooo/trunk/test/testgui/source/testlib/gui/UIMap.java

Added: incubator/ooo/trunk/test/testgui/data/svt/64K_Chart1.ods
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testgui/data/svt/64K_Chart1.ods?rev=1396930&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ooo/trunk/test/testgui/data/svt/64K_Chart1.ods
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/ooo/trunk/test/testgui/data/svt/64K_Chart2.ods
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testgui/data/svt/64K_Chart2.ods?rev=1396930&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ooo/trunk/test/testgui/data/svt/64K_Chart2.ods
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/ooo/trunk/test/testgui/data/svt/64K_Chart3.ods
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testgui/data/svt/64K_Chart3.ods?rev=1396930&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ooo/trunk/test/testgui/data/svt/64K_Chart3.ods
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/ooo/trunk/test/testgui/data/svt/64K_Chart4.ods
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testgui/data/svt/64K_Chart4.ods?rev=1396930&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ooo/trunk/test/testgui/data/svt/64K_Chart4.ods
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/ooo/trunk/test/testgui/data/svt/64K_Chart5.ods
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testgui/data/svt/64K_Chart5.ods?rev=1396930&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ooo/trunk/test/testgui/data/svt/64K_Chart5.ods
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/ooo/trunk/test/testgui/data/svt/64K_Chart6.ods
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testgui/data/svt/64K_Chart6.ods?rev=1396930&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ooo/trunk/test/testgui/data/svt/64K_Chart6.ods
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/ooo/trunk/test/testgui/data/svt/DarkBlue.otp
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testgui/data/svt/DarkBlue.otp?rev=1396930&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ooo/trunk/test/testgui/data/svt/DarkBlue.otp
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/ooo/trunk/test/testgui/data/svt/OlEinODP.odp
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testgui/data/svt/OlEinODP.odp?rev=1396930&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ooo/trunk/test/testgui/data/svt/OlEinODP.odp
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/ooo/trunk/test/testgui/data/svt/howtouse.odt
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testgui/data/svt/howtouse.odt?rev=1396930&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ooo/trunk/test/testgui/data/svt/howtouse.odt
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/ooo/trunk/test/testgui/data/svt/sickness_self-certification_meory issue.odt
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testgui/data/svt/sickness_self-certification_meory%20issue.odt?rev=1396930&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ooo/trunk/test/testgui/data/svt/sickness_self-certification_meory issue.odt
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/ooo/trunk/test/testgui/data/svt/swdesign.odt
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testgui/data/svt/swdesign.odt?rev=1396930&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/ooo/trunk/test/testgui/data/svt/swdesign.odt
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/ooo/trunk/test/testgui/source/svt/gui/sc/BasicFuncOnCalc.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testgui/source/svt/gui/sc/BasicFuncOnCalc.java?rev=1396930&view=auto
==============================================================================
--- incubator/ooo/trunk/test/testgui/source/svt/gui/sc/BasicFuncOnCalc.java (added)
+++ incubator/ooo/trunk/test/testgui/source/svt/gui/sc/BasicFuncOnCalc.java Thu Oct 11 07:03:08 2012
@@ -0,0 +1,485 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+/**
+ * 
+ */
+
+package svt.gui.sc;
+
+import static org.openoffice.test.common.Testspace.*;
+import static org.openoffice.test.vcl.Tester.*;
+import static testlib.gui.AppTool.*;
+import static testlib.gui.UIMap.*;
+
+import java.io.FileOutputStream;
+import java.io.PrintStream;
+import java.util.HashMap;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TestName;
+import org.openoffice.test.OpenOffice;
+import org.openoffice.test.common.DataSheet;
+import org.openoffice.test.common.FileUtil;
+import org.openoffice.test.common.Logger;
+import org.openoffice.test.common.SystemUtil;
+import org.openoffice.test.common.Testspace;
+
+import testlib.gui.SCTool;
+
+public class BasicFuncOnCalc {
+	@Rule
+	public Logger log = Logger.getLogger(this);
+
+	@Rule
+	public TestName testname = new TestName();
+
+	private static DataSheet xmlResult;
+
+	private String pid = null;
+
+	private static int iterator = 100;
+
+	private int i = 0;
+
+	/**
+	 * @throws java.lang.Exception
+	 */
+	@BeforeClass
+	public static void beforeClass() throws Exception {
+
+		xmlResult = new DataSheet(getFile("output/svt_gui_sc.xml"));
+		xmlResult.addRow("BasicFuncOnCalc", "Method", "Iterator",
+				"Consumed Time(MS)", "Memory(KB)", "CPU(%)");
+	}
+
+	@AfterClass
+	public static void afterClass() throws Exception {
+		app.stop();
+	}
+	
+	@Before 
+	public void before()throws Exception{
+		app.start(true);
+	}
+	
+
+	@Test
+	public void saveNewSCWithNumberFormat() {
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			createNewSC();
+			SCTool.selectRange("A1");
+			typeKeys("0.3");
+			sleep(1);
+			app.dispatch(".uno:FormatCellDialog");
+			sleep(2);
+			scFormatCode.setText("0%");
+			typeKeys("<enter>");
+			sleep(1);
+			saveAndReopenNewSC(i);
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+
+	@Test
+	public void saveNewSCWithPrintRange() throws Exception {
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			createNewSC();
+			app.dispatch(".uno:EditPrintArea");
+			sleep(1);
+			scPrintAreaType.select("- user defined -");
+			scPrintArea.setText("$A$1:$C$4");
+			typeKeys("<enter>");
+			SCTool.selectRange("A1");
+			typeKeys("test");
+			saveAndReopenNewSC(i);
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+
+	@Test
+	public void saveNewSCWithText() throws Exception {
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			createNewSC();
+			SCTool.selectRange("A1");
+			typeKeys("test");
+			saveAndReopenNewSC(i);
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+
+	@Test
+	public void saveNewSCWithDataSort() throws Exception {
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			createNewSC();
+			SCTool.selectRange("A1");
+			typeKeys("3<down>2<down>5<down>1<down>6<down>4<down>10<down>8<down>9<down>7");
+			sleep(1);
+			app.dispatch(".uno:DataSort");
+			sortOptionsPage.select();
+			sortOptionsPageRangeContainsColumnLabels.uncheck();
+			sortPage.select();
+			sortPageBy1.select(1); // "Column A"
+			sortPageAscending1.check();
+			sortPage.ok();
+			saveAndReopenNewSC(i);
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+
+	@Test
+	public void saveNewSCWithInsertSheets() throws Exception {
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			createNewSC();
+			app.dispatch(".uno:Insert");
+			scAfterCurrentSheet.check();
+			scNewSheetName.setText("Instant Filter");
+			scInsertSheetDlg.ok();
+			sleep(5);
+			saveAndReopenNewSC(i);
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+
+	@Test
+	public void saveNewSCWithStandardFilter() throws Exception {
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			createNewSC();
+			SCTool.selectRange("A1");
+			typeKeys("A<down>1<down>2<down>3<down>1<down>2<down>3<down>1<down>2<down>3");
+			sleep(1);
+			SCTool.selectRange("A1");
+			app.dispatch(".uno:DataFilterStandardFilter");
+			sleep(2);
+			filterValue1.setText("1");
+			standardFilterDlg.ok();
+			saveAndReopenNewSC(i);
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+
+	@Test
+	public void saveNewSCWithInsertPic() throws Exception {
+		String pic = prepareData("image/blue_256x256.jpg");
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			createNewSC();
+			calc.menuItem("Insert->Picture->From File...").select();
+			sleep(2);
+			filePickerPath.setText(pic);
+			sleep(1);
+			filePickerOpen.click();
+			sleep(2);
+			typeKeys("<esc>");
+			sleep(2);
+			saveAndReopenNewSC(i);
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+
+	@Test
+	public void saveNewSCWithValidaty() throws Exception {
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			createNewSC();
+			app.dispatch(".uno:Insert");
+			scAfterCurrentSheet.check();
+			scNewSheetName.setText("Data Validate");
+			scInsertSheetDlg.ok();
+			sleep(5);
+			SCTool.selectRange("B2:E5");
+			sleep(2);
+
+			app.dispatch(".uno:Validation");
+			scValidityCriteriaTabpage.select();
+			scValidityCriteriaAllowList.select("Whole Numbers");
+			scValidityDecimalCompareOperator.select("greater than");
+			scValiditySourceInput.setText("1");
+			scValidityErrorAlertTabPage.select();
+			scValidityShowErrorMessage.check();
+			scValidityErrorMessageTitle.setText("Error");
+			scValidityErrorMessage.setText("Must greater than 1");
+			scValidityErrorAlertTabPage.ok();
+
+			SCTool.selectRange("B2");
+			typeKeys("0<enter>");
+			activeMsgBox.ok();
+			sleep(1);
+
+			SCTool.selectRange("E5");
+			typeKeys("1<enter>");
+			activeMsgBox.ok();
+			sleep(1);
+
+			SCTool.selectRange("E2");
+			typeKeys("2<enter>");
+			sleep(5);
+			saveAndReopenNewSC(i);
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+
+	@Test
+	public void insertChartToOpenedSC() throws Exception {
+		String file = prepareData("pvt/plain_11s.ods");
+		String[][] inputStr = { { "Area", "Item", "Count" }, { "1", "2", "3" },
+				{ "4", "5", "6" }, { "7", "8", "9" }, { "10", "11", "12" } };
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			app.dispatch(".uno:Open");
+			submitOpenDlg(file);
+			calc.waitForExistence(20, 2);
+			sleep(2);
+
+			// Insert Chart
+			app.dispatch(".uno:Insert");
+			scAfterCurrentSheet.check();
+			scNewSheetName.setText("Instant Chart");
+			scInsertSheetDlg.ok();
+			sleep(5);
+			inputCells(inputStr);
+			sleep(2);
+			SCTool.selectRange("A1:C5");
+			calc.menuItem("Insert->Chart...").select();
+			sleep(1);
+			chartWizard.ok();
+			sleep(5);
+			calc.typeKeys("<esc>");
+			sleep(5);
+			calc.typeKeys("<esc>");
+			sleep(5);
+			calc.typeKeys("<esc>");
+			sleep(5);
+			closeWithoutSaveSC();
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+
+	@Test
+	public void insertPicToOpenedSC() throws Exception {
+		String file = prepareData("pvt/plain_11s.ods");
+		String pic = prepareData("image/blue_256x256.jpg");
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			app.dispatch(".uno:Open");
+			submitOpenDlg(file);
+			calc.waitForExistence(20, 2);
+			sleep(2);
+
+			// Insert Chart
+			app.dispatch(".uno:Insert");
+			scAfterCurrentSheet.check();
+			scNewSheetName.setText("Instant Graphic");
+			scInsertSheetDlg.ok();
+			sleep(5);
+			calc.menuItem("Insert->Picture->From File...").select();
+			sleep(2);
+			filePickerPath.setText(pic);
+			sleep(1);
+			filePickerOpen.click();
+			sleep(5);
+			calc.typeKeys("<esc>");
+			sleep(2);
+			closeWithoutSaveSC();
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+
+	@Test
+	public void insertFontWorkToOpenedSC() throws Exception {
+		String file = prepareData("pvt/plain_11s.ods");
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			app.dispatch(".uno:Open");
+			submitOpenDlg(file);
+			calc.waitForExistence(20, 2);
+			sleep(2);
+
+			calc.menuItem("View->Toolbars->Fontwork").select();
+			sleep(2);
+			app.dispatch(".uno:FontworkGalleryFloater");
+			sleep(2);
+			typeKeys("<right>");
+			fontworkGalleryDlg.ok();
+			sleep(2);
+			calc.typeKeys("<esc>");
+			sleep(2);
+
+			closeWithoutSaveSC();
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+
+	@Test
+	public void switchFileContainingChart() throws Exception {
+		String file1 = prepareData("svt/64K_Chart1.ods");
+		String file2 = prepareData("svt/64K_Chart2.ods");
+		String file3 = prepareData("svt/64K_Chart3.ods");
+		String file4 = prepareData("svt/64K_Chart4.ods");
+		String file5 = prepareData("svt/64K_Chart5.ods");
+		String file6 = prepareData("svt/64K_Chart6.ods");
+
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			app.dispatch(".uno:Open");
+			submitOpenDlg(file1);
+			calc.waitForExistence(20, 2);
+			sleep(2);
+
+			app.dispatch(".uno:Open");
+			submitOpenDlg(file2);
+			calc.waitForExistence(20, 2);
+			sleep(2);
+
+			app.dispatch(".uno:Open");
+			submitOpenDlg(file3);
+			calc.waitForExistence(20, 2);
+			sleep(2);
+
+			app.dispatch(".uno:Open");
+			submitOpenDlg(file4);
+			calc.waitForExistence(20, 2);
+			sleep(2);
+
+			app.dispatch(".uno:Open");
+			submitOpenDlg(file5);
+			calc.waitForExistence(20, 2);
+			sleep(2);
+
+			app.dispatch(".uno:Open");
+			submitOpenDlg(file6);
+			calc.waitForExistence(20, 2);
+
+			sleep(2);
+
+			selectCertainFile(2);
+			sleep(2);
+			selectCertainFile(3);
+			sleep(2);
+			selectCertainFile(5);
+			sleep(2);
+
+			closeAlldocuments();
+			sleep(3);
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+
+	public void selectCertainFile(int k) {
+		calc.menuItem("Window").select();
+		k += 5;
+		for (int i = 0; i < k; i++) {
+			typeKeys("<down>");
+		}
+		typeKeys("<enter>");
+		sleep(2);
+	}
+
+	public void closeAlldocuments() {
+		for (int index = 3; index < 9; index++) {
+			calc.menuItem("File->Close").select();
+			sleep(2);
+		}
+
+	}
+
+	public static void inputCells(String[][] inputs) {
+		String back = "";
+		for (int i = 0; i < inputs.length; i++) {
+			calc.typeKeys(back);
+			sleep(1);
+			back = "";
+			for (int j = 0; j < inputs[i].length; j++) {
+				typeKeys(inputs[i][j]);
+				typeKeys("<Right>");
+				sleep(0.5);
+				back += "<Left>";
+			}
+			back += "<enter>";
+		}
+		sleep(2);
+	}
+
+	private void createNewSC() {
+		app.dispatch("private:factory/scalc");
+	}
+
+	private void saveAndReopenNewSC(int iterator) {
+		String saveTo = getPath("temp/" + "tempSC_New" + iterator + ".ods");
+		calc.menuItem("File->Save As...").select();
+		FileUtil.deleteFile(saveTo);
+		submitSaveDlg(saveTo);
+		if (activeMsgBox.exists()) {
+			activeMsgBox.yes();
+			sleep(2);
+		}
+		app.dispatch(".uno:CloseDoc");
+		// sleep(2);
+		startCenterOpenButton.waitForExistence(30, 2);
+		startCenterOpenButton.click();
+		submitOpenDlg(saveTo);
+		sleep(1);
+		app.dispatch(".uno:CloseDoc");
+	}
+
+	private void closeWithoutSaveSC() {
+		calc.menuItem("File->Close").select();
+		activeMsgBox.no();
+		sleep(2);
+	}
+
+	private HashMap<String, Object> getPerfData() {
+		HashMap<String, Object> proccessInfo = SystemUtil
+				.findProcess(".*(soffice\\.bin|soffice\\.exe|soffice).*");
+		String pid = (String) proccessInfo.get("pid");
+		return SystemUtil.getProcessPerfData(pid);
+	}
+
+	private void addRecord(int i, long start, long end) {
+		HashMap<String, Object> perf = getPerfData();
+		xmlResult.addRow("BasicFuncOnCalc",testname.getMethodName(), i, (end - start),
+				perf.get("rss"), perf.get("pcpu"));
+	}
+}

Added: incubator/ooo/trunk/test/testgui/source/svt/gui/sd/BasicFuncOnImpress.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testgui/source/svt/gui/sd/BasicFuncOnImpress.java?rev=1396930&view=auto
==============================================================================
--- incubator/ooo/trunk/test/testgui/source/svt/gui/sd/BasicFuncOnImpress.java (added)
+++ incubator/ooo/trunk/test/testgui/source/svt/gui/sd/BasicFuncOnImpress.java Thu Oct 11 07:03:08 2012
@@ -0,0 +1,385 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+/**
+ * 
+ */
+
+package svt.gui.sd;
+
+import static org.junit.Assert.assertEquals;
+import static org.openoffice.test.common.Testspace.*;
+import static org.openoffice.test.vcl.Tester.*;
+import static testlib.gui.AppTool.*;
+import static testlib.gui.UIMap.*;
+
+import java.io.FileOutputStream;
+import java.io.PrintStream;
+import java.util.HashMap;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TestName;
+import org.openoffice.test.OpenOffice;
+import org.openoffice.test.common.DataSheet;
+import org.openoffice.test.common.FileUtil;
+import org.openoffice.test.common.Logger;
+import org.openoffice.test.common.SystemUtil;
+import org.openoffice.test.common.Testspace;
+
+import testlib.gui.SCTool;
+
+public class BasicFuncOnImpress {
+	@Rule
+	public Logger log = Logger.getLogger(this);
+
+	@Rule
+	public TestName testname = new TestName();
+
+	private static DataSheet xmlResult;
+
+	private String pid = null;
+
+	private static int iterator = 100;
+
+	private int i = 0;
+
+	/**
+	 * @throws java.lang.Exception
+	 */
+	@BeforeClass
+	public static void beforeClass() throws Exception {
+
+		xmlResult = new DataSheet(getFile("output/svt_gui_sd.xml"));
+		xmlResult.addRow("BasicFunOnImpress","Method", "Iterator", "Consumed Time(MS)",
+				"Memory(KB)", "CPU(%)");
+	}
+
+	@AfterClass
+	public static void afterClass() throws Exception {
+		app.stop();
+	}
+
+	@Before
+	public void before() throws Exception{
+		app.start(true);
+	}
+
+	@Test
+	public void saveNewSDWithNewSlides() throws Exception {
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			createNewSD();
+			impress.menuItem("Insert->Slide").select();
+			sleep(2);
+			saveAndReopenNewSD(i);
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+
+	@Test
+	public void saveNewSDWithTable() throws Exception {
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			createNewSD();
+			app.dispatch(".uno:InsertTable", 3);
+			sleep(2);
+			numberofCol.setText("5");
+			numberofRow.setText("4");
+			sleep(2);
+			insertTable.ok();
+			impress.typeKeys("<enter>");
+			impress.typeKeys("2");
+			impress.typeKeys("<right>");
+			impress.typeKeys("2");
+			impress.typeKeys("<right>");
+			impress.typeKeys("<ctrl end>");
+			impress.typeKeys("2");
+			sleep(2);
+			saveAndReopenNewSD(i);
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+
+	@Test
+	public void saveNewSDWithPic() throws Exception {
+		String pic = prepareData("image/blue_256x256.jpg");
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			createNewSD();
+			impress.menuItem("Insert->Picture->From File...").select();
+			sleep(2);
+			filePickerPath.setText(pic);
+			sleep(1);
+			filePickerOpen.click();
+			sleep(5);
+			impress.typeKeys("<esc>");
+			sleep(2);
+			saveAndReopenNewSD(i);
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+
+	@Test
+	public void saveNewSDWithTextbox()throws Exception{
+		if(!sdDrawingToolbar.exists()){
+			app.dispatch(".uno:AvailableToolbars?Toolbar:string=toolbar");
+		}
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			createNewSD();
+			sdInsertTextboxButtonOnToolbar.click();
+			impress.focus();
+			impress.drag(100, 100, 200, 200);
+			typeKeys("test");
+			typeKeys("<esc>");
+			sleep(2);
+			saveAndReopenNewSD(i);
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+	
+	@Test
+	public void saveNewSDWithExternalSlides() throws Exception {
+		String externalFile = prepareData("pvt/plain_200p.odp");
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			createNewSD();
+			app.dispatch(".uno:ImportFromFile");
+			sleep(2);
+			filePickerPath.setText(externalFile);
+			filePickerOpen.click();
+			sleep(2);
+			insertSlideObjects.ok();
+			sleep(5);
+			saveAndReopenNewSD(i);
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+
+	@Test
+	public void saveNewSDWithAnimation()throws Exception{
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			createNewSD();			
+			//Insert a Shape and select it via Navigator
+			sdCalloutShapes.click();
+			impress.focus();
+			impress.drag(100, 100, 200, 200);
+			app.dispatch(".uno:CustomAnimation");
+			sdAddAnimation.click();
+			sdEntranceAnimationTab.waitForExistence(60, 2);
+			sdEntranceAnimationTab.select("Circle");
+			typeKeys("<enter>");
+			sdAnimationList.openContextMenu();
+			typeKeys("<down><down><enter>");
+			impress.menuItem("Slide Show->Slide Show").select();
+			sleep(10);
+			impress.typeKeys("<esc>");
+			sleep(5);
+			saveAndReopenNewSD(i);
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+	
+	@Test
+	public void saveNewSDWithShowSettings() throws Exception {
+		String externalFile = prepareData("pvt/plain_200p.odp");
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			createNewSD();
+			// Insert Slides from External Sample files
+			impress.menuItem("Insert->File...").select();
+			sleep(2);
+			filePickerPath.setText(externalFile);
+			filePickerOpen.click();
+			sleep(2);
+			insertSlideObjects.ok();
+			sleep(20);
+
+			// Slide Screen Show Settings
+			impress.menuItem("Slide Show->Slide Transition...").select();
+			sleep(2);
+			impressSlideTransitions.select("Uncover Up");
+			sleep(2);
+			slideShowSpeed.select("Slow");
+			sleep(5);
+			slideAutoAfter.check();
+			sleep(2);
+			applyToAllSlides.click();
+			sleep(2);
+			impress.menuItem("Slide Show->Slide Show").select();
+			sleep(70);
+			impress.typeKeys("<esc>");
+			sleep(5);
+			saveAndReopenNewSD(i);
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+	
+	@Test
+	public void saveSDTemplate()throws Exception{
+		String templateFile = prepareData("svt/DarkBlue.otp");
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			app.dispatch(".uno:Open");
+			submitOpenDlg(templateFile);
+			impress.waitForExistence(10, 2);
+			sleep(5);	
+			saveAndReopenNewSD(i);
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+	
+	@Test
+	public void opChartOnOpenedSD() throws Exception {
+		String file = prepareData("svt/OLEinODP.odp");
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			app.dispatch(".uno:Open");
+			submitOpenDlg(file);
+			impress.waitForExistence(10, 2);
+			sleep(5);
+			if (!sdNavigatorDlg.exists()) {
+				app.dispatch(".uno:Navigator");
+			}
+			impress.focus();
+			sdNavigator.focus();
+			sdNavigator.collapseAll();
+			sdNavigator.expand(0);
+			sdNavigator.select(1);
+			typeKeys("<enter>");
+			impress.menuItem("Edit->Copy").select();
+			sleep(2);
+			impress.menuItem("Edit->Paste").select();
+			sleep(2);
+
+			sdNavigator.focus();
+			sdNavigator.collapseAll();
+			sdNavigator.expand(0);
+			sdNavigator.select(2);
+			typeKeys("<enter>");
+			impress.menuItem("Edit->Copy").select();
+			sleep(2);
+			impress.menuItem("Edit->Paste").select();
+			sleep(2);
+
+			sdNavigator.focus();
+			sdNavigator.collapseAll();
+			sdNavigator.expand(0);
+			sdNavigator.select(3);
+			typeKeys("<enter>");
+			impress.menuItem("Edit->Copy").select();
+			sleep(2);
+			impress.menuItem("Edit->Paste").select();
+			sleep(2);
+			closeWithoutSaveSD();
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+
+	@Test
+	public void switchViewOfOpenedSD() throws Exception {
+		String file = prepareData("pvt/plain_200p.odp");
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			app.dispatch(".uno:Open");
+			submitOpenDlg(file);
+			impress.waitForExistence(10, 2);
+			sleep(5);
+
+			impress.menuItem("View->Outline").select();
+			sleep(2);
+			impressOutline.menuItem("View->Slide Sorter").select();
+			sleep(10);
+			impressSlideSorter.menuItem("View->Notes Page").select();
+			sleep(2);
+			impressHandoutView.menuItem("View->Master->Slide Master").select();
+			sleep(2);
+			impress.menuItem("View->Master->Notes Master").select();
+			sleep(2);
+
+			impressHandoutView.menuItem("View->Normal").select();
+			sleep(2);
+			closeWithoutSaveSD();
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+
+	private void createNewSD() {
+		app.dispatch("private:factory/simpress?slot=6686");
+		presentationWizard.ok();
+	}
+
+	private void saveAndReopenNewSD(int iterator) {
+		String saveTo = getPath("temp/" + "tempSD_New" + iterator + ".odp");
+		impress.menuItem("File->Save As...").select();
+		FileUtil.deleteFile(saveTo);
+		submitSaveDlg(saveTo);
+		if (activeMsgBox.exists()) {
+			activeMsgBox.yes();
+			sleep(2);
+		}
+		sleep(5);
+		app.dispatch(".uno:CloseDoc");	
+		startCenterOpenButton.waitForExistence(30, 2);
+		startCenterOpenButton.click();
+		submitOpenDlg(saveTo);
+		sleep(2);		
+		app.dispatch(".uno:CloseDoc");
+	}
+	
+	private void closeWithoutSaveSD() {
+		impress.menuItem("File->Close").select();
+		if (activeMsgBox.exists()) {
+			activeMsgBox.no();
+			sleep(2);
+		}
+	}
+
+	private HashMap<String, Object> getPerfData() {
+		HashMap<String, Object> proccessInfo = SystemUtil
+				.findProcess(".*(soffice\\.bin|soffice\\.exe|soffice).*");
+		String pid = (String) proccessInfo.get("pid");
+		return SystemUtil.getProcessPerfData(pid);
+	}
+
+	private void addRecord(int i, long start, long end) {
+		HashMap<String, Object> perf = getPerfData();
+		xmlResult.addRow("BasicFuncOnImpress",testname.getMethodName(), i, (end - start),
+				perf.get("rss"), perf.get("pcpu"));
+	}
+}

Added: incubator/ooo/trunk/test/testgui/source/svt/gui/sw/BasicFuncOnWriter.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testgui/source/svt/gui/sw/BasicFuncOnWriter.java?rev=1396930&view=auto
==============================================================================
--- incubator/ooo/trunk/test/testgui/source/svt/gui/sw/BasicFuncOnWriter.java (added)
+++ incubator/ooo/trunk/test/testgui/source/svt/gui/sw/BasicFuncOnWriter.java Thu Oct 11 07:03:08 2012
@@ -0,0 +1,530 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+/**
+ * 
+ */
+package svt.gui.sw;
+
+import static org.openoffice.test.common.Testspace.getFile;
+import static org.openoffice.test.common.Testspace.getPath;
+import static org.openoffice.test.common.Testspace.prepareData;
+import static org.openoffice.test.vcl.Tester.*;
+import static testlib.gui.AppTool.*;
+import static testlib.gui.UIMap.*;
+
+import java.io.FileOutputStream;
+import java.io.PrintStream;
+import java.util.HashMap;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TestName;
+import org.openoffice.test.common.DataSheet;
+import org.openoffice.test.common.FileUtil;
+import org.openoffice.test.common.Logger;
+import org.openoffice.test.common.SystemUtil;
+import org.openoffice.test.common.Testspace;
+
+public class BasicFuncOnWriter {
+	@Rule
+	public Logger log = Logger.getLogger(this);
+
+	@Rule
+	public TestName testname = new TestName();
+
+	private static DataSheet xmlResult;
+
+	private String pid = null;
+
+	private static int iterator = 100;
+
+	private int i = 0;
+
+	/**
+	 * @throws java.lang.Exception
+	 */
+	@BeforeClass
+	public static void beforeClass() throws Exception {
+
+		xmlResult = new DataSheet(getFile("output/svt_gui_sw.xml"));
+		xmlResult.addRow("BasicFuncOnWriter","Method", "Iterator", "Consumed Time(MS)",
+				"Memory(KB)", "CPU(%)");
+	}
+
+	@AfterClass
+	public static void afterClass() throws Exception {
+		app.stop();
+	}
+	
+	@Before
+	public void before()throws Exception{
+		app.start(true);
+	}
+	
+	@Test
+	public void saveNewSWWithPic() throws Exception {
+		String pic = prepareData("image/blue_256x256.jpg");
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			createNewSW();
+			writer.menuItem("Insert->Picture->From File...").select();
+			sleep(2);
+			filePickerPath.setText(pic);
+			sleep(1);
+			filePickerOpen.click();
+			sleep(5);
+			typeKeys("<esc>");
+			sleep(2);
+			saveAndReopenNewSW(i);
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+
+	
+	@Test
+	public void saveNewSWWithBullet() throws Exception {
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			createNewSW();
+			writer.typeKeys("The first");
+			writer.typeKeys("<enter>");
+			sleep(3);
+			writer.typeKeys("The second");
+			app.dispatch(".uno:SelectAll");
+			writer.menuItem("Format->Bullets and Numbering...").select();
+			sleep(3);
+			bulletPage.ok();
+			writer.typeKeys("<ctrl z");
+			sleep(1);
+			writer.typeKeys("<ctrl y>");
+			sleep(1);
+			writer.typeKeys("<ctrl end>");
+			writer.typeKeys("<enter>");
+			sleep(2);
+			
+			writer.focus();
+			saveAndReopenNewSW(i);
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+	
+	@Test
+	public void saveNewSWWithUnDoDelete()throws Exception{
+		if(!sdDrawingToolbar.exists()){
+			app.dispatch(".uno:AvailableToolbars?Toolbar:string=toolbar");
+		}
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			createNewSW();
+			app.dispatch(".uno:Ellipse");
+			writer.focus();
+			writer.drag(200, 200, 300, 300);
+			typeKeys("<Delete>");
+			typeKeys("<ctrl z>");
+			typeKeys("<ctrl y>");
+
+			saveAndReopenNewSW(i);
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+	
+	
+	@Test
+	public void saveNewSWWithSpellCheck() throws Exception {
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			createNewSW();
+			writer.typeKeys("goood");
+			sleep(2);
+			writer.menuItem("Tools->Spelling and Grammar...").select();
+			sleep(2);
+			spellcheckDlgSuggestionList.select(0);
+			spellcheckDlgIgnoreOnce.click();
+			activeMsgBox.ok();
+			sleep(2);
+			saveAndReopenNewSW(i);
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+
+	@Test
+	public void saveNewSWWithHeaderFooter() throws Exception {
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			createNewSW();
+			writer.menuItem("Insert->Header->Default").select();
+			sleep(2);
+			writer.typeKeys("Header");
+			sleep(2);
+			writer.menuItem("Insert->Footer->Default").select();
+			sleep(2);
+			writer.typeKeys("Footer");
+			sleep(2);
+			writer.typeKeys("<ctrl end>");
+			sleep(2);
+			writer.typeKeys("<enter>");
+			sleep(2);
+			saveAndReopenNewSW(i);
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+	
+	@Test
+	public void saveNewSWWithFrameAnchor() throws Exception {
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			createNewSW();
+			writer.menuItem("Insert->Frame...").select();
+			sleep(2);
+			writerFrameDlg.ok();
+			writer.menuItem("Format->Anchor->To Page").select();
+			sleep(2);
+			writer.menuItem("Format->Anchor->To Paragraph").select();
+			sleep(2);
+			writer.menuItem("Format->Anchor->To Character").select();
+			sleep(2);
+			writer.menuItem("Format->Anchor->As Character").select();
+			sleep(2);
+			writer.typeKeys("<esc>");
+			sleep(2);
+			writer.typeKeys("<enter>");
+			sleep(2);
+			saveAndReopenNewSW(i);
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+	
+	@Test
+	public void saveNewSWWithSDAsOLE()throws Exception{
+		String linkFile = prepareData("pvt/plain_200p.odp");
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			createNewSW();
+			app.dispatch(".uno:InsertObject");
+			sleep(2);
+			insertObject.waitForExistence(60, 2);
+			objectFromFile.check();
+			objectFilePath.setText(linkFile);
+			objectFileLink.check();
+			insertObject.ok();
+			sleep(10);
+			
+			writer.focus();
+			writer.doubleClick(200, 300);
+			sleep(15);
+			writer.activate();
+			writer.click(10, 10);
+			sleep(5);
+			
+			saveAndReopenNewSW(i);
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+	
+	@Test
+	public void saveNewSWWithTOC() throws Exception {
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			createNewSW();
+			for (int j = 0; j < 6; j++) {
+				writer.typeKeys(String.valueOf(j + 1));
+				writer.typeKeys("<enter>");
+			}
+			writer.typeKeys("<ctrl home>");
+			for (int k = 0; k < 2; k++) {
+				writer.typeKeys("<shift down>");
+			}
+			if (!styleAndFormattingDlg.exists()) {
+				app.dispatch(".uno:DesignerDialog");
+				sleep(2);
+			}
+
+			styleAndFormattingList.doubleClick(0.5, 0.25);
+			sleep(2);
+			writer.typeKeys("<down>");
+			writer.typeKeys("<right>");
+			writer.typeKeys("<left>");
+			for (int k = 0; k < 2; k++) {
+				writer.typeKeys("<shift down>");
+			}
+			styleAndFormattingList.doubleClick(0.5, 0.3);
+			sleep(2);
+			writer.typeKeys("<ctrl home>");
+			sleep(2);
+			writer.menuItem("Insert->Indexes and Tables->Indexes and Tables...").select();
+			sleep(2);
+			insertIndexDlg.ok();
+			sleep(2);
+			writer.typeKeys("<ctrl end>");
+			saveAndReopenNewSW(i);
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+
+	@Test
+	public void splitMergeTableOnOpenedSW() throws Exception {
+		String file = prepareData("svt/swdesign.odt");
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			app.dispatch(".uno:Open");
+			submitOpenDlg(file);
+			writer.waitForExistence(10, 2);
+			writer.typeKeys("<down>");
+			writer.typeKeys("<down>");
+			sleep(2);
+
+			writer.menuItem("Table->Split Cells").select();
+			sleep(2);
+			writerSplitCellDlg.ok();
+			sleep(2);
+
+			writer.typeKeys("<shift down>");
+			writer.typeKeys("<shift down>");
+			writer.typeKeys("<shift down>");
+			writer.typeKeys("<shift down>");
+			writer.typeKeys("<shift down>");
+			sleep(2);
+			writer.menuItem("Table->Merge Cells").select();
+			sleep(2);
+
+			writer.typeKeys("<enter>");
+			closeWithoutSaveSW();
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+	
+	@Test
+	public void addDelColumnsRowsInTableOnOpenedSW() throws Exception {
+		String file = prepareData("svt/swdesign.odt");
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			app.dispatch(".uno:Open");
+			submitOpenDlg(file);
+			writer.waitForExistence(10, 2);
+			writer.typeKeys("<down>");
+			writer.typeKeys("<down>");
+			sleep(2);
+
+			app.dispatch(".uno:InsertRowDialog");
+			writerInsertRowsDlg.ok();
+			sleep(2);
+
+			writer.menuItem("Table->Delete->Rows").select();
+			sleep(2);
+
+			app.dispatch(".uno:InsertColumnDialog");
+			writerInsertColumnsDlg.ok();
+			sleep(2);
+
+			writer.menuItem("Table->Delete->Columns").select();
+			sleep(2);
+			
+			closeWithoutSaveSW();
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+	
+	@Test
+	public void setParaPropertoesOnOpenedSW() throws Exception {
+		String file = prepareData("pvt/plain_200p.odt");
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			app.dispatch(".uno:Open");
+			submitOpenDlg(file);
+			writer.waitForExistence(10, 2);
+			writer.focus();
+			app.dispatch(".uno:ParagraphDialog");
+			alignPage.select();
+			alignPageRight.check();
+			sleep(2);
+			alignPageVerticalAlign.select("Bottom");
+			sleep(2);
+			alignPage.ok();
+			sleep(2);
+			writer.typeKeys("<ctrl end>");
+			sleep(5);
+			
+			closeWithoutSaveSW();
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+	
+	@Test
+	public void InsertPicToOpenedSW() throws Exception {
+		String file = prepareData("pvt/plain_200p.odt");
+		String pic = prepareData("image/blue_256x256.jpg");
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			app.dispatch(".uno:Open");
+			submitOpenDlg(file);
+			writer.waitForExistence(10, 2);
+			writer.focus();
+			writer.menuItem("Insert->Picture->From File...").select();
+			sleep(2);
+			filePickerPath.setText(pic);
+			sleep(1);
+			filePickerOpen.click();
+			sleep(5);
+			writer.typeKeys("<esc>");
+			sleep(2);			
+			closeWithoutSaveSW();
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+	
+	@Test
+	public void InsertOLEToOpenedSW() throws Exception {
+		String file = prepareData("pvt/plain_200p.odt");
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			app.dispatch(".uno:Open");
+			submitOpenDlg(file);
+			writer.waitForExistence(10, 2);
+			writer.focus();
+			app.dispatch(".uno:InsertObject");
+			sleep(2);
+			insertObject.ok();
+			sleep(10);
+			typeKeys("<esc>");
+			sleep(5);
+			typeKeys("<esc>");
+			sleep(5);		
+			closeWithoutSaveSW();
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+	
+	@Test
+	public void InsertChartToOpenedSW() throws Exception {
+		String file = prepareData("pvt/plain_200p.odt");
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			app.dispatch(".uno:Open");
+			submitOpenDlg(file);
+			writer.waitForExistence(10, 2);
+			writer.focus();
+			writer.menuItem("Insert->Object->Chart...").select();
+			sleep(5);
+			typeKeys("<esc>");
+			sleep(5);
+			typeKeys("<esc>");
+			sleep(5);
+			typeKeys("<esc>");
+			sleep(5);
+			closeWithoutSaveSW();
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+
+	@Test
+	public void openSWWithXForm()throws Exception{
+		String file = prepareData("svt/sickness_self-certification_meory issue.odt");
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			app.dispatch(".uno:Open");
+			submitOpenDlg(file);
+			writer.waitForExistence(10, 2);
+			app.dispatch(".uno:CloseDoc");
+			
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+	
+	@Test
+	public void openSWWithSecuritySignature()throws Exception{
+		String file = prepareData("svt/howtouse.odt");
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			app.dispatch(".uno:Open");
+			submitOpenDlg(file);
+			writer.waitForExistence(10, 2);
+			app.dispatch(".uno:CloseDoc");
+			
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+	
+	
+	private void createNewSW() {
+		app.dispatch("private:factory/swriter");
+	}
+	
+	private void saveAndReopenNewSW(int iterator) {
+		String saveTo = getPath("temp/" + "tempSW_New" + iterator + ".odt");
+		writer.menuItem("File->Save As...").select();
+		FileUtil.deleteFile(saveTo);
+		submitSaveDlg(saveTo);
+		if (activeMsgBox.exists()) {
+			activeMsgBox.yes();
+			sleep(2);
+		}
+		app.dispatch(".uno:CloseDoc");	
+		startCenterOpenButton.waitForExistence(30, 2);
+		startCenterOpenButton.click();
+		submitOpenDlg(saveTo);
+		sleep(1);		
+		app.dispatch(".uno:CloseDoc");
+	}
+
+	private void closeWithoutSaveSW() {
+		writer.menuItem("File->Close").select();
+		if (activeMsgBox.exists()) {
+			activeMsgBox.no();
+			sleep(2);
+		}
+	}
+
+	private HashMap<String, Object> getPerfData() {
+		HashMap<String, Object> proccessInfo = SystemUtil
+				.findProcess(".*(soffice\\.bin|soffice\\.exe|soffice).*");
+		String pid = (String) proccessInfo.get("pid");
+		return SystemUtil.getProcessPerfData(pid);
+	}
+
+	private void addRecord(int i, long start, long end) {
+		HashMap<String, Object> perf = getPerfData();
+		xmlResult.addRow("BasicFuncOnWriter",testname.getMethodName(), i, (end - start),
+				perf.get("rss"), perf.get("pcpu"));
+	}
+	
+}

Added: incubator/ooo/trunk/test/testgui/source/svt/gui/sw/FileTypeAboutWriter.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testgui/source/svt/gui/sw/FileTypeAboutWriter.java?rev=1396930&view=auto
==============================================================================
--- incubator/ooo/trunk/test/testgui/source/svt/gui/sw/FileTypeAboutWriter.java (added)
+++ incubator/ooo/trunk/test/testgui/source/svt/gui/sw/FileTypeAboutWriter.java Thu Oct 11 07:03:08 2012
@@ -0,0 +1,199 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+/**
+ * 
+ */
+package svt.gui.sw;
+
+import static org.openoffice.test.common.Testspace.getFile;
+import static org.openoffice.test.common.Testspace.getPath;
+import static org.openoffice.test.common.Testspace.prepareData;
+import static org.openoffice.test.vcl.Tester.*;
+import static testlib.gui.AppTool.*;
+import static testlib.gui.UIMap.*;
+
+import java.io.FileOutputStream;
+import java.io.PrintStream;
+import java.util.HashMap;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TestName;
+import org.openoffice.test.common.DataSheet;
+import org.openoffice.test.common.FileUtil;
+import org.openoffice.test.common.Logger;
+import org.openoffice.test.common.SystemUtil;
+import org.openoffice.test.common.Testspace;
+
+public class FileTypeAboutWriter {
+	@Rule
+	public Logger log = Logger.getLogger(this);
+
+	@Rule
+	public TestName testname = new TestName();
+
+	private static DataSheet xmlResult;
+
+	private String pid = null;
+
+	private static int iterator = 100;
+
+	private int i = 0;
+
+
+	/**
+	 * @throws java.lang.Exception
+	 */
+	@BeforeClass
+	public static void beforeClass() throws Exception {
+
+		xmlResult = new DataSheet(getFile("output/svt_gui_type_sw.xml"));
+		xmlResult.addRow("FileTypeAboutWriter","Method", "Iterator", "Consumed Time(MS)",
+				"Memory(KB)", "CPU(%)");
+	}
+
+	@AfterClass
+	public static void afterClass() throws Exception {
+		app.stop();
+	}
+	
+	@Before
+	public void before()throws Exception{
+		app.start(true);
+	}
+
+	
+	@Test
+	public void saveNewSWWithShapeToHTML()throws Exception{
+		for ( i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			createNewSW();
+			if(!swDrawingToolbar.exists()){
+				app.dispatch(".uno:AvailableToolbars?Toolbar:string=drawbar");
+			}
+			sleep(2);
+			app.dispatch(".uno:Rect");
+			writer.focus();
+			writer.drag(200, 200, 300, 300);
+			sleep(2);
+
+			typeKeys("<esc>");
+			sleep(2);
+			saveToOther(i,".html");
+			//reopen
+			String saveTo = getPath("temp/" + "tempDOC" + i + ".html");
+			startCenterOpenButton.click();
+			submitOpenDlg(saveTo);
+			sleep(1);
+			app.dispatch(".uno:CloseDoc");	
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+	
+	@Test
+    public void saveNewSWWithLineToDoc()throws Exception{
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			createNewSW();
+			if(!swDrawingToolbar.exists()){
+				app.dispatch(".uno:AvailableToolbars?Toolbar:string=drawbar");
+			}
+			sleep(2);
+			swInsertLineButtonOnToolbar.click();
+			writer.focus();
+			for(int j=0;j<10;j++){
+			writer.drag(150+j, 150+j*10, 200+j, 200+j*10);
+			sleep(2);
+			}
+			typeKeys("<esc>");
+			sleep(2);
+			saveToOther(i,".doc");
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+	
+	@Test
+	public void saveNewSWWithPicToDoc() throws Exception {
+		String pic = prepareData("image/blue_256x256.jpg");
+		for (i = 1; i <= iterator; i++) {
+			long start = System.currentTimeMillis();
+			createNewSW();
+			writer.menuItem("Insert->Picture->From File...").select();
+			sleep(2);
+			filePickerPath.setText(pic);
+			sleep(1);
+			filePickerOpen.click();
+			sleep(3);
+			typeKeys("<esc>");
+			sleep(2);
+			saveToOther(i,".doc");
+			long end = System.currentTimeMillis();
+			addRecord(i, start, end);
+		}
+	}
+
+	private void createNewSW() {
+		app.dispatch("private:factory/swriter");
+	}
+
+	private void saveToOther(int iterator, String type){
+		String saveTo = getPath("temp/" + "tempDOC" + iterator + type);
+		writer.menuItem("File->Save As...").select();
+		FileUtil.deleteFile(saveTo);
+		submitSaveDlg(saveTo);
+		if (activeMsgBox.exists()) {
+			activeMsgBox.yes();
+			sleep(2);
+		}		
+		if (alienFormatDlg.exists(3))
+			alienFormatDlg.ok();
+		app.dispatch(".uno:CloseDoc");	
+		startCenterOpenButton.waitForExistence(30, 2);
+		startCenterOpenButton.click();
+		submitOpenDlg(saveTo);
+		sleep(2);		
+		app.dispatch(".uno:CloseDoc");
+	}
+	
+
+
+	private HashMap<String, Object> getPerfData() {
+		HashMap<String, Object> proccessInfo = SystemUtil
+				.findProcess(".*(soffice\\.bin|soffice\\.exe|soffice).*");
+		String pid = (String) proccessInfo.get("pid");
+		return SystemUtil.getProcessPerfData(pid);
+	}
+
+	private void addRecord(int i, long start, long end) {
+		HashMap<String, Object> perf = getPerfData();
+		xmlResult.addRow("FileTypeAboutWriter",testname.getMethodName(), i, (end - start),
+				perf.get("rss"), perf.get("pcpu"));
+	}
+	
+}

Modified: incubator/ooo/trunk/test/testgui/source/testlib/gui/UIMap.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testgui/source/testlib/gui/UIMap.java?rev=1396930&r1=1396929&r2=1396930&view=diff
==============================================================================
--- incubator/ooo/trunk/test/testgui/source/testlib/gui/UIMap.java (original)
+++ incubator/ooo/trunk/test/testgui/source/testlib/gui/UIMap.java Thu Oct 11 07:03:08 2012
@@ -538,6 +538,27 @@ public class UIMap {
 	public static final VclDialog runMacroDlg = dialog("CUI_HID_SELECTOR_DIALOG");
 	public static final VclTreeListBox runMacroDlgCategories = tree("CUI_HID_SELECTOR_CATEGORIES");
 	public static final VclTreeListBox runMacroDlgCommands = tree("CUI_HID_SELECTOR_COMMANDS");
+	public static final VclButton optionUseOOdialog = button("cui:CheckBox:OFA_TP_MISC:CB_FILEDLG");
 	
 	public static final VclButton standardBarSave = button(".uno:Save");
+
+	public static final VclControl swFormatParagragh = control("CUI_HID_FORMAT_PARAGRAPH_STD");
+
+	public static final VclButton sdAddAnimation = button("SD_HID_SD_CUSTOMANIMATIONPANE_PB_ADD_EFFECT");
+
+	public static final VclListBox sdEntranceAnimationTab = listbox("sd:ListBox:RID_TP_CUSTOMANIMATION_ENTRANCE:LB_EFFECTS");
+
+	public static final VclControl sdAnimationList = control("SD_HID_SD_CUSTOMANIMATIONPANE_CT_CUSTOM_ANIMATION_LIST");
+
+	public static final VclWindow sdCurrentMastersList = window("SD_HID_SD_CURRENT_MASTERS");
+
+	public static final VclButton swInsertLineButtonOnToolbar = button(".uno:Line");
+
+	public static final VclToolBox swDrawingToolbar = toolbox(".HelpId:drawbar");
+
+	public static final VclListBox scPrintAreaType = listbox("sc:ListBox:RID_SCDLG_AREAS:LB_PRINTAREA");
+
+	public static final VclEditBox scPrintArea = editbox("sc:Edit:RID_SCDLG_AREAS:ED_PRINTAREA");
+
+	public static final VclEditBox scFormatCode = editbox("cui:Edit:RID_SVXPAGE_NUMBERFORMAT:ED_FORMAT");
 }



Mime
View raw message