diff options
Diffstat (limited to 'qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupItemObj.java')
-rw-r--r-- | qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupItemObj.java | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupItemObj.java b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupItemObj.java index 7ef352c94d2a..c011619a0687 100644 --- a/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupItemObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupItemObj.java @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -61,13 +61,13 @@ import util.SOfficeFactory; public class ScDataPilotFieldGroupItemObj extends TestCase { static XSpreadsheetDocument xSheetDoc = null; - + /** * A field is filled some values. This integer determines the size of the * field in x and y direction. */ private int mMaxFieldIndex = 6; - + /** * Creates Spreadsheet document. */ @@ -75,7 +75,7 @@ public class ScDataPilotFieldGroupItemObj extends TestCase { SOfficeFactory SOF = SOfficeFactory.getFactory ( (XMultiServiceFactory) tParam.getMSF ()); - + try { log.println ("creating a Spreadsheet document"); @@ -88,30 +88,30 @@ public class ScDataPilotFieldGroupItemObj extends TestCase throw new StatusException ("Couldn't create document", e); } } - + /** * Disposes Spreadsheet document. */ protected void cleanup (TestParameters tParam, PrintWriter log) { log.println (" disposing xSheetDoc "); - + XComponent oComp = (XComponent) UnoRuntime.queryInterface ( XComponent.class, xSheetDoc); util.DesktopTools.closeDoc (oComp); } - + protected synchronized TestEnvironment createTestEnvironment (TestParameters Param, PrintWriter log) { XInterface oObj = null; XInterface datapilotfield = null; XInterface groups = null; - + // creation of testobject here // first we write what we are intend to do to log file log.println ("Creating a test environment"); - + // the cell range CellRangeAddress sCellRangeAdress = new CellRangeAddress (); sCellRangeAdress.Sheet = 0; @@ -119,21 +119,21 @@ public class ScDataPilotFieldGroupItemObj extends TestCase sCellRangeAdress.StartRow = 0; sCellRangeAdress.EndColumn = mMaxFieldIndex - 1; sCellRangeAdress.EndRow = mMaxFieldIndex - 1; - + // position of the data pilot table CellAddress sCellAdress = new CellAddress (); sCellAdress.Sheet = 0; sCellAdress.Column = 7; sCellAdress.Row = 8; - + log.println ("Getting a sheet"); - + XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets (); XSpreadsheet oSheet = null; XSpreadsheet oSheet2 = null; XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface ( XIndexAccess.class, xSpreadsheets); - + try { oSheet = (XSpreadsheet) AnyConverter.toObject ( @@ -158,11 +158,11 @@ public class ScDataPilotFieldGroupItemObj extends TestCase e.printStackTrace (); throw new StatusException ("Couldn't get a spreadsheet", e); } - + try { log.println ("Filling a table"); - + for (int i = 1; i < mMaxFieldIndex; i++) { oSheet.getCellByPosition (i, 0).setFormula ("Col" + i); @@ -170,7 +170,7 @@ public class ScDataPilotFieldGroupItemObj extends TestCase oSheet2.getCellByPosition (i, 0).setFormula ("Col" + i); oSheet2.getCellByPosition (0, i).setFormula ("Row" + i); } - + for (int i = 1; i < mMaxFieldIndex; i++) { for (int j = 1; j < mMaxFieldIndex; j++) @@ -179,35 +179,35 @@ public class ScDataPilotFieldGroupItemObj extends TestCase oSheet2.getCellByPosition (i, j).setValue (i * (j + 2)); } } - + oSheet.getCellByPosition (1, 1).setFormula ("aName"); oSheet.getCellByPosition (1, 2).setFormula ("otherName"); oSheet.getCellByPosition (1, 3).setFormula ("una"); oSheet.getCellByPosition (1, 4).setFormula ("otherName"); oSheet.getCellByPosition (1, 5).setFormula ("somethingelse"); - + } catch (com.sun.star.lang.IndexOutOfBoundsException e) { e.printStackTrace (); throw new StatusException ("Couldn't fill some cells", e); } - + // change a value of a cell and check the change in the data pilot // (for the XDataPilotTable.refresh() test) Object oChangeCell = null; Object oCheckCell = null; Integer aChangeValue = null; - + try { // cell of data oChangeCell = oSheet.getCellByPosition (1, 5); - + int x = sCellAdress.Column; int y = sCellAdress.Row + 3; - - + + // cell of the data pilot output oCheckCell = oSheet.getCellByPosition (x, y); aChangeValue = new Integer (27); @@ -217,20 +217,20 @@ public class ScDataPilotFieldGroupItemObj extends TestCase e.printStackTrace (); throw new StatusException ("Couldn't get cells for changeing.", e); } - - + + // create the test objects log.println ("Getting test objects"); - + XDataPilotTablesSupplier DPTS = (XDataPilotTablesSupplier) UnoRuntime.queryInterface ( XDataPilotTablesSupplier.class, oSheet); XDataPilotTables DPT = DPTS.getDataPilotTables (); XDataPilotDescriptor DPDsc = DPT.createDataPilotDescriptor (); DPDsc.setSourceRange (sCellRangeAdress); - - XPropertySet fieldPropSet = null; - + + XPropertySet fieldPropSet = null; + try { Object oDataPilotField = DPDsc.getDataPilotFields ().getByIndex (0); @@ -276,14 +276,14 @@ public class ScDataPilotFieldGroupItemObj extends TestCase e.printStackTrace (); throw new StatusException ("Couldn't create a test environment", e); } - + log.println ("Insert the DataPilotTable"); - + if (DPT.hasByName ("DataPilotTable")) { DPT.removeByName ("DataPilotTable"); } - + DPT.insertNewByName ("DataPilotTable", sCellAdress, DPDsc); XIndexAccess xIA = (XIndexAccess) UnoRuntime.queryInterface (XIndexAccess.class,DPTS.getDataPilotTables ()); XIndexAccess IA = null; @@ -311,7 +311,7 @@ public class ScDataPilotFieldGroupItemObj extends TestCase e.printStackTrace (); throw new StatusException ("Couldn't get data pilot field", e); } - + try { XDataPilotFieldGrouping dpfg = (XDataPilotFieldGrouping) UnoRuntime.queryInterface (XDataPilotFieldGrouping.class, datapilotfield); @@ -333,7 +333,7 @@ public class ScDataPilotFieldGroupItemObj extends TestCase { e.printStackTrace (); throw new StatusException ("Couldn't get data pilot field", e); - } + } for (int i=0;i<IA.getCount ();i++) { datapilotfield = (XInterface) AnyConverter.toObject ( @@ -348,7 +348,7 @@ public class ScDataPilotFieldGroupItemObj extends TestCase } } groups = dpgi.Groups; - XIndexAccess groupAccess = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, groups); + XIndexAccess groupAccess = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, groups); XNameAccess groupNames = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, groupAccess.getByIndex(0)); oObj = (XInterface) UnoRuntime.queryInterface(XInterface.class, groupNames.getByName("aName")); } @@ -356,16 +356,16 @@ public class ScDataPilotFieldGroupItemObj extends TestCase { e.printStackTrace (); } - + log.println ("Creating object - " + ((oObj == null) ? "FAILED" : "OK")); - + TestEnvironment tEnv = new TestEnvironment (oObj); - + log.println ("Implementationname: " + util.utils.getImplName (oObj)); - + // Other parameters required for interface tests return tEnv; } - + } |