summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLiu Zhe <liuzhe@apache.org>2012-07-10 05:46:10 +0000
committerLiu Zhe <liuzhe@apache.org>2012-07-10 05:46:10 +0000
commit9754414011f2318861eb99383bc974b57028a512 (patch)
tree4887b692732d1de9bbb8c41297b94c8e41813fdf /test
parent41e30e1dc27b82e7fbd6741b085182b022f2aa9b (diff)
Merge all test classes under subtotals into one test class.
Notes
Notes: ignore: vclauto
Diffstat (limited to 'test')
-rw-r--r--test/testoo/src/testcase/sc/subtotals/SubtotalsFunctionAverage.java122
-rw-r--r--test/testoo/src/testcase/sc/subtotals/SubtotalsFunctionCountNumbersOnly.java122
-rw-r--r--test/testoo/src/testcase/sc/subtotals/SubtotalsFunctionMax.java120
-rw-r--r--test/testoo/src/testcase/sc/subtotals/SubtotalsFunctionMin.java121
-rw-r--r--test/testoo/src/testcase/sc/subtotals/SubtotalsFunctionProduct.java122
-rw-r--r--test/testoo/src/testcase/sc/subtotals/SubtotalsFunctionStDevPPopulation.java125
-rw-r--r--test/testoo/src/testcase/sc/subtotals/SubtotalsFunctionSum.java115
-rw-r--r--test/testoo/src/testcase/sc/subtotals/SubtotalsFunctionVarSample.java126
-rw-r--r--test/testoo/src/testcase/sc/subtotals/SubtotalsFunctions.java329
-rw-r--r--test/testoo/src/testcase/sc/subtotals/SubtotalsNoColumnSelectedForGroupBy.java96
-rw-r--r--test/testoo/src/testcase/sc/subtotals/SubtotalsOptionsSortDoNotSort.java119
-rw-r--r--test/testoo/src/testcase/sc/subtotals/SubtotalsRecalculateRefreshAfterSourceRowDeleted.java131
-rw-r--r--test/testoo/src/testcase/sc/subtotals/SubtotalsRecalculatesWhenSourceDataChanged.java133
-rw-r--r--test/testoo/src/testcase/sc/subtotals/SubtotalsUIOptionsDefaultStatus.java102
-rw-r--r--test/testoo/src/testcase/sc/subtotals/SubtotalsUsingAllGroup.java171
15 files changed, 329 insertions, 1725 deletions
diff --git a/test/testoo/src/testcase/sc/subtotals/SubtotalsFunctionAverage.java b/test/testoo/src/testcase/sc/subtotals/SubtotalsFunctionAverage.java
deleted file mode 100644
index afd15f0021ce..000000000000
--- a/test/testoo/src/testcase/sc/subtotals/SubtotalsFunctionAverage.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/**************************************************************
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- *************************************************************/
-
-
-
-/**
- *
- */
-package testcase.sc.subtotals;
-
-import static testlib.AppUtil.*;
-import static testlib.UIMap.*;
-
-import java.awt.Rectangle;
-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.Test;
-import org.openoffice.test.common.FileUtil;
-import org.openoffice.test.common.GraphicsUtil;
-
-import testlib.CalcUtil;
-import testlib.Log;
-
-
-/**
- *
- *
- */
-public class SubtotalsFunctionAverage {
- /**
- * TestCapture helps us to do 1. Take a screenshot when failure occurs. 2.
- * Collect extra data when OpenOffice crashes.
- */
- @Rule
- public Log LOG = new Log();
-
- /**
- * initApp helps us to do 1. Patch the OpenOffice to enable automation if
- * necessary. 2. Start OpenOffice with automation enabled if necessary. 3.
- * Reset OpenOffice to startcenter.
- *
- * @throws java.lang.Exception
- */
- @Before
- public void setUp() throws Exception {
- initApp();
- }
- /**
- *
- * Verify Average function in SubTotals
- */
- @Test
- public void test() {
- String file = testFile("sc/SubtotalsSampleFile.ods");
- startcenter.menuItem("File->Open...").select();
- submitOpenDlg(file);
- sleep(2);
- CalcUtil.selectRange("A1:E7");
- calc.menuItem("Data->Subtotals...").select();
-
- assertTrue(SCSubTotalsGroup1Dialog.exists());
- assertEquals("- none -",SCSubTotalsGroupByListBox.getItemText(0));
- assertEquals("Level",SCSubTotalsGroupByListBox.getItemText(1));
- assertEquals("Code",SCSubTotalsGroupByListBox.getItemText(2));
- assertEquals("No.",SCSubTotalsGroupByListBox.getItemText(3));
- assertEquals("Team",SCSubTotalsGroupByListBox.getItemText(4));
- assertEquals("Name",SCSubTotalsGroupByListBox.getItemText(5));
-
-
- SCSubTotalsGroupByListBox.select("Team");
- sleep(1);
- SCCalcSubTotalForColumns.click(10,25);
- sleep(1);
- typeKeys("<tab>");
- typeKeys("<down>");
- typeKeys("<down>");
- sleep(1);
- SCSubTotalsGroup1Dialog.ok();
- sleep(1);
-
- assertEquals("20",CalcUtil.getCellText("B5"));
- assertEquals("=SUBTOTAL(1;$B$2:$B$4)",CalcUtil.getCellInput("B5"));
- assertEquals("A Average",CalcUtil.getCellText("D5"));
-
- assertEquals("15",CalcUtil.getCellText("B8"));
- assertEquals("=SUBTOTAL(1;$B$6:$B$7)",CalcUtil.getCellInput("B8"));
- assertEquals("B Average",CalcUtil.getCellText("D8"));
-
- assertEquals("20",CalcUtil.getCellText("B10"));
- assertEquals("=SUBTOTAL(1;$B$9:$B$9)",CalcUtil.getCellInput("B10"));
- assertEquals("C Average",CalcUtil.getCellText("D10"));
-
- assertEquals("18.33333333",CalcUtil.getCellText("B11"));
- assertEquals("=SUBTOTAL(1;$B$2:$B$10)",CalcUtil.getCellInput("B11"));
- assertEquals("Grand Total",CalcUtil.getCellText("D11"));
- }
-
-}
diff --git a/test/testoo/src/testcase/sc/subtotals/SubtotalsFunctionCountNumbersOnly.java b/test/testoo/src/testcase/sc/subtotals/SubtotalsFunctionCountNumbersOnly.java
deleted file mode 100644
index c38fd3bdd28e..000000000000
--- a/test/testoo/src/testcase/sc/subtotals/SubtotalsFunctionCountNumbersOnly.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/**************************************************************
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- *************************************************************/
-
-
-
-/**
- *
- */
-package testcase.sc.subtotals;
-
-import static testlib.AppUtil.*;
-import static testlib.UIMap.*;
-
-import java.awt.Rectangle;
-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.Test;
-import org.openoffice.test.common.FileUtil;
-import org.openoffice.test.common.GraphicsUtil;
-
-import testlib.CalcUtil;
-import testlib.Log;
-
-/**
- *
- *
- */
-public class SubtotalsFunctionCountNumbersOnly {
- /**
- * TestCapture helps us to do 1. Take a screenshot when failure occurs. 2.
- * Collect extra data when OpenOffice crashes.
- */
- @Rule
- public Log LOG = new Log();
-
- /**
- * initApp helps us to do 1. Patch the OpenOffice to enable automation if
- * necessary. 2. Start OpenOffice with automation enabled if necessary. 3.
- * Reset OpenOffice to startcenter.
- *
- * @throws java.lang.Exception
- */
- @Before
- public void setUp() throws Exception {
- initApp();
- }
- /**
- *
- * Verify Count Numbers only function in SubTotals
- */
- @Test
- public void test() {
- String file = testFile("sc/SubtotalsSampleFile.ods");
- startcenter.menuItem("File->Open...").select();
- submitOpenDlg(file);
- sleep(2);
- CalcUtil.selectRange("A1:E7");
- calc.menuItem("Data->Subtotals...").select();
-
- assertTrue(SCSubTotalsGroup1Dialog.exists());
- assertEquals("- none -",SCSubTotalsGroupByListBox.getItemText(0));
- assertEquals("Level",SCSubTotalsGroupByListBox.getItemText(1));
- assertEquals("Code",SCSubTotalsGroupByListBox.getItemText(2));
- assertEquals("No.",SCSubTotalsGroupByListBox.getItemText(3));
- assertEquals("Team",SCSubTotalsGroupByListBox.getItemText(4));
- assertEquals("Name",SCSubTotalsGroupByListBox.getItemText(5));
-
- SCCalcSubTotalForColumns.click(10,45);
- sleep(1);
- typeKeys("<tab>");
- typeKeys("<down>");
- typeKeys("<down>");
- typeKeys("<down>");
- typeKeys("<down>");
- typeKeys("<down>");
- typeKeys("<down>");
- sleep(1);
- SCSubTotalsGroup1Dialog.ok();
- sleep(1);
-
- assertEquals("BS Count",CalcUtil.getCellText("A5"));
- assertEquals("=SUBTOTAL(2;$C$2:$C$4)",CalcUtil.getCellInput("C5"));
- assertEquals("3",CalcUtil.getCellText("C5"));
-
- assertEquals("CS Count",CalcUtil.getCellText("A7"));
- assertEquals("=SUBTOTAL(2;$C$6:$C$6)",CalcUtil.getCellInput("C7"));
- assertEquals("1",CalcUtil.getCellText("C7"));
-
- assertEquals("MS Count",CalcUtil.getCellText("A10"));
- assertEquals("=SUBTOTAL(2;$C$8:$C$9)",CalcUtil.getCellInput("C10"));
- assertEquals("2",CalcUtil.getCellText("C10"));
-
- assertEquals("Grand Total",CalcUtil.getCellText("A11"));
- assertEquals("=SUBTOTAL(2;$C$2:$C$10)",CalcUtil.getCellInput("C11"));
- assertEquals("6",CalcUtil.getCellText("C11"));
- }
-
-}
diff --git a/test/testoo/src/testcase/sc/subtotals/SubtotalsFunctionMax.java b/test/testoo/src/testcase/sc/subtotals/SubtotalsFunctionMax.java
deleted file mode 100644
index e57ab4a5c206..000000000000
--- a/test/testoo/src/testcase/sc/subtotals/SubtotalsFunctionMax.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/**************************************************************
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- *************************************************************/
-
-
-
-/**
- *
- */
-package testcase.sc.subtotals;
-
-import static testlib.AppUtil.*;
-import static testlib.UIMap.*;
-
-import java.awt.Rectangle;
-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.Test;
-import org.openoffice.test.common.FileUtil;
-import org.openoffice.test.common.GraphicsUtil;
-
-import testlib.CalcUtil;
-import testlib.Log;
-
-/**
- *
- *
- */
-public class SubtotalsFunctionMax {
- /**
- * TestCapture helps us to do 1. Take a screenshot when failure occurs. 2.
- * Collect extra data when OpenOffice crashes.
- */
- @Rule
- public Log LOG = new Log();
-
- /**
- * initApp helps us to do 1. Patch the OpenOffice to enable automation if
- * necessary. 2. Start OpenOffice with automation enabled if necessary. 3.
- * Reset OpenOffice to startcenter.
- *
- * @throws java.lang.Exception
- */
- @Before
- public void setUp() throws Exception {
- initApp();
- }
- /**
- *
- * Verify Max Numbers function in SubTotals
- */
- @Test
- public void test() {
- String file = testFile("sc/SubtotalsSampleFile.ods");
- startcenter.menuItem("File->Open...").select();
- submitOpenDlg(file);
- sleep(2);
- CalcUtil.selectRange("A1:E7");
- calc.menuItem("Data->Subtotals...").select();
- sleep(1);
-
- assertTrue(SCSubTotalsGroup1Dialog.exists());
- assertEquals("- none -",SCSubTotalsGroupByListBox.getItemText(0));
- assertEquals("Level",SCSubTotalsGroupByListBox.getItemText(1));
- assertEquals("Code",SCSubTotalsGroupByListBox.getItemText(2));
- assertEquals("No.",SCSubTotalsGroupByListBox.getItemText(3));
- assertEquals("Team",SCSubTotalsGroupByListBox.getItemText(4));
- assertEquals("Name",SCSubTotalsGroupByListBox.getItemText(5));
-
- SCCalcSubTotalForColumns.click(10,45);
- sleep(1);
- typeKeys("<tab>");
- typeKeys("<down>");
- typeKeys("<down>");
- typeKeys("<down>");
- sleep(1);
- SCSubTotalsGroup1Dialog.ok();
- sleep(1);
-
- assertEquals("BS Max",CalcUtil.getCellText("A5"));
- assertEquals("=SUBTOTAL(4;$C$2:$C$4)",CalcUtil.getCellInput("C5"));
- assertEquals("6",CalcUtil.getCellText("C5"));
-
- assertEquals("CS Max",CalcUtil.getCellText("A7"));
- assertEquals("=SUBTOTAL(4;$C$6:$C$6)",CalcUtil.getCellInput("C7"));
- assertEquals("5",CalcUtil.getCellText("C7"));
-
- assertEquals("MS Max",CalcUtil.getCellText("A10"));
- assertEquals("=SUBTOTAL(4;$C$8:$C$9)",CalcUtil.getCellInput("C10"));
- assertEquals("3",CalcUtil.getCellText("C10"));
-
- assertEquals("Grand Total",CalcUtil.getCellText("A11"));
- assertEquals("=SUBTOTAL(4;$C$2:$C$10)",CalcUtil.getCellInput("C11"));
- assertEquals("6",CalcUtil.getCellText("C11"));
- }
-
-}
diff --git a/test/testoo/src/testcase/sc/subtotals/SubtotalsFunctionMin.java b/test/testoo/src/testcase/sc/subtotals/SubtotalsFunctionMin.java
deleted file mode 100644
index 035f13598b6f..000000000000
--- a/test/testoo/src/testcase/sc/subtotals/SubtotalsFunctionMin.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/**************************************************************
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- *************************************************************/
-
-
-
-/**
- *
- */
-package testcase.sc.subtotals;
-
-import static testlib.AppUtil.*;
-import static testlib.UIMap.*;
-
-import java.awt.Rectangle;
-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.Test;
-import org.openoffice.test.common.FileUtil;
-import org.openoffice.test.common.GraphicsUtil;
-
-import testlib.CalcUtil;
-import testlib.Log;
-
-/**
- *
- *
- */
-public class SubtotalsFunctionMin {
- /**
- * TestCapture helps us to do 1. Take a screenshot when failure occurs. 2.
- * Collect extra data when OpenOffice crashes.
- */
- @Rule
- public Log LOG = new Log();
-
- /**
- * initApp helps us to do 1. Patch the OpenOffice to enable automation if
- * necessary. 2. Start OpenOffice with automation enabled if necessary. 3.
- * Reset OpenOffice to startcenter.
- *
- * @throws java.lang.Exception
- */
- @Before
- public void setUp() throws Exception {
- initApp();
- }
- /**
- *
- * Verify Min Numbers function in SubTotals
- */
- @Test
- public void test() {
- String file = testFile("sc/SubtotalsSampleFile.ods");
- startcenter.menuItem("File->Open...").select();
- submitOpenDlg(file);
- sleep(2);
- CalcUtil.selectRange("A1:E7");
- calc.menuItem("Data->Subtotals...").select();
- sleep(1);
-
- assertTrue(SCSubTotalsGroup1Dialog.exists());
- assertEquals("- none -",SCSubTotalsGroupByListBox.getItemText(0));
- assertEquals("Level",SCSubTotalsGroupByListBox.getItemText(1));
- assertEquals("Code",SCSubTotalsGroupByListBox.getItemText(2));
- assertEquals("No.",SCSubTotalsGroupByListBox.getItemText(3));
- assertEquals("Team",SCSubTotalsGroupByListBox.getItemText(4));
- assertEquals("Name",SCSubTotalsGroupByListBox.getItemText(5));
-
- SCCalcSubTotalForColumns.click(10,45);
- sleep(1);
- typeKeys("<tab>");
- typeKeys("<down>");
- typeKeys("<down>");
- typeKeys("<down>");
- typeKeys("<down>");
- sleep(1);
- SCSubTotalsGroup1Dialog.ok();
- sleep(1);
-
- assertEquals("BS Min",CalcUtil.getCellText("A5"));
- assertEquals("=SUBTOTAL(5;$C$2:$C$4)",CalcUtil.getCellInput("C5"));
- assertEquals("2",CalcUtil.getCellText("C5"));
-
- assertEquals("CS Min",CalcUtil.getCellText("A7"));
- assertEquals("=SUBTOTAL(5;$C$6:$C$6)",CalcUtil.getCellInput("C7"));
- assertEquals("5",CalcUtil.getCellText("C7"));
-
- assertEquals("MS Min",CalcUtil.getCellText("A10"));
- assertEquals("=SUBTOTAL(5;$C$8:$C$9)",CalcUtil.getCellInput("C10"));
- assertEquals("1",CalcUtil.getCellText("C10"));
-
- assertEquals("Grand Total",CalcUtil.getCellText("A11"));
- assertEquals("=SUBTOTAL(5;$C$2:$C$10)",CalcUtil.getCellInput("C11"));
- assertEquals("1",CalcUtil.getCellText("C11"));
- }
-
-}
diff --git a/test/testoo/src/testcase/sc/subtotals/SubtotalsFunctionProduct.java b/test/testoo/src/testcase/sc/subtotals/SubtotalsFunctionProduct.java
deleted file mode 100644
index 1f3df11b4554..000000000000
--- a/test/testoo/src/testcase/sc/subtotals/SubtotalsFunctionProduct.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/**************************************************************
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- *************************************************************/
-
-
-
-/**
- *
- */
-package testcase.sc.subtotals;
-
-import static testlib.AppUtil.*;
-import static testlib.UIMap.*;
-
-import java.awt.Rectangle;
-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.Test;
-import org.openoffice.test.common.FileUtil;
-import org.openoffice.test.common.GraphicsUtil;
-
-import testlib.CalcUtil;
-import testlib.Log;
-
-/**
- *
- *
- */
-public class SubtotalsFunctionProduct {
- /**
- * TestCapture helps us to do 1. Take a screenshot when failure occurs. 2.
- * Collect extra data when OpenOffice crashes.
- */
- @Rule
- public Log LOG = new Log();
-
- /**
- * initApp helps us to do 1. Patch the OpenOffice to enable automation if
- * necessary. 2. Start OpenOffice with automation enabled if necessary. 3.
- * Reset OpenOffice to startcenter.
- *
- * @throws java.lang.Exception
- */
- @Before
- public void setUp() throws Exception {
- initApp();
- }
- /**
- *
- * Verify Product Numbers function in SubTotals
- */
- @Test
- public void test() {
- String file = testFile("sc/SubtotalsSampleFile.ods");
- startcenter.menuItem("File->Open...").select();
- submitOpenDlg(file);
- sleep(2);
- CalcUtil.selectRange("A1:E7");
- calc.menuItem("Data->Subtotals...").select();
- sleep(1);
-
- assertTrue(SCSubTotalsGroup1Dialog.exists());
- assertEquals("- none -",SCSubTotalsGroupByListBox.getItemText(0));
- assertEquals("Level",SCSubTotalsGroupByListBox.getItemText(1));
- assertEquals("Code",SCSubTotalsGroupByListBox.getItemText(2));
- assertEquals("No.",SCSubTotalsGroupByListBox.getItemText(3));
- assertEquals("Team",SCSubTotalsGroupByListBox.getItemText(4));
- assertEquals("Name",SCSubTotalsGroupByListBox.getItemText(5));
-
- SCCalcSubTotalForColumns.click(10,45);
- sleep(1);
- typeKeys("<tab>");
- typeKeys("<down>");
- typeKeys("<down>");
- typeKeys("<down>");
- typeKeys("<down>");
- typeKeys("<down>");
- sleep(1);
- SCSubTotalsGroup1Dialog.ok();
- sleep(1);
-
- assertEquals("BS Product",CalcUtil.getCellText("A5"));
- assertEquals("=SUBTOTAL(6;$C$2:$C$4)",CalcUtil.getCellInput("C5"));
- assertEquals("48",CalcUtil.getCellText("C5"));
-
- assertEquals("CS Product",CalcUtil.getCellText("A7"));
- assertEquals("=SUBTOTAL(6;$C$6:$C$6)",CalcUtil.getCellInput("C7"));
- assertEquals("5",CalcUtil.getCellText("C7"));
-
- assertEquals("MS Product",CalcUtil.getCellText("A10"));
- assertEquals("=SUBTOTAL(6;$C$8:$C$9)",CalcUtil.getCellInput("C10"));
- assertEquals("3",CalcUtil.getCellText("C10"));
-
- assertEquals("Grand Total",CalcUtil.getCellText("A11"));
- assertEquals("=SUBTOTAL(6;$C$2:$C$10)",CalcUtil.getCellInput("C11"));
- assertEquals("720",CalcUtil.getCellText("C11"));
- }
-
-}
diff --git a/test/testoo/src/testcase/sc/subtotals/SubtotalsFunctionStDevPPopulation.java b/test/testoo/src/testcase/sc/subtotals/SubtotalsFunctionStDevPPopulation.java
deleted file mode 100644
index 3207bdd5b43e..000000000000
--- a/test/testoo/src/testcase/sc/subtotals/SubtotalsFunctionStDevPPopulation.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/**************************************************************
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- *************************************************************/
-
-
-
-/**
- *
- */
-package testcase.sc.subtotals;
-
-import static testlib.AppUtil.*;
-import static testlib.UIMap.*;
-
-import java.awt.Rectangle;
-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.Test;
-import org.openoffice.test.common.FileUtil;
-import org.openoffice.test.common.GraphicsUtil;
-
-import testlib.CalcUtil;
-import testlib.Log;
-
-/**
- *
- *
- */
-public class SubtotalsFunctionStDevPPopulation {
- /**
- * TestCapture helps us to do 1. Take a screenshot when failure occurs. 2.
- * Collect extra data when OpenOffice crashes.
- */
- @Rule
- public Log LOG = new Log();
-
- /**
- * initApp helps us to do 1. Patch the OpenOffice to enable automation if
- * necessary. 2. Start OpenOffice with automation enabled if necessary. 3.
- * Reset OpenOffice to startcenter.
- *
- * @throws java.lang.Exception
- */
- @Before
- public void setUp() throws Exception {
- initApp();
- }
- /**
- *
- * Verify Product Numbers function in SubTotals
- */
- @Test
- public void test() {
- String file = testFile("sc/SubtotalsSampleFile.ods");
- startcenter.menuItem("File->Open...").select();
- submitOpenDlg(file);
- sleep(2);
- CalcUtil.selectRange("A1:E7");
- calc.menuItem("Data->Subtotals...").select();
- sleep(1);
-
- assertTrue(SCSubTotalsGroup1Dialog.exists());
- assertEquals("- none -",SCSubTotalsGroupByListBox.getItemText(0));
- assertEquals("Level",SCSubTotalsGroupByListBox.getItemText(1));
- assertEquals("Code",SCSubTotalsGroupByListBox.getItemText(2));
- assertEquals("No.",SCSubTotalsGroupByListBox.getItemText(3));
- assertEquals("Team",SCSubTotalsGroupByListBox.getItemText(4));
- assertEquals("Name",SCSubTotalsGroupByListBox.getItemText(5));
-
- SCCalcSubTotalForColumns.click(10,45);
- sleep(1);
- typeKeys("<tab>");
- typeKeys("<down>");
- typeKeys("<down>");
- typeKeys("<down>");
- typeKeys("<down>");
- typeKeys("<down>");
- typeKeys("<down>");
- typeKeys("<down>");
- typeKeys("<down>");
- sleep(1);
- SCSubTotalsGroup1Dialog.ok();
- sleep(1);
-
- assertEquals("BS StDev",CalcUtil.getCellText("A5"));
- assertEquals("=SUBTOTAL(8;$C$2:$C$4)",CalcUtil.getCellInput("C5"));
- assertEquals("1.63299316",CalcUtil.getCellText("C5"));
-
- assertEquals("CS StDev",CalcUtil.getCellText("A7"));
- assertEquals("=SUBTOTAL(8;$C$6:$C$6)",CalcUtil.getCellInput("C7"));
- assertEquals("0",CalcUtil.getCellText("C7"));
-
- assertEquals("MS StDev",CalcUtil.getCellText("A10"));
- assertEquals("=SUBTOTAL(8;$C$8:$C$9)",CalcUtil.getCellInput("C10"));
- assertEquals("1",CalcUtil.getCellText("C10"));
-
- assertEquals("Grand Total",CalcUtil.getCellText("A11"));
- assertEquals("=SUBTOTAL(8;$C$2:$C$10)",CalcUtil.getCellInput("C11"));
- assertEquals("1.70782513",CalcUtil.getCellText("C11"));
- }
-
-}
diff --git a/test/testoo/src/testcase/sc/subtotals/SubtotalsFunctionSum.java b/test/testoo/src/testcase/sc/subtotals/SubtotalsFunctionSum.java
deleted file mode 100644
index da6ddde5e511..000000000000
--- a/test/testoo/src/testcase/sc/subtotals/SubtotalsFunctionSum.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/**************************************************************
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- *************************************************************/
-
-
-
-/**
- *
- */
-package testcase.sc.subtotals;
-
-import static testlib.AppUtil.*;
-import static testlib.UIMap.*;
-
-import java.awt.Rectangle;
-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.Test;
-import org.openoffice.test.common.FileUtil;
-import org.openoffice.test.common.GraphicsUtil;
-
-import testlib.CalcUtil;
-import testlib.Log;
-
-/**
- *
- *
- */
-public class SubtotalsFunctionSum {
- /**
- * TestCapture helps us to do 1. Take a screenshot when failure occurs. 2.
- * Collect extra data when OpenOffice crashes.
- */
- @Rule
- public Log LOG = new Log();
-
- /**
- * initApp helps us to do 1. Patch the OpenOffice to enable automation if
- * necessary. 2. Start OpenOffice with automation enabled if necessary. 3.
- * Reset OpenOffice to startcenter.
- *
- * @throws java.lang.Exception
- */
- @Before
- public void setUp() throws Exception {
- initApp();
- }
- /**
- *
- * Verify Product Numbers function in SubTotals
- */
- @Test
- public void test() {
- String file = testFile("sc/SubtotalsSampleFile.ods");
- startcenter.menuItem("File->Open...").select();
- submitOpenDlg(file);
- sleep(2);
- CalcUtil.selectRange("A1:E7");
- calc.menuItem("Data->Subtotals...").select();
- sleep(1);
-
- assertTrue(SCSubTotalsGroup1Dialog.exists());
- assertEquals("- none -",SCSubTotalsGroupByListBox.getItemText(0));
- assertEquals("Level",SCSubTotalsGroupByListBox.getItemText(1));
- assertEquals("Code",SCSubTotalsGroupByListBox.getItemText(2));
- assertEquals("No.",SCSubTotalsGroupByListBox.getItemText(3));
- assertEquals("Team",SCSubTotalsGroupByListBox.getItemText(4));
- assertEquals("Name",SCSubTotalsGroupByListBox.getItemText(5));
-
- SCCalcSubTotalForColumns.click(10,45);
- sleep(1);
- SCSubTotalsGroup1Dialog.ok();
- sleep(1);
-
- assertEquals("BS Sum",CalcUtil.getCellText("A5"));
- assertEquals("=SUBTOTAL(9;$C$2:$C$4)",CalcUtil.getCellInput("C5"));
- assertEquals("12",CalcUtil.getCellText("C5"));
-
- assertEquals("CS Sum",CalcUtil.getCellText("A7"));
- assertEquals("=SUBTOTAL(9;$C$6:$C$6)",CalcUtil.getCellInput("C7"));
- assertEquals("5",CalcUtil.getCellText("C7"));
-
- assertEquals("MS Sum",CalcUtil.getCellText("A10"));
- assertEquals("=SUBTOTAL(9;$C$8:$C$9)",CalcUtil.getCellInput("C10"));
- assertEquals("4",CalcUtil.getCellText("C10"));
-
- assertEquals("Grand Total",CalcUtil.getCellText("A11"));
- assertEquals("=SUBTOTAL(9;$C$2:$C$10)",CalcUtil.getCellInput("C11"));
- assertEquals("21",CalcUtil.getCellText("C11"));
- }
-
-}
diff --git a/test/testoo/src/testcase/sc/subtotals/SubtotalsFunctionVarSample.java b/test/testoo/src/testcase/sc/subtotals/SubtotalsFunctionVarSample.java
deleted file mode 100644
index 47b9835829fe..000000000000
--- a/test/testoo/src/testcase/sc/subtotals/SubtotalsFunctionVarSample.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/**************************************************************
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- *************************************************************/
-
-
-
-/**
- *
- */
-package testcase.sc.subtotals;
-
-import static testlib.AppUtil.*;
-import static testlib.UIMap.*;
-
-import java.awt.Rectangle;
-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.Test;
-import org.openoffice.test.common.FileUtil;
-import org.openoffice.test.common.GraphicsUtil;
-
-import testlib.CalcUtil;
-import testlib.Log;
-
-/**
- *
- *
- */
-public class SubtotalsFunctionVarSample {
- /**
- * TestCapture helps us to do 1. Take a screenshot when failure occurs. 2.
- * Collect extra data when OpenOffice crashes.
- */
- @Rule
- public Log LOG = new Log();
-
- /**
- * initApp helps us to do 1. Patch the OpenOffice to enable automation if
- * necessary. 2. Start OpenOffice with automation enabled if necessary. 3.
- * Reset OpenOffice to startcenter.
- *
- * @throws java.lang.Exception
- */
- @Before
- public void setUp() throws Exception {
- initApp();
- }
- /**
- *
- * Verify Product Numbers function in SubTotals
- */
- @Test
- public void test() {
- String file = testFile("sc/SubtotalsSampleFile.ods");
- startcenter.menuItem("File->Open...").select();
- submitOpenDlg(file);
- sleep(2);
- CalcUtil.selectRange("A1:E7");
- calc.menuItem("Data->Subtotals...").select();
- sleep(1);
-
- assertTrue(SCSubTotalsGroup1Dialog.exists());
- assertEquals("- none -",SCSubTotalsGroupByListBox.getItemText(0));
- assertEquals("Level",SCSubTotalsGroupByListBox.getItemText(1));
- assertEquals("Code",SCSubTotalsGroupByListBox.getItemText(2));
- assertEquals("No.",SCSubTotalsGroupByListBox.getItemText(3));
- assertEquals("Team",SCSubTotalsGroupByListBox.getItemText(4));
- assertEquals("Name",SCSubTotalsGroupByListBox.getItemText(5));
-
- SCCalcSubTotalForColumns.click(10,45);
- sleep(1);
- typeKeys("<tab>");
- typeKeys("<down>");
- typeKeys("<down>");
- typeKeys("<down>");
- typeKeys("<down>");
- typeKeys("<down>");
- typeKeys("<down>");
- typeKeys("<down>");
- typeKeys("<down>");
- typeKeys("<down>");
- sleep(1);
- SCSubTotalsGroup1Dialog.ok();
- sleep(1);
-
- assertEquals("BS Var",CalcUtil.getCellText("A5"));
- assertEquals("=SUBTOTAL(10;$C$2:$C$4)",CalcUtil.getCellInput("C5"));
- assertEquals("4",CalcUtil.getCellText("C5"));
-
- assertEquals("CS Var",CalcUtil.getCellText("A7"));
- assertEquals("=SUBTOTAL(10;$C$6:$C$6)",CalcUtil.getCellInput("C7"));
- assertEquals("#DIV/0!",CalcUtil.getCellText("C7"));
-
- assertEquals("MS Var",CalcUtil.getCellText("A10"));
- assertEquals("=SUBTOTAL(10;$C$8:$C$9)",CalcUtil.getCellInput("C10"));
- assertEquals("2",CalcUtil.getCellText("C10"));
-
- assertEquals("Grand Total",CalcUtil.getCellText("A11"));
- assertEquals("=SUBTOTAL(10;$C$2:$C$10)",CalcUtil.getCellInput("C11"));
- assertEquals("3.5",CalcUtil.getCellText("C11"));
- }
-
-}
diff --git a/test/testoo/src/testcase/sc/subtotals/SubtotalsFunctions.java b/test/testoo/src/testcase/sc/subtotals/SubtotalsFunctions.java
new file mode 100644
index 000000000000..c62c4902878a
--- /dev/null
+++ b/test/testoo/src/testcase/sc/subtotals/SubtotalsFunctions.java
@@ -0,0 +1,329 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+/**
+ *
+ */
+package testcase.sc.subtotals;
+
+import static org.junit.Assert.*;
+import static org.openoffice.test.vcl.Tester.*;
+import static testlib.AppUtil.*;
+import static testlib.UIMap.*;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+import testlib.CalcUtil;
+import testlib.Log;
+
+/**
+ *
+ *
+ */
+public class SubtotalsFunctions {
+
+ @Rule
+ public Log LOG = new Log();
+
+ @Before
+ public void setUp() throws Exception {
+ app.start();
+ String file = testFile("sc/SubtotalsSampleFile.ods");
+ startcenter.menuItem("File->Open...").select();
+ submitOpenDlg(file);
+ sleep(2);
+ CalcUtil.selectRange("A1:E7");
+ calc.menuItem("Data->Subtotals...").select();
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ app.close();
+ }
+
+ /**
+ *
+ * Verify Average function in SubTotals
+ */
+ @Test
+ public void testAverage() {
+ SCSubTotalsGroupByListBox.select("Team");
+ SCCalcSubTotalForColumns.click(10, 25);
+ SCCalcSubTotolsFuncionList.select("Average");
+ SCSubTotalsGroup1Dialog.ok();
+ sleep(1);
+
+ assertArrayEquals("Subtotal table", 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", "" } }, CalcUtil.getCellTexts("A1:E11"));
+ }
+
+ /**
+ *
+ * Verify Count Numbers only function in SubTotals
+ */
+ @Test
+ public void testCountNumbersOnly() {
+ SCCalcSubTotalForColumns.click(10, 45);
+ SCCalcSubTotolsFuncionList.select("Count (numbers only)");
+ SCSubTotalsGroup1Dialog.ok();
+ sleep(1);
+
+ assertArrayEquals("Subtotal table", 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", "", "" } }, CalcUtil.getCellTexts("A1:E11"));
+ }
+
+ /**
+ *
+ * Verify Max Numbers function in SubTotals
+ */
+ @Test
+ public void testMax() {
+ SCCalcSubTotalForColumns.click(10, 45);
+ SCCalcSubTotolsFuncionList.select("Max");
+ SCSubTotalsGroup1Dialog.ok();
+ sleep(1);
+
+ assertArrayEquals("Subtotal table", 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", "", "" } }, CalcUtil.getCellTexts("A1:E11"));
+ }
+
+ /**
+ *
+ * Verify Min Numbers function in SubTotals
+ */
+ @Test
+ public void testMin() {
+ SCCalcSubTotalForColumns.click(10, 45);
+ SCCalcSubTotolsFuncionList.select("Min");
+ SCSubTotalsGroup1Dialog.ok();
+ sleep(1);
+
+ assertArrayEquals("Subtotal table", 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", "", "" } }, CalcUtil.getCellTexts("A1:E11"));
+ }
+
+ /**
+ *
+ * Verify Product function in SubTotals
+ */
+ @Test
+ public void testProduct() {
+ SCCalcSubTotalForColumns.click(10, 45);
+ SCCalcSubTotolsFuncionList.select("Product");
+ SCSubTotalsGroup1Dialog.ok();
+ sleep(1);
+
+ assertArrayEquals("Subtotal table", 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", "", "" } }, CalcUtil.getCellTexts("A1:E11"));
+ }
+
+ /**
+ *
+ * Verify StDevP (Population) function in SubTotals
+ */
+ @Test
+ public void testStDevPPopulation() {
+ SCCalcSubTotalForColumns.click(10, 45);
+ SCCalcSubTotolsFuncionList.select("StDevP (Population)");
+ SCSubTotalsGroup1Dialog.ok();
+ sleep(1);
+
+ assertArrayEquals("Subtotal table", 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", "", "" } }, CalcUtil.getCellTexts("A1:E11"));
+ }
+
+ /**
+ *
+ * Verify sum function in SubTotals
+ */
+ @Test
+ public void testSum() {
+ SCCalcSubTotalForColumns.click(10, 45);
+ SCCalcSubTotolsFuncionList.select("Sum");
+ SCSubTotalsGroup1Dialog.ok();
+ sleep(1);
+
+ assertArrayEquals("Subtotal table", 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", "", "" } }, CalcUtil.getCellTexts("A1:E11"));
+ }
+
+ /**
+ *
+ * Verify Var Sample function in SubTotals
+ */
+ @Test
+ public void testVarSample() {
+ SCCalcSubTotalForColumns.click(10, 45);
+ SCCalcSubTotolsFuncionList.select("Var (Sample)");
+ SCSubTotalsGroup1Dialog.ok();
+ sleep(1);
+
+ assertArrayEquals("Subtotal table", 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", "", "" } }, CalcUtil.getCellTexts("A1:E11"));
+ }
+
+ /**
+ *
+ * Verify Don't sort in Sub totals
+ */
+ @Test
+ public void testDoNotSortOption() {
+ SCSubTotalsGroupByListBox.select("Team");
+ SCCalcSubTotalForColumns.click(10, 25);
+ SCSubTotalsOptionsTabPage.select();
+ SCSubtotalsPreSortToGroupCheckBox.uncheck();
+ SCSubTotalsOptionsTabPage.ok();
+ sleep(1);
+
+ assertArrayEquals("Subtotal table", 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", "" } }, CalcUtil.getCellTexts("A1:E12"));
+ }
+
+ /**
+ *
+ * Verify SubTotals Options default UI
+ */
+ @Test
+ public void testDefaultUI() {
+ 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());
+ SCSubTotalsOptionsTabPage.ok();
+ }
+
+ /**
+ *
+ * Verify Subtotals using all group
+ */
+ @Test
+ public void testUsingAllGroup() {
+ SCSubTotalsGroup1Dialog.select();
+ SCSubTotalsGroupByListBox.select("Level");
+ SCCalcSubTotalForColumns.click(10, 45);
+ SCSubTotalsGroup2Dialog.select();
+ SCSubTotalsGroupByListBox.select("Team");
+ SCCalcSubTotalForColumns.click(10, 25);
+ SCCalcSubTotolsFuncionList.select("Max");
+ SCSubTotalsGroup3Dialog.select();
+ SCSubTotalsGroupByListBox.select("Name");
+ SCCalcSubTotalForColumns.click(10, 25);
+ SCSubTotalsGroup1Dialog.select();
+ SCSubTotalsGroup1Dialog.ok();
+ sleep(1);
+
+ assertArrayEquals("Subtotal table", 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", "", "" }, { "MS", "10", "1", "A", "Joker" }, { "", "10", "", "", "Joker Sum" }, { "", "10", "", "A Max", "" },
+ { "MS", "10", "3", "B", "Kevin" }, { "", "10", "", "", "Kevin Sum" }, { "", "10", "", "B Max", "" }, { "MS Sum", "", "4", "", "" },
+ { "Grand Total", "", "21", "", "" } }, CalcUtil.getCellTexts("A1:E23"));
+ }
+
+
+ /**
+ *
+ * Verify Subtotals_Recalculate and refresh results when data rows deleted.
+ */
+ @Test
+ public void testRecalculateAfterRowDeleted() {
+ SCCalcSubTotalForColumns.click(10,45);
+ SCSubTotalsGroup1Dialog.ok();
+ sleep(1);
+
+ assertArrayEquals("Subtotal table 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", "", "" } }, CalcUtil.getCellTexts("A1:E11"));
+
+ CalcUtil.selectRange("A3:E3");
+ calc.menuItem("Edit->Delete Cells...").select();
+ SCDeleteCellsDeleteRowsRadioButton.check();
+ SCDeleteCellsDialog.ok();
+ sleep(1);
+
+ assertArrayEquals("Subtotal table 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", "", "" },
+ { "", "", "", "", "" } }, CalcUtil.getCellTexts("A1:E11"));
+
+ }
+
+ /**
+ *
+ * Verify Recalculates when source data changed with Average function in SubTotals
+ */
+ @Test
+ public void testRecalculateWhenDataChanged() {
+ SCSubTotalsGroupByListBox.select("Team");
+ SCCalcSubTotalForColumns.click(10,25);
+ SCCalcSubTotolsFuncionList.select("Average");
+ SCSubTotalsGroup1Dialog.ok();
+ sleep(1);
+
+ CalcUtil.selectRange("B4");
+ typeKeys("40" + "<enter>");
+ sleep(1);
+ assertEquals("30",CalcUtil.getCellText("B5"));
+ assertEquals("23.33333333",CalcUtil.getCellText("B11"));
+
+ CalcUtil.selectRange("B7");
+ typeKeys("50" + "<enter>");
+ sleep(1);
+ assertEquals("35",CalcUtil.getCellText("B8"));
+ assertEquals("30",CalcUtil.getCellText("B11"));
+
+ CalcUtil.selectRange("B9");
+ typeKeys("30" + "<enter>");
+ sleep(1);
+ assertEquals("30",CalcUtil.getCellText("B10"));
+ assertEquals("31.66666667",CalcUtil.getCellText("B11"));
+ }
+}
diff --git a/test/testoo/src/testcase/sc/subtotals/SubtotalsNoColumnSelectedForGroupBy.java b/test/testoo/src/testcase/sc/subtotals/SubtotalsNoColumnSelectedForGroupBy.java
deleted file mode 100644
index 816848ac2021..000000000000
--- a/test/testoo/src/testcase/sc/subtotals/SubtotalsNoColumnSelectedForGroupBy.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/**************************************************************
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- *************************************************************/
-
-
-
-package testcase.sc.subtotals;
-
-import static testlib.AppUtil.*;
-import static testlib.UIMap.*;
-
-import java.awt.Rectangle;
-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.Test;
-import org.openoffice.test.common.FileUtil;
-import org.openoffice.test.common.GraphicsUtil;
-
-import testlib.CalcUtil;
-import testlib.Log;
-
-public class SubtotalsNoColumnSelectedForGroupBy {
- /**
- * TestCapture helps us to do 1. Take a screenshot when failure occurs. 2.
- * Collect extra data when OpenOffice crashes.
- */
- @Rule
- public Log LOG = new Log();
-
- /**
- * initApp helps us to do 1. Patch the OpenOffice to enable automation if
- * necessary. 2. Start OpenOffice with automation enabled if necessary. 3.
- * Reset OpenOffice to startcenter.
- *
- * @throws java.lang.Exception
- */
- @Before
- public void setUp() throws Exception {
- initApp();
- }
- /**
- *
- * Verify Subtotals_No column selected for Group by.
- */
- @Test
- public void test() {
- String file = testFile("sc/SubtotalsSampleFile.ods");
- startcenter.menuItem("File->Open...").select();
- submitOpenDlg(file);
- sleep(2);
- String[][] Expect = CalcUtil.getCellTexts("A1:E7");
- CalcUtil.selectRange("A1:E7");
- calc.menuItem("Data->Subtotals...").select();
- sleep(1);
-
- assertTrue(SCSubTotalsGroup1Dialog.exists());
- assertEquals("- none -",SCSubTotalsGroupByListBox.getItemText(0));
- assertEquals("Level",SCSubTotalsGroupByListBox.getItemText(1));
- assertEquals("Code",SCSubTotalsGroupByListBox.getItemText(2));
- assertEquals("No.",SCSubTotalsGroupByListBox.getItemText(3));
- assertEquals("Team",SCSubTotalsGroupByListBox.getItemText(4));
- assertEquals("Name",SCSubTotalsGroupByListBox.getItemText(5));
- SCSubTotalsGroupByListBox.select(0);
- sleep(1);
-
- SCSubTotalsGroup1Dialog.ok();
- extracted(Expect);
- }
- private void extracted(String[][] Expect) {
- CalcUtil.getCellTexts("A1:E7");
- }
-
-}
diff --git a/test/testoo/src/testcase/sc/subtotals/SubtotalsOptionsSortDoNotSort.java b/test/testoo/src/testcase/sc/subtotals/SubtotalsOptionsSortDoNotSort.java
deleted file mode 100644
index 2df936e536ec..000000000000
--- a/test/testoo/src/testcase/sc/subtotals/SubtotalsOptionsSortDoNotSort.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/**************************************************************
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- *************************************************************/
-
-
-
-package testcase.sc.subtotals;
-
-import static testlib.AppUtil.*;
-import static testlib.UIMap.*;
-
-import java.awt.Rectangle;
-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.Test;
-import org.openoffice.test.common.FileUtil;
-import org.openoffice.test.common.GraphicsUtil;
-
-import testlib.CalcUtil;
-import testlib.Log;
-
-
-public class SubtotalsOptionsSortDoNotSort {
- /**
- * TestCapture helps us to do 1. Take a screenshot when failure occurs. 2.
- * Collect extra data when OpenOffice crashes.
- */
- @Rule
- public Log LOG = new Log();
-
- /**
- * initApp helps us to do 1. Patch the OpenOffice to enable automation if
- * necessary. 2. Start OpenOffice with automation enabled if necessary. 3.
- * Reset OpenOffice to startcenter.
- *
- * @throws java.lang.Exception
- */
- @Before
- public void setUp() throws Exception {
- initApp();
- }
- /**
- *
- * Verify Don't sort in Sub totals
- */
- @Test
- public void test() {
- String file = testFile("sc/SubtotalsSampleFile.ods");
- startcenter.menuItem("File->Open...").select();
- submitOpenDlg(file);
- sleep(2);
- CalcUtil.selectRange("A1:E7");
- calc.menuItem("Data->Subtotals...").select();
- sleep(1);
-
- assertTrue(SCSubTotalsGroup1Dialog.exists());
- assertEquals("- none -",SCSubTotalsGroupByListBox.getItemText(0));
- assertEquals("Level",SCSubTotalsGroupByListBox.getItemText(1));
- assertEquals("Code",SCSubTotalsGroupByListBox.getItemText(2));
- assertEquals("No.",SCSubTotalsGroupByListBox.getItemText(3));
- assertEquals("Team",SCSubTotalsGroupByListBox.getItemText(4));
- assertEquals("Name",SCSubTotalsGroupByListBox.getItemText(5));
-
- SCSubTotalsGroupByListBox.select("Team");
- sleep(1);
- SCCalcSubTotalForColumns.click(10,25);
- sleep(1);
-
- SCSubTotalsOptionsTabPage.select();
- SCSubtotalsPreSortToGroupCheckBox.uncheck();
- SCSubTotalsGroup1Dialog .select();
- SCSubTotalsGroup1Dialog .ok();
- sleep(1);
-
- assertEquals("20",CalcUtil.getCellText("B3"));
- assertEquals("=SUBTOTAL(9;$B$2:$B$2)",CalcUtil.getCellInput("B3"));
- assertEquals("B Sum",CalcUtil.getCellText("D3"));
-
- assertEquals("20",CalcUtil.getCellText("B5"));
- assertEquals("=SUBTOTAL(9;$B$4:$B$4)",CalcUtil.getCellInput("B5"));
- assertEquals("C Sum",CalcUtil.getCellText("D5"));
-
- assertEquals("60",CalcUtil.getCellText("B9"));
- assertEquals("=SUBTOTAL(9;$B$6:$B$8)",CalcUtil.getCellInput("B9"));
- assertEquals("A Sum",CalcUtil.getCellText("D9"));
-
- assertEquals("10",CalcUtil.getCellText("B11"));
- assertEquals("=SUBTOTAL(9;$B$10:$B$10)",CalcUtil.getCellInput("B11"));
- assertEquals("B Sum",CalcUtil.getCellText("D11"));
-
- assertEquals("110",CalcUtil.getCellText("B12"));
- assertEquals("=SUBTOTAL(9;$B$2:$B$11)",CalcUtil.getCellInput("B12"));
- assertEquals("Grand Total",CalcUtil.getCellText("D12"));
- }
-
-}
diff --git a/test/testoo/src/testcase/sc/subtotals/SubtotalsRecalculateRefreshAfterSourceRowDeleted.java b/test/testoo/src/testcase/sc/subtotals/SubtotalsRecalculateRefreshAfterSourceRowDeleted.java
deleted file mode 100644
index 04c586ddc55a..000000000000
--- a/test/testoo/src/testcase/sc/subtotals/SubtotalsRecalculateRefreshAfterSourceRowDeleted.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/**************************************************************
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- *************************************************************/
-
-
-
-package testcase.sc.subtotals;
-
-import static testlib.AppUtil.*;
-import static testlib.UIMap.*;
-
-import java.awt.Rectangle;
-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.Test;
-import org.openoffice.test.common.FileUtil;
-import org.openoffice.test.common.GraphicsUtil;
-
-import testlib.CalcUtil;
-import testlib.Log;
-
-public class SubtotalsRecalculateRefreshAfterSourceRowDeleted {
- /**
- * TestCapture helps us to do 1. Take a screenshot when failure occurs. 2.
- * Collect extra data when OpenOffice crashes.
- */
- @Rule
- public Log LOG = new Log();
-
- /**
- * initApp helps us to do 1. Patch the OpenOffice to enable automation if
- * necessary. 2. Start OpenOffice with automation enabled if necessary. 3.
- * Reset OpenOffice to startcenter.
- *
- * @throws java.lang.Exception
- */
- @Before
- public void setUp() throws Exception {
- initApp();
- }
- /**
- *
- * Verify Subtotals_Recalculate and refresh results when data rows deleted.
- */
- @Test
- public void test() {
- String file = testFile("sc/SubtotalsSampleFile.ods");
- startcenter.menuItem("File->Open...").select();
- submitOpenDlg(file);
- sleep(2);
- CalcUtil.selectRange("A1:E7");
- calc.menuItem("Data->Subtotals...").select();
- sleep(1);
-
- assertTrue(SCSubTotalsGroup1Dialog.exists());
- assertEquals("- none -",SCSubTotalsGroupByListBox.getItemText(0));
- assertEquals("Level",SCSubTotalsGroupByListBox.getItemText(1));
- assertEquals("Code",SCSubTotalsGroupByListBox.getItemText(2));
- assertEquals("No.",SCSubTotalsGroupByListBox.getItemText(3));
- assertEquals("Team",SCSubTotalsGroupByListBox.getItemText(4));
- assertEquals("Name",SCSubTotalsGroupByListBox.getItemText(5));
-
- SCCalcSubTotalForColumns.click(10,45);
- sleep(1);
- SCSubTotalsGroup1Dialog.ok();
- sleep(1);
-
- assertEquals("BS Sum",CalcUtil.getCellText("A5"));
- assertEquals("=SUBTOTAL(9;$C$2:$C$4)",CalcUtil.getCellInput("C5"));
- assertEquals("12",CalcUtil.getCellText("C5"));
-
- assertEquals("CS Sum",CalcUtil.getCellText("A7"));
- assertEquals("=SUBTOTAL(9;$C$6:$C$6)",CalcUtil.getCellInput("C7"));
- assertEquals("5",CalcUtil.getCellText("C7"));
-
- assertEquals("MS Sum",CalcUtil.getCellText("A10"));
- assertEquals("=SUBTOTAL(9;$C$8:$C$9)",CalcUtil.getCellInput("C10"));
- assertEquals("4",CalcUtil.getCellText("C10"));
-
- assertEquals("Grand Total",CalcUtil.getCellText("A11"));
- assertEquals("=SUBTOTAL(9;$C$2:$C$10)",CalcUtil.getCellInput("C11"));
- assertEquals("21",CalcUtil.getCellText("C11"));
-
- CalcUtil.selectRange("A3:E3");
- calc.menuItem("Edit->Delete Cells...").select();
- SCDeleteCellsDeleteRowsRadioButton.check();
- SCDeleteCellsDialog.ok();
- sleep(1);
-
- assertEquals("BS Sum",CalcUtil.getCellText("A4"));
- assertEquals("=SUBTOTAL(9;$C$2:$C$3)",CalcUtil.getCellInput("C4"));
- assertEquals("6",CalcUtil.getCellText("C4"));
-
- assertEquals("CS Sum",CalcUtil.getCellText("A6"));
- assertEquals("=SUBTOTAL(9;$C$5:$C$5)",CalcUtil.getCellInput("C6"));
- assertEquals("5",CalcUtil.getCellText("C6"));
-
- assertEquals("MS Sum",CalcUtil.getCellText("A9"));
- assertEquals("=SUBTOTAL(9;$C$7:$C$8)",CalcUtil.getCellInput("C9"));
- assertEquals("4",CalcUtil.getCellText("C9"));
-
- assertEquals("Grand Total",CalcUtil.getCellText("A10"));
- assertEquals("=SUBTOTAL(9;$C$2:$C$9)",CalcUtil.getCellInput("C10"));
- assertEquals("15",CalcUtil.getCellText("C10"));
-
- }
-
-}
diff --git a/test/testoo/src/testcase/sc/subtotals/SubtotalsRecalculatesWhenSourceDataChanged.java b/test/testoo/src/testcase/sc/subtotals/SubtotalsRecalculatesWhenSourceDataChanged.java
deleted file mode 100644
index ffb042f970e9..000000000000
--- a/test/testoo/src/testcase/sc/subtotals/SubtotalsRecalculatesWhenSourceDataChanged.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/**************************************************************
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- *************************************************************/
-
-
-
-package testcase.sc.subtotals;
-
-import static testlib.AppUtil.*;
-import static testlib.UIMap.*;
-
-import java.awt.Rectangle;
-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.Test;
-import org.openoffice.test.common.FileUtil;
-import org.openoffice.test.common.GraphicsUtil;
-
-import testlib.CalcUtil;
-import testlib.Log;
-
-
-public class SubtotalsRecalculatesWhenSourceDataChanged {
- /**
- * TestCapture helps us to do 1. Take a screenshot when failure occurs. 2.
- * Collect extra data when OpenOffice crashes.
- */
- @Rule
- public Log LOG = new Log();
-
- /**
- * initApp helps us to do 1. Patch the OpenOffice to enable automation if
- * necessary. 2. Start OpenOffice with automation enabled if necessary. 3.
- * Reset OpenOffice to startcenter.
- *
- * @throws java.lang.Exception
- */
- @Before
- public void setUp() throws Exception {
- initApp();
- }
- /**
- *
- * Verify Recalculates when source data changed with Average function in SubTotals
- */
- @Test
- public void test() {
- String file = testFile("sc/SubtotalsSampleFile.ods");
- startcenter.menuItem("File->Open...").select();
- submitOpenDlg(file);
- sleep(2);
- CalcUtil.selectRange("A1:E7");
- calc.menuItem("Data->Subtotals...").select();
-
- assertTrue(SCSubTotalsGroup1Dialog.exists());
- assertEquals("- none -",SCSubTotalsGroupByListBox.getItemText(0));
- assertEquals("Level",SCSubTotalsGroupByListBox.getItemText(1));
- assertEquals("Code",SCSubTotalsGroupByListBox.getItemText(2));
- assertEquals("No.",SCSubTotalsGroupByListBox.getItemText(3));
- assertEquals("Team",SCSubTotalsGroupByListBox.getItemText(4));
- assertEquals("Name",SCSubTotalsGroupByListBox.getItemText(5));
-
-
- SCSubTotalsGroupByListBox.select("Team");
- sleep(1);
- SCCalcSubTotalForColumns.click(10,25);
- sleep(1);
- typeKeys("<tab>");
- typeKeys("<down>");
- typeKeys("<down>");
- sleep(1);
- SCSubTotalsGroup1Dialog.ok();
- sleep(1);
-
- assertEquals("20",CalcUtil.getCellText("B5"));
- assertEquals("=SUBTOTAL(1;$B$2:$B$4)",CalcUtil.getCellInput("B5"));
- assertEquals("A Average",CalcUtil.getCellText("D5"));
-
- assertEquals("15",CalcUtil.getCellText("B8"));
- assertEquals("=SUBTOTAL(1;$B$6:$B$7)",CalcUtil.getCellInput("B8"));
- assertEquals("B Average",CalcUtil.getCellText("D8"));
-
- assertEquals("20",CalcUtil.getCellText("B10"));
- assertEquals("=SUBTOTAL(1;$B$9:$B$9)",CalcUtil.getCellInput("B10"));
- assertEquals("C Average",CalcUtil.getCellText("D10"));
-
- assertEquals("18.33333333",CalcUtil.getCellText("B11"));
- assertEquals("=SUBTOTAL(1;$B$2:$B$10)",CalcUtil.getCellInput("B11"));
- assertEquals("Grand Total",CalcUtil.getCellText("D11"));
-
- CalcUtil.selectRange("B4");
- typeKeys("40" + "<enter>");
- sleep(1);
- assertEquals("30",CalcUtil.getCellText("B5"));
- assertEquals("23.33333333",CalcUtil.getCellText("B11"));
-
- CalcUtil.selectRange("B7");
- typeKeys("50" + "<enter>");
- sleep(1);
- assertEquals("35",CalcUtil.getCellText("B8"));
- assertEquals("30",CalcUtil.getCellText("B11"));
-
- CalcUtil.selectRange("B9");
- typeKeys("30" + "<enter>");
- sleep(1);
- assertEquals("30",CalcUtil.getCellText("B10"));
- assertEquals("31.66666667",CalcUtil.getCellText("B11"));
- }
-
-}
diff --git a/test/testoo/src/testcase/sc/subtotals/SubtotalsUIOptionsDefaultStatus.java b/test/testoo/src/testcase/sc/subtotals/SubtotalsUIOptionsDefaultStatus.java
deleted file mode 100644
index 5c3056ea0a47..000000000000
--- a/test/testoo/src/testcase/sc/subtotals/SubtotalsUIOptionsDefaultStatus.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/**************************************************************
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- *************************************************************/
-
-
-
-package testcase.sc.subtotals;
-
-import static testlib.AppUtil.*;
-import static testlib.UIMap.*;
-
-import java.awt.Rectangle;
-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.Test;
-import org.openoffice.test.common.FileUtil;
-import org.openoffice.test.common.GraphicsUtil;
-
-import testlib.CalcUtil;
-import testlib.Log;
-
-public class SubtotalsUIOptionsDefaultStatus {
- /**
- * TestCapture helps us to do 1. Take a screenshot when failure occurs. 2.
- * Collect extra data when OpenOffice crashes.
- */
- @Rule
- public Log LOG = new Log();
-
- /**
- * initApp helps us to do 1. Patch the OpenOffice to enable automation if
- * necessary. 2. Start OpenOffice with automation enabled if necessary. 3.
- * Reset OpenOffice to startcenter.
- *
- * @throws java.lang.Exception
- */
- @Before
- public void setUp() throws Exception {
- initApp();
- }
- /**
- *
- * Verify SubTotals Options default UI
- */
- @Test
- public void test() {
- String file = testFile("sc/SubtotalsSampleFile.ods");
- startcenter.menuItem("File->Open...").select();
- submitOpenDlg(file);
- sleep(2);
- CalcUtil.selectRange("A1:E7");
- calc.menuItem("Data->Subtotals...").select();
-
- assertTrue(SCSubTotalsGroup1Dialog.exists());
- assertEquals("- none -",SCSubTotalsGroupByListBox.getItemText(0));
- assertEquals("Level",SCSubTotalsGroupByListBox.getItemText(1));
- assertEquals("Code",SCSubTotalsGroupByListBox.getItemText(2));
- assertEquals("No.",SCSubTotalsGroupByListBox.getItemText(3));
- assertEquals("Team",SCSubTotalsGroupByListBox.getItemText(4));
- assertEquals("Name",SCSubTotalsGroupByListBox.getItemText(5));
- SCSubTotalsOptionsTabPage.select();
- sleep(1);
-
- assertFalse(SCSubtotalsInsertPageBreakCheckBox.isChecked());
- assertFalse(SCSubtotalsCaseSensitiveCheckBox.isChecked());
- assertTrue(SCSubtotalsPreSortToGroupCheckBox.isChecked());
- assertTrue(SCSubtotalSortAscendingRadioButton.isChecked());
- assertFalse(SCSubtotalSortDescendingRadioButton.isChecked());
- assertFalse(SCSubtotalsIncludeFormatsCheckBox.isChecked());
- assertFalse(SCSubtotalsCustomSortOrderCheckBox.isChecked());
- assertFalse(SCSubtotalsCustomSortListBox.isEnabled());
- sleep(1);
- SCSubTotalsGroup1Dialog.select();
- sleep(1);
- SCSubTotalsGroup1Dialog.ok();
-
- }
-
-}
diff --git a/test/testoo/src/testcase/sc/subtotals/SubtotalsUsingAllGroup.java b/test/testoo/src/testcase/sc/subtotals/SubtotalsUsingAllGroup.java
deleted file mode 100644
index 537b7cc2ffa5..000000000000
--- a/test/testoo/src/testcase/sc/subtotals/SubtotalsUsingAllGroup.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/**************************************************************
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- *************************************************************/
-
-
-
-package testcase.sc.subtotals;
-
-import static testlib.AppUtil.*;
-import static testlib.UIMap.*;
-
-import java.awt.Rectangle;
-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.Test;
-import org.openoffice.test.common.FileUtil;
-import org.openoffice.test.common.GraphicsUtil;
-
-import testlib.CalcUtil;
-import testlib.Log;
-
-public class SubtotalsUsingAllGroup {
- /**
- * TestCapture helps us to do 1. Take a screenshot when failure occurs. 2.
- * Collect extra data when OpenOffice crashes.
- */
- @Rule
- public Log LOG = new Log();
-
- /**
- * initApp helps us to do 1. Patch the OpenOffice to enable automation if
- * necessary. 2. Start OpenOffice with automation enabled if necessary. 3.
- * Reset OpenOffice to startcenter.
- *
- * @throws java.lang.Exception
- */
- @Before
- public void setUp() throws Exception {
- initApp();
- }
- /**
- *
- * Verify Subtotals using all group
- */
- @Test
- public void test() {
- String file = testFile("sc/SubtotalsSampleFile.ods");
- startcenter.menuItem("File->Open...").select();
- submitOpenDlg(file);
- sleep(2);
- CalcUtil.selectRange("A1:E7");
- calc.menuItem("Data->Subtotals...").select();
- sleep(1);
-
- assertTrue(SCSubTotalsGroup1Dialog.exists());
- assertEquals("- none -",SCSubTotalsGroupByListBox.getItemText(0));
- assertEquals("Level",SCSubTotalsGroupByListBox.getItemText(1));
- assertEquals("Code",SCSubTotalsGroupByListBox.getItemText(2));
- assertEquals("No.",SCSubTotalsGroupByListBox.getItemText(3));
- assertEquals("Team",SCSubTotalsGroupByListBox.getItemText(4));
- assertEquals("Name",SCSubTotalsGroupByListBox.getItemText(5));
-
- SCSubTotalsGroup1Dialog.select();
- SCSubTotalsGroupByListBox.select("Level");
- SCCalcSubTotalForColumns.click(10,45);
- sleep(1);
-
- SCSubTotalsGroup2Dialog.select();
- SCSubTotalsGroupByListBox.select("Team");
- SCCalcSubTotalForColumns.click(10,25);
- SCCalcSubTotolsFuncionList.click(15,60);
- sleep(1);
-
- SCSubTotalsGroup3Dialog.select();
- SCSubTotalsGroupByListBox.select("Name");
- SCCalcSubTotalForColumns.click(10,25);
- sleep(1);
-
- SCSubTotalsGroup1Dialog.select();
- SCSubTotalsGroup1Dialog.ok();
- sleep(1);
-
- assertEquals("20",CalcUtil.getCellText("B3"));
- assertEquals("=SUBTOTAL(9;$B$2:$B$2)",CalcUtil.getCellInput("B3"));
- assertEquals("Chcomic Sum",CalcUtil.getCellText("E3"));
-
- assertEquals("20",CalcUtil.getCellText("B4"));
- assertEquals("=SUBTOTAL(4;$B$2:$B$3)",CalcUtil.getCellInput("B4"));
- assertEquals("A Max",CalcUtil.getCellText("D4"));
-
- assertEquals("20",CalcUtil.getCellText("B6"));
- assertEquals("=SUBTOTAL(9;$B$5:$B$5)",CalcUtil.getCellInput("B6"));
- assertEquals("Elle Sum",CalcUtil.getCellText("E6"));
-
- assertEquals("20",CalcUtil.getCellText("B7"));
- assertEquals("=SUBTOTAL(4;$B$5:$B$6)",CalcUtil.getCellInput("B7"));
- assertEquals("B Max",CalcUtil.getCellText("D7"));
-
- assertEquals("20",CalcUtil.getCellText("B9"));
- assertEquals("=SUBTOTAL(9;$B$8:$B$8)",CalcUtil.getCellInput("B9"));
- assertEquals("Sweet Sum",CalcUtil.getCellText("E9"));
-
- assertEquals("20",CalcUtil.getCellText("B10"));
- assertEquals("=SUBTOTAL(4;$B$8:$B$9)",CalcUtil.getCellInput("B10"));
- assertEquals("C Max",CalcUtil.getCellText("D10"));
-
- assertEquals("12",CalcUtil.getCellText("C11"));
- assertEquals("=SUBTOTAL(9;$C$2:$C$10)",CalcUtil.getCellInput("C11"));
- assertEquals("BS Sum",CalcUtil.getCellText("A11"));
-
- assertEquals("30",CalcUtil.getCellText("B13"));
- assertEquals("=SUBTOTAL(9;$B$12:$B$12)",CalcUtil.getCellInput("B13"));
- assertEquals("Ally Sum",CalcUtil.getCellText("E13"));
-
- assertEquals("30",CalcUtil.getCellText("B14"));
- assertEquals("=SUBTOTAL(4;$B$12:$B$13)",CalcUtil.getCellInput("B14"));
- assertEquals("A Max",CalcUtil.getCellText("D14"));
-
- assertEquals("5",CalcUtil.getCellText("C15"));
- assertEquals("=SUBTOTAL(9;$C$12:$C$14)",CalcUtil.getCellInput("C15"));
- assertEquals("CS Sum",CalcUtil.getCellText("A15"));
-
- assertEquals("10",CalcUtil.getCellText("B17"));
- assertEquals("=SUBTOTAL(9;$B$16:$B$16)",CalcUtil.getCellInput("B17"));
- assertEquals("Joker Sum",CalcUtil.getCellText("E17"));
-
- assertEquals("10",CalcUtil.getCellText("B18"));
- assertEquals("=SUBTOTAL(4;$B$16:$B$17)",CalcUtil.getCellInput("B18"));
- assertEquals("A Max",CalcUtil.getCellText("D18"));
-
- assertEquals("10",CalcUtil.getCellText("B20"));
- assertEquals("=SUBTOTAL(9;$B$19:$B$19)",CalcUtil.getCellInput("B20"));
- assertEquals("Kevin Sum",CalcUtil.getCellText("E20"));
-
- assertEquals("10",CalcUtil.getCellText("B21"));
- assertEquals("=SUBTOTAL(4;$B$19:$B$20)",CalcUtil.getCellInput("B21"));
- assertEquals("B Max",CalcUtil.getCellText("D21"));
-
- assertEquals("4",CalcUtil.getCellText("C22"));
- assertEquals("=SUBTOTAL(9;$C$16:$C$21)",CalcUtil.getCellInput("C22"));
- assertEquals("MS Sum",CalcUtil.getCellText("A22"));
-
- assertEquals("21",CalcUtil.getCellText("C23"));
- assertEquals("=SUBTOTAL(9;$C$2:$C$22)",CalcUtil.getCellInput("C23"));
- assertEquals("Grand Total",CalcUtil.getCellText("A23"));
- }
-
-}