incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liu...@apache.org
Subject svn commit: r1377588 - in /incubator/ooo/trunk/main/test/testgui/source: testcase/gui/svt/sc/ testcase/gui/svt/sc/OperationOnNewSC.java testlib/gui/UIMap.java
Date Mon, 27 Aug 2012 07:25:45 GMT
Author: liuzhe
Date: Mon Aug 27 07:25:44 2012
New Revision: 1377588

URL: http://svn.apache.org/viewvc?rev=1377588&view=rev
Log:
#120700 - SC SVT case 1 on a new ods document
Patch by: Liu Yi Xuan <liuyixuan.527@gmail.com>
Review by: Liu Zhe <aliuzhe@gmail.com>

Added:
    incubator/ooo/trunk/main/test/testgui/source/testcase/gui/svt/sc/
    incubator/ooo/trunk/main/test/testgui/source/testcase/gui/svt/sc/OperationOnNewSC.java
Modified:
    incubator/ooo/trunk/main/test/testgui/source/testlib/gui/UIMap.java

Added: incubator/ooo/trunk/main/test/testgui/source/testcase/gui/svt/sc/OperationOnNewSC.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/test/testgui/source/testcase/gui/svt/sc/OperationOnNewSC.java?rev=1377588&view=auto
==============================================================================
--- incubator/ooo/trunk/main/test/testgui/source/testcase/gui/svt/sc/OperationOnNewSC.java
(added)
+++ incubator/ooo/trunk/main/test/testgui/source/testcase/gui/svt/sc/OperationOnNewSC.java
Mon Aug 27 07:25:44 2012
@@ -0,0 +1,196 @@
+/**************************************************************
+ * 
+ * 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 testcase.gui.svt.sc;
+
+import static org.openoffice.test.vcl.Tester.sleep;
+import static testlib.gui.AppUtil.typeKeys;
+import static testlib.gui.UIMap.SortOptionsPage;
+import static testlib.gui.UIMap.SortOptionsPage_RangeContainsColumnLabels;
+import static testlib.gui.UIMap.SortPage;
+import static testlib.gui.UIMap.SortPage_Ascending1;
+import static testlib.gui.UIMap.SortPage_By1;
+import static testlib.gui.UIMap.app;
+import static testlib.gui.UIMap.*;
+
+import java.io.FileOutputStream;
+import java.io.PrintStream;
+import java.util.HashMap;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.openoffice.test.OpenOffice;
+import org.openoffice.test.common.SystemUtil;
+import static org.openoffice.test.common.Testspace.prepareData;
+import org.openoffice.test.common.*;
+
+import testlib.gui.CalcUtil;
+import testlib.gui.Log;
+import static testlib.gui.AppUtil.submitSaveDlg;
+
+public class OperationOnNewSC {
+	@Rule
+	public Log LOG = new Log();
+	
+	private PrintStream result = null;
+	
+	private String pid = null;
+	
+	/**
+	 * @throws java.lang.Exception
+	 */
+	@Before
+	public void setUp() throws Exception {
+		OpenOffice.killAll();
+		app.start();
+		result = new PrintStream(new FileOutputStream(Testspace.getFile("output/svt_sc_new.csv")));
+		HashMap<String, Object> proccessInfo = SystemUtil.findProcess(".*(soffice\\.bin|soffice.*-env).*");
+		pid = (String)proccessInfo.get("pid");
+		result.println("Iterator,Time,Memory(KB),CPU(%)");
+		LOG.info("Result will be saved to " + Testspace.getPath("output/svt_sc_new.csv"));
+	}
+
+	@After
+	public void tearDown() throws Exception {
+		app.close();
+		result.close();
+	}
+	
+	@Test
+	public void operationOnNewSC() throws Exception {
+		String[][] inputStr = {{"3"},{"2"}, {"5"}, {"1"}, {"6"},{"4"}, {"10"}, {"8"}, {"9"}, {"7"}};
+		String[][] inputStr_InstantFilter = {{ "A" }, { "1" }, { "2" }, { "3" }, { "1" },
+				{ "2" }, { "3" }, { "1" }, { "2" }, { "3" } };
+		String pic = prepareData("svt/Sunset.jpg");
+
+		for(int i = 0; i < 1000; i++)
+		{
+			// Data Sort
+			app.dispatch("private:factory/scalc");
+			CalcUtil.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();
+			SortOptionsPage_RangeContainsColumnLabels.uncheck();
+			SortPage.select();
+			SortPage_By1.select(1);	// "Column A"
+			SortPage_Ascending1.check();
+			SortPage.ok();		
+			sleep(5);
+			
+			//Insert Sheet
+			app.dispatch(".uno:Insert");
+			SCAfterCurrentSheet.check();
+			SCNewSheetName.setText("Instant Filter");
+			SCInsertSheetDlg.ok();
+			sleep(5);
+			
+			//Standard Filter
+			CalcUtil.selectRange("A1");
+			typeKeys("A<down>1<down>2<down>3<down>1<down>2<down>3<down>1<down>2<down>3");
+			sleep(1);
+			CalcUtil.selectRange("A1");
+			app.dispatch(".uno:DataFilterStandardFilter");
+			sleep(2);
+			FilterValue1.setText("1");
+			StandardFilterDlg.ok();
+			sleep(5);
+			
+			//Data Validate
+			app.dispatch(".uno:Insert");
+			SCAfterCurrentSheet.check();
+			SCNewSheetName.setText("Data Validate");
+			SCInsertSheetDlg.ok();
+			sleep(5);
+			CalcUtil.selectRange("B2:E5");
+			sleep(2);
+			
+			app.dispatch(".uno:Validation");
+			SC_ValidityCriteriaTabpage.select();
+			SC_ValidityCriteriaAllowList.select("Whole Numbers");
+			SC_ValidityDecimalCompareOperator.select("greater than");
+			SC_ValiditySourceInput.setText("1");
+			SC_ValidityErrorAlertTabPage.select();
+			SC_ValidityShowErrorMessage.check();
+			SC_ValidityErrorMessageTitle.setText("Error");
+			SC_ValidityErrorMessage.setText("Must greater than 1");
+			SC_ValidityErrorAlertTabPage.ok();
+			
+			CalcUtil.selectRange("B2");
+			typeKeys("0<enter>");
+			ActiveMsgBox.ok();
+			sleep(1);
+			
+			CalcUtil.selectRange("E5");
+			typeKeys("1<enter>");
+			ActiveMsgBox.ok();
+			sleep(1);
+			
+			CalcUtil.selectRange("E2");
+			typeKeys("2<enter>");
+			sleep(5);
+			
+			//Input cells, insert pics and chart
+			app.dispatch(".uno:Insert");
+			SCBeforeCurrentSheet.check();
+			SCNewSheetName.setText("InsertObjects");
+			SCInsertSheetDlg.ok();
+			sleep(5);
+			calc.menuItem("Insert->Picture->From File...").select();
+			sleep(2);
+			FilePicker_Path.setText(pic);
+			sleep(1);
+			FilePicker_Open.click();
+			sleep(5);
+			typeKeys("<esc>");
+			sleep(5);
+			
+			//Save file and close
+			String saveTo = "tempSC_New" + i + ".ods";
+			calc.menuItem("File->Save As...").select();
+			FileUtil.deleteFile(saveTo);
+			submitSaveDlg(saveTo);
+			if(ActiveMsgBox.exists())
+			{
+				ActiveMsgBox.yes();
+				sleep(2);
+			}
+			calc.menuItem("File->Close").select();
+			
+			HashMap<String, Object> perfData = SystemUtil.getProcessPerfData(pid);
+			String record = i + "," + System.currentTimeMillis() + "," + perfData.get("rss") + ","
+ perfData.get("pcpu");
+			LOG.info("Record: " + record);
+			result.println(record);
+			result.flush();
+			
+			sleep(3);
+		}
+	}
+
+}

Modified: incubator/ooo/trunk/main/test/testgui/source/testlib/gui/UIMap.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/test/testgui/source/testlib/gui/UIMap.java?rev=1377588&r1=1377587&r2=1377588&view=diff
==============================================================================
--- incubator/ooo/trunk/main/test/testgui/source/testlib/gui/UIMap.java (original)
+++ incubator/ooo/trunk/main/test/testgui/source/testlib/gui/UIMap.java Mon Aug 27 07:25:44
2012
@@ -462,6 +462,10 @@ public class UIMap {
 	public static final VclButton SlideAutoAfter = button("SD_HID_SD_SLIDETRANSITIONPANE_RB_ADVANCE_AUTO");
 	public static final VclButton ApplyToAllSlides = button("SD_HID_SD_SLIDETRANSITIONPANE_PB_APPLY_TO_ALL");
 	
+    //Spreadsheet: Standard Filter Dialog
+	public static final VclComboBox FilterValue1 = combobox("sc:ComboBox:RID_SCDLG_FILTER:ED_VAL1");
+	public static final VclDialog StandardFilterDlg = dialog(".uno:DataFilterStandardFilter");
+	
 	
 	
 



Mime
View raw message