You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by li...@apache.org on 2012/08/30 11:27:23 UTC
svn commit: r1378870 [5/6] - in /incubator/ooo/trunk/main/test: ./ inc/ prj/
source/ testcommon/ testcommon/source/org/openoffice/test/common/
testgui/source/testcase/gui/ testgui/source/testcase/gui/bvt/
testgui/source/testcase/gui/formula/catalog/ te...
Modified: incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sc/validity/ValidityDialogSetting.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sc/validity/ValidityDialogSetting.java?rev=1378870&r1=1378869&r2=1378870&view=diff
==============================================================================
--- incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sc/validity/ValidityDialogSetting.java (original)
+++ incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sc/validity/ValidityDialogSetting.java Thu Aug 30 09:27:21 2012
@@ -19,36 +19,31 @@
*
*************************************************************/
-
-
package testcase.gui.sc.validity;
+import static org.junit.Assert.*;
import static testlib.gui.AppUtil.*;
import static testlib.gui.UIMap.*;
import java.io.File;
import org.junit.After;
-import static org.junit.Assert.*;
-import static org.openoffice.test.vcl.Tester.*;
-
import org.junit.Before;
-import org.junit.Rule;
import org.junit.Ignore;
+import org.junit.Rule;
import org.junit.Test;
+import org.openoffice.test.common.Logger;
import org.openoffice.test.vcl.IDList;
import org.openoffice.test.vcl.widgets.VclMessageBox;
import testlib.gui.CalcUtil;
-import testlib.gui.Log;
-
public class ValidityDialogSetting {
private static IDList idList = new IDList(new File("./ids"));
public static final VclMessageBox ActiveMsgBox = new VclMessageBox(idList.getId("UID_ACTIVE"), "Message on message box.");
@Rule
- public Log LOG = new Log();
+ public Logger log = Logger.getLogger(this);
@Before
public void setUp() throws Exception {
@@ -63,7 +58,7 @@ public class ValidityDialogSetting {
@After
public void tearDown() throws Exception {
-
+
}
/**
@@ -72,8 +67,8 @@ public class ValidityDialogSetting {
@Test
public void testAllowDateNotBetween() {
SC_ValidityCriteriaTabpage.select();
- SC_ValidityCriteriaAllowList.select(3); // "Date"
- SC_ValidityDecimalCompareOperator.select(7); // "not between"
+ SC_ValidityCriteriaAllowList.select(3); // "Date"
+ SC_ValidityDecimalCompareOperator.select(7); // "not between"
SC_ValiditySourceInput.setText("01/01/08");
SC_ValidityMaxValueInput.setText("03/01/08");
SC_ValidityErrorAlertTabPage.select();
@@ -86,61 +81,61 @@ public class ValidityDialogSetting {
SC_InputBar_Input.activate();
typeKeys("12/31/07");
typeKeys("<enter>");
- assertEquals("12/31/07",CalcUtil.getCellText("A1"));
+ assertEquals("12/31/07", CalcUtil.getCellText("A1"));
CalcUtil.selectRange("A2");
SC_InputBar_Input.activate();
typeKeys("03/02/08");
typeKeys("<enter>");
- assertEquals("03/02/08",CalcUtil.getCellText("A2"));
+ assertEquals("03/02/08", CalcUtil.getCellText("A2"));
CalcUtil.selectRange("A3");
SC_InputBar_Input.activate();
typeKeys("01/01/08");
typeKeys("<enter>");
- assertEquals("Invalid value",ActiveMsgBox.getMessage());
+ assertEquals("Invalid value", ActiveMsgBox.getMessage());
ActiveMsgBox.ok();
- assertEquals("",CalcUtil.getCellText("A3"));
+ assertEquals("", CalcUtil.getCellText("A3"));
CalcUtil.selectRange("A4");
SC_InputBar_Input.activate();
typeKeys("03/01/08");
typeKeys("<enter>");
- assertEquals("Invalid value",ActiveMsgBox.getMessage());
+ assertEquals("Invalid value", ActiveMsgBox.getMessage());
ActiveMsgBox.ok();
- assertEquals("",CalcUtil.getCellText("A4"));
+ assertEquals("", CalcUtil.getCellText("A4"));
CalcUtil.selectRange("A5");
SC_InputBar_Input.activate();
typeKeys("01/02/08");
typeKeys("<enter>");
- assertEquals("Invalid value",ActiveMsgBox.getMessage());
+ assertEquals("Invalid value", ActiveMsgBox.getMessage());
ActiveMsgBox.ok();
- assertEquals("",CalcUtil.getCellText("A5"));
+ assertEquals("", CalcUtil.getCellText("A5"));
CalcUtil.selectRange("B1");
SC_InputBar_Input.activate();
typeKeys("02/29/08");
typeKeys("<enter>");
- assertEquals("Invalid value",ActiveMsgBox.getMessage());
+ assertEquals("Invalid value", ActiveMsgBox.getMessage());
ActiveMsgBox.ok();
- assertEquals("",CalcUtil.getCellText("B1"));
+ assertEquals("", CalcUtil.getCellText("B1"));
CalcUtil.selectRange("B2");
SC_InputBar_Input.activate();
typeKeys("test");
typeKeys("<enter>");
- assertEquals("Invalid value",ActiveMsgBox.getMessage());
+ assertEquals("Invalid value", ActiveMsgBox.getMessage());
ActiveMsgBox.ok();
- assertEquals("",CalcUtil.getCellText("B2"));
+ assertEquals("", CalcUtil.getCellText("B2"));
CalcUtil.selectRange("B3");
SC_InputBar_Input.activate();
typeKeys("39448");
typeKeys("<enter>");
- assertEquals("Invalid value",ActiveMsgBox.getMessage());
+ assertEquals("Invalid value", ActiveMsgBox.getMessage());
ActiveMsgBox.ok();
- assertEquals("",CalcUtil.getCellText("B3"));
+ assertEquals("", CalcUtil.getCellText("B3"));
}
/**
@@ -150,8 +145,8 @@ public class ValidityDialogSetting {
public void testAllowDecimalEqual() {
SC_ValidityCriteriaTabpage.select();
- SC_ValidityCriteriaAllowList.select(2); // "Decimal"
- SC_ValidityDecimalCompareOperator.select(0); // "equal"
+ SC_ValidityCriteriaAllowList.select(2); // "Decimal"
+ SC_ValidityDecimalCompareOperator.select(0); // "equal"
SC_ValiditySourceInput.setText("0.33333333");
SC_ValidityErrorAlertTabPage.select();
SC_ValidityShowErrorMessage.check();
@@ -163,50 +158,50 @@ public class ValidityDialogSetting {
SC_InputBar_Input.activate();
typeKeys("0.33333333");
typeKeys("<enter>");
- assertEquals("0.33333333",CalcUtil.getCellText("A1"));
+ assertEquals("0.33333333", CalcUtil.getCellText("A1"));
CalcUtil.selectRange("A2");
SC_InputBar_Input.activate();
typeKeys("=1/3");
typeKeys("<enter>");
- assertEquals("Invalid value",ActiveMsgBox.getMessage());
+ assertEquals("Invalid value", ActiveMsgBox.getMessage());
ActiveMsgBox.ok();
- assertEquals("",CalcUtil.getCellText("A2"));
+ assertEquals("", CalcUtil.getCellText("A2"));
CalcUtil.selectRange("A3");
SC_InputBar_Input.activate();
typeKeys("0.3");
typeKeys("<enter>");
- assertEquals("Invalid value",ActiveMsgBox.getMessage());
+ assertEquals("Invalid value", ActiveMsgBox.getMessage());
ActiveMsgBox.ok();
- assertEquals("",CalcUtil.getCellText("A3"));
+ assertEquals("", CalcUtil.getCellText("A3"));
CalcUtil.selectRange("A4");
SC_InputBar_Input.activate();
typeKeys("0.333333333");
typeKeys("<enter>");
- assertEquals("Invalid value",ActiveMsgBox.getMessage());
+ assertEquals("Invalid value", ActiveMsgBox.getMessage());
ActiveMsgBox.ok();
- assertEquals("",CalcUtil.getCellText("A4"));
+ assertEquals("", CalcUtil.getCellText("A4"));
CalcUtil.selectRange("B2");
SC_InputBar_Input.activate();
typeKeys("test");
typeKeys("<enter>");
- assertEquals("Invalid value",ActiveMsgBox.getMessage());
+ assertEquals("Invalid value", ActiveMsgBox.getMessage());
ActiveMsgBox.ok();
- assertEquals("",CalcUtil.getCellText("B2"));
+ assertEquals("", CalcUtil.getCellText("B2"));
}
/**
- * test Allow Text length, greater than or equal to in Validity.
+ * test Allow Text length, greater than or equal to in Validity.
*/
@Test
public void testAllowGreaterTextLength() {
SC_ValidityCriteriaTabpage.select();
- SC_ValidityCriteriaAllowList.select(7); // "Text length"
- SC_ValidityDecimalCompareOperator.select(4); // "greater than or equal to"
+ SC_ValidityCriteriaAllowList.select(7); // "Text length"
+ SC_ValidityDecimalCompareOperator.select(4); // "greater than or equal to"
SC_ValiditySourceInput.setText("10");
SC_ValidityErrorAlertTabPage.select();
SC_ValidityShowErrorMessage.check();
@@ -218,33 +213,33 @@ public class ValidityDialogSetting {
SC_InputBar_Input.activate();
typeKeys("testtesttesttest");
typeKeys("<enter>");
- assertEquals("testtesttesttest",CalcUtil.getCellText("A1"));
+ assertEquals("testtesttesttest", CalcUtil.getCellText("A1"));
CalcUtil.selectRange("A2");
SC_InputBar_Input.activate();
typeKeys("test test ");
typeKeys("<enter>");
- assertEquals("test test ",CalcUtil.getCellText("A2"));
+ assertEquals("test test ", CalcUtil.getCellText("A2"));
CalcUtil.selectRange("A4");
SC_InputBar_Input.activate();
typeKeys(" ");
typeKeys("<enter>");
- assertEquals("Invalid value",ActiveMsgBox.getMessage());
+ assertEquals("Invalid value", ActiveMsgBox.getMessage());
ActiveMsgBox.ok();
- assertEquals("",CalcUtil.getCellText("A4"));
+ assertEquals("", CalcUtil.getCellText("A4"));
CalcUtil.selectRange("A3");
SC_InputBar_Input.activate();
typeKeys("Testatest");
typeKeys("<enter>");
- assertEquals("Invalid value",ActiveMsgBox.getMessage());
+ assertEquals("Invalid value", ActiveMsgBox.getMessage());
ActiveMsgBox.ok();
- assertEquals("",CalcUtil.getCellText("A3"));
+ assertEquals("", CalcUtil.getCellText("A3"));
}
/**
- * test Allow Text length, less than in Validity.
+ * test Allow Text length, less than in Validity.
*/
@Ignore("Bug 93128")
public void testAllowLessThanTextLength() {
@@ -252,8 +247,8 @@ public class ValidityDialogSetting {
app.dispatch(".uno:Validation");
SC_ValidityCriteriaTabpage.select();
- SC_ValidityCriteriaAllowList.select(7); // "Text length"
- SC_ValidityDecimalCompareOperator.select(1); // "less than"
+ SC_ValidityCriteriaAllowList.select(7); // "Text length"
+ SC_ValidityDecimalCompareOperator.select(1); // "less than"
SC_ValiditySourceInput.setText("10");
SC_ValidityInputHelpTabPage.select();
@@ -272,23 +267,23 @@ public class ValidityDialogSetting {
SC_InputBar_Input.activate();
typeKeys("testtesttesttest<enter>");
ActiveMsgBox.ok();
- assertEquals("testtesttesttest",CalcUtil.getCellText("A1"));
+ assertEquals("testtesttesttest", CalcUtil.getCellText("A1"));
CalcUtil.selectRange("A2");
SC_InputBar_Input.activate();
typeKeys("sfsafsddddddd<enter>");
ActiveMsgBox.cancel();
- assertEquals("",CalcUtil.getCellText("A2"));
+ assertEquals("", CalcUtil.getCellText("A2"));
CalcUtil.selectRange("A2");
SC_InputBar_Input.activate();
typeKeys("10<enter>");
- assertEquals("10",CalcUtil.getCellText("A2"));
+ assertEquals("10", CalcUtil.getCellText("A2"));
CalcUtil.selectRange("A3");
SC_InputBar_Input.activate();
typeKeys("ok<enter>");
- assertEquals("ok",CalcUtil.getCellText("A3"));
+ assertEquals("ok", CalcUtil.getCellText("A3"));
}
/**
@@ -298,7 +293,7 @@ public class ValidityDialogSetting {
public void testAllowListSpecialChar() {
SC_ValidityCriteriaTabpage.select();
- SC_ValidityCriteriaAllowList.select(6); // "List"
+ SC_ValidityCriteriaAllowList.select(6); // "List"
SC_ValidityEntries.focus();
typeKeys("a");
typeKeys("<enter>");
@@ -311,34 +306,34 @@ public class ValidityDialogSetting {
SC_ValidityCriteriaTabpage.ok();
// These codes are not stable: start
-// calc.rightClick(1, 1);
-// typeKeys("<shift s>");
-// typeKeys("<down><enter>"); // Choose a
-// sleep(2); // if no sleep, error occur
+ // calc.rightClick(1, 1);
+ // typeKeys("<shift s>");
+ // typeKeys("<down><enter>"); // Choose a
+ // sleep(2); // if no sleep, error occur
// These codes are not stable: end
CalcUtil.selectRange("A1");
SC_InputBar_Input.activate();
typeKeys("a<enter>");
- assertEquals("a",CalcUtil.getCellText("A1"));
+ assertEquals("a", CalcUtil.getCellText("A1"));
CalcUtil.selectRange("B2");
SC_InputBar_Input.activate();
typeKeys("test");
typeKeys("<enter>");
- assertEquals("Invalid value",ActiveMsgBox.getMessage());
+ assertEquals("Invalid value", ActiveMsgBox.getMessage());
ActiveMsgBox.ok();
- assertEquals("",CalcUtil.getCellText("B2"));
+ assertEquals("", CalcUtil.getCellText("B2"));
}
/**
- * test Allow time between in Validity.
+ * test Allow time between in Validity.
*/
@Test
public void testAllowTimeBetween() {
SC_ValidityCriteriaTabpage.select();
- SC_ValidityCriteriaAllowList.select(4); // "Time"
- SC_ValidityDecimalCompareOperator.select(6); // "between"
+ SC_ValidityCriteriaAllowList.select(4); // "Time"
+ SC_ValidityDecimalCompareOperator.select(6); // "between"
SC_ValiditySourceInput.setText("27:00");
SC_ValidityMaxValueInput.setText("21:00");
SC_ValidityErrorAlertTabPage.select();
@@ -351,95 +346,95 @@ public class ValidityDialogSetting {
SC_InputBar_Input.activate();
typeKeys("21:00");
typeKeys("<enter>");
- assertEquals("09:00:00 PM",CalcUtil.getCellText("A1"));
+ assertEquals("09:00:00 PM", CalcUtil.getCellText("A1"));
CalcUtil.selectRange("A2");
SC_InputBar_Input.activate();
typeKeys("27:00");
typeKeys("<enter>");
- assertEquals("27:00:00",CalcUtil.getCellText("A2"));
+ assertEquals("27:00:00", CalcUtil.getCellText("A2"));
CalcUtil.selectRange("A3");
SC_InputBar_Input.activate();
typeKeys("1.125");
typeKeys("<enter>");
- assertEquals("1.125",CalcUtil.getCellText("A3"));
+ assertEquals("1.125", CalcUtil.getCellText("A3"));
CalcUtil.selectRange("A4");
SC_InputBar_Input.activate();
typeKeys("0.875");
typeKeys("<enter>");
- assertEquals("0.875",CalcUtil.getCellText("A4"));
+ assertEquals("0.875", CalcUtil.getCellText("A4"));
CalcUtil.selectRange("B1");
SC_InputBar_Input.activate();
typeKeys("03:00:01");
typeKeys("<enter>");
- assertEquals("Invalid value",ActiveMsgBox.getMessage());
+ assertEquals("Invalid value", ActiveMsgBox.getMessage());
ActiveMsgBox.ok();
- assertEquals("",CalcUtil.getCellText("B1"));
+ assertEquals("", CalcUtil.getCellText("B1"));
CalcUtil.selectRange("B2");
SC_InputBar_Input.activate();
typeKeys("20:59:59");
typeKeys("<enter>");
- assertEquals("Invalid value",ActiveMsgBox.getMessage());
+ assertEquals("Invalid value", ActiveMsgBox.getMessage());
ActiveMsgBox.ok();
- assertEquals("",CalcUtil.getCellText("B2"));
+ assertEquals("", CalcUtil.getCellText("B2"));
CalcUtil.selectRange("B3");
SC_InputBar_Input.activate();
typeKeys("1.126");
typeKeys("<enter>");
- assertEquals("Invalid value",ActiveMsgBox.getMessage());
+ assertEquals("Invalid value", ActiveMsgBox.getMessage());
ActiveMsgBox.ok();
- assertEquals("",CalcUtil.getCellText("B3"));
+ assertEquals("", CalcUtil.getCellText("B3"));
CalcUtil.selectRange("B4");
SC_InputBar_Input.activate();
typeKeys("0.874");
typeKeys("<enter>");
- assertEquals("Invalid value",ActiveMsgBox.getMessage());
+ assertEquals("Invalid value", ActiveMsgBox.getMessage());
ActiveMsgBox.ok();
- assertEquals("",CalcUtil.getCellText("B4"));
+ assertEquals("", CalcUtil.getCellText("B4"));
CalcUtil.selectRange("C1");
SC_InputBar_Input.activate();
typeKeys("test");
typeKeys("<enter>");
- assertEquals("Invalid value",ActiveMsgBox.getMessage());
+ assertEquals("Invalid value", ActiveMsgBox.getMessage());
ActiveMsgBox.ok();
- assertEquals("",CalcUtil.getCellText("C1"));
+ assertEquals("", CalcUtil.getCellText("C1"));
CalcUtil.selectRange("C2");
SC_InputBar_Input.activate();
typeKeys("24:00");
typeKeys("<enter>");
- assertEquals("24:00:00",CalcUtil.getCellText("C2"));
+ assertEquals("24:00:00", CalcUtil.getCellText("C2"));
CalcUtil.selectRange("C3");
SC_InputBar_Input.activate();
typeKeys("12:00");
typeKeys("<enter>");
- assertEquals("Invalid value",ActiveMsgBox.getMessage());
+ assertEquals("Invalid value", ActiveMsgBox.getMessage());
ActiveMsgBox.ok();
- assertEquals("",CalcUtil.getCellText("C3"));
+ assertEquals("", CalcUtil.getCellText("C3"));
}
/**
- * test Allow time Greater than and equal to in Validity.
+ * test Allow time Greater than and equal to in Validity.
*/
@Test
public void testAllowTimeGreaterThan() {
SC_ValidityCriteriaTabpage.select();
- SC_ValidityCriteriaAllowList.select(4); // "Time"
- SC_ValidityDecimalCompareOperator.select(4); // "greater than or equal to"
+ SC_ValidityCriteriaAllowList.select(4); // "Time"
+ SC_ValidityDecimalCompareOperator.select(4); // "greater than or equal to"
SC_ValiditySourceInput.setText("8:00");
SC_ValidityErrorAlertTabPage.select();
SC_ValidityShowErrorMessage.check();
- SC_ValidityErrorAlertActionList.select(1); // "Warning"
+ SC_ValidityErrorAlertActionList.select(1); // "Warning"
SC_ValidityErrorMessageTitle.setText("warning to enter");
SC_ValidityErrorMessage.setText("Invalid value");
@@ -449,23 +444,23 @@ public class ValidityDialogSetting {
SC_InputBar_Input.activate();
typeKeys("7:30");
typeKeys("<enter>");
- assertEquals("Invalid value",ActiveMsgBox.getMessage());
+ assertEquals("Invalid value", ActiveMsgBox.getMessage());
ActiveMsgBox.ok();
- assertEquals("07:30:00 AM",CalcUtil.getCellText("A1"));
+ assertEquals("07:30:00 AM", CalcUtil.getCellText("A1"));
CalcUtil.selectRange("A2");
SC_InputBar_Input.activate();
typeKeys("6:00");
typeKeys("<enter>");
- assertEquals("Invalid value",ActiveMsgBox.getMessage());
+ assertEquals("Invalid value", ActiveMsgBox.getMessage());
ActiveMsgBox.cancel();
- assertEquals("",CalcUtil.getCellText("A2"));
+ assertEquals("", CalcUtil.getCellText("A2"));
CalcUtil.selectRange("A3");
SC_InputBar_Input.activate();
typeKeys("8:00");
typeKeys("<enter>");
- assertEquals("08:00:00 AM",CalcUtil.getCellText("A3"));
+ assertEquals("08:00:00 AM", CalcUtil.getCellText("A3"));
}
/**
@@ -475,8 +470,8 @@ public class ValidityDialogSetting {
public void testAllowWholeNumLessThan() {
SC_ValidityCriteriaTabpage.select();
- SC_ValidityCriteriaAllowList.select(1); // "Whole Numbers"
- SC_ValidityDecimalCompareOperator.select(3); // "less than or equal"
+ SC_ValidityCriteriaAllowList.select(1); // "Whole Numbers"
+ SC_ValidityDecimalCompareOperator.select(3); // "less than or equal"
SC_ValiditySourceInput.setText("100");
SC_ValidityErrorAlertTabPage.select();
SC_ValidityShowErrorMessage.check();
@@ -488,37 +483,37 @@ public class ValidityDialogSetting {
SC_InputBar_Input.activate();
typeKeys("99");
typeKeys("<enter>");
- assertEquals("99",CalcUtil.getCellText("A1"));
+ assertEquals("99", CalcUtil.getCellText("A1"));
CalcUtil.selectRange("A2");
SC_InputBar_Input.activate();
typeKeys("100");
typeKeys("<enter>");
- assertEquals("100",CalcUtil.getCellText("A2"));
+ assertEquals("100", CalcUtil.getCellText("A2"));
CalcUtil.selectRange("B1");
SC_InputBar_Input.activate();
typeKeys("101");
typeKeys("<enter>");
- assertEquals("Invalid value",ActiveMsgBox.getMessage());
+ assertEquals("Invalid value", ActiveMsgBox.getMessage());
ActiveMsgBox.ok();
- assertEquals("",CalcUtil.getCellText("B1"));
+ assertEquals("", CalcUtil.getCellText("B1"));
CalcUtil.selectRange("B2");
SC_InputBar_Input.activate();
typeKeys("45.5");
typeKeys("<enter>");
- assertEquals("Invalid value",ActiveMsgBox.getMessage());
+ assertEquals("Invalid value", ActiveMsgBox.getMessage());
ActiveMsgBox.ok();
- assertEquals("",CalcUtil.getCellText("B2"));
+ assertEquals("", CalcUtil.getCellText("B2"));
CalcUtil.selectRange("C1");
SC_InputBar_Input.activate();
typeKeys("test");
typeKeys("<enter>");
- assertEquals("Invalid value",ActiveMsgBox.getMessage());
+ assertEquals("Invalid value", ActiveMsgBox.getMessage());
ActiveMsgBox.ok();
- assertEquals("",CalcUtil.getCellText("C1"));
+ assertEquals("", CalcUtil.getCellText("C1"));
}
/**
@@ -528,23 +523,24 @@ public class ValidityDialogSetting {
public void testDefaultErrorAlertMessage() {
SC_ValidityCriteriaTabpage.select();
- SC_ValidityCriteriaAllowList.select(2); // "Decimal"
- SC_ValidityDecimalCompareOperator.select(0); // "equal"
+ SC_ValidityCriteriaAllowList.select(2); // "Decimal"
+ SC_ValidityDecimalCompareOperator.select(0); // "equal"
SC_ValiditySourceInput.setText("1");
SC_ValidityErrorAlertTabPage.select();
SC_ValidityShowErrorMessage.check();
- SC_ValidityErrorAlertActionList.select(0); // "Stop"
+ SC_ValidityErrorAlertActionList.select(0); // "Stop"
SC_ValidityErrorAlertTabPage.ok();
CalcUtil.selectRange("A1");
SC_InputBar_Input.activate();
typeKeys("13");
typeKeys("<enter>");
- assertEquals("OpenOffice.org Calc",ActiveMsgBox.getCaption());
-// assertEquals("Invalid value.",ActiveMsgBox.getMessage()); // Can not verify in multi-language
+ assertEquals("OpenOffice.org Calc", ActiveMsgBox.getCaption());
+ // assertEquals("Invalid value.",ActiveMsgBox.getMessage()); // Can not
+ // verify in multi-language
ActiveMsgBox.ok();
- assertEquals("",CalcUtil.getCellText("A1"));
+ assertEquals("", CalcUtil.getCellText("A1"));
}
/**
@@ -554,19 +550,19 @@ public class ValidityDialogSetting {
public void testUncheckErrorAlert() {
SC_ValidityCriteriaTabpage.select();
- SC_ValidityCriteriaAllowList.select(2); // "Decimal"
- SC_ValidityDecimalCompareOperator.select(0); // "equal"
+ SC_ValidityCriteriaAllowList.select(2); // "Decimal"
+ SC_ValidityDecimalCompareOperator.select(0); // "equal"
SC_ValiditySourceInput.setText("1");
SC_ValidityErrorAlertTabPage.select();
SC_ValidityShowErrorMessage.uncheck();
- SC_ValidityErrorAlertActionList.select(0); // "Stop"
+ SC_ValidityErrorAlertActionList.select(0); // "Stop"
SC_ValidityErrorAlertTabPage.ok();
CalcUtil.selectRange("A1");
typeKeys("13");
typeKeys("<enter>");
- assertEquals("13",CalcUtil.getCellText("A1"));
+ assertEquals("13", CalcUtil.getCellText("A1"));
}
/**
@@ -576,16 +572,16 @@ public class ValidityDialogSetting {
public void testValidityCellRangeSourcePicker() {
SC_ValidityCriteriaTabpage.select();
- SC_ValidityCriteriaAllowList.select(5); // "Cell range"
+ SC_ValidityCriteriaAllowList.select(5); // "Cell range"
SC_ValiditySourcePicker.click();
- assertEquals(false,SC_ValidityCriteriaAllowList.exists());
+ assertEquals(false, SC_ValidityCriteriaAllowList.exists());
SC_ValiditySourceInput.setText("$E$2:$G$5");
SC_ValiditySourcePicker.click();
- assertEquals(true,SC_ValidityCriteriaAllowList.exists());
+ assertEquals(true, SC_ValidityCriteriaAllowList.exists());
SC_ValidityErrorAlertTabPage.select();
SC_ValidityShowErrorMessage.check();
- SC_ValidityErrorAlertActionList.select(0); // "Stop"
+ SC_ValidityErrorAlertActionList.select(0); // "Stop"
SC_ValidityErrorMessageTitle.setText("Stop to enter");
SC_ValidityErrorMessage.setText("Invalid value.");
SC_ValidityErrorAlertTabPage.ok();
@@ -600,15 +596,15 @@ public class ValidityDialogSetting {
SC_InputBar_Input.activate();
typeKeys("test32");
typeKeys("<enter>");
- assertEquals("Invalid value.",ActiveMsgBox.getMessage());
+ assertEquals("Invalid value.", ActiveMsgBox.getMessage());
ActiveMsgBox.ok();
- assertEquals("",CalcUtil.getCellText("A1"));
+ assertEquals("", CalcUtil.getCellText("A1"));
CalcUtil.selectRange("B1");
SC_InputBar_Input.activate();
typeKeys("test");
typeKeys("<enter>");
- assertEquals("test",CalcUtil.getCellText("B1"));
+ assertEquals("test", CalcUtil.getCellText("B1"));
}
/**
@@ -617,7 +613,7 @@ public class ValidityDialogSetting {
@Test
public void testAllowBlankCells() {
SC_ValidityCriteriaTabpage.select();
- SC_ValidityCriteriaAllowList.select(5); // "Cell range"
+ SC_ValidityCriteriaAllowList.select(5); // "Cell range"
SC_ValiditySourceInput.setText("$E$1:$E$5");
SC_ValidityAllowBlankCells.check();
SC_ValidityCriteriaTabpage.ok();
@@ -630,7 +626,7 @@ public class ValidityDialogSetting {
CalcUtil.selectRange("D1");
SC_InputBar_Input.activate();
typeKeys("<backspace><enter>");
- assertEquals("",CalcUtil.getCellText("D1"));
+ assertEquals("", CalcUtil.getCellText("D1"));
CalcUtil.selectRange("B1");
app.dispatch(".uno:Validation");
@@ -644,4 +640,3 @@ public class ValidityDialogSetting {
typeKeys("<enter>");
}
}
-
Modified: incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sc/validity/ValiditySampleFile.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sc/validity/ValiditySampleFile.java?rev=1378870&r1=1378869&r2=1378870&view=diff
==============================================================================
--- incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sc/validity/ValiditySampleFile.java (original)
+++ incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sc/validity/ValiditySampleFile.java Thu Aug 30 09:27:21 2012
@@ -19,27 +19,25 @@
*
*************************************************************/
-
-
package testcase.gui.sc.validity;
-import static testlib.gui.AppUtil.*;
-import static testlib.gui.UIMap.*;
import static org.junit.Assert.*;
import static org.openoffice.test.common.Testspace.*;
-import static org.openoffice.test.vcl.Tester.*;
+import static testlib.gui.AppUtil.*;
+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.CalcUtil;
-import testlib.gui.Log;
public class ValiditySampleFile {
@Rule
- public Log LOG = new Log();
+ public Logger log = Logger.getLogger(this);
@Before
public void setUp() throws Exception {
@@ -48,7 +46,7 @@ public class ValiditySampleFile {
@After
public void tearDown() throws Exception {
-
+
}
/**
@@ -57,7 +55,7 @@ public class ValiditySampleFile {
* @throws Exception
*/
@Test
- public void testFFCIgnoreBlank() throws Exception{
+ public void testFFCIgnoreBlank() throws Exception {
// Open sample file
String file = prepareData("sc/FFC252FFCSC_XML_Datarange0235.xls");
app.dispatch(".uno:Open", 3);
@@ -66,11 +64,11 @@ public class ValiditySampleFile {
CalcUtil.selectRange("D5");
SC_InputBar_Input.activate();
- for(int i=1;i<=10;i++)
+ for (int i = 1; i <= 10; i++)
typeKeys("<backspace>");
typeKeys("<enter>");
- assertEquals("",CalcUtil.getCellText("D5"));
+ assertEquals("", CalcUtil.getCellText("D5"));
}
/**
@@ -79,8 +77,8 @@ public class ValiditySampleFile {
* @throws Exception
*/
@Test
- public void testFFCNotIgnoreBlank() throws Exception{
- //open sample file
+ public void testFFCNotIgnoreBlank() throws Exception {
+ // open sample file
String file = prepareData("sc/FFC252FFCSC_XML_Datarange0205.xls");
app.dispatch(".uno:Open", 3);
submitOpenDlg(file);
@@ -91,7 +89,7 @@ public class ValiditySampleFile {
typeKeys("<backspace><enter>");
ActiveMsgBox.ok();
- assertEquals("8",CalcUtil.getCellText("F5"));
+ assertEquals("8", CalcUtil.getCellText("F5"));
}
/**
@@ -99,7 +97,7 @@ public class ValiditySampleFile {
*/
@Test
public void testNotLockCellFromValidityCell() {
- //open sample file on data path
+ // open sample file on data path
String file = prepareData("sc/sampledata.ods");
app.dispatch(".uno:Open", 3);
submitOpenDlg(file);
@@ -110,6 +108,6 @@ public class ValiditySampleFile {
CalcUtil.selectRange("F17");
typeKeys("Test<enter>");
- assertEquals("Test",CalcUtil.getCellText("F17"));
+ assertEquals("Test", CalcUtil.getCellText("F17"));
}
}
Modified: incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sd/headerandfooter/HeaderAndFooterSetting.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sd/headerandfooter/HeaderAndFooterSetting.java?rev=1378870&r1=1378869&r2=1378870&view=diff
==============================================================================
--- incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sd/headerandfooter/HeaderAndFooterSetting.java (original)
+++ incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sd/headerandfooter/HeaderAndFooterSetting.java Thu Aug 30 09:27:21 2012
@@ -19,41 +19,41 @@
*
*************************************************************/
-
-
/**
*
*/
package testcase.gui.sd.headerandfooter;
+
+import static org.junit.Assert.*;
import static org.openoffice.test.common.Testspace.*;
+import static org.openoffice.test.vcl.Tester.*;
import static testlib.gui.AppUtil.*;
import static testlib.gui.UIMap.*;
-import static org.junit.Assert.*;
-import static org.openoffice.test.vcl.Tester.*;
+
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.openoffice.test.common.FileUtil;
+import org.openoffice.test.common.Logger;
import testlib.gui.ImpressUtil;
-import testlib.gui.Log;
-public class HeaderAndFooterSetting{
+public class HeaderAndFooterSetting {
@Rule
- public Log LOG = new Log();
+ public Logger log = Logger.getLogger(this);
@Before
public void setUp() throws Exception {
- app.start(true); // Bug 120476
+ app.start(true); // Bug 120476
// New a impress, insert some slides
app.dispatch("private:factory/simpress?slot=6686");
PresentationWizard.ok();
impress.waitForExistence(10, 2);
- for(int i=0; i<5;i++){
+ for (int i = 0; i < 5; i++) {
SD_InsertPageButtonOnToolbar.click();
}
// Pop up navigator panel
@@ -64,17 +64,18 @@ public class HeaderAndFooterSetting{
@After
public void tearDown() throws Exception {
-
+
}
/**
* Test Copy slide with Apply Footer to same file and different file
+ *
* @throws Exception
*/
@Test
- public void testCopySlideWithApplyFooter() throws Exception{
+ public void testCopySlideWithApplyFooter() throws Exception {
- //add header and footer
+ // add header and footer
app.dispatch(".uno:HeaderAndFooter");
SD_DateAndTimeFooterOnSlide.check();
@@ -93,7 +94,7 @@ public class HeaderAndFooterSetting{
SD_SlideNumAsFooterOnSlide.uncheck();
SD_ApplyButtonOnSlideFooter.click();
- //paste to the same file
+ // paste to the same file
ImpressSlideSorter.focus();
app.dispatch(".uno:Copy");
app.dispatch(".uno:Paste");
@@ -104,7 +105,7 @@ public class HeaderAndFooterSetting{
assertEquals(false, SD_SlideNumAsFooterOnSlide.isChecked());
SD_HeaderAndFooterDlgSlideTab.cancel();
- //paste to different file
+ // paste to different file
impress.focus();
app.dispatch("private:factory/simpress?slot=6686");
PresentationWizard.ok();
@@ -121,12 +122,13 @@ public class HeaderAndFooterSetting{
/**
* Test Copy slide with Apply to all Footer to same file and different file
+ *
* @throws Exception
*/
@Test
- public void testCopySlideWithApplyToAllFooter() throws Exception{
+ public void testCopySlideWithApplyToAllFooter() throws Exception {
- //add header and footer
+ // add header and footer
app.dispatch(".uno:HeaderAndFooter");
SD_DateAndTimeFooterOnSlide.check();
@@ -138,14 +140,14 @@ public class HeaderAndFooterSetting{
SD_ApplyToAllButtonOnSlideFooter.click();
ImpressSlideSorter.focus();
- for(int j=0; j<=2;j++){
+ for (int j = 0; j <= 2; j++) {
typeKeys("<up>");
}
app.dispatch(".uno:HeaderAndFooter");
SD_SlideNumAsFooterOnSlide.uncheck();
SD_ApplyButtonOnSlideFooter.click();
- //paste to the same file
+ // paste to the same file
ImpressSlideSorter.focus();
typeKeys("<up>");
app.dispatch(".uno:Copy");
@@ -153,12 +155,12 @@ public class HeaderAndFooterSetting{
app.dispatch(".uno:Paste");
app.dispatch(".uno:HeaderAndFooter");
- assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText());
- assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
- assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
+ assertEquals("Fix Date: 20120323", SD_FixedDateAndTimeOnSlideInput.getText());
+ assertEquals("Footer Test", SD_FooterTextOnSlideInput.getText());
+ assertEquals(true, SD_SlideNumAsFooterOnSlide.isChecked());
SD_HeaderAndFooterDlgSlideTab.cancel();
- //paste to different file
+ // paste to different file
app.dispatch("private:factory/simpress?slot=6686");
PresentationWizard.ok();
app.dispatch(".uno:Paste");
@@ -167,19 +169,20 @@ public class HeaderAndFooterSetting{
sleep(1); // If no sleep, error occur
app.dispatch(".uno:HeaderAndFooter");
- assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText());
- assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
- assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
+ assertEquals("Fix Date: 20120323", SD_FixedDateAndTimeOnSlideInput.getText());
+ assertEquals("Footer Test", SD_FooterTextOnSlideInput.getText());
+ assertEquals(true, SD_SlideNumAsFooterOnSlide.isChecked());
}
/**
* Test Copy slide with Notes Footer to same file and different file
+ *
* @throws Exception
*/
@Test
- public void testCopySlideWithNotesHeaderFooter() throws Exception{
+ public void testCopySlideWithNotesHeaderFooter() throws Exception {
- //add header and footer
+ // add header and footer
app.dispatch(".uno:HeaderAndFooter");
SD_HeaderAndFooterOnNotesTabPage.select();
SD_HeaderTextOnNotes.check();
@@ -192,7 +195,7 @@ public class HeaderAndFooterSetting{
SD_SlideNumAsFooterOnSlide.check();
SD_ApplyToAllButtonOnSlideFooter.click();
- //paste to the same file
+ // paste to the same file
ImpressSlideSorter.focus();
typeKeys("<up>");
app.dispatch(".uno:Copy");
@@ -201,13 +204,13 @@ public class HeaderAndFooterSetting{
app.dispatch(".uno:HeaderAndFooter");
SD_HeaderAndFooterOnNotesTabPage.select();
- assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText());
- assertEquals("Fix Date: 20120329",SD_FixedDateAndTimeOnSlideInput.getText());
- assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
- assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
+ assertEquals("Header Test", SD_HeaderTextOnNotesInput.getText());
+ assertEquals("Fix Date: 20120329", SD_FixedDateAndTimeOnSlideInput.getText());
+ assertEquals("Footer Test", SD_FooterTextOnSlideInput.getText());
+ assertEquals(true, SD_SlideNumAsFooterOnSlide.isChecked());
SD_HeaderAndFooterOnNotesTabPage.cancel();
- //paste to different file
+ // paste to different file
impress.focus();
app.dispatch("private:factory/simpress?slot=6686");
PresentationWizard.ok();
@@ -217,20 +220,21 @@ public class HeaderAndFooterSetting{
ImpressUtil.getCurView().activate();
app.dispatch(".uno:HeaderAndFooter");
SD_HeaderAndFooterOnNotesTabPage.select();
- assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText());
- assertEquals("Fix Date: 20120329",SD_FixedDateAndTimeOnSlideInput.getText());
- assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
- assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
+ assertEquals("Header Test", SD_HeaderTextOnNotesInput.getText());
+ assertEquals("Fix Date: 20120329", SD_FixedDateAndTimeOnSlideInput.getText());
+ assertEquals("Footer Test", SD_FooterTextOnSlideInput.getText());
+ assertEquals(true, SD_SlideNumAsFooterOnSlide.isChecked());
}
/**
- * Test duplicate slide with Apply to all Footer to same file
+ * Test duplicate slide with Apply to all Footer to same file
+ *
* @throws Exception
*/
@Test
- public void testDuplicateSlideWithApplyToAllFooter() throws Exception{
+ public void testDuplicateSlideWithApplyToAllFooter() throws Exception {
- //add header and footer
+ // add header and footer
app.dispatch(".uno:HeaderAndFooter");
SD_DateAndTimeFooterOnSlide.check();
@@ -241,26 +245,26 @@ public class HeaderAndFooterSetting{
SD_SlideNumAsFooterOnSlide.check();
SD_ApplyToAllButtonOnSlideFooter.click();
-
ImpressSlideSorter.focus();
- for(int j=0; j<=2;j++){
+ for (int j = 0; j <= 2; j++) {
typeKeys("<up>");
}
app.dispatch(".uno:DuplicatePage");
app.dispatch(".uno:HeaderAndFooter");
- assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText());
- assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
- assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
+ assertEquals("Fix Date: 20120323", SD_FixedDateAndTimeOnSlideInput.getText());
+ assertEquals("Footer Test", SD_FooterTextOnSlideInput.getText());
+ assertEquals(true, SD_SlideNumAsFooterOnSlide.isChecked());
}
/**
- * Test footer not show on the first slide.
+ * Test footer not show on the first slide.
+ *
* @throws Exception
*/
@Test
- public void testFooterNotShowOn1stSlide() throws Exception{
+ public void testFooterNotShowOn1stSlide() throws Exception {
- //add header and footer
+ // add header and footer
app.dispatch(".uno:HeaderAndFooter");
SD_FooterTextOnSlide.check();
SD_FooterTextOnSlideInput.setText("Footer Test");
@@ -269,26 +273,27 @@ public class HeaderAndFooterSetting{
// Check slide 1
ImpressSlideSorter.focus();
-// typeKeys("<up><up><up><up><up>"); // Not stable on ubuntu10.04
-// sleep(1); // If no sleep, error occur
- for (int i=0; i<5; i++) {
+ // typeKeys("<up><up><up><up><up>"); // Not stable on ubuntu10.04
+ // sleep(1); // If no sleep, error occur
+ for (int i = 0; i < 5; i++) {
typeKeys("<up>");
sleep(1);
}
app.dispatch(".uno:HeaderAndFooter");
- assertEquals(true,SD_FooterNotShowOn1stSlide.isChecked());
- assertEquals(false,SD_FooterTextOnSlide.isChecked());
+ assertEquals(true, SD_FooterNotShowOn1stSlide.isChecked());
+ assertEquals(false, SD_FooterTextOnSlide.isChecked());
}
/**
* Test Insert Footer to focus slide.
+ *
* @throws Exception
*/
@Test
- public void testInsertApplyFooterOnSlide() throws Exception{
+ public void testInsertApplyFooterOnSlide() throws Exception {
- //add header and footer to focus slide.
+ // add header and footer to focus slide.
app.dispatch(".uno:HeaderAndFooter");
SD_DateAndTimeFooterOnSlide.check();
@@ -300,47 +305,48 @@ public class HeaderAndFooterSetting{
SD_ApplyButtonOnSlideFooter.click();
app.dispatch(".uno:HeaderAndFooter");
- assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked());
- assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked());
- assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText());
- assertEquals(true,SD_FooterTextOnSlide.isChecked());
- assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
- assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
- //close header and footer dialog.
+ assertEquals(true, SD_DateAndTimeFooterOnSlide.isChecked());
+ assertEquals(true, SD_FixedDateAndTimeFooterOnSlide.isChecked());
+ assertEquals("Fix Date: 20120323", SD_FixedDateAndTimeOnSlideInput.getText());
+ assertEquals(true, SD_FooterTextOnSlide.isChecked());
+ assertEquals("Footer Test", SD_FooterTextOnSlideInput.getText());
+ assertEquals(true, SD_SlideNumAsFooterOnSlide.isChecked());
+ // close header and footer dialog.
SD_ApplyButtonOnSlideFooter.focus();
typeKeys("<tab>");
typeKeys("<enter>");
- //end close
+ // end close
ImpressSlideSorter.focus();
typeKeys("<up>");
- sleep(1); // If no sleep, error occur
+ sleep(1); // If no sleep, error occur
app.dispatch(".uno:HeaderAndFooter");
- assertEquals("",SD_FixedDateAndTimeOnSlideInput.getText());
- assertEquals("",SD_FooterTextOnSlideInput.getText());
- assertEquals(false,SD_SlideNumAsFooterOnSlide.isChecked());
- //close header and footer dialog.
+ assertEquals("", SD_FixedDateAndTimeOnSlideInput.getText());
+ assertEquals("", SD_FooterTextOnSlideInput.getText());
+ assertEquals(false, SD_SlideNumAsFooterOnSlide.isChecked());
+ // close header and footer dialog.
SD_ApplyButtonOnSlideFooter.focus();
typeKeys("<tab>");
typeKeys("<enter>");
- //end close
+ // end close
SD_InsertPageButtonOnToolbar.click();
app.dispatch(".uno:HeaderAndFooter");
- assertEquals("",SD_FixedDateAndTimeOnSlideInput.getText());
- assertEquals("",SD_FooterTextOnSlideInput.getText());
- assertEquals(false,SD_SlideNumAsFooterOnSlide.isChecked());
+ assertEquals("", SD_FixedDateAndTimeOnSlideInput.getText());
+ assertEquals("", SD_FooterTextOnSlideInput.getText());
+ assertEquals(false, SD_SlideNumAsFooterOnSlide.isChecked());
}
/**
* Test Insert Footer to Notes View
+ *
* @throws Exception
*/
@Test
- public void testInsertApplyToAllFooterOnNotes() throws Exception{
+ public void testInsertApplyToAllFooterOnNotes() throws Exception {
- //add header and footer to focus slide.
+ // add header and footer to focus slide.
app.dispatch(".uno:HeaderAndFooter");
SD_HeaderAndFooterOnNotesTabPage.select();
SD_HeaderTextOnNotes.check();
@@ -355,60 +361,61 @@ public class HeaderAndFooterSetting{
app.dispatch(".uno:HeaderAndFooter");
SD_HeaderAndFooterOnNotesTabPage.select();
- assertEquals(true,SD_HeaderTextOnNotes.isChecked());
- assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText());
- assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked());
- assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked());
- assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText());
- assertEquals(true,SD_FooterTextOnSlide.isChecked());
- assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
- assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
- //close header and footer dialog.
+ assertEquals(true, SD_HeaderTextOnNotes.isChecked());
+ assertEquals("Header Test", SD_HeaderTextOnNotesInput.getText());
+ assertEquals(true, SD_DateAndTimeFooterOnSlide.isChecked());
+ assertEquals(true, SD_FixedDateAndTimeFooterOnSlide.isChecked());
+ assertEquals("Fix Date: 20120323", SD_FixedDateAndTimeOnSlideInput.getText());
+ assertEquals(true, SD_FooterTextOnSlide.isChecked());
+ assertEquals("Footer Test", SD_FooterTextOnSlideInput.getText());
+ assertEquals(true, SD_SlideNumAsFooterOnSlide.isChecked());
+ // close header and footer dialog.
SD_ApplyToAllButtonOnSlideFooter.focus();
typeKeys("<tab>");
typeKeys("<enter>");
- //end close
+ // end close
ImpressSlideSorter.focus();
typeKeys("<up>");
app.dispatch(".uno:HeaderAndFooter");
SD_HeaderAndFooterOnNotesTabPage.select();
- assertEquals(true,SD_HeaderTextOnNotes.isChecked());
- assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText());
- assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked());
- assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked());
- assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText());
- assertEquals(true,SD_FooterTextOnSlide.isChecked());
- assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
- assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
- //close header and footer dialog.
+ assertEquals(true, SD_HeaderTextOnNotes.isChecked());
+ assertEquals("Header Test", SD_HeaderTextOnNotesInput.getText());
+ assertEquals(true, SD_DateAndTimeFooterOnSlide.isChecked());
+ assertEquals(true, SD_FixedDateAndTimeFooterOnSlide.isChecked());
+ assertEquals("Fix Date: 20120323", SD_FixedDateAndTimeOnSlideInput.getText());
+ assertEquals(true, SD_FooterTextOnSlide.isChecked());
+ assertEquals("Footer Test", SD_FooterTextOnSlideInput.getText());
+ assertEquals(true, SD_SlideNumAsFooterOnSlide.isChecked());
+ // close header and footer dialog.
SD_ApplyToAllButtonOnSlideFooter.focus();
typeKeys("<tab>");
typeKeys("<enter>");
- //end close
+ // end close
SD_InsertPageButtonOnToolbar.click();
app.dispatch(".uno:HeaderAndFooter");
SD_HeaderAndFooterOnNotesTabPage.select();
- assertEquals(true,SD_HeaderTextOnNotes.isChecked());
- assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText());
- assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked());
- assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked());
- assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText());
- assertEquals(true,SD_FooterTextOnSlide.isChecked());
- assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
- assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
+ assertEquals(true, SD_HeaderTextOnNotes.isChecked());
+ assertEquals("Header Test", SD_HeaderTextOnNotesInput.getText());
+ assertEquals(true, SD_DateAndTimeFooterOnSlide.isChecked());
+ assertEquals(true, SD_FixedDateAndTimeFooterOnSlide.isChecked());
+ assertEquals("Fix Date: 20120323", SD_FixedDateAndTimeOnSlideInput.getText());
+ assertEquals(true, SD_FooterTextOnSlide.isChecked());
+ assertEquals("Footer Test", SD_FooterTextOnSlideInput.getText());
+ assertEquals(true, SD_SlideNumAsFooterOnSlide.isChecked());
}
/**
* Test Insert Footer to Slide, use Apply to All
+ *
* @throws Exception
*/
@Test
- public void testInsertApplyToAllFooterOnSlide() throws Exception{
+ public void testInsertApplyToAllFooterOnSlide() throws Exception {
- //add header and footer to focus slide.
+ // add header and footer to focus slide.
app.dispatch(".uno:HeaderAndFooter");
SD_DateAndTimeFooterOnSlide.check();
@@ -420,95 +427,97 @@ public class HeaderAndFooterSetting{
SD_ApplyToAllButtonOnSlideFooter.click();
app.dispatch(".uno:HeaderAndFooter");
- assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked());
- assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked());
- assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText());
- assertEquals(true,SD_FooterTextOnSlide.isChecked());
- assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
- assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
- //close header and footer dialog.
+ assertEquals(true, SD_DateAndTimeFooterOnSlide.isChecked());
+ assertEquals(true, SD_FixedDateAndTimeFooterOnSlide.isChecked());
+ assertEquals("Fix Date: 20120323", SD_FixedDateAndTimeOnSlideInput.getText());
+ assertEquals(true, SD_FooterTextOnSlide.isChecked());
+ assertEquals("Footer Test", SD_FooterTextOnSlideInput.getText());
+ assertEquals(true, SD_SlideNumAsFooterOnSlide.isChecked());
+ // close header and footer dialog.
SD_ApplyButtonOnSlideFooter.focus();
typeKeys("<tab>");
typeKeys("<enter>");
- //end close
+ // end close
ImpressSlideSorter.focus();
typeKeys("<up>");
app.dispatch(".uno:HeaderAndFooter");
- assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked());
- assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked());
- assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText());
- assertEquals(true,SD_FooterTextOnSlide.isChecked());
- assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
- assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
- //close header and footer dialog.
+ assertEquals(true, SD_DateAndTimeFooterOnSlide.isChecked());
+ assertEquals(true, SD_FixedDateAndTimeFooterOnSlide.isChecked());
+ assertEquals("Fix Date: 20120323", SD_FixedDateAndTimeOnSlideInput.getText());
+ assertEquals(true, SD_FooterTextOnSlide.isChecked());
+ assertEquals("Footer Test", SD_FooterTextOnSlideInput.getText());
+ assertEquals(true, SD_SlideNumAsFooterOnSlide.isChecked());
+ // close header and footer dialog.
SD_ApplyButtonOnSlideFooter.focus();
typeKeys("<tab>");
typeKeys("<enter>");
- //end close
+ // end close
SD_InsertPageButtonOnToolbar.click();
app.dispatch(".uno:HeaderAndFooter");
- assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked());
- assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked());
- assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText());
- assertEquals(true,SD_FooterTextOnSlide.isChecked());
- assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
- assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
+ assertEquals(true, SD_DateAndTimeFooterOnSlide.isChecked());
+ assertEquals(true, SD_FixedDateAndTimeFooterOnSlide.isChecked());
+ assertEquals("Fix Date: 20120323", SD_FixedDateAndTimeOnSlideInput.getText());
+ assertEquals(true, SD_FooterTextOnSlide.isChecked());
+ assertEquals("Footer Test", SD_FooterTextOnSlideInput.getText());
+ assertEquals(true, SD_SlideNumAsFooterOnSlide.isChecked());
}
/**
* Test Insert update automatically time footer to slides.
+ *
* @throws Exception
*/
@Test
- public void testInsertAutoUpdateTimeFooter() throws Exception{
+ public void testInsertAutoUpdateTimeFooter() throws Exception {
- //add header and footer
+ // add header and footer
app.dispatch(".uno:HeaderAndFooter");
SD_AutoUpdateTimeFooter.check();
SD_AutoUpdateTimeFooterType.select(7);
- String currentTime=SD_AutoUpdateTimeFooterType.getItemText(7);
+ String currentTime = SD_AutoUpdateTimeFooterType.getItemText(7);
SD_ApplyToAllButtonOnSlideFooter.click();
sleep(1); // Wait some time to check the time update
app.dispatch(".uno:HeaderAndFooter");
- String updatedTime=SD_AutoUpdateTimeFooterType.getItemText(7);
+ String updatedTime = SD_AutoUpdateTimeFooterType.getItemText(7);
assertNotSame("Time can not update", currentTime, updatedTime);
}
/**
* Test Insert update automatically time footer to Notes view.
+ *
* @throws Exception
*/
@Test
- public void testInsertAutoUpdateTimeFooterOnNotes() throws Exception{
+ public void testInsertAutoUpdateTimeFooterOnNotes() throws Exception {
- //add header and footer
+ // add header and footer
app.dispatch(".uno:HeaderAndFooter");
SD_HeaderAndFooterOnNotesTabPage.select();
SD_AutoUpdateTimeFooter.check();
- String currentTime=SD_AutoUpdateTimeFooterType.getItemText(7);
+ String currentTime = SD_AutoUpdateTimeFooterType.getItemText(7);
SD_ApplyToAllButtonOnSlideFooter.click();
sleep(1); // Wait some time to check the time update
app.dispatch(".uno:HeaderAndFooter");
SD_HeaderAndFooterOnNotesTabPage.select();
- String updatedTime=SD_AutoUpdateTimeFooterType.getItemText(7);
+ String updatedTime = SD_AutoUpdateTimeFooterType.getItemText(7);
assertNotSame("Time can not update", currentTime, updatedTime);
}
/**
- * Test Insert Header and Footer to Notes view.
- * Save and ReOpen
+ * Test Insert Header and Footer to Notes view. Save and ReOpen
+ *
* @throws Exception
*/
@Test
- public void testInsertHeaderFooterOnNotes() throws Exception{
+ public void testInsertHeaderFooterOnNotes() throws Exception {
- //add header and footer
+ // add header and footer
app.dispatch(".uno:HeaderAndFooter");
SD_HeaderAndFooterOnNotesTabPage.select();
SD_HeaderTextOnNotes.check();
@@ -526,43 +535,43 @@ public class HeaderAndFooterSetting{
app.dispatch(".uno:HeaderAndFooter");
SD_HeaderAndFooterOnNotesTabPage.select();
- assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText());
- assertEquals("Fix Date: 20120329",SD_FixedDateAndTimeOnSlideInput.getText());
- assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
- assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
+ assertEquals("Header Test", SD_HeaderTextOnNotesInput.getText());
+ assertEquals("Fix Date: 20120329", SD_FixedDateAndTimeOnSlideInput.getText());
+ assertEquals("Footer Test", SD_FooterTextOnSlideInput.getText());
+ assertEquals(true, SD_SlideNumAsFooterOnSlide.isChecked());
SD_HeaderAndFooterOnNotesTabPage.cancel();
- //save this file
+ // save this file
app.dispatch(".uno:SaveAs");
String saveTo = getPath("temp/" + "hello.odp");
FileUtil.deleteFile(saveTo);
- submitSaveDlg(saveTo);
+ submitSaveDlg(saveTo);
app.dispatch(".uno:CloseDoc");
- //Reopen this file
+ // Reopen this file
openStartcenter();
app.dispatch(".uno:Open");
- String openFrom=getPath("temp/" + "hello.odp");
+ String openFrom = getPath("temp/" + "hello.odp");
submitOpenDlg(openFrom);
- //check after reopen
+ // check after reopen
app.dispatch(".uno:HeaderAndFooter");
SD_HeaderAndFooterOnNotesTabPage.select();
- assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText());
- assertEquals("Fix Date: 20120329",SD_FixedDateAndTimeOnSlideInput.getText());
- assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
- assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
+ assertEquals("Header Test", SD_HeaderTextOnNotesInput.getText());
+ assertEquals("Fix Date: 20120329", SD_FixedDateAndTimeOnSlideInput.getText());
+ assertEquals("Footer Test", SD_FooterTextOnSlideInput.getText());
+ assertEquals(true, SD_SlideNumAsFooterOnSlide.isChecked());
}
/**
- * Test Insert Header and Footer to Slide
- * Save and Reopen
+ * Test Insert Header and Footer to Slide Save and Reopen
+ *
* @throws Exception
*/
@Test
- public void testInsertHeaderFooterOnSlide() throws Exception{
+ public void testInsertHeaderFooterOnSlide() throws Exception {
- //add header and footer
+ // add header and footer
app.dispatch(".uno:HeaderAndFooter");
SD_DateAndTimeFooterOnSlide.check();
SD_FixedDateAndTimeFooterOnSlide.check();
@@ -576,32 +585,32 @@ public class HeaderAndFooterSetting{
typeKeys("<up>");
app.dispatch(".uno:HeaderAndFooter");
- assertEquals("Fix Date: 20120329",SD_FixedDateAndTimeOnSlideInput.getText());
- assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
- assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
+ assertEquals("Fix Date: 20120329", SD_FixedDateAndTimeOnSlideInput.getText());
+ assertEquals("Footer Test", SD_FooterTextOnSlideInput.getText());
+ assertEquals(true, SD_SlideNumAsFooterOnSlide.isChecked());
- //close header and footer dialog.
+ // close header and footer dialog.
SD_ApplyButtonOnSlideFooter.focus();
typeKeys("<tab>");
typeKeys("<enter>");
- //save this file
+ // save this file
app.dispatch(".uno:SaveAs");
String saveTo = getPath("temp/" + "hello.odp");
FileUtil.deleteFile(saveTo);
- submitSaveDlg(saveTo);
+ submitSaveDlg(saveTo);
app.dispatch(".uno:CloseDoc");
- //Reopen this file
+ // Reopen this file
openStartcenter();
app.dispatch(".uno:Open");
- String openFrom=getPath("temp/" + "hello.odp");
+ String openFrom = getPath("temp/" + "hello.odp");
submitOpenDlg(openFrom);
- //check after reopen
+ // check after reopen
app.dispatch(".uno:HeaderAndFooter");
- assertEquals("Fix Date: 20120329",SD_FixedDateAndTimeOnSlideInput.getText());
- assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
- assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
+ assertEquals("Fix Date: 20120329", SD_FixedDateAndTimeOnSlideInput.getText());
+ assertEquals("Footer Test", SD_FooterTextOnSlideInput.getText());
+ assertEquals(true, SD_SlideNumAsFooterOnSlide.isChecked());
}
}
Modified: incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sd/headerandfooter/OpenDocumentWithHeaderFooter.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sd/headerandfooter/OpenDocumentWithHeaderFooter.java?rev=1378870&r1=1378869&r2=1378870&view=diff
==============================================================================
--- incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sd/headerandfooter/OpenDocumentWithHeaderFooter.java (original)
+++ incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sd/headerandfooter/OpenDocumentWithHeaderFooter.java Thu Aug 30 09:27:21 2012
@@ -19,143 +19,142 @@
*
*************************************************************/
-
-
/**
*
*/
package testcase.gui.sd.headerandfooter;
+
+import static org.junit.Assert.*;
import static org.openoffice.test.common.Testspace.*;
import static testlib.gui.AppUtil.*;
import static testlib.gui.UIMap.*;
-import static org.junit.Assert.*;
-import static org.openoffice.test.vcl.Tester.*;
+
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.openoffice.test.common.FileUtil;
-
-import testlib.gui.Log;
+import org.openoffice.test.common.Logger;
public class OpenDocumentWithHeaderFooter {
@Rule
- public Log LOG = new Log();
+ public Logger log = Logger.getLogger(this);
@Before
public void setUp() throws Exception {
- app.start(true); // Bug 120476
+ app.start(true); // Bug 120476
}
@After
public void tearDown() throws Exception {
-
+
}
/**
- * Test open AOO3.4 presentation with header and footer.
- * edit and save to ODP
+ * Test open AOO3.4 presentation with header and footer. edit and save to
+ * ODP
+ *
* @throws Exception
*/
@Test
- public void testOpenAOO34WithHeaderFooter() throws Exception{
- //open sample file
+ public void testOpenAOO34WithHeaderFooter() throws Exception {
+ // open sample file
String file = prepareData("sd/AOO3.4HeaderFooter.odp");
app.dispatch(".uno:Open");
submitOpenDlg(file);
impress.waitForExistence(10, 2);
- //check after reopen
+ // check after reopen
app.dispatch(".uno:HeaderAndFooter");
- assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked());
- assertEquals("fixed date",SD_FixedDateAndTimeOnSlideInput.getText());
- assertEquals(true,SD_FooterTextOnSlide.isChecked());
- assertEquals("footer test",SD_FooterTextOnSlideInput.getText());
- assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
+ assertEquals(true, SD_DateAndTimeFooterOnSlide.isChecked());
+ assertEquals("fixed date", SD_FixedDateAndTimeOnSlideInput.getText());
+ assertEquals(true, SD_FooterTextOnSlide.isChecked());
+ assertEquals("footer test", SD_FooterTextOnSlideInput.getText());
+ assertEquals(true, SD_SlideNumAsFooterOnSlide.isChecked());
SD_SlideNumAsFooterOnSlide.uncheck();
SD_ApplyToAllButtonOnSlideFooter.click();
- //save to odp and reopen
+ // save to odp and reopen
app.dispatch(".uno:SaveAs");
String saveTo2 = getPath("temp/" + "AOO3.4HeaderFooter.odp");
FileUtil.deleteFile(saveTo2);
- submitSaveDlg(saveTo2);
+ submitSaveDlg(saveTo2);
app.dispatch(".uno:CloseDoc");
openStartcenter();
app.dispatch(".uno:Open");
- String openFrom2=getPath("temp/" + "AOO3.4HeaderFooter.odp");
+ String openFrom2 = getPath("temp/" + "AOO3.4HeaderFooter.odp");
submitOpenDlg(openFrom2);
app.dispatch(".uno:HeaderAndFooter");
- assertEquals(false,SD_SlideNumAsFooterOnSlide.isChecked());
- //end-save to odp and reopen
+ assertEquals(false, SD_SlideNumAsFooterOnSlide.isChecked());
+ // end-save to odp and reopen
}
/**
- * Test open ppt file with header and footer.
- * edit and save to PPT/ODP
+ * Test open ppt file with header and footer. edit and save to PPT/ODP
+ *
* @throws Exception
*/
@Test
- public void testOpenPPTWithHeaderFooter() throws Exception{
- //open sample file
+ public void testOpenPPTWithHeaderFooter() throws Exception {
+ // open sample file
String file = prepareData("sd/gfdd.ppt");
app.dispatch(".uno:Open");
submitOpenDlg(file);
impress.waitForExistence(10, 2);
- //check after reopen
+ // check after reopen
app.dispatch(".uno:HeaderAndFooter");
- assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked());
- assertEquals("testdte",SD_FixedDateAndTimeOnSlideInput.getText());
- assertEquals(true,SD_FooterTextOnSlide.isChecked());
- assertEquals("yesy",SD_FooterTextOnSlideInput.getText());
- assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
+ assertEquals(true, SD_DateAndTimeFooterOnSlide.isChecked());
+ assertEquals("testdte", SD_FixedDateAndTimeOnSlideInput.getText());
+ assertEquals(true, SD_FooterTextOnSlide.isChecked());
+ assertEquals("yesy", SD_FooterTextOnSlideInput.getText());
+ assertEquals(true, SD_SlideNumAsFooterOnSlide.isChecked());
SD_SlideNumAsFooterOnSlide.uncheck();
SD_ApplyToAllButtonOnSlideFooter.click();
- //save to ppt and reopen
+ // save to ppt and reopen
app.dispatch(".uno:SaveAs");
String saveTo = getPath("temp/" + "gfdd.ppt");
FileUtil.deleteFile(saveTo);
- submitSaveDlg(saveTo);
+ submitSaveDlg(saveTo);
if (AlienFormatDlg.exists(3))
AlienFormatDlg.ok();
app.dispatch(".uno:CloseDoc");
openStartcenter();
app.dispatch(".uno:Open");
- String openFrom=getPath("temp/" + "gfdd.ppt");
+ String openFrom = getPath("temp/" + "gfdd.ppt");
submitOpenDlg(openFrom);
app.dispatch(".uno:HeaderAndFooter");
- assertEquals(false,SD_SlideNumAsFooterOnSlide.isChecked());
- //end-save to ppt and reopen
+ assertEquals(false, SD_SlideNumAsFooterOnSlide.isChecked());
+ // end-save to ppt and reopen
- //close Header and Footer dialog.
+ // close Header and Footer dialog.
SD_ApplyButtonOnSlideFooter.focus();
typeKeys("<tab>");
typeKeys("<enter>");
- //end
+ // end
- //save to odp and reopen
+ // save to odp and reopen
app.dispatch(".uno:SaveAs");
String saveTo2 = getPath("temp/" + "gfdd.odp");
FileUtil.deleteFile(saveTo2);
- submitSaveDlg(saveTo2);
+ submitSaveDlg(saveTo2);
app.dispatch(".uno:CloseDoc");
openStartcenter();
app.dispatch(".uno:Open");
- String openFrom2=getPath("temp/" + "gfdd.odp");
+ String openFrom2 = getPath("temp/" + "gfdd.odp");
submitOpenDlg(openFrom2);
app.dispatch(".uno:HeaderAndFooter");
- assertEquals(false,SD_SlideNumAsFooterOnSlide.isChecked());
- //end-save to odp and reopen
+ assertEquals(false, SD_SlideNumAsFooterOnSlide.isChecked());
+ // end-save to odp and reopen
}
}
Modified: incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sd/table/ChangeTableBackgroundProperty.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sd/table/ChangeTableBackgroundProperty.java?rev=1378870&r1=1378869&r2=1378870&view=diff
==============================================================================
--- incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sd/table/ChangeTableBackgroundProperty.java (original)
+++ incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sd/table/ChangeTableBackgroundProperty.java Thu Aug 30 09:27:21 2012
@@ -21,17 +21,18 @@
package testcase.gui.sd.table;
-import static testlib.gui.UIMap.*;
import static org.junit.Assert.*;
+import static testlib.gui.UIMap.*;
+
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import testlib.gui.Log;
+import org.openoffice.test.common.Logger;
public class ChangeTableBackgroundProperty {
@Rule
- public Log LOG = new Log();
+ public Logger log = Logger.getLogger(this);
@Before
public void setUp() throws Exception {
@@ -68,10 +69,10 @@ public class ChangeTableBackgroundProper
Area_Area_page.select();
// select Color
Area_Fill_Type.select(1);
- assertEquals("Area_Fill_Type is Color",Area_Fill_Type.getSelText(), Area_Fill_Type.getItemText(1));
+ assertEquals("Area_Fill_Type is Color", Area_Fill_Type.getSelText(), Area_Fill_Type.getItemText(1));
Area_Fill_Color.select(2);
- //Area_Fill_Color.getItemCount();
- assertEquals("Area_Fill_Color is second item",Area_Fill_Color.getSelText(), Area_Fill_Color.getItemText(2));
+ // Area_Fill_Color.getItemCount();
+ assertEquals("Area_Fill_Color is second item", Area_Fill_Color.getSelText(), Area_Fill_Color.getItemText(2));
Area_Area_page.ok();
// open Table Properties Dialog
@@ -79,30 +80,29 @@ public class ChangeTableBackgroundProper
Area_Area_page.select();
// select Gradient
Area_Fill_Type.select(2);
- assertEquals("Area_Fill_Type is Gradient",Area_Fill_Type.getSelText(), Area_Fill_Type.getItemText(2));
+ assertEquals("Area_Fill_Type is Gradient", Area_Fill_Type.getSelText(), Area_Fill_Type.getItemText(2));
Area_Fill_Gradient.select(2);
- assertEquals("Area_Fill_Gradient is second item",Area_Fill_Gradient.getSelText(), Area_Fill_Gradient.getItemText(2));
+ assertEquals("Area_Fill_Gradient is second item", Area_Fill_Gradient.getSelText(), Area_Fill_Gradient.getItemText(2));
Area_Area_page.ok();
-
// open Table Properties Dialog
app.dispatch(".uno:TableDialog", 3);
Area_Area_page.select();
// select Hatching
Area_Fill_Type.select(3);
- assertEquals("Area_Fill_Type is Hatching",Area_Fill_Type.getSelText(), Area_Fill_Type.getItemText(3));
+ assertEquals("Area_Fill_Type is Hatching", Area_Fill_Type.getSelText(), Area_Fill_Type.getItemText(3));
Area_Fill_Hatching.select(2);
- assertEquals("Area_Fill_Hatching is second item",Area_Fill_Hatching.getSelText(), Area_Fill_Hatching.getItemText(2));
+ assertEquals("Area_Fill_Hatching is second item", Area_Fill_Hatching.getSelText(), Area_Fill_Hatching.getItemText(2));
Area_Area_page.ok();
-
+
// open Table Properties Dialog
app.dispatch(".uno:TableDialog", 3);
Area_Area_page.select();
// select Bitmap
Area_Fill_Type.select(4);
- assertEquals("Area_Fill_Type is Bitmap",Area_Fill_Type.getSelText(), Area_Fill_Type.getItemText(4));
+ assertEquals("Area_Fill_Type is Bitmap", Area_Fill_Type.getSelText(), Area_Fill_Type.getItemText(4));
Area_Fill_Bitmap.select(2);
- assertEquals("Area_Fill_Bitmap is second item",Area_Fill_Bitmap.getSelText(), Area_Fill_Bitmap.getItemText(2));
+ assertEquals("Area_Fill_Bitmap is second item", Area_Fill_Bitmap.getSelText(), Area_Fill_Bitmap.getItemText(2));
Area_Area_page.ok();
}
Modified: incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sd/table/ChangeTableBorderProperty.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sd/table/ChangeTableBorderProperty.java?rev=1378870&r1=1378869&r2=1378870&view=diff
==============================================================================
--- incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sd/table/ChangeTableBorderProperty.java (original)
+++ incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sd/table/ChangeTableBorderProperty.java Thu Aug 30 09:27:21 2012
@@ -21,21 +21,19 @@
package testcase.gui.sd.table;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.openoffice.test.vcl.Tester.sleep;
+import static org.junit.Assert.*;
+import static org.openoffice.test.vcl.Tester.*;
import static testlib.gui.UIMap.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-
-import testlib.gui.Log;
+import org.openoffice.test.common.Logger;
public class ChangeTableBorderProperty {
@Rule
- public Log LOG = new Log();
+ public Logger log = Logger.getLogger(this);
@Before
public void setUp() throws Exception {
@@ -71,34 +69,34 @@ public class ChangeTableBorderProperty {
// open Table Properties Dialog
app.dispatch(".uno:TableDialog", 3);
- Area_Border_page.select();
-
+ Area_Border_page.select();
+
Area_Border_Presets.click(0.01, 0.01);
-
+
// select Line
Area_Border_LineStyle.select(1);
- assertEquals("Area_Border_LineStyle is first item",Area_Border_LineStyle.getSelText(), Area_Border_LineStyle.getItemText(1));
-
+ assertEquals("Area_Border_LineStyle is first item", Area_Border_LineStyle.getSelText(), Area_Border_LineStyle.getItemText(1));
+
Area_Border_LineColor.select(1);
- assertEquals("Area_Border_LineColor is first item",Area_Border_LineColor.getSelText(), Area_Border_LineColor.getItemText(1));
-
+ assertEquals("Area_Border_LineColor is first item", Area_Border_LineColor.getSelText(), Area_Border_LineColor.getItemText(1));
+
// select Spacing to Contents
Area_Border_Sync.check();
- assertTrue("Area_Border_Sync is checked",Area_Border_Sync.isChecked());
-
+ assertTrue("Area_Border_Sync is checked", Area_Border_Sync.isChecked());
+
Area_Border_Mf_Left.setText("0.5");
- assertTrue("Area_Border_Mf_Left is 0.5",Area_Border_Mf_Left.getText().startsWith("0.5"));
-
+ assertTrue("Area_Border_Mf_Left is 0.5", Area_Border_Mf_Left.getText().startsWith("0.5"));
+
Area_Border_Mf_Right.setText("0.5");
- assertTrue("Area_Border_Mf_Right is 0.5",Area_Border_Mf_Right.getText().startsWith("0.5"));
-
+ assertTrue("Area_Border_Mf_Right is 0.5", Area_Border_Mf_Right.getText().startsWith("0.5"));
+
Area_Border_Mf_Top.setText("0.5");
- assertTrue("Area_Border_Mf_Top is 0.5",Area_Border_Mf_Top.getText().startsWith("0.5"));
-
+ assertTrue("Area_Border_Mf_Top is 0.5", Area_Border_Mf_Top.getText().startsWith("0.5"));
+
Area_Border_Mf_Bottom.setText("0.5");
- assertTrue("Area_Border_Mf_Bottom is 0.5",Area_Border_Mf_Bottom.getText().startsWith("0.5"));
-
+ assertTrue("Area_Border_Mf_Bottom is 0.5", Area_Border_Mf_Bottom.getText().startsWith("0.5"));
+
Area_Border_page.ok();
-
+
}
}
Modified: incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sd/table/ChangeTableFontEffectsProperty.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sd/table/ChangeTableFontEffectsProperty.java?rev=1378870&r1=1378869&r2=1378870&view=diff
==============================================================================
--- incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sd/table/ChangeTableFontEffectsProperty.java (original)
+++ incubator/ooo/trunk/main/test/testgui/source/testcase/gui/sd/table/ChangeTableFontEffectsProperty.java Thu Aug 30 09:27:21 2012
@@ -21,20 +21,18 @@
package testcase.gui.sd.table;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
import static testlib.gui.UIMap.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-
-import testlib.gui.Log;
+import org.openoffice.test.common.Logger;
public class ChangeTableFontEffectsProperty {
@Rule
- public Log LOG = new Log();
+ public Logger log = Logger.getLogger(this);
@Before
public void setUp() throws Exception {
@@ -64,49 +62,49 @@ public class ChangeTableFontEffectsPrope
InsertTable.ok();
// Verify if the table toolbar is active
- assertTrue("Table Toolbar exist",Table_Toolbar.exists(3));
+ assertTrue("Table Toolbar exist", Table_Toolbar.exists(3));
// open Table Properties Dialog
app.dispatch(".uno:TableDialog", 3);
- EffectsPage.select();
+ EffectsPage.select();
// select Font color
EffectsPage_Color.select(1);
- assertEquals("EffectsPage_Color is black",EffectsPage_Color.getSelText(), "Black");
-
+ assertEquals("EffectsPage_Color is black", EffectsPage_Color.getSelText(), "Black");
+
// select Relief
EffectsPage_Relief.select(0);
- assertEquals("EffectsPage_Relief is no",EffectsPage_Relief.getSelText(), "(Without)");
+ assertEquals("EffectsPage_Relief is no", EffectsPage_Relief.getSelText(), "(Without)");
EffectsPage_Outline.check();
- assertTrue("EffectsPage_Outline is checked",EffectsPage_Outline.isChecked());
+ assertTrue("EffectsPage_Outline is checked", EffectsPage_Outline.isChecked());
EffectsPage_Shadow.check();
- assertTrue("EffectsPage_Shadow is checked",EffectsPage_Shadow.isChecked());
-
+ assertTrue("EffectsPage_Shadow is checked", EffectsPage_Shadow.isChecked());
+
// select Overlining
EffectsPage_Overline.select(1);
- assertEquals("EffectsPage_Overline is first item",EffectsPage_Overline.getSelText(), EffectsPage_Overline.getItemText(1));
+ assertEquals("EffectsPage_Overline is first item", EffectsPage_Overline.getSelText(), EffectsPage_Overline.getItemText(1));
EffectsPage_Overline_Color.select(1);
- assertEquals("EffectsPage_Overline_Color is first item",EffectsPage_Overline_Color.getSelText(), EffectsPage_Overline_Color.getItemText(1));
-
+ assertEquals("EffectsPage_Overline_Color is first item", EffectsPage_Overline_Color.getSelText(), EffectsPage_Overline_Color.getItemText(1));
+
// select Strikethrough
EffectsPage_Strikeout.select(1);
- assertEquals("EffectsPage_Strikeout is first item",EffectsPage_Strikeout.getSelText(), EffectsPage_Strikeout.getItemText(1));
-
+ assertEquals("EffectsPage_Strikeout is first item", EffectsPage_Strikeout.getSelText(), EffectsPage_Strikeout.getItemText(1));
+
// select Underlining
EffectsPage_Underline.select(1);
- assertEquals("EffectsPage_Underline is first item",EffectsPage_Underline.getSelText(), EffectsPage_Underline.getItemText(1));
+ assertEquals("EffectsPage_Underline is first item", EffectsPage_Underline.getSelText(), EffectsPage_Underline.getItemText(1));
EffectsPage_Underline_Color.select(1);
- assertEquals("EffectsPage_Underline_Color is first item",EffectsPage_Underline_Color.getSelText(), EffectsPage_Underline_Color.getItemText(1));
-
+ assertEquals("EffectsPage_Underline_Color is first item", EffectsPage_Underline_Color.getSelText(), EffectsPage_Underline_Color.getItemText(1));
+
// select individual workds
EffectsPage_InvidiualWords.check();
- assertTrue("EffectsPage_InvidiualWords is checked",EffectsPage_InvidiualWords.isChecked());
-
+ assertTrue("EffectsPage_InvidiualWords is checked", EffectsPage_InvidiualWords.isChecked());
+
// select Emphasis Mark
- //EffectsPage_Emphasis.select(1);
- //assertEquals(EffectsPage_Emphasis.getSelText(), "Dot");
- //EffectsPage_Position.select(1);
- //assertEquals(EffectsPage_Position.getSelText(), "Below text");
+ // EffectsPage_Emphasis.select(1);
+ // assertEquals(EffectsPage_Emphasis.getSelText(), "Dot");
+ // EffectsPage_Position.select(1);
+ // assertEquals(EffectsPage_Position.getSelText(), "Below text");
EffectsPage.ok();
-
+
}
}
Modified: incubator/ooo/trunk/main/test/testgui/source/testcase/gui/svt/LongRun.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/test/testgui/source/testcase/gui/svt/LongRun.java?rev=1378870&r1=1378869&r2=1378870&view=diff
==============================================================================
--- incubator/ooo/trunk/main/test/testgui/source/testcase/gui/svt/LongRun.java (original)
+++ incubator/ooo/trunk/main/test/testgui/source/testcase/gui/svt/LongRun.java Thu Aug 30 09:27:21 2012
@@ -20,29 +20,12 @@
*************************************************************/
package testcase.gui.svt;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.openoffice.test.common.Testspace.getPath;
-import static org.openoffice.test.common.Testspace.prepareData;
-import static org.openoffice.test.vcl.Tester.sleep;
-import static org.openoffice.test.vcl.Tester.typeText;
-import static testlib.gui.AppUtil.submitOpenDlg;
-import static testlib.gui.AppUtil.submitSaveDlg;
-import static testlib.gui.AppUtil.typeKeys;
-import static testlib.gui.UIMap.AlienFormatDlg;
-import static testlib.gui.UIMap.EffectsPage;
-import static testlib.gui.UIMap.EffectsPage_Color;
-import static testlib.gui.UIMap.PresentationWizard;
-import static testlib.gui.UIMap.app;
-import static testlib.gui.UIMap.calc;
-import static testlib.gui.UIMap.draw;
-import static testlib.gui.UIMap.impress;
-import static testlib.gui.UIMap.math_EditWindow;
-import static testlib.gui.UIMap.math_ElementsWindow;
-import static testlib.gui.UIMap.menuItem;
-import static testlib.gui.UIMap.startcenter;
-import static testlib.gui.UIMap.writer;
+
+import static org.junit.Assert.*;
+import static org.openoffice.test.common.Testspace.*;
+import static org.openoffice.test.vcl.Tester.*;
+import static testlib.gui.AppUtil.*;
+import static testlib.gui.UIMap.*;
import java.awt.Rectangle;
import java.awt.image.BufferedImage;
@@ -58,21 +41,21 @@ import org.junit.Test;
import org.openoffice.test.common.Condition;
import org.openoffice.test.common.FileUtil;
import org.openoffice.test.common.GraphicsUtil;
+import org.openoffice.test.common.Logger;
import org.openoffice.test.common.SystemUtil;
import org.openoffice.test.common.Testspace;
import testlib.gui.CalcUtil;
-import testlib.gui.Log;
public class LongRun {
-
+
@Rule
- public Log LOG = new Log();
-
+ public Logger log = Logger.getLogger(this);
+
private PrintStream result = null;
-
+
private String pid = null;
-
+
/**
* @throws java.lang.Exception
*/
@@ -81,9 +64,9 @@ public class LongRun {
app.start(true);
result = new PrintStream(new FileOutputStream(Testspace.getFile("output/longrun.csv")));
HashMap<String, Object> proccessInfo = SystemUtil.findProcess(".*(soffice\\.bin|soffice.*-env).*");
- pid = (String)proccessInfo.get("pid");
+ pid = (String) proccessInfo.get("pid");
result.println("Iterator,Time,Memory(KB),CPU(%)");
- LOG.info("Result will be saved to " + Testspace.getPath("output/longrun.csv"));
+ log.info("Result will be saved to " + Testspace.getPath("output/longrun.csv"));
}
@After
@@ -91,14 +74,14 @@ public class LongRun {
app.close();
result.close();
}
-
+
Rectangle rect = new Rectangle(400, 200, 60, 60);
Condition condition = new Condition() {
@Override
public boolean value() {
BufferedImage image = GraphicsUtil.screenshot(rect);
- for (int x = 0; x < image.getWidth();x++) {
- for (int y = 0; y < image.getHeight();y++) {
+ for (int x = 0; x < image.getWidth(); x++) {
+ for (int y = 0; y < image.getHeight(); y++) {
if (image.getRGB(x, y) == 0xFF000000) {
return true;
}
@@ -106,9 +89,9 @@ public class LongRun {
}
return false;
}
-
+
};
-
+
/**
* Test New/Save a text document
*
@@ -118,7 +101,7 @@ public class LongRun {
public void testLongRun() throws Exception {
startcenter.menuItem("File->New->Text Document").select();
writer.typeKeys("Long-running test...");
- for(int i = 0 ; i < 1000; i++){
+ for (int i = 0; i < 1000; i++) {
saveNewDocument("helloworld_saveas.odt");
saveNewDocument("helloworld_saveas.ott");
saveNewDocument("helloworld_saveas.sxw");
@@ -144,7 +127,7 @@ public class LongRun {
saveNewDrawing("draw_saveas.std");
HashMap<String, Object> perfData = SystemUtil.getProcessPerfData(pid);
String record = i + "," + System.currentTimeMillis() + "," + perfData.get("rss") + "," + perfData.get("pcpu");
- LOG.info("Record: " + record);
+ log.info("Record: " + record);
result.println(record);
result.flush();
}
@@ -168,8 +151,7 @@ public class LongRun {
sleep(1);
// Verify the text via system clip board
- Assert.assertEquals("The typed text into writer", text,
- app.getClipboard());
+ Assert.assertEquals("The typed text into writer", text, app.getClipboard());
// Set the text style
writer.openContextMenu();
@@ -188,7 +170,7 @@ public class LongRun {
// Close it by clicking main menu
writer.menuItem("File->Close").select();
-// openStartcenter();
+ // openStartcenter();
// Reopen the saved file
writer.menuItem("File->Open...").select();
submitOpenDlg(saveTo);
@@ -199,8 +181,7 @@ public class LongRun {
typeKeys("<$copy>");
sleep(1);
// Verify if the text still exists in the file
- Assert.assertEquals("The typed text into writer is saved!", text,
- app.getClipboard());
+ Assert.assertEquals("The typed text into writer is saved!", text, app.getClipboard());
writer.menuItem("File->Close").select();
}
@@ -218,13 +199,12 @@ public class LongRun {
AlienFormatDlg.ok();
// Close it by clicking main menu
calc.menuItem("File->Close").select();
-// openStartcenter();
+ // openStartcenter();
// Reopen the saved file
writer.menuItem("File->Open...").select();
submitOpenDlg(saveTo);
calc.waitForExistence(10, 2);
- Assert.assertEquals("The typed text is saved!", text,
- CalcUtil.getCellText("A65536"));
+ Assert.assertEquals("The typed text is saved!", text, CalcUtil.getCellText("A65536"));
calc.menuItem("File->Close").select();
}
@@ -247,7 +227,7 @@ public class LongRun {
AlienFormatDlg.ok();
// Close it by clicking main menu
impress.menuItem("File->Close").select();
-// openStartcenter();
+ // openStartcenter();
// Reopen the saved file
sleep(2);
writer.menuItem("File->Open...").select();
@@ -260,12 +240,10 @@ public class LongRun {
// app.setClipboard(".wrong");
typeKeys("<$copy>");
sleep(1);
- Assert.assertEquals("The typed text is saved!", text,
- app.getClipboard());
+ Assert.assertEquals("The typed text is saved!", text, app.getClipboard());
impress.menuItem("File->Close").select();
}
-
/**
* New/Save a draw document 1. New a draw document 2. Insert a picture 3.
* Save it as the input filename 4. Reopen the saved file 5. Check if the
@@ -292,8 +270,7 @@ public class LongRun {
sleep(1);
// Verify if the picture is inserted successfully
- Rectangle rectangle = GraphicsUtil.findRectangle(
- draw.getScreenRectangle(), 0xFF00FF00);
+ Rectangle rectangle = GraphicsUtil.findRectangle(draw.getScreenRectangle(), 0xFF00FF00);
assertNotNull("Green rectangle: " + rectangle, rectangle);
// Save the drawing
@@ -307,7 +284,7 @@ public class LongRun {
// Close it by clicking main menu
draw.menuItem("File->Close").select();
-// openStartcenter();
+ // openStartcenter();
// Reopen the saved file
writer.menuItem("File->Open...").select();
@@ -316,13 +293,11 @@ public class LongRun {
draw.click(5, 5);
sleep(1);
// Verify if the picture still exists in the file
- Rectangle rectangle1 = GraphicsUtil.findRectangle(
- draw.getScreenRectangle(), 0xFF00FF00);
+ Rectangle rectangle1 = GraphicsUtil.findRectangle(draw.getScreenRectangle(), 0xFF00FF00);
assertNotNull("Green rectangle: " + rectangle1, rectangle1);
draw.menuItem("File->Close").select();
}
-
/**
* New/Save a math 1. New a math 2. Insert a formula 3. Save it as the input
* filename 4. Reopen the saved file 5. Check if the formula is still there
@@ -362,7 +337,7 @@ public class LongRun {
// Close it by clicking main menu
math_EditWindow.menuItem("File->Close").select();
-// openStartcenter();
+ // openStartcenter();
// Reopen the saved file
writer.menuItem("File->Open...").select();
@@ -373,8 +348,7 @@ public class LongRun {
math_EditWindow.menuItem("Edit->Select All").select();
typeKeys("<$copy>");
sleep(1);
- assertEquals("The typed formula into math is saved", text,
- app.getClipboard());
+ assertEquals("The typed formula into math is saved", text, app.getClipboard());
// Close the file to avoid the app closing the Elements window
// automatically
Modified: 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=1378870&r1=1378869&r2=1378870&view=diff
==============================================================================
--- incubator/ooo/trunk/main/test/testgui/source/testcase/gui/svt/sc/OperationOnNewSC.java (original)
+++ incubator/ooo/trunk/main/test/testgui/source/testcase/gui/svt/sc/OperationOnNewSC.java Thu Aug 30 09:27:21 2012
@@ -23,17 +23,11 @@
*
*/
-
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 org.openoffice.test.common.Testspace.*;
+import static org.openoffice.test.vcl.Tester.*;
+import static testlib.gui.AppUtil.*;
import static testlib.gui.UIMap.*;
import java.io.FileOutputStream;
@@ -45,22 +39,21 @@ 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.Logger;
import org.openoffice.test.common.SystemUtil;
-import static org.openoffice.test.common.Testspace.prepareData;
-import org.openoffice.test.common.*;
+import org.openoffice.test.common.Testspace;
import testlib.gui.CalcUtil;
-import testlib.gui.Log;
-import static testlib.gui.AppUtil.submitSaveDlg;
public class OperationOnNewSC {
@Rule
- public Log LOG = new Log();
-
+ public Logger log = Logger.getLogger(this);
+
private PrintStream result = null;
-
+
private String pid = null;
-
+
/**
* @throws java.lang.Exception
*/
@@ -70,9 +63,9 @@ public class OperationOnNewSC {
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");
+ 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"));
+ log.info("Result will be saved to " + Testspace.getPath("output/svt_sc_new.csv"));
}
@After
@@ -80,16 +73,14 @@ public class OperationOnNewSC {
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[][] 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++)
- {
+ for (int i = 0; i < 1000; i++) {
// Data Sort
app.dispatch("private:factory/scalc");
CalcUtil.selectRange("A1");
@@ -99,19 +90,19 @@ public class OperationOnNewSC {
SortOptionsPage.select();
SortOptionsPage_RangeContainsColumnLabels.uncheck();
SortPage.select();
- SortPage_By1.select(1); // "Column A"
+ SortPage_By1.select(1); // "Column A"
SortPage_Ascending1.check();
- SortPage.ok();
+ SortPage.ok();
sleep(5);
-
- //Insert Sheet
+
+ // Insert Sheet
app.dispatch(".uno:Insert");
SCAfterCurrentSheet.check();
SCNewSheetName.setText("Instant Filter");
SCInsertSheetDlg.ok();
sleep(5);
-
- //Standard Filter
+
+ // 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);
@@ -121,8 +112,8 @@ public class OperationOnNewSC {
FilterValue1.setText("1");
StandardFilterDlg.ok();
sleep(5);
-
- //Data Validate
+
+ // Data Validate
app.dispatch(".uno:Insert");
SCAfterCurrentSheet.check();
SCNewSheetName.setText("Data Validate");
@@ -130,7 +121,7 @@ public class OperationOnNewSC {
sleep(5);
CalcUtil.selectRange("B2:E5");
sleep(2);
-
+
app.dispatch(".uno:Validation");
SC_ValidityCriteriaTabpage.select();
SC_ValidityCriteriaAllowList.select("Whole Numbers");
@@ -141,22 +132,22 @@ public class OperationOnNewSC {
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
+
+ // Input cells, insert pics and chart
app.dispatch(".uno:Insert");
SCBeforeCurrentSheet.check();
SCNewSheetName.setText("InsertObjects");
@@ -170,25 +161,24 @@ public class OperationOnNewSC {
sleep(5);
typeKeys("<esc>");
sleep(5);
-
- //Save file and close
+
+ // Save file and close
String saveTo = "tempSC_New" + i + ".ods";
calc.menuItem("File->Save As...").select();
FileUtil.deleteFile(saveTo);
submitSaveDlg(saveTo);
- if(ActiveMsgBox.exists())
- {
+ 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);
+ log.info("Record: " + record);
result.println(record);
result.flush();
-
+
sleep(3);
}
}