openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wan...@apache.org
Subject svn commit: r1409059 - in /incubator/ooo/trunk/test/testgui/source/fvt/gui/sc: cell/ celltext/ chart/ datapilot/ filter/ rowcolumn/ sheet/ sort/ subtotals/ validity/
Date Wed, 14 Nov 2012 02:13:12 GMT
Author: wanglf
Date: Wed Nov 14 02:13:10 2012
New Revision: 1409059

URL: http://svn.apache.org/viewvc?rev=1409059&view=rev
Log:
reconstruct GUI FVT case about Spreadsheet

Added:
    incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/cell/Cells.java
      - copied, changed from r1408174, incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/cell/InserCells.java
    incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/sheet/Sheets.java
      - copied, changed from r1408174, incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/sheet/InsertSheet.java
Removed:
    incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/cell/InserCells.java
    incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/celltext/
    incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/datapilot/
    incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/sheet/InsertSheet.java
Modified:
    incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/chart/ChartDialogSetting.java
    incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/filter/Fitler.java
    incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/rowcolumn/InsertRowAndColumn.java
    incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/sort/SortDialogSetting.java
    incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/subtotals/SubtotalsFunctions.java
    incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/validity/ValidityDateSupport1024Columns.java
    incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/validity/ValidityDialogDefaultValue.java
    incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/validity/ValidityDialogSetting.java
    incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/validity/ValiditySampleFile.java

Copied: incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/cell/Cells.java (from r1408174,
incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/cell/InserCells.java)
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/cell/Cells.java?p2=incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/cell/Cells.java&p1=incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/cell/InserCells.java&r1=1408174&r2=1409059&rev=1409059&view=diff
==============================================================================
--- incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/cell/InserCells.java (original)
+++ incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/cell/Cells.java Wed Nov 14 02:13:10
2012
@@ -27,34 +27,25 @@ import static testlib.gui.UIMap.*;
 
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Rule;
 import org.junit.Test;
-import org.openoffice.test.common.Logger;
 
+import testlib.gui.AppTool;
 import testlib.gui.SCTool;
 
-/**
- * Before running the testing class, you need specify the AOO location firstly
- * with system property openoffice.home.
- * 
- * 
- */
 
-public class InserCells {
 
-	@Rule
-	public Logger log = Logger.getLogger(this);
+public class Cells {
+
 
 	@Before
 	public void setUp() throws Exception {
 		app.start();
-		app.dispatch("private:factory/scalc");
-		calc.waitForExistence(10, 3);
+		AppTool.newSpreadsheet();
 	}
 
 	@After
 	public void tearDown() throws Exception {
-		app.close();
+		app.stop();
 	}
 
 	/**
@@ -69,50 +60,42 @@ public class InserCells {
 		// Input data to cell range A1:B2
 		SCTool.selectRange("A1");
 		typeKeys("1<right>2<down><left>3<right>4");
-
 		// Set expected result after executing shift cell down
-		String[][] expectedShiftCellDownResult = new String[][] { { "", "2" }, { "1", "4" }, {
"3", "" }, };
-
+		String[][] expectedShiftCellDownResult = new String[][] { { "", "2" },
+				{ "1", "4" }, { "3", "" }, };
 		// Select Cell A1
 		SCTool.selectRange("Sheet1.A1");
-
 		// Launch insert cells dialog via menu
 		calc.menuItem("Insert->Cells...").select();
-
 		// Select the first option "shift cells down" from dialog
 		typeKeys("<enter>");
-
 		// Verify results after shift one cell down
-		assertArrayEquals("Verify results after shift one cell down", expectedShiftCellDownResult,
SCTool.getCellTexts("A1:B3"));
-
+		assertArrayEquals("Verify results after shift one cell down",
+				expectedShiftCellDownResult, SCTool.getCellTexts("A1:B3"));
 		// Set expected result after executing shift cell right
-		String[][] expectedShiftCellRightResult = new String[][] { { "", "1", "2" }, { "3", "4",
"" }, };
-
+		String[][] expectedShiftCellRightResult = new String[][] {
+				{ "", "1", "2" }, { "3", "4", "" }, };
 		// Undo
 		calc.menuItem("Edit->Undo: Insert").select();
-
+		
 		// Select cell B2
 		SCTool.selectRange("Sheet1.A1");
-
 		// Launch insert cells dialog via menu
 		calc.menuItem("Insert->Cells...").select();
-
 		// Select the second option "shift cells right" from dialog
 		typeKeys("<down>");
 		typeKeys("<enter>");
-
 		// Verify results after shift one cell right
-		assertArrayEquals("Verify results after shift one cell right", expectedShiftCellRightResult,
SCTool.getCellTexts("A1:C2"));
-
+		assertArrayEquals("Verify results after shift one cell right",
+				expectedShiftCellRightResult, SCTool.getCellTexts("A1:C2"));
 		// Set expected result after executing insert entire row
-		String[][] expectedEntireRowResult = new String[][] { { "", "" }, { "1", "2" }, { "3",
"4" }, };
+		String[][] expectedEntireRowResult = new String[][] { { "", "" },
+				{ "1", "2" }, { "3", "4" }, };
 
 		// Undo
 		calc.menuItem("Edit->Undo: Insert").select();
-
 		// Select Cell B2
 		SCTool.selectRange("Sheet1.A1");
-
 		// Launch insert cells dialog via menu
 		calc.menuItem("Insert->Cells...").select();
 
@@ -121,13 +104,12 @@ public class InserCells {
 		typeKeys("<enter>");
 
 		// Verify results after insert entire row
-		assertArrayEquals("Verify results after insert entire row", expectedEntireRowResult, SCTool.getCellTexts("A1:B3"));
+		assertArrayEquals("Verify results after insert entire row",
+				expectedEntireRowResult, SCTool.getCellTexts("A1:B3"));
 
 		// Set expected result after executing insert entire column
 		String[][] expectedEntireColumnResult = new String[][] {
-
 		{ "", "1", "2" }, { "", "3", "4" }, };
-
 		// Undo
 		calc.menuItem("Edit->Undo: Insert").select();
 
@@ -142,7 +124,8 @@ public class InserCells {
 		typeKeys("<enter>");
 
 		// Verify the results after inserting entire column
-		assertArrayEquals("Verify the results after inserting entire column", expectedEntireColumnResult,
SCTool.getCellTexts("A1:C2"));
+		assertArrayEquals("Verify the results after inserting entire column",
+				expectedEntireColumnResult, SCTool.getCellTexts("A1:C2"));
 
 	}
 

Modified: incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/chart/ChartDialogSetting.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/chart/ChartDialogSetting.java?rev=1409059&r1=1409058&r2=1409059&view=diff
==============================================================================
--- incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/chart/ChartDialogSetting.java (original)
+++ incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/chart/ChartDialogSetting.java Wed Nov
14 02:13:10 2012
@@ -33,26 +33,23 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.openoffice.test.common.Logger;
 
+import testlib.gui.AppTool;
+
 /**
  * Test the setting about chart dialog in spreadsheet
  */
 public class ChartDialogSetting {
 
-	@Rule
-	public Logger log = Logger.getLogger(this);
-
 	@Before
 	public void setUp() throws Exception {
 		app.start(true);
-
-		// Create a new spreadsheet document
-		app.dispatch("private:factory/scalc");
-		calc.waitForExistence(10, 2);
+		AppTool.newSpreadsheet();
 		app.dispatch(".uno:InsertObjectChart");
 	}
 
 	@After
 	public void tearDown() throws Exception {
+		app.stop();
 
 	}
 
@@ -64,10 +61,10 @@ public class ChartDialogSetting {
 	@Test
 	public void testChartDialogCancelBack() {
 		wizardNextButton.click();
-		assertTrue(chartRangeChooseTabPage.isEnabled());
+		assertTrue("Range Choose Tab is disable",chartRangeChooseTabPage.isEnabled());
 		wizardBackButton.click();
-		assertTrue(chartTypeChooseTabPage.isEnabled());
+		assertTrue("Type Choose Tab is disable",chartTypeChooseTabPage.isEnabled());
 		chartWizard.cancel();
-		assertFalse(chartWizard.exists());
+		assertFalse("Chart wizard not exist", chartWizard.exists());
 	}
 }

Modified: incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/filter/Fitler.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/filter/Fitler.java?rev=1409059&r1=1409058&r2=1409059&view=diff
==============================================================================
--- incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/filter/Fitler.java (original)
+++ incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/filter/Fitler.java Wed Nov 14 02:13:10
2012
@@ -35,6 +35,7 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.openoffice.test.common.Logger;
 
+import testlib.gui.AppTool;
 import testlib.gui.SCTool;
 
 /**
@@ -42,19 +43,15 @@ import testlib.gui.SCTool;
  */
 public class Fitler {
 
-	@Rule
-	public Logger log = Logger.getLogger(this);
-
 	@Before
 	public void setUp() throws Exception {
 		app.start(true);
-
-		// Create a new spreadsheet document
-		app.dispatch("private:factory/scalc");
+		AppTool.newSpreadsheet();
 	}
 
 	@After
 	public void tearDown() throws Exception {
+		app.stop();
 
 	}
 
@@ -62,12 +59,12 @@ public class Fitler {
 	 * 
 	 * Verify 2+ won't be treated as 2
 	 */
-	@Ignore("Bug #120076")
+	@Ignore("Bug #120076 2+ and 2 will be filter out at the same time")
 	@Test
 	public void testAutoFilterWithPlusSign() {
 		String expect = "2+";
 		SCTool.selectRange("A1");
 		typeKeys(expect + "<enter>");
-		assertEquals(expect, SCTool.getCellText("A1"));
+		assertEquals("expect 2+ not display correctly",expect, SCTool.getCellText("A1"));
 	}
 }

Modified: incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/rowcolumn/InsertRowAndColumn.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/rowcolumn/InsertRowAndColumn.java?rev=1409059&r1=1409058&r2=1409059&view=diff
==============================================================================
--- incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/rowcolumn/InsertRowAndColumn.java (original)
+++ incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/rowcolumn/InsertRowAndColumn.java Wed
Nov 14 02:13:10 2012
@@ -30,23 +30,20 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.openoffice.test.common.Logger;
 
+import testlib.gui.AppTool;
 import testlib.gui.SCTool;
 
 public class InsertRowAndColumn {
 
-	@Rule
-	public Logger log = Logger.getLogger(this);
-
 	@Before
 	public void setUp() throws Exception {
 		app.start();
-		app.dispatch("private:factory/scalc");
-		calc.waitForExistence(10, 3);
+		AppTool.newSpreadsheet();
 	}
 
 	@After
 	public void tearDown() throws Exception {
-		app.close();
+		app.stop();
 	}
 
 	/**
@@ -80,7 +77,6 @@ public class InsertRowAndColumn {
 		String[][] expectedInsertColumnResult = new String[][] { { "", "", "" }, { "", "", "" },
{ "", "123", "456" }, };
 		// Select Cell A3
 		SCTool.selectRange("Sheet1.A3");
-
 		// Insert one entire Column via menu
 		calc.menuItem("Insert->Columns").select();
 

Copied: incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/sheet/Sheets.java (from r1408174,
incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/sheet/InsertSheet.java)
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/sheet/Sheets.java?p2=incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/sheet/Sheets.java&p1=incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/sheet/InsertSheet.java&r1=1408174&r2=1409059&rev=1409059&view=diff
==============================================================================
--- incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/sheet/InsertSheet.java (original)
+++ incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/sheet/Sheets.java Wed Nov 14 02:13:10
2012
@@ -29,6 +29,8 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.openoffice.test.common.Logger;
 
+import testlib.gui.AppTool;
+
 /**
  * Before running the testing class, you need specify the AOO location firstly
  * with system property openoffice.home.
@@ -36,21 +38,17 @@ import org.openoffice.test.common.Logger
  * 
  */
 
-public class InsertSheet {
-
-	@Rule
-	public Logger log = Logger.getLogger(this);
+public class Sheets {
 
 	@Before
 	public void setUp() throws Exception {
 		app.start(true);
-		app.dispatch("private:factory/scalc");
-		calc.waitForExistence(10, 3);
+		AppTool.newSpreadsheet();
 	}
 
 	@After
 	public void tearDown() throws Exception {
-
+		app.stop();
 	}
 
 	/**
@@ -69,12 +67,12 @@ public class InsertSheet {
 		// Verify new sheets have been inserted before Sheet1
 		app.dispatch(".uno:SelectTables");
 		// To support multi-language, just verify the number in the sheet name
-		assertTrue(scSheetsList.getItemsText()[0].contains("4"));
-		assertTrue(scSheetsList.getItemsText()[1].contains("5"));
-		assertTrue(scSheetsList.getItemsText()[2].contains("6"));
-		assertTrue(scSheetsList.getItemsText()[3].contains("1"));
-		assertTrue(scSheetsList.getItemsText()[4].contains("2"));
-		assertTrue(scSheetsList.getItemsText()[5].contains("3"));
+		assertTrue("The first sheet name not contain 4",scSheetsList.getItemsText()[0].contains("4"));
+		assertTrue("The second sheet name not contain 5",scSheetsList.getItemsText()[1].contains("5"));
+		assertTrue("The third sheet name not contain 6",scSheetsList.getItemsText()[2].contains("6"));
+		assertTrue("The fourth sheet name not contain 1",scSheetsList.getItemsText()[3].contains("1"));
+		assertTrue("The fifth sheet name not contain 2",scSheetsList.getItemsText()[4].contains("2"));
+		assertTrue("The sixth sheet name not contain 3",scSheetsList.getItemsText()[5].contains("3"));
 		scSelectSheetsDlg.ok();
 	}
 

Modified: incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/sort/SortDialogSetting.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/sort/SortDialogSetting.java?rev=1409059&r1=1409058&r2=1409059&view=diff
==============================================================================
--- incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/sort/SortDialogSetting.java (original)
+++ incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/sort/SortDialogSetting.java Wed Nov
14 02:13:10 2012
@@ -38,6 +38,7 @@ import org.junit.Test;
 import org.openoffice.test.common.FileUtil;
 import org.openoffice.test.common.Logger;
 
+import testlib.gui.AppTool;
 import testlib.gui.SCTool;
 
 /**
@@ -45,16 +46,10 @@ import testlib.gui.SCTool;
  */
 public class SortDialogSetting {
 
-	@Rule
-	public Logger log = Logger.getLogger(this);
-
 	@Before
 	public void setUp() throws Exception {
 		app.start(true);
-
-		// Create a new spreadsheet document
-		app.dispatch("private:factory/scalc");
-		calc.waitForExistence(10, 2);
+		AppTool.newSpreadsheet();
 	}
 
 	@After
@@ -76,9 +71,8 @@ public class SortDialogSetting {
 		SCTool.selectRange("A1");
 		typeKeys("1ColumnName<down>D<down>C<down>B<down>A<down>a<down>");
 		SCTool.selectRange("A6");
-		app.dispatch(".uno:ChangeCaseToLower"); // In case SC capitalize first
-												// letter automatically
-
+		app.dispatch(".uno:ChangeCaseToLower");
+		// In case SC capitalize first letter automatically
 		// "Data->Sort...", choose "Ascending", check "Case sensitive"
 		app.dispatch(".uno:DataSort");
 		sortOptionsPage.select();
@@ -86,30 +80,18 @@ public class SortDialogSetting {
 		sortOptionsPage.ok();
 
 		// Verify sorted result
-		assertArrayEquals("Sorted result", expectedSortedResult, SCTool.getCellTexts("A2:A6"));
+		assertArrayEquals("Wrong Sorted result", expectedSortedResult, SCTool.getCellTexts("A2:A6"));
 
 		// Uodo/redo
 		app.dispatch(".uno:Undo");
-		assertArrayEquals("Undo sorted result", data, SCTool.getCellTexts("A2:A6"));
+		assertArrayEquals("Wrong Undo sorted result", data, SCTool.getCellTexts("A2:A6"));
 		app.dispatch(".uno:Redo");
-		assertArrayEquals("Redo sorted result", expectedSortedResult, SCTool.getCellTexts("A2:A6"));
+		assertArrayEquals("Wrong Redo sorted result", expectedSortedResult, SCTool.getCellTexts("A2:A6"));
 
 		// Save and close document
 		String saveTo = getPath("temp/" + "RowsSortWithOptionsCaseSensitive.ods");
-		app.dispatch(".uno:SaveAs");
 		FileUtil.deleteFile(saveTo);
-		submitSaveDlg(saveTo);
-		if (activeMsgBox.exists()) {
-			activeMsgBox.yes();
-			sleep(2);
-		}
-		sleep(5);
-		app.dispatch(".uno:CloseDoc");
-		openStartcenter();
-
-		// Reopen and verify sorted result
-		app.dispatch(".uno:Open");
-		submitOpenDlg(saveTo);
+		saveAndReopen(saveTo);
 		calc.waitForExistence(10, 2);
 		assertArrayEquals("Saved sorted result", expectedSortedResult, SCTool.getCellTexts("A2:A6"));
 	}
@@ -119,18 +101,9 @@ public class SortDialogSetting {
 	 * 
 	 * @throws Exception
 	 */
-	@Ignore("Bug #119035")
+	@Ignore("Bug #119035 - Redo is not work when sort result to other postion")
 	public void testSortOptionsCopyResultTo() throws Exception {
 
-		// Input some data
-		// String[][] data = new String[][] {
-		// {"3", "D"},
-		// {"5", "FLK"},
-		// {"4", "E"},
-		// {"2", "BC"},
-		// {"6", "GE"},
-		// {"1", "AB"},
-		// };
 		String[][] expectedSortedResult = new String[][] { { "1", "AB" }, { "2", "BC" }, { "3",
"D" }, { "4", "E" }, { "5", "FLK" }, { "6", "GE" }, };
 		SCTool.selectRange("A1");
 		typeKeys("3<down>5<down>4<down>2<down>6<down>1");
@@ -179,15 +152,9 @@ public class SortDialogSetting {
 
 		// Save and close document
 		String saveTo = getPath("temp/" + "RowsSortWithOptionsCopyResultTo.ods");
-		app.dispatch(".uno:SaveAs");
 		FileUtil.deleteFile(saveTo);
-		submitSaveDlg(saveTo);
-		app.dispatch(".uno:CloseDoc");
-		openStartcenter();
-
-		// Reopen and verify sorted result
-		app.dispatch(".uno:Open");
-		submitOpenDlg(saveTo);
+		saveAndReopen(saveTo);
+		
 		calc.waitForExistence(10, 2);
 		assertArrayEquals("Saved sorted result", expectedSortedResult, SCTool.getCellTexts("$Sheet3.$A4:$B9"));
 		assertArrayEquals("Saved sorted result to cell range", expectedSortedResult, SCTool.getCellTexts("$Sheet2.$A1:$B6"));
@@ -228,21 +195,11 @@ public class SortDialogSetting {
 
 		// Save and close document
 		String saveTo = getPath("temp/" + "SortCriteriaSortFirstBy.ods");
-		app.dispatch(".uno:SaveAs");
 		FileUtil.deleteFile(saveTo);
-		submitSaveDlg(saveTo);
-		if (activeMsgBox.exists()) {
-			activeMsgBox.yes();
-			sleep(2);
-		}
-		sleep(5);
-		app.dispatch(".uno:CloseDoc");
-		openStartcenter();
-
-		// Reopen, "Data->Sort...", choose "Descending", sort first by Column A
-		app.dispatch(".uno:Open");
-		submitOpenDlg(saveTo);
+		saveAndReopen(saveTo);
+		
 		calc.waitForExistence(10, 2);
+		// "Data->Sort...", choose "Descending", sort first by Column A
 		app.dispatch(".uno:DataSort");
 		sortPageDescending1.check();
 		sortPageBy1.select(1); // "Column A"
@@ -287,21 +244,11 @@ public class SortDialogSetting {
 
 		// Save and close document
 		String saveTo = getPath("temp/" + "SortCriteriaSortSecondBy.ods");
-		app.dispatch(".uno:SaveAs");
 		FileUtil.deleteFile(saveTo);
-		submitSaveDlg(saveTo);
-		if (activeMsgBox.exists()) {
-			activeMsgBox.yes();
-			sleep(2);
-		}
-		sleep(5);
-		app.dispatch(".uno:CloseDoc");
-		openStartcenter();
-
-		// Reopen, "Data->Sort...", sort first by Column B "Ascending", sort
-		// second by Column A "Descending"
-		app.dispatch(".uno:Open");
-		submitOpenDlg(saveTo);
+		saveAndReopen(saveTo);
+		
+//		// "Data->Sort...", sort first by Column B "Ascending", sort
+//		// second by Column A "Descending"
 		calc.waitForExistence(10, 2);
 		app.dispatch(".uno:DataSort");
 		sortPageBy1.select(2); // "Column B"
@@ -356,21 +303,11 @@ public class SortDialogSetting {
 
 		// Save and close document
 		String saveTo = getPath("temp/" + "SortCriteriaSortThirdBy.ods");
-		app.dispatch(".uno:SaveAs");
 		FileUtil.deleteFile(saveTo);
-		submitSaveDlg(saveTo);
-		if (activeMsgBox.exists()) {
-			activeMsgBox.yes();
-			sleep(2);
-		}
-		sleep(5);
-		app.dispatch(".uno:CloseDoc");
-		openStartcenter();
-
+		saveAndReopen(saveTo);
+		
 		// Reopen, "Data->Sort...", sort first by Column B "Ascending", sort
 		// second by Column C "Descending"
-		app.dispatch(".uno:Open");
-		submitOpenDlg(saveTo);
 		calc.waitForExistence(10, 2);
 		app.dispatch(".uno:DataSort");
 		sortPageBy1.select(2); // "Column B"
@@ -404,20 +341,9 @@ public class SortDialogSetting {
 
 		// Save and close document
 		saveTo = getPath("temp/" + "SortCriteriaSortThirdBy1.ods");
-		app.dispatch(".uno:SaveAs");
 		FileUtil.deleteFile(saveTo);
-		submitSaveDlg(saveTo);
-		if (activeMsgBox.exists()) {
-			activeMsgBox.yes();
-			sleep(2);
-		}
-		sleep(5);
-		app.dispatch(".uno:CloseDoc");
-		openStartcenter();
+		saveAndReopen(saveTo);
 
-		// Reopen and verify data sort is not lost
-		app.dispatch(".uno:Open");
-		submitOpenDlg(saveTo);
 		calc.waitForExistence(10, 2);
 		assertArrayEquals("Saved sorted result", expectedResultSortThirdByA, SCTool.getCellTexts("A1:C9"));
 	}
@@ -527,20 +453,9 @@ public class SortDialogSetting {
 
 		// Save and close document
 		String saveTo = getPath("temp/" + "SortOptionsCustomSortOrderPredefineFromCopyList.ods");
-		app.dispatch(".uno:SaveAs");
 		FileUtil.deleteFile(saveTo);
-		submitSaveDlg(saveTo);
-		if (activeMsgBox.exists()) {
-			activeMsgBox.yes();
-			sleep(2);
-		}
-		sleep(5);
-		app.dispatch(".uno:CloseDoc");
-		openStartcenter();
+		saveAndReopen(saveTo);
 
-		// Reopen and verify sorted result
-		app.dispatch(".uno:Open");
-		submitOpenDlg(saveTo);
 		calc.waitForExistence(10, 2);
 		app.dispatch(".uno:SelectTables");
 		scSheetsList.select(0); // Sheet 1
@@ -584,8 +499,7 @@ public class SortDialogSetting {
 		app.dispatch(".uno:CloseDoc");
 		// Dependencies end
 
-		// Create a new spreadsheet document
-		app.dispatch("private:factory/scalc");
+		AppTool.newSpreadsheet();
 
 		// Input some data
 		String[][] data = new String[][] { { "Color" }, { "black" }, { "yellow" }, { "blue" },
{ "black" }, { "white" }, { "red" }, };
@@ -650,20 +564,9 @@ public class SortDialogSetting {
 
 		// Save and close document
 		String saveTo = getPath("temp/" + "SortOptionsCustomSortOrderPredefineFromNewList.ods");
-		app.dispatch(".uno:SaveAs");
 		FileUtil.deleteFile(saveTo);
-		submitSaveDlg(saveTo);
-		if (activeMsgBox.exists()) {
-			activeMsgBox.yes();
-			sleep(2);
-		}
-		sleep(5);
-		app.dispatch(".uno:CloseDoc");
-		openStartcenter();
-
-		// Reopen and verify sorted result
-		app.dispatch(".uno:Open");
-		submitOpenDlg(saveTo);
+		saveAndReopen(saveTo);
+		
 		calc.waitForExistence(10, 2);
 		app.dispatch(".uno:SelectTables");
 		scSheetsList.select(0); // Sheet 1
@@ -712,20 +615,9 @@ public class SortDialogSetting {
 
 		// Save and close document
 		String saveTo = getPath("temp/" + "SortOptionsDirectionSortColumns.ods");
-		app.dispatch(".uno:SaveAs");
 		FileUtil.deleteFile(saveTo);
-		submitSaveDlg(saveTo);
-		if (activeMsgBox.exists()) {
-			activeMsgBox.yes();
-			sleep(2);
-		}
-		sleep(5);
-		app.dispatch(".uno:CloseDoc");
-		openStartcenter();
+		saveAndReopen(saveTo);
 
-		// Reopen and verify sorted result
-		app.dispatch(".uno:Open");
-		submitOpenDlg(saveTo);
 		calc.waitForExistence(10, 2);
 		assertArrayEquals("Saved sorted result", expectedSortedResult, SCTool.getCellTexts("A1:G1"));
 	}
@@ -802,20 +694,9 @@ public class SortDialogSetting {
 
 		// Save and close document
 		String saveTo = getPath("temp/" + "SortOptionsIncludeFormats.ods");
-		app.dispatch(".uno:SaveAs");
 		FileUtil.deleteFile(saveTo);
-		submitSaveDlg(saveTo);
-		if (activeMsgBox.exists()) {
-			activeMsgBox.yes();
-			sleep(2);
-		}
-		sleep(5);
-		app.dispatch(".uno:CloseDoc");
-		openStartcenter();
+		saveAndReopen(saveTo);
 
-		// Reopen and verify sorted result
-		app.dispatch(".uno:Open");
-		submitOpenDlg(saveTo);
 		calc.waitForExistence(10, 2);
 		assertArrayEquals("Original data", dataWithCurrencyFormats, SCTool.getCellTexts("$Sheet1.$A1:$A7"));
 		assertArrayEquals("Saved sorted result exclude format", expectedSortedResultExcludeFormat,
SCTool.getCellTexts("$Sheet2.$A1:$A7"));
@@ -879,20 +760,9 @@ public class SortDialogSetting {
 
 		// Save and close document
 		String saveTo = getPath("temp/" + "SortOptionsMultipleSortDataOverlap.ods");
-		app.dispatch(".uno:SaveAs");
 		FileUtil.deleteFile(saveTo);
-		submitSaveDlg(saveTo);
-		if (activeMsgBox.exists()) {
-			activeMsgBox.yes();
-			sleep(2);
-		}
-		sleep(5);
-		app.dispatch(".uno:CloseDoc");
-		openStartcenter();
+		saveAndReopen(saveTo);
 
-		// Reopen and verify sorted result
-		app.dispatch(".uno:Open");
-		submitOpenDlg(saveTo);
 		calc.waitForExistence(10, 2);
 		assertArrayEquals("Saved sorted result", expectedSortedResultDataOverlap, SCTool.getCellTexts("A1:A8"));
 		assertArrayEquals("Original data2", data2, SCTool.getCellTexts("G10:G14"));
@@ -975,20 +845,9 @@ public class SortDialogSetting {
 
 		// Save and close document
 		String saveTo = getPath("temp/" + "SortOptionsMultipleSortParameterSaved.ods");
-		app.dispatch(".uno:SaveAs");
 		FileUtil.deleteFile(saveTo);
-		submitSaveDlg(saveTo);
-		if (activeMsgBox.exists()) {
-			activeMsgBox.yes();
-			sleep(2);
-		}
-		sleep(5);
-		app.dispatch(".uno:CloseDoc");
-		openStartcenter();
+		saveAndReopen(saveTo);
 
-		// Reopen and verify sorted result and sort parameters
-		app.dispatch(".uno:Open");
-		submitOpenDlg(saveTo);
 		calc.waitForExistence(10, 2);
 		assertArrayEquals("Saved sorted result1", expectedSortedResult1, SCTool.getCellTexts("A1:A5"));
 		assertArrayEquals("Saved sorted result2", expectedSortedResult2, SCTool.getCellTexts("G10:G15"));
@@ -1000,4 +859,5 @@ public class SortDialogSetting {
 		sortOptionsPage.ok();
 	}
 
+
 }

Modified: incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/subtotals/SubtotalsFunctions.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/subtotals/SubtotalsFunctions.java?rev=1409059&r1=1409058&r2=1409059&view=diff
==============================================================================
--- incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/subtotals/SubtotalsFunctions.java (original)
+++ incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/subtotals/SubtotalsFunctions.java Wed
Nov 14 02:13:10 2012
@@ -19,9 +19,7 @@
  * 
  *************************************************************/
 
-/**
- * 
- */
+
 package fvt.gui.sc.subtotals;
 
 import static org.junit.Assert.*;
@@ -38,28 +36,21 @@ import org.openoffice.test.common.Logger
 
 import testlib.gui.SCTool;
 
-/**
- * 
- *
- */
-public class SubtotalsFunctions {
 
-	@Rule
-	public Logger log = Logger.getLogger(this);
+public class SubtotalsFunctions {
 
 	@Before
 	public void setUp() throws Exception {
 		app.start(true);
 		String file = prepareData("sc/SubtotalsSampleFile.ods");
-		app.dispatch(".uno:Open");
-		submitOpenDlg(file);
-		calc.waitForExistence(10, 2);
+		open(file);
 		SCTool.selectRange("A1:E7");
 		app.dispatch(".uno:DataSubTotals");
 	}
 
 	@After
 	public void tearDown() throws Exception {
+		app.stop();
 
 	}
 
@@ -78,7 +69,7 @@ public class SubtotalsFunctions {
 		scSubTotalsGroup1Dialog.ok();
 		sleep(1);
 
-		assertArrayEquals("Subtotal table", new String[][] { { "Level", "Code", "No.", "Team",
"Name" }, { "BS", "20", "2", "A", "Chcomic" }, { "CS", "30", "5", "A", "Ally" },
+		assertArrayEquals("Wrong Average function in Subtotal ", new String[][] { { "Level", "Code",
"No.", "Team", "Name" }, { "BS", "20", "2", "A", "Chcomic" }, { "CS", "30", "5", "A", "Ally"
},
 				{ "MS", "10", "1", "A", "Joker" }, { "", "20", "", "A Average", "" }, { "BS", "20", "4",
"B", "Elle" }, { "MS", "10", "3", "B", "Kevin" },
 				{ "", "15", "", "B Average", "" }, { "BS", "20", "6", "C", "Sweet" }, { "", "20", "",
"C Average", "" }, { "", "18.33333333", "", "Grand Total", "" } },
 				SCTool.getCellTexts("A1:E11"));
@@ -97,7 +88,7 @@ public class SubtotalsFunctions {
 		scSubTotalsGroup1Dialog.ok();
 		sleep(1);
 
-		assertArrayEquals("Subtotal table", new String[][] { { "Level", "Code", "No.", "Team",
"Name" }, { "BS", "20", "4", "B", "Elle" }, { "BS", "20", "6", "C", "Sweet" },
+		assertArrayEquals("Wrong Count Numbers only function in Subtotal", new String[][] { { "Level",
"Code", "No.", "Team", "Name" }, { "BS", "20", "4", "B", "Elle" }, { "BS", "20", "6", "C",
"Sweet" },
 				{ "BS", "20", "2", "A", "Chcomic" }, { "BS Count", "", "3", "", "" }, { "CS", "30", "5",
"A", "Ally" }, { "CS Count", "", "1", "", "" },
 				{ "MS", "10", "1", "A", "Joker" }, { "MS", "10", "3", "B", "Kevin" }, { "MS Count", "",
"2", "", "" }, { "Grand Total", "", "6", "", "" } },
 				SCTool.getCellTexts("A1:E11"));
@@ -115,7 +106,7 @@ public class SubtotalsFunctions {
 		scSubTotalsGroup1Dialog.ok();
 		sleep(1);
 
-		assertArrayEquals("Subtotal table", new String[][] { { "Level", "Code", "No.", "Team",
"Name" }, { "BS", "20", "4", "B", "Elle" }, { "BS", "20", "6", "C", "Sweet" },
+		assertArrayEquals("Wrong Max Numbers function in Subtotal", new String[][] { { "Level",
"Code", "No.", "Team", "Name" }, { "BS", "20", "4", "B", "Elle" }, { "BS", "20", "6", "C",
"Sweet" },
 				{ "BS", "20", "2", "A", "Chcomic" }, { "BS Max", "", "6", "", "" }, { "CS", "30", "5",
"A", "Ally" }, { "CS Max", "", "5", "", "" },
 				{ "MS", "10", "1", "A", "Joker" }, { "MS", "10", "3", "B", "Kevin" }, { "MS Max", "",
"3", "", "" }, { "Grand Total", "", "6", "", "" } },
 				SCTool.getCellTexts("A1:E11"));
@@ -133,7 +124,7 @@ public class SubtotalsFunctions {
 		scSubTotalsGroup1Dialog.ok();
 		sleep(1);
 
-		assertArrayEquals("Subtotal table", new String[][] { { "Level", "Code", "No.", "Team",
"Name" }, { "BS", "20", "4", "B", "Elle" }, { "BS", "20", "6", "C", "Sweet" },
+		assertArrayEquals("Wrong Min Numbers function in Subtotal", new String[][] { { "Level",
"Code", "No.", "Team", "Name" }, { "BS", "20", "4", "B", "Elle" }, { "BS", "20", "6", "C",
"Sweet" },
 				{ "BS", "20", "2", "A", "Chcomic" }, { "BS Min", "", "2", "", "" }, { "CS", "30", "5",
"A", "Ally" }, { "CS Min", "", "5", "", "" },
 				{ "MS", "10", "1", "A", "Joker" }, { "MS", "10", "3", "B", "Kevin" }, { "MS Min", "",
"1", "", "" }, { "Grand Total", "", "1", "", "" } },
 				SCTool.getCellTexts("A1:E11"));
@@ -151,7 +142,7 @@ public class SubtotalsFunctions {
 		scSubTotalsGroup1Dialog.ok();
 		sleep(1);
 
-		assertArrayEquals("Subtotal table", new String[][] { { "Level", "Code", "No.", "Team",
"Name" }, { "BS", "20", "4", "B", "Elle" }, { "BS", "20", "6", "C", "Sweet" },
+		assertArrayEquals("Wrong Product function in Subtotal", new String[][] { { "Level", "Code",
"No.", "Team", "Name" }, { "BS", "20", "4", "B", "Elle" }, { "BS", "20", "6", "C", "Sweet"
},
 				{ "BS", "20", "2", "A", "Chcomic" }, { "BS Product", "", "48", "", "" }, { "CS", "30",
"5", "A", "Ally" }, { "CS Product", "", "5", "", "" },
 				{ "MS", "10", "1", "A", "Joker" }, { "MS", "10", "3", "B", "Kevin" }, { "MS Product",
"", "3", "", "" }, { "Grand Total", "", "720", "", "" } },
 				SCTool.getCellTexts("A1:E11"));
@@ -170,7 +161,7 @@ public class SubtotalsFunctions {
 		scSubTotalsGroup1Dialog.ok();
 		sleep(1);
 
-		assertArrayEquals("Subtotal table", new String[][] { { "Level", "Code", "No.", "Team",
"Name" }, { "BS", "20", "4", "B", "Elle" }, { "BS", "20", "6", "C", "Sweet" },
+		assertArrayEquals("Wrong StdevP function in Subtotal", new String[][] { { "Level", "Code",
"No.", "Team", "Name" }, { "BS", "20", "4", "B", "Elle" }, { "BS", "20", "6", "C", "Sweet"
},
 				{ "BS", "20", "2", "A", "Chcomic" }, { "BS StDev", "", "1.63299316", "", "" }, { "CS",
"30", "5", "A", "Ally" }, { "CS StDev", "", "0", "", "" },
 				{ "MS", "10", "1", "A", "Joker" }, { "MS", "10", "3", "B", "Kevin" }, { "MS StDev", "",
"1", "", "" }, { "Grand Total", "", "1.70782513", "", "" } },
 				SCTool.getCellTexts("A1:E11"));
@@ -188,7 +179,7 @@ public class SubtotalsFunctions {
 		scSubTotalsGroup1Dialog.ok();
 		sleep(1);
 
-		assertArrayEquals("Subtotal table", new String[][] { { "Level", "Code", "No.", "Team",
"Name" }, { "BS", "20", "4", "B", "Elle" }, { "BS", "20", "6", "C", "Sweet" },
+		assertArrayEquals("Wrong Sum Function in Subtotal", new String[][] { { "Level", "Code",
"No.", "Team", "Name" }, { "BS", "20", "4", "B", "Elle" }, { "BS", "20", "6", "C", "Sweet"
},
 				{ "BS", "20", "2", "A", "Chcomic" }, { "BS Sum", "", "12", "", "" }, { "CS", "30", "5",
"A", "Ally" }, { "CS Sum", "", "5", "", "" },
 				{ "MS", "10", "1", "A", "Joker" }, { "MS", "10", "3", "B", "Kevin" }, { "MS Sum", "",
"4", "", "" }, { "Grand Total", "", "21", "", "" } },
 				SCTool.getCellTexts("A1:E11"));
@@ -206,7 +197,7 @@ public class SubtotalsFunctions {
 		scSubTotalsGroup1Dialog.ok();
 		sleep(1);
 
-		assertArrayEquals("Subtotal table", new String[][] { { "Level", "Code", "No.", "Team",
"Name" }, { "BS", "20", "4", "B", "Elle" }, { "BS", "20", "6", "C", "Sweet" },
+		assertArrayEquals("Wrong Var Sample function in Subtotal", new String[][] { { "Level",
"Code", "No.", "Team", "Name" }, { "BS", "20", "4", "B", "Elle" }, { "BS", "20", "6", "C",
"Sweet" },
 				{ "BS", "20", "2", "A", "Chcomic" }, { "BS Var", "", "4", "", "" }, { "CS", "30", "5",
"A", "Ally" }, { "CS Var", "", "#DIV/0!", "", "" },
 				{ "MS", "10", "1", "A", "Joker" }, { "MS", "10", "3", "B", "Kevin" }, { "MS Var", "",
"2", "", "" }, { "Grand Total", "", "3.5", "", "" } },
 				SCTool.getCellTexts("A1:E11"));
@@ -226,7 +217,7 @@ public class SubtotalsFunctions {
 		scSubTotalsOptionsTabPage.ok();
 		sleep(1);
 
-		assertArrayEquals("Subtotal table", new String[][] { { "Level", "Code", "No.", "Team",
"Name" }, { "BS", "20", "4", "B", "Elle" }, { "", "20", "", "B Sum", "" },
+		assertArrayEquals("Wrong Not Sort option in Subtotal", new String[][] { { "Level", "Code",
"No.", "Team", "Name" }, { "BS", "20", "4", "B", "Elle" }, { "", "20", "", "B Sum", "" },
 				{ "BS", "20", "6", "C", "Sweet" }, { "", "20", "", "C Sum", "" }, { "BS", "20", "2",
"A", "Chcomic" }, { "CS", "30", "5", "A", "Ally" },
 				{ "MS", "10", "1", "A", "Joker" }, { "", "60", "", "A Sum", "" }, { "MS", "10", "3",
"B", "Kevin" }, { "", "10", "", "B Sum", "" },
 				{ "", "110", "", "Grand Total", "" } }, SCTool.getCellTexts("A1:E12"));
@@ -240,14 +231,14 @@ public class SubtotalsFunctions {
 		assertArrayEquals("Group List: ", new String[] { "- none -", "Level", "Code", "No.", "Team",
"Name" }, scSubTotalsGroupByListBox.getItemsText());
 
 		scSubTotalsOptionsTabPage.select();
-		assertFalse(scSubtotalsInsertPageBreakCheckBox.isChecked());
-		assertFalse(scSubtotalsCaseSensitiveCheckBox.isChecked());
-		assertTrue(scSubtotalsPreSortToGroupCheckBox.isChecked());
-		assertTrue(scSubtotalSortAscendingRadioButton.isChecked());
-		assertFalse(scSubtotalSortDescendingRadioButton.isChecked());
-		assertFalse(scSubtotalsIncludeFormatsCheckBox.isChecked());
-		assertFalse(scSubtotalsCustomSortOrderCheckBox.isChecked());
-		assertFalse(scSubtotalsCustomSortListBox.isEnabled());
+		assertFalse("Wrong default value of InsertPageBreak checkbox",scSubtotalsInsertPageBreakCheckBox.isChecked());
+		assertFalse("Wrong default value of CaseSensitive checkbox",scSubtotalsCaseSensitiveCheckBox.isChecked());
+		assertTrue("Worng default value of PreSortToGroup checkbox",scSubtotalsPreSortToGroupCheckBox.isChecked());
+		assertTrue("Wrong default value of SortAscending Radio button",scSubtotalSortAscendingRadioButton.isChecked());
+		assertFalse("Wrong default value of SortDescending Radio button",scSubtotalSortDescendingRadioButton.isChecked());
+		assertFalse("Wrong default value of InludeFormat checkbox",scSubtotalsIncludeFormatsCheckBox.isChecked());
+		assertFalse("Wrong default value of CustomSortOrder checkbox",scSubtotalsCustomSortOrderCheckBox.isChecked());
+		assertFalse("Wrong default value of CustomSort listbox",scSubtotalsCustomSortListBox.isEnabled());
 		scSubTotalsOptionsTabPage.ok();
 	}
 
@@ -276,7 +267,7 @@ public class SubtotalsFunctions {
 		scSubTotalsGroup1Dialog.ok();
 		sleep(1);
 
-		assertArrayEquals("Subtotal table", new String[][] { { "Level", "Code", "No.", "Team",
"Name" }, { "BS", "20", "2", "A", "Chcomic" }, { "", "20", "", "", "Chcomic Sum" },
+		assertArrayEquals("Not all group in Subtotal", new String[][] { { "Level", "Code", "No.",
"Team", "Name" }, { "BS", "20", "2", "A", "Chcomic" }, { "", "20", "", "", "Chcomic Sum" },
 				{ "", "20", "", "A Max", "" }, { "BS", "20", "4", "B", "Elle" }, { "", "20", "", "",
"Elle Sum" }, { "", "20", "", "B Max", "" },
 				{ "BS", "20", "6", "C", "Sweet" }, { "", "20", "", "", "Sweet Sum" }, { "", "20", "",
"C Max", "" }, { "BS Sum", "", "12", "", "" },
 				{ "CS", "30", "5", "A", "Ally" }, { "", "30", "", "", "Ally Sum" }, { "", "30", "", "A
Max", "" }, { "CS Sum", "", "5", "", "" },
@@ -297,7 +288,7 @@ public class SubtotalsFunctions {
 		scSubTotalsGroup1Dialog.ok();
 		sleep(1);
 
-		assertArrayEquals("Subtotal table before deleting row", new String[][] { { "Level", "Code",
"No.", "Team", "Name" }, { "BS", "20", "4", "B", "Elle" },
+		assertArrayEquals("Subtotal table not equal before deleting row", new String[][] { { "Level",
"Code", "No.", "Team", "Name" }, { "BS", "20", "4", "B", "Elle" },
 				{ "BS", "20", "6", "C", "Sweet" }, { "BS", "20", "2", "A", "Chcomic" }, { "BS Sum", "",
"12", "", "" }, { "CS", "30", "5", "A", "Ally" },
 				{ "CS Sum", "", "5", "", "" }, { "MS", "10", "1", "A", "Joker" }, { "MS", "10", "3",
"B", "Kevin" }, { "MS Sum", "", "4", "", "" },
 				{ "Grand Total", "", "21", "", "" } }, SCTool.getCellTexts("A1:E11"));
@@ -308,7 +299,7 @@ public class SubtotalsFunctions {
 		scDeleteCellsDialog.ok();
 		sleep(1);
 
-		assertArrayEquals("Subtotal table after deleting row", new String[][] { { "Level", "Code",
"No.", "Team", "Name" }, { "BS", "20", "4", "B", "Elle" },
+		assertArrayEquals("Subtotal table not equal after deleting row", new String[][] { { "Level",
"Code", "No.", "Team", "Name" }, { "BS", "20", "4", "B", "Elle" },
 				{ "BS", "20", "2", "A", "Chcomic" }, { "BS Sum", "", "6", "", "" }, { "CS", "30", "5",
"A", "Ally" }, { "CS Sum", "", "5", "", "" },
 				{ "MS", "10", "1", "A", "Joker" }, { "MS", "10", "3", "B", "Kevin" }, { "MS Sum", "",
"4", "", "" }, { "Grand Total", "", "15", "", "" }, { "", "", "", "", "" } },
 				SCTool.getCellTexts("A1:E11"));
@@ -332,19 +323,19 @@ public class SubtotalsFunctions {
 		SCTool.selectRange("B4");
 		typeKeys("40" + "<enter>");
 		sleep(1);
-		assertEquals("30", SCTool.getCellText("B5"));
-		assertEquals("23.33333333", SCTool.getCellText("B11"));
+		assertEquals("B5's cell text is not 30","30", SCTool.getCellText("B5"));
+		assertEquals("B11's cell text is not 23.33333333","23.33333333", SCTool.getCellText("B11"));
 
 		SCTool.selectRange("B7");
 		typeKeys("50" + "<enter>");
 		sleep(1);
-		assertEquals("35", SCTool.getCellText("B8"));
-		assertEquals("30", SCTool.getCellText("B11"));
+		assertEquals("B8's cell text is not 35","35", SCTool.getCellText("B8"));
+		assertEquals("B11's cell text is not 30","30", SCTool.getCellText("B11"));
 
 		SCTool.selectRange("B9");
 		typeKeys("30" + "<enter>");
 		sleep(1);
-		assertEquals("30", SCTool.getCellText("B10"));
-		assertEquals("31.66666667", SCTool.getCellText("B11"));
+		assertEquals("B10's cell text is not 30","30", SCTool.getCellText("B10"));
+		assertEquals("B11's cell text is not 31.66666667","31.66666667", SCTool.getCellText("B11"));
 	}
 }

Modified: incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/validity/ValidityDateSupport1024Columns.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/validity/ValidityDateSupport1024Columns.java?rev=1409059&r1=1409058&r2=1409059&view=diff
==============================================================================
--- incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/validity/ValidityDateSupport1024Columns.java
(original)
+++ incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/validity/ValidityDateSupport1024Columns.java
Wed Nov 14 02:13:10 2012
@@ -31,21 +31,21 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.openoffice.test.common.Logger;
 
+import testlib.gui.AppTool;
 import testlib.gui.SCTool;
 
 public class ValidityDateSupport1024Columns {
 
-	@Rule
-	public Logger log = Logger.getLogger(this);
 
 	@Before
 	public void setUp() throws Exception {
 		app.start(true);
+		AppTool.newSpreadsheet();
 	}
 
 	@After
-	public void tearDown() throws Exception {
-
+	public void tearDown() throws Exception {	
+		app.stop();
 	}
 
 	/**
@@ -54,7 +54,6 @@ public class ValidityDateSupport1024Colu
 	 */
 	@Test
 	public void testValidityDateSupport1024Columns() {
-		app.dispatch("private:factory/scalc");
 		SCTool.selectRange("ALM1000:ALO1005");
 		app.dispatch(".uno:Validation");
 
@@ -71,25 +70,25 @@ public class ValidityDateSupport1024Colu
 		SCTool.selectRange("ALM1001");
 		scInputBarInput.activate();
 		typeKeys("02/01/08<enter>");
-		assertEquals("02/01/08", SCTool.getCellText("ALM1001"));
+		assertEquals("Cell text in ALM1001 is not 02/01/08","02/01/08", SCTool.getCellText("ALM1001"));
 
 		SCTool.selectRange("ALM1002");
 		scInputBarInput.activate();
 		typeKeys("01/02/08<enter>");
-		assertEquals("01/02/08", SCTool.getCellText("ALM1002"));
+		assertEquals("Cell text in ALM1002 is not 01/02/08","01/02/08", SCTool.getCellText("ALM1002"));
 
 		SCTool.selectRange("ALM1003");
 		scInputBarInput.activate();
 		typeKeys("01/01/08<enter>");
-		assertEquals("Invalid value", activeMsgBox.getMessage());
+		assertEquals("Have no alert message","Invalid value", activeMsgBox.getMessage());
 		activeMsgBox.ok();
-		assertEquals("", SCTool.getCellText("ALM1003"));
+		assertEquals("Validity have not filter invalid value","", SCTool.getCellText("ALM1003"));
 
 		SCTool.selectRange("AML1003");
 		scInputBarInput.activate();
 		typeKeys("12/31/07<enter>");
-		assertEquals("Invalid value", activeMsgBox.getMessage());
+		assertEquals("Have no alert message","Invalid value", activeMsgBox.getMessage());
 		activeMsgBox.ok();
-		assertEquals("", SCTool.getCellText("AML1003"));
+		assertEquals("Validity have not filter invalid value","", SCTool.getCellText("AML1003"));
 	}
 }

Modified: incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/validity/ValidityDialogDefaultValue.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/validity/ValidityDialogDefaultValue.java?rev=1409059&r1=1409058&r2=1409059&view=diff
==============================================================================
--- incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/validity/ValidityDialogDefaultValue.java
(original)
+++ incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/validity/ValidityDialogDefaultValue.java
Wed Nov 14 02:13:10 2012
@@ -30,23 +30,20 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.openoffice.test.common.Logger;
 
-public class ValidityDialogDefaultValue {
+import testlib.gui.AppTool;
 
-	@Rule
-	public Logger log = Logger.getLogger(this);
+public class ValidityDialogDefaultValue {
 
 	@Before
 	public void setUp() throws Exception {
 		app.start(true);
-
-		// New a spreadsheet, open Validity dialog
-		app.dispatch("private:factory/scalc");
+		AppTool.newSpreadsheet();
 		app.dispatch(".uno:Validation");
 	}
 
 	@After
 	public void tearDown() throws Exception {
-
+		app.stop();
 	}
 
 	/**
@@ -56,15 +53,14 @@ public class ValidityDialogDefaultValue 
 	public void testValidityUICellRange() {
 
 		scValidityCriteriaTabpage.select();
-		scValidityCriteriaAllowList.select(5); // "Cell range"
+		scValidityCriteriaAllowList.select(5); 
 
-		assertEquals(true, scValidityAllowBlankCells.isChecked());
-		assertEquals(true, scValidityShowSelectionList.isChecked());
-		assertEquals(false, scValiditySortEntriesAscending.isChecked());
-		assertEquals(true, scValidityAllowBlankCells.isEnabled());
-		assertEquals(true, scValiditySortEntriesAscending.isEnabled());
-		assertEquals(true, scValiditySortEntriesAscending.isEnabled());
-		assertEquals(true, scValiditySourcePicker.isEnabled());
+		assertEquals("Wrong default value of AllowBlankCells in Validity",true, scValidityAllowBlankCells.isChecked());
+		assertEquals("Wrong default value of ShowSelectionList in Validity",true, scValidityShowSelectionList.isChecked());
+		assertEquals("Wrong default value of Sort Entries Ascending in Validity",false, scValiditySortEntriesAscending.isChecked());
+		assertEquals("Wrong default value of AllowBlankCells in Validity",true, scValidityAllowBlankCells.isEnabled());
+		assertEquals("Wrong default value of Sort Entries Ascending in Validity",true, scValiditySortEntriesAscending.isEnabled());
+		assertEquals("Wrong default value of SourcePicker in Validity",true, scValiditySourcePicker.isEnabled());
 	}
 
 	/**
@@ -74,15 +70,15 @@ public class ValidityDialogDefaultValue 
 	public void testValidityUIErrorAlert() {
 
 		scValidityErrorAlertTabPage.select();
-		assertEquals(true, scValidityErrorAlertActionList.isEnabled());
-		// assertEquals("Stop",SC_ValidityErrorAlertActionList.getSelText()); //
+		assertEquals("Error Alert Action list is disable",true, scValidityErrorAlertActionList.isEnabled());
+		// assertEquals("Stop",SC_ValidityErrorAlertActionList.getSelText()); 
 		// Do not test this. Do it in GVT.
-		assertEquals(true, scValidityErrorMessageTitle.isEnabled());
-		assertEquals("", scValidityErrorMessageTitle.getText());
-		assertEquals(true, scValidityErrorMessage.isEnabled());
-		assertEquals("", scValidityErrorMessage.getText());
+		assertEquals("Error Message Title is disable",true, scValidityErrorMessageTitle.isEnabled());
+		assertEquals("Have default error message title","", scValidityErrorMessageTitle.getText());
+		assertEquals("Error message is disable",true, scValidityErrorMessage.isEnabled());
+		assertEquals("Have default error message","", scValidityErrorMessage.getText());
 		scValidityErrorAlertActionList.select(3); // "Macro"
-		assertEquals(true, scValidityErrorBrowseButton.isEnabled());
+		assertEquals("error browse button is disable",true, scValidityErrorBrowseButton.isEnabled());
 	}
 
 }

Modified: incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/validity/ValidityDialogSetting.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/validity/ValidityDialogSetting.java?rev=1409059&r1=1409058&r2=1409059&view=diff
==============================================================================
--- incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/validity/ValidityDialogSetting.java
(original)
+++ incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/validity/ValidityDialogSetting.java
Wed Nov 14 02:13:10 2012
@@ -32,20 +32,15 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.openoffice.test.common.Logger;
 
+import testlib.gui.AppTool;
 import testlib.gui.SCTool;
 
 public class ValidityDialogSetting {
-
-	@Rule
-	public Logger log = Logger.getLogger(this);
-
+	
 	@Before
 	public void setUp() throws Exception {
 		app.start(true);
-
-		// New a spreadsheet, select cell range, open Validity dialog
-		app.dispatch("private:factory/scalc");
-		calc.waitForExistence(10, 2);
+		AppTool.newSpreadsheet();
 		SCTool.selectRange("A1:C5");
 		app.dispatch(".uno:Validation");
 	}
@@ -238,8 +233,6 @@ public class ValidityDialogSetting {
 	@Test
 	public void testAllowLessThanTextLength() {
 
-//		app.dispatch(".uno:Validation");
-
 		scValidityCriteriaTabpage.select();
 		scValidityCriteriaAllowList.select(7); // "Text length"
 		scValidityDecimalCompareOperator.select(1); // "less than"

Modified: incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/validity/ValiditySampleFile.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/validity/ValiditySampleFile.java?rev=1409059&r1=1409058&r2=1409059&view=diff
==============================================================================
--- incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/validity/ValiditySampleFile.java (original)
+++ incubator/ooo/trunk/test/testgui/source/fvt/gui/sc/validity/ValiditySampleFile.java Wed
Nov 14 02:13:10 2012
@@ -36,9 +36,6 @@ import testlib.gui.SCTool;
 
 public class ValiditySampleFile {
 
-	@Rule
-	public Logger log = Logger.getLogger(this);
-
 	@Before
 	public void setUp() throws Exception {
 		app.start(true);
@@ -46,6 +43,7 @@ public class ValiditySampleFile {
 
 	@After
 	public void tearDown() throws Exception {
+		app.stop();
 
 	}
 
@@ -58,8 +56,7 @@ public class ValiditySampleFile {
 	public void testFFCIgnoreBlank() throws Exception {
 		// Open sample file
 		String file = prepareData("sc/FFC252FFCSC_XML_Datarange0235.xls");
-		app.dispatch(".uno:Open", 3);
-		submitOpenDlg(file);
+		open(file);
 		calc.waitForExistence(10, 2);
 
 		SCTool.selectRange("D5");
@@ -80,8 +77,7 @@ public class ValiditySampleFile {
 	public void testFFCNotIgnoreBlank() throws Exception {
 		// open sample file
 		String file = prepareData("sc/FFC252FFCSC_XML_Datarange0205.xls");
-		app.dispatch(".uno:Open", 3);
-		submitOpenDlg(file);
+		open(file);
 		calc.waitForExistence(10, 2);
 
 		SCTool.selectRange("F5");
@@ -99,8 +95,7 @@ public class ValiditySampleFile {
 	public void testNotLockCellFromValidityCell() {
 		// open sample file on data path
 		String file = prepareData("sc/sampledata.ods");
-		app.dispatch(".uno:Open", 3);
-		submitOpenDlg(file);
+		open(file);
 		calc.waitForExistence(10, 2);
 
 		SCTool.selectRange("F19");



Mime
View raw message