incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liu...@apache.org
Subject svn commit: r1377580 - in /incubator/ooo/trunk/main/test/testgui: data/svt/ data/svt/Sunset.jpg data/svt/sd_plain_50p.odp source/testcase/gui/svt/sd/ source/testcase/gui/svt/sd/OperationOnNewSD.java source/testlib/gui/UIMap.java
Date Mon, 27 Aug 2012 06:50:49 GMT
Author: liuzhe
Date: Mon Aug 27 06:50:48 2012
New Revision: 1377580

URL: http://svn.apache.org/viewvc?rev=1377580&view=rev
Log:
#120658 - SD SVT cases 1
Patch by: Liu Yi Xuan <liuyixuan.527@gmail.com>
Review by: Liu Zhe <aliuzhe@gmail.com>

Added:
    incubator/ooo/trunk/main/test/testgui/data/svt/
    incubator/ooo/trunk/main/test/testgui/data/svt/Sunset.jpg   (with props)
    incubator/ooo/trunk/main/test/testgui/data/svt/sd_plain_50p.odp   (with props)
    incubator/ooo/trunk/main/test/testgui/source/testcase/gui/svt/sd/
    incubator/ooo/trunk/main/test/testgui/source/testcase/gui/svt/sd/OperationOnNewSD.java
Modified:
    incubator/ooo/trunk/main/test/testgui/source/testlib/gui/UIMap.java

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

Propchange: incubator/ooo/trunk/main/test/testgui/data/svt/Sunset.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

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

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

Added: incubator/ooo/trunk/main/test/testgui/source/testcase/gui/svt/sd/OperationOnNewSD.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/test/testgui/source/testcase/gui/svt/sd/OperationOnNewSD.java?rev=1377580&view=auto
==============================================================================
--- incubator/ooo/trunk/main/test/testgui/source/testcase/gui/svt/sd/OperationOnNewSD.java
(added)
+++ incubator/ooo/trunk/main/test/testgui/source/testcase/gui/svt/sd/OperationOnNewSD.java
Mon Aug 27 06:50:48 2012
@@ -0,0 +1,172 @@
+/**************************************************************
+ * 
+ * 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.sd;
+
+import static testlib.gui.AppUtil.submitSaveDlg;
+import static testlib.gui.UIMap.PresentationWizard;
+import static testlib.gui.UIMap.app;
+import static testlib.gui.UIMap.startcenter;
+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.FileUtil;
+import org.openoffice.test.common.SystemUtil;
+import org.openoffice.test.common.Testspace;
+
+import static org.openoffice.test.common.Testspace.prepareData;
+import static org.openoffice.test.vcl.Tester.*;
+
+import testlib.gui.Log;
+
+public class OperationOnNewSD {
+	@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_sd_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_sd_new.csv"));
+	}
+
+	@After
+	public void tearDown() throws Exception {
+		app.close();
+		result.close();
+	}
+	
+	@Test
+	public void operationOnNewSW() throws Exception {
+		String externalFile = prepareData("svt/sd_plain_50p.odp");
+		String pic = prepareData("svt/Sunset.jpg");
+		for(int i = 0; i < 1000; i++)
+		{
+//			Create a new SD
+			app.dispatch("private:factory/simpress?slot=6686");
+			PresentationWizard.ok();
+			sleep(2);
+			
+//			Create a new slide
+			impress.menuItem("Insert->Slide").select();
+			sleep(2);
+			
+//			Insert a table
+			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);
+			
+//			Insert a picture
+			impress.menuItem("Insert->Slide").select();
+			sleep(2);
+			impress.menuItem("Insert->Picture->From File...").select();
+			sleep(2);
+			FilePicker_Path.setText(pic);
+			sleep(1);
+			FilePicker_Open.click();
+			sleep(5);
+			impress.typeKeys("<esc>");
+			sleep(2);
+			
+//			Insert Slides from External Sample files
+			impress.menuItem("Insert->File...").select();
+			sleep(2);
+			FilePicker_Path.setText(externalFile);
+			FilePicker_Open.click();
+			sleep(2);
+			InsertSlideObjects.ok();
+			sleep(2);
+			ActiveMsgBox.yes();
+			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);
+			
+//			Save file and close
+			String saveTo = "tempSD" + i + ".odp";
+			impress.menuItem("File->Save As...").select();
+			FileUtil.deleteFile(saveTo);
+			submitSaveDlg(saveTo);
+			if(ActiveMsgBox.exists())
+			{
+				ActiveMsgBox.yes();
+				sleep(2);
+			}
+			impress.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=1377580&r1=1377579&r2=1377580&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 06:50:48
2012
@@ -450,6 +450,17 @@ public class UIMap {
 	public static final VclEditBox ObjectFilePath = editbox("cui:Edit:MD_INSERT_OLEOBJECT:ED_FILEPATH");
 	public static final VclButton ObjectFileSearch = button("cui:PushButton:MD_INSERT_OLEOBJECT:BTN_FILEPATH");
 	public static final VclButton ObjectFileLink = button("cui:CheckBox:MD_INSERT_OLEOBJECT:CB_FILELINK");
+	public static final VclField NumberofCol = field("cui:NumericField:RID_SVX_NEWTABLE_DLG:NF_COLUMNS");
+	
+	//Presentation: Insert Table
+	public static final VclField NumberofRow = field("cui:NumericField:RID_SVX_NEWTABLE_DLG:NF_ROWS");
+	public static final VclDialog InsertSlideObjects = dialog("SD_HID_DLG_INSERT_PAGES_OBJS");
+	
+	//Presentation: Slide Transition Settings
+	public static final VclListBox ImpressSlideTransitions = listbox("SD_HID_SD_SLIDETRANSITIONPANE_LB_SLIDE_TRANSITIONS");
+	public static final VclListBox SlideShowSpeed = listbox("SD_HID_SD_SLIDETRANSITIONPANE_LB_SPEED");
+	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");
 	
 	
 	



Mime
View raw message