summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
Diffstat (limited to 'sc/qa')
-rwxr-xr-xsc/qa/complex/calcPreview/ViewForwarder.java1057
-rwxr-xr-xsc/qa/complex/calcPreview/makefile.mk93
-rwxr-xr-xsc/qa/complex/calcPreview/test_documents/calcshapes.sxcbin0 -> 13030 bytes
-rwxr-xr-xsc/qa/complex/cellRanges/CheckXCellRangesQuery.java229
-rwxr-xr-xsc/qa/complex/cellRanges/makefile.mk77
-rw-r--r--sc/qa/complex/dataPilot/CheckDataPilot.java329
-rw-r--r--sc/qa/complex/dataPilot/interfaceTests/beans/_XPropertySet.java631
-rw-r--r--sc/qa/complex/dataPilot/interfaceTests/beans/makefile.mk46
-rw-r--r--sc/qa/complex/dataPilot/interfaceTests/container/_XNamed.java147
-rw-r--r--sc/qa/complex/dataPilot/interfaceTests/container/makefile.mk46
-rw-r--r--sc/qa/complex/dataPilot/interfaceTests/sheet/_XDataPilotDescriptor.java449
-rw-r--r--sc/qa/complex/dataPilot/interfaceTests/sheet/_XDataPilotTable.java133
-rw-r--r--sc/qa/complex/dataPilot/interfaceTests/sheet/makefile.mk46
-rw-r--r--sc/qa/complex/dataPilot/makefile.mk58
-rw-r--r--sc/qa/complex/sc/CalcRTL.java567
-rw-r--r--sc/qa/complex/sc/makefile.mk57
-rw-r--r--sc/qa/unoapi/Test.java51
-rw-r--r--sc/qa/unoapi/knownissues.xcl199
-rw-r--r--sc/qa/unoapi/makefile.mk48
-rw-r--r--sc/qa/unoapi/sc.sce125
-rw-r--r--sc/qa/unoapi/testdocuments/10test.csv19
-rw-r--r--sc/qa/unoapi/testdocuments/ScAnnotationShapeObj.sxcbin0 -> 6542 bytes
-rw-r--r--sc/qa/unoapi/testdocuments/ScDDELinksObj.sdcbin0 -> 17408 bytes
-rw-r--r--sc/qa/unoapi/testdocuments/ScSheetLinksObj.sdcbin0 -> 16896 bytes
-rw-r--r--sc/qa/unoapi/testdocuments/calcshapes.sxcbin0 -> 13030 bytes
-rw-r--r--sc/qa/unoapi/testdocuments/crazy-blue.jpgbin0 -> 4451 bytes
-rw-r--r--sc/qa/unoapi/testdocuments/space-metal.jpgbin0 -> 4313 bytes
27 files changed, 4407 insertions, 0 deletions
diff --git a/sc/qa/complex/calcPreview/ViewForwarder.java b/sc/qa/complex/calcPreview/ViewForwarder.java
new file mode 100755
index 000000000000..160dc1ebd20a
--- /dev/null
+++ b/sc/qa/complex/calcPreview/ViewForwarder.java
@@ -0,0 +1,1057 @@
+/*************************************************************************
+ *
+ * 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
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package complex.calcPreview;
+
+import complexlib.ComplexTestCase;
+
+import com.sun.star.awt.XWindow;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.frame.XController;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.XCell;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleText;
+import com.sun.star.accessibility.XAccessibleValue;
+import com.sun.star.accessibility.XAccessibleComponent;
+import com.sun.star.accessibility.XAccessibleContext;
+
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.beans.XPropertySetInfo;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.sheet.XHeaderFooterContent;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.style.XStyle;
+import com.sun.star.style.XStyleFamiliesSupplier;
+import com.sun.star.text.XText;
+import com.sun.star.drawing.XDrawPageSupplier;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XShape;
+import com.sun.star.drawing.XShapes;
+
+
+import com.sun.star.beans.Property;
+import com.sun.star.lang.XServiceInfo;
+
+/**
+ * A complex test for the preview of Calc documents. This complex test
+ * needs interaction from the user: documents have to be resized and moved.
+ */
+public class ViewForwarder extends ComplexTestCase {
+
+ /** The MultiServiceFactory **/
+ private XMultiServiceFactory mXMSF = null;
+
+ /** Get all test methods.
+ * @return The test methods.
+ */
+ public String[] getTestMethodNames() {
+ return new String[]{"checkPositiveViewForwarder",
+ "checkNegativeViewForwarder",
+ "checkPreviewHeaderCells",
+ "checkPreviewShape"
+ };
+ }
+
+ /**
+ * Get a MultiServiceFactory from the Office before the test.
+ */
+ public void before() {
+ mXMSF = (XMultiServiceFactory)param.getMSF();
+ }
+
+
+ /** Create a spreadsheet document, insert some text, header and footer.
+ * Let the user resize the document and check the contents.
+ */
+ public void checkPositiveViewForwarder() {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( mXMSF );
+ XSpreadsheetDocument xSpreadsheetDoc = null;
+
+ try {
+ log.println("Creating a spreadsheet document");
+ xSpreadsheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ failed(e.getMessage());
+ return;
+ }
+
+ XInterface oObj = null;
+
+ // inserting some content to have non-empty page preview
+ XCell xCell = null;
+ try {
+ XSpreadsheets oSheets = xSpreadsheetDoc.getSheets() ;
+ XIndexAccess oIndexSheets = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ Object o = oIndexSheets.getByIndex(0);
+ XSpreadsheet oSheet = (XSpreadsheet)AnyConverter.toObject(
+ new com.sun.star.uno.Type(XSpreadsheet.class), o);
+ xCell = oSheet.getCellByPosition(0, 0) ;
+ xCell.setFormula("ScAccessiblePageHeader");
+
+ xCell = oSheet.getCellByPosition(0, 1) ;
+ xCell.setFormula("Cell 1");
+ xCell = oSheet.getCellByPosition(0, 2) ;
+ xCell.setFormula("Cell 2");
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception ceating relation :");
+ failed(e.getMessage());
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception ceating relation :");
+ failed(e.getMessage());
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Exception ceating relation :");
+ failed(e.getMessage());
+ }
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc);
+
+ XController xController = aModel.getCurrentController();
+
+ // get page styles
+ XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface(
+ XStyleFamiliesSupplier.class,
+ xSpreadsheetDoc );
+ XNameAccess StyleFamNames = StyleFam.getStyleFamilies();
+ XStyle StdStyle = null;
+
+ try{
+ Object o = StyleFamNames.getByName("PageStyles");
+ XNameAccess PageStyles = (XNameAccess)AnyConverter.toObject(
+ new com.sun.star.uno.Type(XNameAccess.class), o);
+
+ o = PageStyles.getByName("Default");
+ StdStyle = (XStyle)AnyConverter.toObject(
+ new com.sun.star.uno.Type(XStyle.class), o);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ failed(e.getMessage());
+ } catch(com.sun.star.lang.WrappedTargetException e){
+ failed(e.getMessage());
+ return;
+ } catch(com.sun.star.container.NoSuchElementException e){
+ failed(e.getMessage());
+ return;
+ }
+
+ //get the property-set
+ final XPropertySet PropSet = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, StdStyle);
+
+ XHeaderFooterContent RPHFC = null;
+
+ // get the header
+ try {
+ Object o = PropSet.getPropertyValue("RightPageHeaderContent");
+ RPHFC = (XHeaderFooterContent)AnyConverter.toObject(
+ new com.sun.star.uno.Type(XHeaderFooterContent.class), o);
+
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ failed(e.getMessage());
+ } catch(com.sun.star.lang.WrappedTargetException e){
+ failed(e.getMessage());
+ return;
+ } catch(com.sun.star.beans.UnknownPropertyException e){
+ failed(e.getMessage());
+ return;
+ }
+
+ // insert text into header
+ XText center = RPHFC.getCenterText();
+ center.setString("First line \n\r Second line \n\r third line ");
+ try {
+ PropSet.setPropertyValue("RightPageHeaderContent",RPHFC);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ } catch (com.sun.star.lang.WrappedTargetException e) {}
+
+ // get footer
+ RPHFC = null;
+ try {
+ Object o = PropSet.getPropertyValue("RightPageHeaderContent");
+ RPHFC = (XHeaderFooterContent)AnyConverter.toObject(
+ new com.sun.star.uno.Type(XHeaderFooterContent.class), o);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ failed(e.getMessage());
+ } catch(com.sun.star.lang.WrappedTargetException e){
+ failed(e.getMessage());
+ return;
+ } catch(com.sun.star.beans.UnknownPropertyException e){
+ failed(e.getMessage());
+ return;
+ }
+
+ // insert text into footer
+ center = RPHFC.getCenterText();
+ center.setString("Third last line\n\r Second last line\n\r last line");
+ try {
+ PropSet.setPropertyValue("RightPageFooterContent",RPHFC);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ } catch (com.sun.star.lang.WrappedTargetException e) {}
+
+ // switching to 'Page Preview' mode
+ try {
+ XDispatchProvider xDispProv = (XDispatchProvider)
+ UnoRuntime.queryInterface(XDispatchProvider.class, xController);
+ XURLTransformer xParser = (com.sun.star.util.XURLTransformer)
+ UnoRuntime.queryInterface(XURLTransformer.class,
+ mXMSF.createInstance("com.sun.star.util.URLTransformer"));
+ // Because it's an in/out parameter we must use an
+ // array of URL objects.
+ URL[] aParseURL = new URL[1];
+ aParseURL[0] = new URL();
+ aParseURL[0].Complete = ".uno:PrintPreview";
+ xParser.parseStrict(aParseURL);
+ URL aURL = aParseURL[0];
+ XDispatch xDispatcher = xDispProv.queryDispatch(aURL, "", 0);
+ if(xDispatcher != null)
+ xDispatcher.dispatch( aURL, null );
+ } catch (com.sun.star.uno.Exception e) {
+ failed("Couldn't change mode");
+ return;
+ }
+
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException ex) {}
+
+ log.println("Press any key after resizing ");
+ try{
+ byte[]b = new byte[16];
+ System.in.read(b);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ // get the accessible content
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow(mXMSF, aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+ XAccessible parent = null;
+
+ try {
+ parent = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.HEADER, "").getAccessibleChild(0);
+ oObj = parent.getAccessibleContext().getAccessibleChild(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException iabe) {
+ failed(iabe.getMessage());
+ return;
+ }
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ XAccessibleComponent accPC = (XAccessibleComponent)
+ UnoRuntime.queryInterface(XAccessibleComponent.class, parent);
+
+ log.println("Parent-BoundsX= "+accPC.getBounds().X);
+ log.println("Parent-BoundsY= "+accPC.getBounds().Y);
+ log.println("Parent-BoundsWidth= "+accPC.getBounds().Width);
+ log.println("Parent-BoundsHeight= "+accPC.getBounds().Height);
+
+ XAccessibleComponent accPPC = (XAccessibleComponent)
+ UnoRuntime.queryInterface(XAccessibleComponent.class,
+ parent.getAccessibleContext().getAccessibleParent());
+
+ log.println("P-Parent-BoundsX= "+accPPC.getBounds().X);
+ log.println("P-Parent-BoundsY= "+accPPC.getBounds().Y);
+ log.println("P-Parent-BoundsWidth= "+accPPC.getBounds().Width);
+ log.println("P-Parent-BoundsHeight= "+accPPC.getBounds().Height);
+
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException ex) {}
+
+ log.println("Press any key when the second line is on top");
+ try{
+ byte[]b = new byte[16];
+ System.in.read(b);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ try {
+ log.println("ChildCount: "+
+ parent.getAccessibleContext().getAccessibleChildCount());
+ log.println("Getting child 0 again");
+ oObj = parent.getAccessibleContext().getAccessibleChild(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException iabe) {
+ failed(iabe.getMessage());
+ return;
+ }
+
+ XAccessibleText accT = (XAccessibleText)
+ UnoRuntime.queryInterface(XAccessibleText.class, oObj);
+ log.println("Getting the text: "+accT.getText());
+
+ XAccessibleComponent accC = (XAccessibleComponent)
+ UnoRuntime.queryInterface(XAccessibleComponent.class, oObj);
+ log.println("BoundsX= "+accC.getBounds().X);
+ log.println("BoundsY= "+accC.getBounds().Y);
+ log.println("BoundsWidth= "+accC.getBounds().Width);
+ log.println("BoundsHeight= "+accC.getBounds().Height);
+
+ accPC = (XAccessibleComponent)
+ UnoRuntime.queryInterface(XAccessibleComponent.class, parent);
+
+ log.println("Parent-BoundsX= "+accPC.getBounds().X);
+ log.println("Parent-BoundsY= "+accPC.getBounds().Y);
+ log.println("Parent-BoundsWidth= "+accPC.getBounds().Width);
+ log.println("Parent-BoundsHeight= "+accPC.getBounds().Height);
+
+ accPPC = (XAccessibleComponent)
+ UnoRuntime.queryInterface(XAccessibleComponent.class,
+ parent.getAccessibleContext().getAccessibleParent());
+
+ log.println("P-Parent-BoundsX= "+accPPC.getBounds().X);
+ log.println("P-Parent-BoundsY= "+accPPC.getBounds().Y);
+ log.println("P-Parent-BoundsWidth= "+accPPC.getBounds().Width);
+ log.println("P-Parent-BoundsHeight= "+accPPC.getBounds().Height);
+
+
+
+ log.println("Press any key when the footer is visible.");
+ try{
+ byte[]b = new byte[16];
+ System.in.read(b);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ try {
+ parent = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.FOOTER, "").getAccessibleChild(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException iabe) {
+ failed(iabe.getMessage());
+ return;
+ }
+
+ accPC = (XAccessibleComponent)
+ UnoRuntime.queryInterface(XAccessibleComponent.class, parent);
+
+ try {
+ log.println("ChildCount: "+
+ parent.getAccessibleContext().getAccessibleChildCount());
+ log.println("Getting child 0 again");
+ oObj = parent.getAccessibleContext().getAccessibleChild(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException iabe) {
+ failed(iabe.getMessage());
+ return;
+ }
+
+ accT = (XAccessibleText)
+ UnoRuntime.queryInterface(XAccessibleText.class, oObj);
+ log.println("Getting the text: "+accT.getText());
+
+ accC = (XAccessibleComponent)
+ UnoRuntime.queryInterface(XAccessibleComponent.class, oObj);
+ log.println("BoundsX= "+accC.getBounds().X);
+ log.println("BoundsY= "+accC.getBounds().Y);
+ log.println("BoundsWidth= "+accC.getBounds().Width);
+ log.println("BoundsHeight= "+accC.getBounds().Height);
+
+ accPC = (XAccessibleComponent)
+ UnoRuntime.queryInterface(XAccessibleComponent.class, parent);
+
+ log.println("Parent-BoundsX= "+accPC.getBounds().X);
+ log.println("Parent-BoundsY= "+accPC.getBounds().Y);
+ log.println("Parent-BoundsWidth= "+accPC.getBounds().Width);
+ log.println("Parent-BoundsHeight= "+accPC.getBounds().Height);
+
+ accPPC = (XAccessibleComponent)
+ UnoRuntime.queryInterface(XAccessibleComponent.class,
+ parent.getAccessibleContext().getAccessibleParent());
+
+ log.println("P-Parent-BoundsX= "+accPPC.getBounds().X);
+ log.println("P-Parent-BoundsY= "+accPPC.getBounds().Y);
+ log.println("P-Parent-BoundsWidth= "+accPPC.getBounds().Width);
+ log.println("P-Parent-BoundsHeight= "+accPPC.getBounds().Height);
+
+
+ log.println("Press any key when the page content is on top");
+ try{
+ byte[]b = new byte[16];
+ System.in.read(b);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ try {
+ parent = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.DOCUMENT, "").getAccessibleChild(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException iabe) {
+ failed(iabe.getMessage());
+ return;
+ }
+ System.out.println("PARENT: " + parent.getAccessibleContext().getAccessibleName());
+ accPC = (XAccessibleComponent)
+ UnoRuntime.queryInterface(XAccessibleComponent.class, parent);
+
+ int cCount = 0;
+ try {
+ cCount =
+ parent.getAccessibleContext().getAccessibleChildCount();
+ log.println("ChildCount: "+cCount);
+ log.println("Getting child 0 again");
+ oObj = parent.getAccessibleContext().getAccessibleChild(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException iabe) {
+ failed(iabe.getMessage());
+ return;
+ }
+
+ for (int i=0; i<cCount; i++) {
+ try {
+ XAccessible xA = parent.getAccessibleContext().getAccessibleChild(i);
+ System.out.println("NAME object " + i + ": " + xA.getAccessibleContext().getAccessibleName());
+ } catch (com.sun.star.lang.IndexOutOfBoundsException iabe) {
+ failed(iabe.getMessage());
+ return;
+ }
+ }
+
+ System.out.println("SERVICES:");
+ util.dbg.getSuppServices(oObj);
+
+ XAccessibleValue accV = (XAccessibleValue)
+ UnoRuntime.queryInterface(XAccessibleValue.class, oObj);
+ Object o = accV.getCurrentValue();
+ if (o instanceof String)
+ System.out.println("Value: " + (String)o);
+ else
+ System.out.println("Name of Object: " + o.getClass().getName());
+ log.println("Getting the value: "+accV.getCurrentValue());
+
+
+
+
+ accC = (XAccessibleComponent)
+ UnoRuntime.queryInterface(XAccessibleComponent.class, oObj);
+ log.println("BoundsX= "+accC.getBounds().X);
+ log.println("BoundsY= "+accC.getBounds().Y);
+ log.println("BoundsWidth= "+accC.getBounds().Width);
+ log.println("BoundsHeight= "+accC.getBounds().Height);
+
+ accPC = (XAccessibleComponent)
+ UnoRuntime.queryInterface(XAccessibleComponent.class, parent);
+
+ log.println("Parent-BoundsX= "+accPC.getBounds().X);
+ log.println("Parent-BoundsY= "+accPC.getBounds().Y);
+ log.println("Parent-BoundsWidth= "+accPC.getBounds().Width);
+ log.println("Parent-BoundsHeight= "+accPC.getBounds().Height);
+
+ accPPC = (XAccessibleComponent)
+ UnoRuntime.queryInterface(XAccessibleComponent.class,
+ parent.getAccessibleContext().getAccessibleParent());
+
+ log.println("P-Parent-BoundsX= "+accPPC.getBounds().X);
+ log.println("P-Parent-BoundsY= "+accPPC.getBounds().Y);
+ log.println("P-Parent-BoundsWidth= "+accPPC.getBounds().Width);
+ log.println("P-Parent-BoundsHeight= "+accPPC.getBounds().Height);
+
+ XComponent xComp = (XComponent)UnoRuntime.queryInterface(
+ XComponent.class, xSpreadsheetDoc);
+ xComp.dispose();
+ }
+
+
+
+
+
+
+
+
+ /**
+ * Create a spreadsheet document, insert some text, header and footer.
+ * Let the user resize the document and check the contents.
+ */
+ public void checkNegativeViewForwarder() {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( mXMSF );
+ XSpreadsheetDocument xSpreadsheetDoc = null;
+
+ try {
+ log.println("Creating a spreadsheet document");
+ xSpreadsheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ failed(e.getMessage());
+ return;
+ }
+
+ XInterface oObj = null;
+
+ // inserting some content to have non-empty page preview
+ XCell xCell = null;
+ try {
+ XSpreadsheets oSheets = xSpreadsheetDoc.getSheets() ;
+ XIndexAccess oIndexSheets = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ Object o = oIndexSheets.getByIndex(0);
+ XSpreadsheet oSheet = (XSpreadsheet)AnyConverter.toObject(
+ new com.sun.star.uno.Type(XSpreadsheet.class), o);
+ xCell = oSheet.getCellByPosition(0, 0) ;
+ xCell.setFormula("ScAccessiblePageHeader");
+
+ xCell = oSheet.getCellByPosition(0, 1) ;
+ xCell.setFormula("Cell 1");
+ xCell = oSheet.getCellByPosition(0, 2) ;
+ xCell.setFormula("Cell 2");
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception ceating relation :");
+ failed(e.getMessage());
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception ceating relation :");
+ failed(e.getMessage());
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Exception ceating relation :");
+ failed(e.getMessage());
+ }
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc);
+
+ XController xController = aModel.getCurrentController();
+
+ // get page styles
+ XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface(
+ XStyleFamiliesSupplier.class,
+ xSpreadsheetDoc );
+ XNameAccess StyleFamNames = StyleFam.getStyleFamilies();
+ XStyle StdStyle = null;
+
+ try{
+ Object o = StyleFamNames.getByName("PageStyles");
+ XNameAccess PageStyles = (XNameAccess)AnyConverter.toObject(
+ new com.sun.star.uno.Type(XNameAccess.class), o);
+
+ o = PageStyles.getByName("Default");
+ StdStyle = (XStyle)AnyConverter.toObject(
+ new com.sun.star.uno.Type(XStyle.class), o);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ failed(e.getMessage());
+ } catch(com.sun.star.lang.WrappedTargetException e){
+ failed(e.getMessage());
+ return;
+ } catch(com.sun.star.container.NoSuchElementException e){
+ failed(e.getMessage());
+ return;
+ }
+
+ //get the property-set
+ final XPropertySet PropSet = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, StdStyle);
+
+ XHeaderFooterContent RPHFC = null;
+
+ // get the header
+ log.println( "Creating a test environment" );
+ try {
+ Object o = PropSet.getPropertyValue("RightPageHeaderContent");
+ RPHFC = (XHeaderFooterContent)AnyConverter.toObject(
+ new com.sun.star.uno.Type(XHeaderFooterContent.class), o);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ failed(e.getMessage());
+ } catch(com.sun.star.lang.WrappedTargetException e){
+ failed(e.getMessage());
+ return;
+ } catch(com.sun.star.beans.UnknownPropertyException e){
+ failed(e.getMessage());
+ return;
+ }
+
+ // insert text into header
+ XText center = RPHFC.getCenterText();
+ center.setString("First line \n\r Second line \n\r third line ");
+ try {
+ PropSet.setPropertyValue("RightPageHeaderContent",RPHFC);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ } catch (com.sun.star.lang.WrappedTargetException e) {}
+
+ // get footer
+ RPHFC = null;
+ try {
+ Object o = PropSet.getPropertyValue("RightPageFooterContent");
+ RPHFC = (XHeaderFooterContent)AnyConverter.toObject(
+ new com.sun.star.uno.Type(XHeaderFooterContent.class), o);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ failed(e.getMessage());
+ } catch(com.sun.star.lang.WrappedTargetException e){
+ failed(e.getMessage());
+ return;
+ } catch(com.sun.star.beans.UnknownPropertyException e){
+ failed(e.getMessage());
+ return;
+ }
+
+ // insert text into footer
+ center = RPHFC.getCenterText();
+ center.setString("Third last line\n\r Second last line\n\r last line");
+ try {
+ PropSet.setPropertyValue("RightPageFooterContent",RPHFC);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ } catch (com.sun.star.lang.WrappedTargetException e) {}
+
+ // switching to 'Page Preview' mode
+ try {
+ XDispatchProvider xDispProv = (XDispatchProvider)
+ UnoRuntime.queryInterface(XDispatchProvider.class, xController);
+ XURLTransformer xParser = (com.sun.star.util.XURLTransformer)
+ UnoRuntime.queryInterface(XURLTransformer.class,
+ mXMSF.createInstance("com.sun.star.util.URLTransformer"));
+ // Because it's an in/out parameter we must use an
+ // array of URL objects.
+ URL[] aParseURL = new URL[1];
+ aParseURL[0] = new URL();
+ aParseURL[0].Complete = ".uno:PrintPreview";
+ xParser.parseStrict(aParseURL);
+ URL aURL = aParseURL[0];
+ XDispatch xDispatcher = xDispProv.queryDispatch(aURL, "", 0);
+ if(xDispatcher != null)
+ xDispatcher.dispatch( aURL, null );
+ } catch (com.sun.star.uno.Exception e) {
+ failed("Couldn't change mode");
+ return;
+ }
+
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException ex) {}
+
+ log.println("Press any key after resizing ");
+ try{
+ byte[]b = new byte[16];
+ System.in.read(b);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ // get the accessible content
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow(mXMSF, aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+ XAccessible parent = null;
+
+ try {
+ parent = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.HEADER, "").getAccessibleChild(0);
+ oObj = parent.getAccessibleContext().getAccessibleChild(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException iabe) {
+ failed(iabe.getMessage());
+ return;
+ }
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ XAccessibleComponent accPC = (XAccessibleComponent)
+ UnoRuntime.queryInterface(XAccessibleComponent.class, parent);
+
+ log.println("Parent-BoundsX= "+accPC.getBounds().X);
+ log.println("Parent-BoundsY= "+accPC.getBounds().Y);
+ log.println("Parent-BoundsWidth= "+accPC.getBounds().Width);
+ log.println("Parent-BoundsHeight= "+accPC.getBounds().Height);
+
+ XAccessibleComponent accPPC = (XAccessibleComponent)
+ UnoRuntime.queryInterface(XAccessibleComponent.class,
+ parent.getAccessibleContext().getAccessibleParent());
+
+ log.println("P-Parent-BoundsX= "+accPPC.getBounds().X);
+ log.println("P-Parent-BoundsY= "+accPPC.getBounds().Y);
+ log.println("P-Parent-BoundsWidth= "+accPPC.getBounds().Width);
+ log.println("P-Parent-BoundsHeight= "+accPPC.getBounds().Height);
+
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException ex) {}
+
+ log.println("Press any key when the header is not visible.");
+ try{
+ byte[]b = new byte[16];
+ System.in.read(b);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ int childCount = 0;
+ childCount =
+ parent.getAccessibleContext().getAccessibleChildCount();
+ log.println("ChildCount: "+childCount);
+
+ if (childCount != 0)
+ failed("Could access header although it was not visible on page.");
+
+
+ try {
+ parent = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.FOOTER, "").getAccessibleChild(0);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException iabe) {
+ failed(iabe.getMessage());
+ return;
+ }
+
+ accPC = (XAccessibleComponent)
+ UnoRuntime.queryInterface(XAccessibleComponent.class, parent);
+
+ log.println("Press any key when the footer is not visible.");
+ try{
+ byte[]b = new byte[16];
+ System.in.read(b);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ childCount =
+ parent.getAccessibleContext().getAccessibleChildCount();
+ log.println("ChildCount: "+childCount);
+
+ if (childCount != 0)
+ failed("Could access footer although it was not visible on page.");
+
+ XComponent xComp = (XComponent)UnoRuntime.queryInterface(
+ XComponent.class, xSpreadsheetDoc);
+ xComp.dispose();
+
+ }
+
+
+
+
+ /**
+ * Check the preview of header cells
+ */
+ public void checkPreviewHeaderCells() {
+
+ XInterface oObj = null;
+ SOfficeFactory SOF = SOfficeFactory.getFactory( mXMSF);
+ XSpreadsheetDocument xSpreadsheetDoc = null;
+
+ try {
+ log.println("Creating a spreadsheet document");
+ xSpreadsheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ failed(e.getMessage());
+ return;
+ }
+
+ XModel xModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc);
+
+ XController xController = xModel.getCurrentController();
+
+ //setting value of cell A1
+ XCell xCell = null;
+ try {
+ log.println("Getting spreadsheet") ;
+ XSpreadsheets oSheets = xSpreadsheetDoc.getSheets() ;
+ XIndexAccess oIndexSheets = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ Object o = oIndexSheets.getByIndex(0);
+ XSpreadsheet oSheet = (XSpreadsheet)AnyConverter.toObject(
+ new com.sun.star.uno.Type(XSpreadsheet.class), o);
+
+ log.println("Getting a cell from sheet") ;
+ xCell = oSheet.getCellByPosition(0, 0);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ failed(e.getMessage());
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ failed(e.getMessage());
+ return;
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ failed(e.getMessage());
+ return;
+ }
+
+ xCell.setFormula("Value");
+
+ //setting property 'PrintHeaders' of the style 'Default'
+ XStyleFamiliesSupplier xSFS = (XStyleFamiliesSupplier)
+ UnoRuntime.queryInterface(XStyleFamiliesSupplier.class,
+ xSpreadsheetDoc);
+ XNameAccess xNA = xSFS.getStyleFamilies();
+ XPropertySet xPropSet = null;
+ try {
+ Object oPageStyles = xNA.getByName("PageStyles");
+ xNA = (XNameAccess)
+ UnoRuntime.queryInterface(XNameAccess.class, oPageStyles);
+ Object oDefStyle = xNA.getByName("Default");
+ xPropSet = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oDefStyle);
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ failed(e.getMessage());
+ return;
+ } catch(com.sun.star.container.NoSuchElementException e) {
+ failed(e.getMessage());
+ return;
+ }
+
+ try {
+ xPropSet.setPropertyValue("PrintHeaders", new Boolean(true));
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ failed(e.getMessage());
+ return;
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ failed(e.getMessage());
+ return;
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ failed(e.getMessage());
+ return;
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ failed(e.getMessage());
+ return;
+ }
+
+ //switching to 'Print Preview' mode
+ try {
+ XDispatchProvider xDispProv = (XDispatchProvider)
+ UnoRuntime.queryInterface(XDispatchProvider.class, xController);
+ XURLTransformer xParser = (com.sun.star.util.XURLTransformer)
+ UnoRuntime.queryInterface(XURLTransformer.class,
+ mXMSF.createInstance("com.sun.star.util.URLTransformer"));
+ URL[] aParseURL = new URL[1];
+ aParseURL[0] = new URL();
+ aParseURL[0].Complete = ".uno:PrintPreview";
+ xParser.parseStrict(aParseURL);
+ URL aURL = aParseURL[0];
+ XDispatch xDispatcher = xDispProv.queryDispatch(aURL, "", 0);
+ if(xDispatcher != null)
+ xDispatcher.dispatch( aURL, null );
+ } catch (com.sun.star.uno.Exception e) {
+ failed(e.getMessage());
+ return;
+ }
+
+ try {
+ Thread.currentThread().sleep(500) ;
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e) ;
+ }
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow(mXMSF, xModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+// log.println("ImplementationName " + utils.getImplName(oObj));
+
+ log.println("Press any key when the header cell is on top.");
+ try{
+ byte[]b = new byte[16];
+ System.in.read(b);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+
+ XAccessible parent = null;
+
+ try {
+ System.out.println("Count: " +at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.TABLE, "").getAccessibleChildCount());
+// parent = at.getAccessibleObjectForRole
+// (xRoot, AccessibleRole.TABLE, "").getAccessibleChild(0);
+// oObj = parent.getAccessibleContext().getAccessibleChild(1);
+ System.out.println("Getting child 2");
+ oObj = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.TABLE, "").getAccessibleChild(2);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException iabe) {
+ failed(iabe.getMessage());
+ return;
+ }
+
+ System.out.println("*** DEBUG INFO ***");
+ util.dbg.getSuppServices(oObj);
+ System.out.println("****** IFC ******");
+ util.dbg.printInterfaces(oObj);
+ System.out.println("*****************");
+
+
+/* XAccessibleContext accCtx = (XAccessibleContext)
+ UnoRuntime.queryInterface(XAccessibleContext.class, oObj);
+ try {
+ System.out.println("Children now: " + accCtx.getAccessibleChild(0).getAccessibleContext().getAccessibleChildCount());
+ } catch (com.sun.star.lang.IndexOutOfBoundsException iabe) {
+ failed(iabe.getMessage());
+ return;
+ }
+*/
+
+ XAccessibleValue accV = (XAccessibleValue)
+ UnoRuntime.queryInterface(XAccessibleValue.class, oObj);
+ Object o = accV.getCurrentValue();
+ log.println("Getting the value: "+o + " is void " + util.utils.isVoid(o));
+
+
+ XAccessibleComponent accC = (XAccessibleComponent)
+ UnoRuntime.queryInterface(XAccessibleComponent.class, oObj);
+
+ log.println("BoundsX= "+accC.getBounds().X);
+ log.println("BoundsY= "+accC.getBounds().Y);
+ log.println("BoundsWidth= "+accC.getBounds().Width);
+ log.println("BoundsHeight= "+accC.getBounds().Height);
+
+ XComponent xComp = (XComponent)UnoRuntime.queryInterface(
+ XComponent.class, xSpreadsheetDoc);
+ xComp.dispose();
+
+ }
+
+
+
+
+
+ /**
+ * Check the preview of Shapes: load a document with shapes and see, if they
+ * are accessible.
+ */
+ public void checkPreviewShape() {
+ SOfficeFactory SOF = SOfficeFactory.getFactory( mXMSF );
+ XSpreadsheetDocument xSpreadsheetDoc = null;
+ XComponent xComp = null;
+ XInterface oObj = null;
+
+ try {
+ String docName = "calcshapes.sxc";
+ log.println("Loading a spreadsheetdocument.");
+ String url = utils.getFullURL(
+ (String)param.get("TestDocumentPath") + "/" + docName);
+ log.println("loading document '" + url + "'");
+ xComp = SOF.loadDocument(url);
+
+ } catch (com.sun.star.uno.Exception e) {
+ failed(e.getMessage());
+ return;
+ }
+
+ try {
+ Thread.currentThread().sleep(500) ;
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e) ;
+ }
+
+ if (xComp == null) {
+ failed("loading document failed.");
+ return;
+ }
+
+ xSpreadsheetDoc = (XSpreadsheetDocument)UnoRuntime.queryInterface(
+ XSpreadsheetDocument.class, xComp);
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc);
+
+ XController xController = aModel.getCurrentController();
+
+ // switching to 'Page Preview' mode
+ try {
+ XDispatchProvider xDispProv = (XDispatchProvider)
+ UnoRuntime.queryInterface(XDispatchProvider.class, xController);
+ XURLTransformer xParser = (com.sun.star.util.XURLTransformer)
+ UnoRuntime.queryInterface(XURLTransformer.class,
+ mXMSF.createInstance("com.sun.star.util.URLTransformer"));
+ // Because it's an in/out parameter we must use an
+ // array of URL objects.
+ URL[] aParseURL = new URL[1];
+ aParseURL[0] = new URL();
+ aParseURL[0].Complete = ".uno:PrintPreview";
+ xParser.parseStrict(aParseURL);
+ URL aURL = aParseURL[0];
+ XDispatch xDispatcher = xDispProv.queryDispatch(aURL, "", 0);
+ if(xDispatcher != null)
+ xDispatcher.dispatch( aURL, null );
+ } catch (com.sun.star.uno.Exception e) {
+ failed("Couldn't change mode");
+ return;
+ }
+
+ try {
+ Thread.currentThread().sleep(500) ;
+ } catch (InterruptedException e) {
+ System.out.println("While waiting :" + e) ;
+ }
+
+
+
+ log.println("Press any key when a shape is on top.");
+ try{
+ byte[]b = new byte[16];
+ System.in.read(b);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ // get the accessible content
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow(mXMSF, aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+ XAccessible parent = null;
+
+ try {
+ XAccessibleContext con = at.getAccessibleObjectForRole
+ (xRoot, AccessibleRole.SHAPE, "");
+ log.println("Name of AccessibleContext: " + con.getAccessibleName());
+ oObj = con;
+ } catch (Exception e) {
+ failed(e.getMessage());
+ return;
+ }
+
+ log.println("ImplementationName: " + utils.getImplName(oObj));
+ util.dbg.printInterfaces(oObj);
+
+ xComp.dispose();
+ }
+
+}
+
+
diff --git a/sc/qa/complex/calcPreview/makefile.mk b/sc/qa/complex/calcPreview/makefile.mk
new file mode 100755
index 000000000000..14f9428678e7
--- /dev/null
+++ b/sc/qa/complex/calcPreview/makefile.mk
@@ -0,0 +1,93 @@
+#*************************************************************************
+#
+# 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
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ = ..$/..$/..
+TARGET = ViewForward
+PRJNAME = $(TARGET)
+PACKAGE = complex$/calcPreview
+
+# --- Settings -----------------------------------------------------
+.INCLUDE: settings.mk
+
+
+#----- compile .java files -----------------------------------------
+
+JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar mysql.jar
+JAVAFILES = ViewForwarder.java
+JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
+
+#----- make a jar from compiled files ------------------------------
+
+MAXLINELENGTH = 100000
+
+JARCLASSDIRS = $(PACKAGE)
+JARTARGET = $(TARGET).jar
+JARCOMPRESS = TRUE
+
+# --- Parameters for the test --------------------------------------
+
+# start an office if the parameter is set for the makefile
+.IF "$(OFFICE)" == ""
+CT_APPEXECCOMMAND =
+.ELSE
+CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;"
+.ENDIF
+
+# test base is java complex
+CT_TESTBASE = -TestBase java_complex
+
+# set test document path
+CT_TESTDOCS = -tdoc $(PWD)$/test_documents
+
+# test looks something like the.full.package.TestName
+CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b)
+
+# start the runner application
+CT_APP = org.openoffice.Runner
+
+# set the timeout to a bigger value
+CT_TIMEOUT = -TimeOut 120000
+
+# --- Targets ------------------------------------------------------
+
+.IF "$(depend)" == ""
+$(CLASSDIR)$/$(PACKAGE)$/$(JAVAFILES:b).props : ALLTAR
+.ELSE
+$(CLASSDIR)$/$(PACKAGE)$/$(JAVAFILES:b).props : ALLDEP
+.ENDIF
+
+.INCLUDE : target.mk
+
+
+RUN:
+ +java -cp "$(CLASSPATH)" $(CT_APP) $(CT_APPEXECCOMMAND) $(CT_TESTDOCS) $(CT_TESTBASE) $(CT_WORKDIR) $(CT_TIMEOUT) $(CT_TEST)
+
+run: RUN
+
+tst:
+ +@echo $(CT_TESTDOCS)
+
diff --git a/sc/qa/complex/calcPreview/test_documents/calcshapes.sxc b/sc/qa/complex/calcPreview/test_documents/calcshapes.sxc
new file mode 100755
index 000000000000..7f98b1a501e0
--- /dev/null
+++ b/sc/qa/complex/calcPreview/test_documents/calcshapes.sxc
Binary files differ
diff --git a/sc/qa/complex/cellRanges/CheckXCellRangesQuery.java b/sc/qa/complex/cellRanges/CheckXCellRangesQuery.java
new file mode 100755
index 000000000000..b23abe2d6a57
--- /dev/null
+++ b/sc/qa/complex/cellRanges/CheckXCellRangesQuery.java
@@ -0,0 +1,229 @@
+/*************************************************************************
+ *
+ * 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
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package complex.cellRanges;
+
+import com.sun.star.container.XIndexAccess;
+import complexlib.ComplexTestCase;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.CellFlags;
+import com.sun.star.sheet.XCellRangesQuery;
+import com.sun.star.sheet.XSheetCellRanges;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.CellAddress;
+import com.sun.star.table.XColumnRowRange;
+import com.sun.star.table.XTableColumns;
+import com.sun.star.table.XTableRows;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import java.io.PrintWriter;
+import util.SOfficeFactory;
+
+/**
+ * Check the XCellRangesQuery interface on the SheetCell service. test was
+ * created for bug i20044.
+ */
+public class CheckXCellRangesQuery extends ComplexTestCase {
+ XSpreadsheetDocument m_xSheetDoc = null;
+ XCellRangesQuery m_xCell = null;
+ XSpreadsheet m_xSpreadSheet = null;
+
+ /**
+ * Get all test methods.
+ * @return The test methods.
+ */
+ public String[] getTestMethodNames() {
+ return new String[] {"checkEmptyCell", "checkFilledCell"};
+ }
+
+ /**
+ * Creates Spreadsheet document and the test object,
+ * before the actual test starts.
+ */
+ public void before() {
+ // create a calc document
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)param.getMSF() );
+
+ try {
+ log.println( "creating a Spreadsheet document" );
+ m_xSheetDoc = SOF.createCalcDoc(null);
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( (PrintWriter)log );
+ failed( "Couldn?t create document");
+ }
+ XInterface oObj = null;
+
+ try {
+ log.println("Getting spreadsheet") ;
+ XSpreadsheets oSheets = m_xSheetDoc.getSheets() ;
+ XIndexAccess oIndexSheets = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
+ m_xSpreadSheet = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0));
+
+ // get the cell
+ log.println("Getting a cell from sheet") ;
+ oObj = m_xSpreadSheet.getCellByPosition(2, 3);
+ m_xCell = (XCellRangesQuery)UnoRuntime.queryInterface(XCellRangesQuery.class, oObj);
+
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace((PrintWriter)log);
+ failed("Error getting cell object from spreadsheet document");
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace((PrintWriter)log);
+ failed("Error getting cell object from spreadsheet document");
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace((PrintWriter)log);
+ failed("Error getting cell object from spreadsheet document");
+ }
+
+ // set one value for comparison.
+ try {
+ m_xSpreadSheet.getCellByPosition(1, 1).setValue(15);
+ m_xSpreadSheet.getCellByPosition(1, 3).setValue(5);
+ m_xSpreadSheet.getCellByPosition(2, 1).setFormula("=B2+B4");
+/* m_xSpreadSheet.getCellByPosition(2, 1).setFormula("=B2+B3");
+ m_xSpreadSheet.getCellByPosition(3, 2).setFormula("");
+ m_xSpreadSheet.getCellByPosition(3, 3).setFormula(""); */
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace((PrintWriter)log);
+ failed("Could not fill cell (1, 1) with a value.");
+ }
+
+ }
+
+ /**
+ * Perform some tests on an empty cell:
+ * <ol>
+ * <li>compare an empty cell with a cell with a value in the same column</li>
+ * <li>compare an empty cell with a cell with a value in the same row</li>
+ * <li>query for empty cells</li>
+ * <ol>
+ */
+ public void checkEmptyCell() {
+ log.println("Checking an empty cell...");
+ // compare an empty cell with a cell with a value
+ assure("\tQuery column differences did not return the correct value.", _queryColumnDifferences("Sheet1.C4"), true);
+ // compare an empty cell with a cell with a value
+ assure("\tQuery column differences did not return the correct value.", _queryRowDifferences("Sheet1.C4"), true);
+ // try to get this cell
+ assure("\tQuery empty cells did not return the correct value.", _queryEmptyCells("Sheet1.C4"), true);
+ log.println("...done");
+ }
+
+ /**
+ * Perform some tests on a filled cell:
+ * <ol>
+ * <li>compare an cell with value 5 with a cell with value 15 in the same column</li>
+ * <li>compare an cell with value 5 with a cell with value 15 in the same row</li>
+ * <li>query for an empty cell.</li>
+ * <ol>
+ */
+ public void checkFilledCell() {
+ log.println("Checking a filled cell...");
+
+ // fill the cell with a value
+ try {
+ m_xSpreadSheet.getCellByPosition(2, 3).setValue(15);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace((PrintWriter)log);
+ failed("Could not fill cell (2, 3) with a value.");
+ }
+
+ // compare an cell with value 5 with a cell with value 15
+ assure("\tQuery column differences did not return the correct value.", _queryColumnDifferences("Sheet1.C4"), true);
+ // compare an cell with value 5 with a cell with value 15
+ assure("\tQuery column differences did not return the correct value.", _queryRowDifferences("Sheet1.C4"), true);
+ // try to get nothing
+ assure("\tQuery empty cells did not return the correct value.", _queryEmptyCells(""), true);
+ log.println("...done");
+ }
+
+
+ /**
+ * Query column differences between my cell(2,3) and (1,1).
+ * @param expected The expected outcome value.
+ * @return True, if the result equals the expected result.
+ */
+ public boolean _queryColumnDifferences(String expected) {
+ log.println("\tQuery column differences");
+ XSheetCellRanges ranges = m_xCell.queryColumnDifferences(
+ new CellAddress((short) 0, 1, 1));
+ String getting = ranges.getRangeAddressesAsString();
+
+ if (!getting.equals(expected)) {
+ log.println("\tGetting: " + getting);
+ log.println("\tShould have been: " + expected);
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Query for an empty cell.
+ * @param expected The expected outcome value.
+ * @return True, if the result equals the expected result.
+ */
+ public boolean _queryEmptyCells(String expected) {
+ log.println("\tQuery empty cells");
+ XSheetCellRanges ranges = m_xCell.queryEmptyCells();
+ String getting = ranges.getRangeAddressesAsString();
+
+ if (!getting.equals(expected)) {
+ log.println("\tGetting: " + getting);
+ log.println("\tShould have been: " + expected);
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Query row differences between my cell(2,3) and (1,1).
+ * @param expected The expected outcome value.
+ * @return True, if the result equals the expected result.
+ */
+ public boolean _queryRowDifferences(String expected) {
+ log.println("\tQuery row differences");
+ XSheetCellRanges ranges = m_xCell.queryRowDifferences(
+ new CellAddress((short) 0, 1, 1));
+ String getting = ranges.getRangeAddressesAsString();
+
+ if (!getting.equals(expected)) {
+ log.println("\tGetting: " + getting);
+ log.println("\tShould have been: " + expected);
+ return false;
+ }
+
+ return true;
+ }
+
+}
diff --git a/sc/qa/complex/cellRanges/makefile.mk b/sc/qa/complex/cellRanges/makefile.mk
new file mode 100755
index 000000000000..fc296fe4f605
--- /dev/null
+++ b/sc/qa/complex/cellRanges/makefile.mk
@@ -0,0 +1,77 @@
+#*************************************************************************
+#
+# 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
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ = ..$/..$/..
+TARGET = CheckXCellRangesQuery
+PRJNAME = $(TARGET)
+PACKAGE = complex$/cellRanges
+
+# --- Settings -----------------------------------------------------
+.INCLUDE: settings.mk
+
+
+#----- compile .java files -----------------------------------------
+
+JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
+JAVAFILES = $(TARGET).java
+JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
+
+#----- make a jar from compiled files ------------------------------
+
+MAXLINELENGTH = 100000
+
+JARCLASSDIRS = $(PACKAGE)
+JARTARGET = $(TARGET).jar
+JARCOMPRESS = TRUE
+
+# --- Parameters for the test --------------------------------------
+
+# start an office if the parameter is set for the makefile
+.IF "$(OFFICE)" == ""
+CT_APPEXECCOMMAND =
+.ELSE
+CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;"
+.ENDIF
+
+# test base is java complex
+CT_TESTBASE = -TestBase java_complex
+
+# test looks something like the.full.package.TestName
+CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b)
+
+# start the runner application
+CT_APP = org.openoffice.Runner
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
+
+RUN: run
+
+run:
+ +java -cp "$(CLASSPATH)" $(CT_APP) $(CT_APPEXECCOMMAND) $(CT_TESTBASE) $(CT_TEST)
+
diff --git a/sc/qa/complex/dataPilot/CheckDataPilot.java b/sc/qa/complex/dataPilot/CheckDataPilot.java
new file mode 100644
index 000000000000..d013daa24e1f
--- /dev/null
+++ b/sc/qa/complex/dataPilot/CheckDataPilot.java
@@ -0,0 +1,329 @@
+/*************************************************************************
+ *
+ * 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
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package complex.dataPilot;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNamed;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.TableFilterField;
+import com.sun.star.sheet.XDataPilotDescriptor;
+import com.sun.star.sheet.XDataPilotTable;
+import com.sun.star.sheet.XDataPilotTables;
+import com.sun.star.sheet.XDataPilotTablesSupplier;
+import com.sun.star.sheet.XSheetFilterDescriptor;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.CellAddress;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import complex.dataPilot.interfaceTests.beans._XPropertySet;
+import complex.dataPilot.interfaceTests.container._XNamed;
+import complex.dataPilot.interfaceTests.sheet._XDataPilotDescriptor;
+import complex.dataPilot.interfaceTests.sheet._XDataPilotTable;
+import complexlib.ComplexTestCase;
+import lib.StatusException;
+import util.SOfficeFactory;
+
+/**
+ * check the DataPilot of Calc.
+ */
+public class CheckDataPilot extends ComplexTestCase {
+ /** The data pilot field object **/
+ private XInterface mDataPilotFieldObject = null;
+ /** The data pilot table object **/
+ private XInterface mDataPilotTableObject = null;
+
+ /**
+ * A field is filled some values. This integer determines the size of the
+ * field in x and y direction.
+ */
+ private int mMaxFieldIndex = 6;
+
+
+ /**
+ * Get all test methods
+ * @return The test methods
+ */
+ public String[] getTestMethodNames() {
+ return new String[]{"testDataPilotTableObject",
+ "testDataPilotFieldObject"};
+ }
+
+ /**
+ * Test the data pilot field object:
+ * simply execute the interface tests in a row
+ */
+ public void testDataPilotFieldObject() {
+ log.println("Starting 'testDataPilotFieldObject'");
+ // _XNamed
+ XNamed xNamed = (XNamed)UnoRuntime.queryInterface(
+ XNamed.class, mDataPilotFieldObject);
+
+ _XNamed _xNamed = new _XNamed(xNamed, log, param);
+ assure("_getName failed.",_xNamed._getName());
+ assure("_setName failed.",_xNamed._setName());
+
+ // _XPropertySet
+ XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(
+ XPropertySet.class, mDataPilotFieldObject);
+ _XPropertySet _xProp = new _XPropertySet(xProp, log, param);
+ assure("_getPropertySetInfo failed.",_xProp._getPropertySetInfo());
+ assure("_addPropertyChangeListener failed.",_xProp._addPropertyChangeListener());
+ assure("_addVetoableChangeListener failed.",_xProp._addVetoableChangeListener());
+ assure("_setPropertyValue failed.",_xProp._setPropertyValue());
+ assure("_getPropertyValue failed.",_xProp._getPropertyValue());
+ assure("_removePropertyChangeListener failed.",_xProp._removePropertyChangeListener());
+ assure("_removeVetoableChangeListener failed.",_xProp._removeVetoableChangeListener());
+
+ }
+
+ /**
+ * Test the data pilot table object:
+ * simply execute the interface tests in a row
+ */
+ public void testDataPilotTableObject() {
+ log.println("Starting 'testDataPilotTableObject'");
+ // _XNamed
+ XNamed xNamed = (XNamed)UnoRuntime.queryInterface(
+ XNamed.class, mDataPilotTableObject);
+ _XNamed _xNamed = new _XNamed(xNamed, log, param);
+ assure("_getName failed.",_xNamed._getName());
+ assure("_setName failed.",_xNamed._setName());
+
+ // _XDataPilotTable
+ XDataPilotTable xDataPilotTable = (XDataPilotTable)
+ UnoRuntime.queryInterface(XDataPilotTable.class,
+ mDataPilotTableObject);
+ _XDataPilotTable _xDataPilotTable =
+ new _XDataPilotTable(xDataPilotTable, log, param);
+ assure("before failed.", _xDataPilotTable.before());
+ assure("_getOutputRange failed.", _xDataPilotTable._getOutputRange()) ;
+ assure("_refresh failed.", _xDataPilotTable._refresh()) ;
+
+ // _XDataPilotDescriptor
+ XDataPilotDescriptor xDataPilotDescriptor = (XDataPilotDescriptor)
+ UnoRuntime.queryInterface(XDataPilotDescriptor.class,
+ mDataPilotTableObject);
+ _XDataPilotDescriptor _xDataPilotDescriptor =
+ new _XDataPilotDescriptor(xDataPilotDescriptor, log, param);
+ assure("before failed.", _xDataPilotDescriptor.before());
+ assure("_setTag failed.", _xDataPilotDescriptor._setTag()) ;
+ assure("_getTag failed.", _xDataPilotDescriptor._getTag()) ;
+ assure("_getFilterDescriptor failed.", _xDataPilotDescriptor._getFilterDescriptor()) ;
+ assure("_getDataPilotFields failed.", _xDataPilotDescriptor._getDataPilotFields()) ;
+ assure("_getColumnFields failed.", _xDataPilotDescriptor._getColumnFields()) ;
+ assure("_getRowFields failed.", _xDataPilotDescriptor._getRowFields()) ;
+ assure("_getDataFields failed.", _xDataPilotDescriptor._getDataFields()) ;
+ assure("_getHiddenFields failed.", _xDataPilotDescriptor._getHiddenFields()) ;
+ assure("_getPageFields failed.", _xDataPilotDescriptor._getPageFields()) ;
+ assure("_setSourceRange failed.", _xDataPilotDescriptor._setSourceRange()) ;
+ assure("_getSourceRange failed.", _xDataPilotDescriptor._getSourceRange()) ;
+ }
+
+ /**
+ * create an environment for the test
+ */
+ public void before() {
+ Object oInterface = null;
+ XSpreadsheetDocument xSheetDoc = null;
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)param.getMSF() );
+
+ // the cell range
+ CellRangeAddress sCellRangeAdress = new CellRangeAddress();
+ sCellRangeAdress.Sheet = 0;
+ sCellRangeAdress.StartColumn = 1;
+ 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;
+
+ try {
+ log.println( "Creating a Spreadsheet document" );
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace();
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ 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(
+ new Type(XSpreadsheet.class),oIndexAccess.getByIndex(0));
+ oSheet2 = (XSpreadsheet) AnyConverter.toObject(
+ new Type(XSpreadsheet.class),oIndexAccess.getByIndex(1));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace();
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace();
+ throw new StatusException( "Couldn't get a spreadsheet", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ 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);
+ oSheet.getCellByPosition(0, i).setFormula("Row" + i);
+ 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++) {
+ oSheet.getCellByPosition(i, j).setValue(i * (j + 1));
+ oSheet2.getCellByPosition(i, j).setValue(i * (j + 2));
+ }
+ } 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);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ 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;
+ try {
+ Object oDataPilotField = DPDsc.getDataPilotFields().getByIndex(0);
+ fieldPropSet = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oDataPilotField);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't create a test environment", e);
+ }
+
+ try {
+ fieldPropSet.setPropertyValue("Function",
+ com.sun.star.sheet.GeneralFunction.SUM);
+ fieldPropSet.setPropertyValue("Orientation",
+ com.sun.star.sheet.DataPilotFieldOrientation.DATA);
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ 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);
+ try {
+ mDataPilotTableObject = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),DPT.getByName(DPT.getElementNames()[0]));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't create a test environment", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't create a test environment", e);
+ }
+
+ XIndexAccess IA = DPDsc.getDataPilotFields();
+ try {
+ mDataPilotFieldObject = (XInterface)AnyConverter.toObject(
+ new Type(XInterface.class),IA.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't get data pilot field", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't get data pilot field", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace();
+ throw new StatusException("Couldn't get data pilot field", e);
+ }
+
+ // Other parameters required for interface tests
+ param.put("OUTPUTRANGE", sCellAdress);
+ param.put("CELLFORCHANGE", oChangeCell);
+ param.put("CELLFORCHECK", oCheckCell);
+ param.put("CHANGEVALUE", aChangeValue);
+ param.put("FIELDSAMOUNT", new Integer(5));
+
+ }
+
+}
diff --git a/sc/qa/complex/dataPilot/interfaceTests/beans/_XPropertySet.java b/sc/qa/complex/dataPilot/interfaceTests/beans/_XPropertySet.java
new file mode 100644
index 000000000000..57d6474f51b8
--- /dev/null
+++ b/sc/qa/complex/dataPilot/interfaceTests/beans/_XPropertySet.java
@@ -0,0 +1,631 @@
+/*************************************************************************
+ *
+ * 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
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package complex.dataPilot.interfaceTests.beans;
+
+import com.sun.star.beans.Property;
+import com.sun.star.beans.PropertyAttribute;
+import com.sun.star.beans.PropertyChangeEvent;
+import com.sun.star.beans.XPropertyChangeListener;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.beans.XPropertySetInfo;
+import com.sun.star.beans.XVetoableChangeListener;
+import com.sun.star.lang.EventObject;
+import java.util.Random;
+import java.util.StringTokenizer;
+import lib.TestParameters;
+import share.LogWriter;
+//import lib.MultiMethodTest;
+import util.ValueChanger;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.beans.XPropertySet</code>
+* interface methods :
+* <ul>
+* <li><code>getPropertySetInfo()</code></li>
+* <li><code>setPropertyValue()</code></li>
+* <li><code>getPropertyValue()</code></li>
+* <li><code>addPropertyChangeListener()</code></li>
+* <li><code>removePropertyChangeListener()</code></li>
+* <li><code>addVetoableChangeListener()</code></li>
+* <li><code>removeVetoableChangeListener()</code></li>
+* </ul>
+* @see com.sun.star.beans.XPropertySet
+*/
+public class _XPropertySet {
+
+ /**
+ * The object that is testsed.
+ */
+ private XPropertySet oObj = null;
+
+ /**
+ * The test parameters
+ */
+ private TestParameters param = null;
+
+ /**
+ * The log writer
+ */
+ private LogWriter log = null;
+
+ /**
+ * Flag that indicates change listener was called.
+ */
+ boolean propertyChanged = false;
+
+
+ /**
+ * The own property change listener
+ */
+ XPropertyChangeListener PClistener = new MyChangeListener();
+
+ /**
+ * Listener that must be called on bound property changing.
+ */
+ public class MyChangeListener implements XPropertyChangeListener {
+ /**
+ * Just set <code>propertyChanged</code> flag to true.
+ */
+ public void propertyChange(PropertyChangeEvent e) {
+ propertyChanged = true;
+ }
+ public void disposing (EventObject obj) {}
+ };
+
+
+ /**
+ * Flag that indicates veto listener was called.
+ */
+ boolean vetoableChanged = false;
+
+ /**
+ * The own vetoable change listener
+ */
+ XVetoableChangeListener VClistener = new MyVetoListener();
+
+ /**
+ * Listener that must be called on constrained property changing.
+ */
+ public class MyVetoListener implements XVetoableChangeListener {
+ /**
+ * Just set <code>vetoableChanged</code> flag to true.
+ */
+ public void vetoableChange(PropertyChangeEvent e) {
+ vetoableChanged = true;
+ }
+ public void disposing (EventObject obj) {}
+ };
+
+
+ /**
+ * Properties to test
+ */
+ PropsToTest PTT = new PropsToTest();
+
+ /**
+ * Structure that collects three properties of each type to test :
+ * Constrained, Bound and Normal.
+ */
+ public class PropsToTest {
+ String constrained = null;
+ String bound = null;
+ String normal = null;
+ }
+
+ /**
+ * Constructor: gets the object to test, a logger and the test parameters
+ * @param xObj The test object
+ * @param log A log writer
+ * @param param The test parameters
+ */
+ public _XPropertySet(XPropertySet xObj, LogWriter log, TestParameters param) {
+ oObj = xObj;
+ this.log = log;
+ this.param = param;
+ }
+
+ /**
+ * Tests method <code>getPropertySetInfo</code>. After test completed
+ * call {@link #getPropsToTest} method to retrieve different kinds
+ * of properties to test then. <p>
+ * Has OK status if not null <code>XPropertySetInfo</code>
+ * object returned.<p>
+ * Since <code>getPropertySetInfo</code> is optional, it may return null,
+ * if it is not implemented. This method uses then an object relation
+ * <code>PTT</code> (Properties To Test) to determine available properties.
+ * All tests for services without <code>getPropertySetInfo</code> must
+ * provide this object relation.
+ */
+ public boolean _getPropertySetInfo() {
+ XPropertySetInfo propertySetInfo = oObj.getPropertySetInfo();
+
+ if (propertySetInfo == null) {
+ log.println("getPropertySetInfo() method returned null");
+ String[] ptt = (String[]) param.get("PTT");
+ PTT.normal=ptt[0];
+ PTT.bound=ptt[1];
+ PTT.constrained=ptt[2];
+ } else {
+ getPropsToTest(propertySetInfo);
+ }
+
+ return true;
+
+ } // end of getPropertySetInfo()
+
+ /**
+ * Tests change listener which added for bound properties.
+ * Adds listener to bound property (if it exists), then changes
+ * its value and check if listener was called. <p>
+ * Method tests to be successfully completed before :
+ * <ul>
+ * <li> <code>getPropertySetInfo</code> : in this method test
+ * one of bound properties is retrieved. </li>
+ * </ul> <p>
+ * Has OK status if NO bound properties exist or if listener
+ * was successfully called.
+ */
+ public boolean _addPropertyChangeListener() {
+
+ propertyChanged = false;
+ boolean result = true;
+
+ if ( PTT.bound.equals("none") ) {
+ log.println("*** No bound properties found ***");
+ } else {
+ try {
+ oObj.addPropertyChangeListener(PTT.bound,PClistener);
+ Object gValue = oObj.getPropertyValue(PTT.bound);
+ oObj.setPropertyValue(PTT.bound,
+ ValueChanger.changePValue(gValue));
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.bound+"'");
+ e.printStackTrace((java.io.PrintWriter)log);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.bound+"'");
+ e.printStackTrace((java.io.PrintWriter)log);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.bound+"'");
+ e.printStackTrace((java.io.PrintWriter)log);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.bound+"'");
+ e.printStackTrace((java.io.PrintWriter)log);
+ } // end of try-catch
+ result = propertyChanged;
+ if (!propertyChanged) {
+ log.println("propertyChangeListener wasn't called for '"+
+ PTT.bound+"'");
+ }
+ } //endif
+
+ return result;
+
+ } // end of addPropertyChangeListener()
+
+ /**
+ * Tests vetoable listener which added for constrained properties.
+ * Adds listener to constrained property (if it exists), then changes
+ * its value and check if listener was called. <p>
+ * Method tests to be successfully completed before :
+ * <ul>
+ * <li> <code>getPropertySetInfo</code> : in this method test
+ * one of constrained properties is retrieved. </li>
+ * </ul> <p>
+ * Has OK status if NO constrained properties exist or if listener
+ * was successfully called.
+ */
+ public boolean _addVetoableChangeListener() {
+
+// requiredMethod("getPropertySetInfo()");
+
+ vetoableChanged = false;
+ boolean result = true;
+
+ if ( PTT.constrained.equals("none") ) {
+ log.println("*** No constrained properties found ***");
+ } else {
+ try {
+ oObj.addVetoableChangeListener(PTT.constrained,VClistener);
+ Object gValue = oObj.getPropertyValue(PTT.constrained);
+ oObj.setPropertyValue(PTT.constrained,
+ ValueChanger.changePValue(gValue));
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.constrained+"'");
+ e.printStackTrace((java.io.PrintWriter)log);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.constrained+"'");
+ e.printStackTrace((java.io.PrintWriter)log);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.constrained+"'");
+ e.printStackTrace((java.io.PrintWriter)log);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.constrained+"'");
+ e.printStackTrace((java.io.PrintWriter)log);
+ } // end of try-catch
+ result = vetoableChanged;
+ if (!vetoableChanged) {
+ log.println("vetoableChangeListener wasn't called for '"+
+ PTT.constrained+"'");
+ }
+ } //endif
+
+ return result;
+
+ } // end of addVetoableChangeListener()
+
+
+ /**
+ * Tests <code>setPropertyValue</code> method.
+ * Stores value before call, and compares it with value after
+ * call. <p>
+ * Method tests to be successfully completed before :
+ * <ul>
+ * <li> <code>getPropertySetInfo</code> : in this method test
+ * one of normal properties is retrieved. </li>
+ * </ul> <p>
+ * Has OK status if NO normal properties exist or if value before
+ * method call is not equal to value after.
+ */
+ public boolean _setPropertyValue() {
+
+// requiredMethod("getPropertySetInfo()");
+
+ Object gValue = null;
+ Object sValue = null;
+
+ boolean result = true;
+
+ if ( PTT.normal.equals("none") ) {
+ log.println("*** No changeable properties found ***");
+ } else {
+ try {
+ gValue = oObj.getPropertyValue(PTT.normal);
+ sValue = ValueChanger.changePValue(gValue);
+ oObj.setPropertyValue(PTT.normal, sValue);
+ sValue = oObj.getPropertyValue(PTT.normal);
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.normal+"'");
+ e.printStackTrace((java.io.PrintWriter)log);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.normal+"'");
+ e.printStackTrace((java.io.PrintWriter)log);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.normal+"'");
+ e.printStackTrace((java.io.PrintWriter)log);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.normal+"'");
+ e.printStackTrace((java.io.PrintWriter)log);
+ } // end of try-catch
+ result = !gValue.equals(sValue);
+ } //endif
+
+ return result;
+
+ } // end of setPropertyValue()
+
+ /**
+ * Tests <code>getPropertyValue</code> method.
+ * Just call this method and checks for no exceptions <p>
+ * Method tests to be successfully completed before :
+ * <ul>
+ * <li> <code>getPropertySetInfo</code> : in this method test
+ * one of normal properties is retrieved. </li>
+ * </ul> <p>
+ * Has OK status if NO normal properties exist or if no
+ * exceptions were thrown.
+ */
+ public boolean _getPropertyValue() {
+
+// requiredMethod("getPropertySetInfo()");
+
+ boolean result = true;
+ String toCheck = PTT.normal;
+
+ if ( PTT.normal.equals("none") ) {
+ toCheck = oObj.getPropertySetInfo().getProperties()[0].Name;
+ log.println("All properties are Read Only");
+ log.println("Using: "+toCheck);
+ }
+
+ try {
+ Object gValue = oObj.getPropertyValue(toCheck);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception occured while trying to get property '"+
+ PTT.normal+"'");
+ e.printStackTrace((java.io.PrintWriter)log);
+ result = false;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception occured while trying to get property '"+
+ PTT.normal+"'");
+ e.printStackTrace((java.io.PrintWriter)log);
+ result = false;
+ } // end of try-catch
+
+ return result;
+ }
+
+ /**
+ * Tests <code>removePropertyChangeListener</code> method.
+ * Removes change listener, then changes bound property value
+ * and checks if the listener was NOT called.
+ * Method tests to be successfully completed before :
+ * <ul>
+ * <li> <code>addPropertyChangeListener</code> : here listener
+ * was added. </li>
+ * </ul> <p>
+ * Has OK status if NO bound properties exist or if listener
+ * was not called and no exceptions arose.
+ */
+ public boolean _removePropertyChangeListener() {
+
+// requiredMethod("addPropertyChangeListener()");
+
+ propertyChanged = false;
+ boolean result = true;
+
+ if ( PTT.bound.equals("none") ) {
+ log.println("*** No bound properties found ***");
+ } else {
+ try {
+ propertyChanged = false;
+ oObj.removePropertyChangeListener(PTT.bound,PClistener);
+ Object gValue = oObj.getPropertyValue(PTT.bound);
+ oObj.setPropertyValue(PTT.bound,
+ ValueChanger.changePValue(gValue));
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.bound+"'");
+ e.printStackTrace((java.io.PrintWriter)log);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.bound+"'");
+ e.printStackTrace((java.io.PrintWriter)log);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.bound+"'");
+ e.printStackTrace((java.io.PrintWriter)log);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.bound+"'");
+ e.printStackTrace((java.io.PrintWriter)log);
+ } // end of try-catch
+
+ result = !propertyChanged;
+ if (propertyChanged) {
+ log.println("propertyChangeListener was called after removing"+
+ " for '"+PTT.bound+"'");
+ }
+ } //endif
+
+ return result;
+
+ } // end of removePropertyChangeListener()
+
+
+ /**
+ * Tests <code>removeVetoableChangeListener</code> method.
+ * Removes vetoable listener, then changes constrained property value
+ * and checks if the listener was NOT called.
+ * Method tests to be successfully completed before :
+ * <ul>
+ * <li> <code>addPropertyChangeListener</code> : here vetoable listener
+ * was added. </li>
+ * </ul> <p>
+ * Has OK status if NO constrained properties exist or if listener
+ * was NOT called and no exceptions arose.
+ */
+ public boolean _removeVetoableChangeListener() {
+
+// requiredMethod("addVetoableChangeListener()");
+
+ vetoableChanged = false;
+ boolean result = true;
+
+ if ( PTT.constrained.equals("none") ) {
+ log.println("*** No constrained properties found ***");
+ } else {
+ try {
+ oObj.removeVetoableChangeListener(PTT.constrained,VClistener);
+ Object gValue = oObj.getPropertyValue(PTT.constrained);
+ oObj.setPropertyValue(PTT.constrained,
+ ValueChanger.changePValue(gValue));
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.constrained+"'");
+ e.printStackTrace((java.io.PrintWriter)log);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.constrained+"'");
+ e.printStackTrace((java.io.PrintWriter)log);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.constrained+"'");
+ e.printStackTrace((java.io.PrintWriter)log);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception occured while trying to change "+
+ "property '"+ PTT.constrained+"'");
+ e.printStackTrace((java.io.PrintWriter)log);
+ } // end of try-catch
+
+ result = !vetoableChanged;
+ if (vetoableChanged) {
+ log.println("vetoableChangeListener was called after "+
+ "removing for '"+PTT.constrained+"'");
+ }
+ } //endif
+
+ return result;
+
+ } // end of removeVetoableChangeListener()
+
+
+ /**
+ * Gets the properties being tested. Searches and stores by one
+ * property of each kind (Bound, Vetoable, Normal).
+ */
+ public PropsToTest getPropsToTest(XPropertySetInfo xPSI) {
+
+ Property[] properties = xPSI.getProperties();
+ String bound = "";
+ String constrained = "";
+ String normal = "";
+
+ for (int i = 0; i < properties.length; i++) {
+
+ Property property = properties[i];
+ String name = property.Name;
+ log.println("Checking '"+name+"'");
+ boolean isWritable = ((property.Attributes &
+ PropertyAttribute.READONLY) == 0);
+ boolean isNotNull = ((property.Attributes &
+ PropertyAttribute.MAYBEVOID) == 0);
+ boolean isBound = ((property.Attributes &
+ PropertyAttribute.BOUND) != 0);
+ boolean isConstr = ((property.Attributes &
+ PropertyAttribute.CONSTRAINED) != 0);
+ boolean canChange = false;
+
+ if ( !isWritable ) log.println("Property '"+name+"' is READONLY");
+
+ if (name.endsWith("URL")) isWritable = false;
+ if (name.startsWith("Fill")) isWritable = false;
+ if (name.startsWith("Font")) isWritable = false;
+ if (name.startsWith("IsNumbering")) isWritable = false;
+ if (name.startsWith("LayerName")) isWritable = false;
+ if (name.startsWith("Line")) isWritable = false;
+
+ //if (name.equals("xinterfaceA") || name.equals("xtypeproviderA")
+ //|| name.equals("arAnyA")) isWritable=false;
+
+ if ( isWritable && isNotNull ) canChange = isChangeable(name);
+
+ if ( isWritable && isNotNull && isBound && canChange) {
+ bound+=name+";";
+ }
+
+ if ( isWritable && isNotNull && isConstr && canChange) {
+ constrained+=name+";";
+ }
+
+ if ( isWritable && isNotNull && canChange) normal+=name+";";
+
+
+ } // endfor
+
+ //get a random bound property
+ PTT.bound=getRandomString(bound);
+ log.println("Bound: "+PTT.bound);
+
+ //get a random constrained property
+ PTT.constrained=getRandomString(constrained);
+ log.println("Constrained: "+PTT.constrained);
+
+ //get a random normal property
+ PTT.normal=getRandomString(normal);
+
+ return PTT;
+
+ }
+
+ /**
+ * Retrieves one random property name from list (property names separated
+ * by ';') of property names.
+ */
+ public String getRandomString(String str) {
+
+ String gRS = "none";
+ Random rnd = new Random();
+
+ if (str.equals("")) str = "none";
+ StringTokenizer ST=new StringTokenizer(str,";");
+ int nr = rnd.nextInt(ST.countTokens());
+ if (nr < 1) nr+=1;
+ for (int i=1; i<nr+1; i++) gRS = ST.nextToken();
+
+ return gRS;
+
+ }
+
+ public boolean isChangeable(String name) {
+ boolean hasChanged = false;
+ try {
+ Object getProp = oObj.getPropertyValue(name);
+ log.println("Getting: "+getProp);
+
+ Object setValue = null;
+ if (getProp != null) {
+ if (!utils.isVoid(getProp))
+ setValue = ValueChanger.changePValue(getProp);
+ else log.println("Property '"+name+
+ "' is void but MAYBEVOID isn't set");
+ } else log.println("Property '"+name+"'is null and can't be changed");
+ if (name.equals("LineStyle")) setValue = null;
+ if (setValue != null) {
+ oObj.setPropertyValue(name, setValue);
+ log.println("Setting to :"+setValue);
+ hasChanged = (! getProp.equals(oObj.getPropertyValue(name)));
+ } else log.println("Couldn't change Property '"+name+"'");
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println("'" + name + "' throws exception '" + e + "'");
+ e.printStackTrace((java.io.PrintWriter)log);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("'" + name + "' throws exception '" + e + "'");
+ e.printStackTrace((java.io.PrintWriter)log);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("'" + name + "' throws exception '" + e + "'");
+ e.printStackTrace((java.io.PrintWriter)log);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("'" + name + "' throws exception '" + e + "'");
+ e.printStackTrace((java.io.PrintWriter)log);
+ } catch (com.sun.star.uno.RuntimeException e) {
+ log.println("'" + name + "' throws exception '" + e + "'");
+ e.printStackTrace((java.io.PrintWriter)log);
+ } catch (java.lang.ArrayIndexOutOfBoundsException e) {
+ log.println("'" + name + "' throws exception '" + e + "'");
+ e.printStackTrace((java.io.PrintWriter)log);
+ }
+
+ return hasChanged;
+ }
+
+
+} // finish class _XPropertySet
+
diff --git a/sc/qa/complex/dataPilot/interfaceTests/beans/makefile.mk b/sc/qa/complex/dataPilot/interfaceTests/beans/makefile.mk
new file mode 100644
index 000000000000..6ef9f7456cbb
--- /dev/null
+++ b/sc/qa/complex/dataPilot/interfaceTests/beans/makefile.mk
@@ -0,0 +1,46 @@
+#*************************************************************************
+#
+# 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
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ = ..$/..$/..$/..$/..
+TARGET = DataPilotInterfaceBeans
+PRJNAME = sc
+PACKAGE = complex$/dataPilot$/interfaceTests$/beans
+
+# --- Settings -----------------------------------------------------
+.INCLUDE: settings.mk
+
+
+#----- compile .java files -----------------------------------------
+
+JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
+JAVAFILES = _XPropertySet.java
+JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
+
diff --git a/sc/qa/complex/dataPilot/interfaceTests/container/_XNamed.java b/sc/qa/complex/dataPilot/interfaceTests/container/_XNamed.java
new file mode 100644
index 000000000000..97763be2b199
--- /dev/null
+++ b/sc/qa/complex/dataPilot/interfaceTests/container/_XNamed.java
@@ -0,0 +1,147 @@
+/*************************************************************************
+ *
+ * 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
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package complex.dataPilot.interfaceTests.container;
+
+import com.sun.star.container.XNamed;
+import lib.TestParameters;
+import share.LogWriter;
+import util.utils;
+
+/**
+* Testing <code>com.sun.star.container.XNamed</code>
+* interface methods :
+* <ul>
+* <li><code> getName()</code></li>
+* <li><code> setName()</code></li>
+* </ul>
+* This test need the following object relations :
+* <ul>
+* <li> <code>'setName'</code> : of <code>Boolean</code>
+* type. If it exists then <code>setName</code> method
+* isn't to be tested and result of this test will be
+* equal to relation value.</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.container.XNamed
+*/
+public class _XNamed {
+
+ /**
+ * The object that is testsed.
+ */
+ public XNamed oObj = null;
+
+ /**
+ * The test parameters
+ */
+ private TestParameters param = null;
+
+ /**
+ * The log writer
+ */
+ private LogWriter log = null;
+
+ /**
+ * Constructor: gets the object to test, a logger and the test parameters
+ * @param xObj The test object
+ * @param log A log writer
+ * @param param The test parameters
+ */
+ public _XNamed(XNamed xObj, LogWriter log, TestParameters param) {
+ oObj = xObj;
+ this.log = log;
+ this.param = param;
+ }
+
+ /**
+ * Test calls the method and checks return value and that
+ * no exceptions were thrown. <p>
+ * Has <b> OK </b> status if the method returns non null value
+ * and no exceptions were thrown. <p>
+ */
+ public boolean _getName() {
+
+ // write to log what we try next
+ log.println( "test for getName()" );
+
+ boolean result = true;
+ boolean loc_result = true;
+ String name = null;
+ String NewName = null;
+
+ loc_result = ((name = oObj.getName()) != null);
+ log.println("getting the name \"" + name + "\"");
+
+ if (loc_result) log.println("... getName() - OK");
+ else log.println("... getName() - FAILED");
+ result &= loc_result;
+ return result;
+ }
+
+ /**
+ * Sets a new name for object and checks if it was properly
+ * set. Special cases for the following objects :
+ * <ul>
+ * <li><code>ScSheetLinkObj</code> : name must be in form of URL.</li>
+ * <li><code>ScDDELinkObj</code> : name must contain link to cell in
+ * some external Sheet.</li>
+ * </ul>
+ * Has <b> OK </b> status if new name was successfully set, or if
+ * object environment contains relation <code>'setName'</code> with
+ * value <code>true</code>. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getName() </code> : to be sure the method works</li>
+ * </ul>
+ */
+ public boolean _setName(){
+// requiredMethod("getName()");
+ log.println("testing setName() ... ");
+
+ String oldName = oObj.getName();
+ String NewName = oldName == null ? "XNamed" : oldName + "X" ;
+
+ boolean result = true;
+ boolean loc_result = true;
+ log.println("set the name of object to \"" + NewName + "\"");
+ oObj.setName(NewName);
+ log.println("check that container has element with this name");
+
+ String name = oObj.getName();
+ log.println("getting the name \"" + name + "\"");
+ loc_result = name.equals(NewName);
+
+ if (loc_result) log.println("... setName() - OK");
+ else log.println("... setName() - FAILED");
+ result &= loc_result;
+ oObj.setName(oldName);
+ return result;
+ }
+}
+
+
diff --git a/sc/qa/complex/dataPilot/interfaceTests/container/makefile.mk b/sc/qa/complex/dataPilot/interfaceTests/container/makefile.mk
new file mode 100644
index 000000000000..675fe7be9a1c
--- /dev/null
+++ b/sc/qa/complex/dataPilot/interfaceTests/container/makefile.mk
@@ -0,0 +1,46 @@
+#*************************************************************************
+#
+# 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
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ = ..$/..$/..$/..$/..
+TARGET = DataPilotInterfaceContainer
+PRJNAME = sc
+PACKAGE = complex$/dataPilot$/interfaceTests$/container
+
+# --- Settings -----------------------------------------------------
+.INCLUDE: settings.mk
+
+
+#----- compile .java files -----------------------------------------
+
+JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
+JAVAFILES = _XNamed.java
+JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
+
diff --git a/sc/qa/complex/dataPilot/interfaceTests/sheet/_XDataPilotDescriptor.java b/sc/qa/complex/dataPilot/interfaceTests/sheet/_XDataPilotDescriptor.java
new file mode 100644
index 000000000000..8358e5bb6106
--- /dev/null
+++ b/sc/qa/complex/dataPilot/interfaceTests/sheet/_XDataPilotDescriptor.java
@@ -0,0 +1,449 @@
+/*************************************************************************
+ *
+ * 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
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package complex.dataPilot.interfaceTests.sheet;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.container.XNamed;
+import com.sun.star.sheet.DataPilotFieldOrientation;
+import com.sun.star.sheet.XDataPilotDescriptor;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.uno.UnoRuntime;
+import lib.MultiMethodTest;
+import lib.Status;
+//import lib.StatusException;
+import lib.TestParameters;
+import share.LogWriter;
+
+/**
+* Testing <code>com.sun.star.sheet.XDataPilotDescriptor</code>
+* interface methods :
+* <ul>
+* <li><code> getTag()</code></li>
+* <li><code> setTag()</code></li>
+* <li><code> getSourceRange()</code></li>
+* <li><code> setSourceRange()</code></li>
+* <li><code> getFilterDescriptor()</code></li>
+* <li><code> getDataPilotFields()</code></li>
+* <li><code> getColumnFields()</code></li>
+* <li><code> getRowFields()</code></li>
+* <li><code> getPageFields()</code></li>
+* <li><code> getDataFields()</code></li>
+* <li><code> getHiddenFields()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'FIELDSAMOUNT'</code> (of type <code>Integer</code>):
+* to have number of fields </li>
+* <ul> <p>
+* @see com.sun.star.sheet.XDataPilotDescriptor
+*/
+public class _XDataPilotDescriptor {
+
+ public XDataPilotDescriptor oObj = null;
+ CellRangeAddress CRA = new CellRangeAddress((short)1, 0, 0, 5, 5);
+ CellRangeAddress oldCRA = null ;
+ String sTag = new String ("XDataPilotDescriptor_Tag");
+ String fieldsNames[];
+ int fieldsAmount = 0;
+ int tEnvFieldsAmount = 0;
+
+ /**
+ * The test parameters
+ */
+ private TestParameters param = null;
+
+ /**
+ * The log writer
+ */
+ private LogWriter log = null;
+
+ /**
+ * Constructor: gets the object to test, a logger and the test parameters
+ * @param xObj The test object
+ * @param log A log writer
+ * @param param The test parameters
+ */
+ public _XDataPilotDescriptor(XDataPilotDescriptor xObj,
+ LogWriter log, TestParameters param) {
+ oObj = xObj;
+ this.log = log;
+ this.param = param;
+ }
+
+ /**
+ * Retrieves object relations.
+ * @throws StatusException If one of relations not found.
+ */
+ public boolean before() {
+ Integer amount = (Integer)param.get("FIELDSAMOUNT");
+ if (amount == null) {
+ log.println("Relation 'FIELDSAMOUNT' not found");
+ return false;
+ }
+ tEnvFieldsAmount = amount.intValue();
+ return true;
+ }
+
+ /**
+ * Test calls the method and compares returned value with value that was set
+ * in method <code>setSourceRange()</code>. <p>
+ * Has <b> OK </b> status if all fields of cell range addresses are equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setSourceRange() </code> : to have current source range </li>
+ * </ul>
+ */
+ public boolean _getSourceRange(){
+// requiredMethod("setSourceRange()");
+ boolean bResult = true;
+
+ CellRangeAddress objRA = oObj.getSourceRange();
+ bResult &= objRA.Sheet == CRA.Sheet;
+ bResult &= objRA.StartRow == CRA.StartRow;
+ bResult &= objRA.StartColumn == CRA.StartColumn;
+ bResult &= objRA.EndRow == CRA.EndRow;
+ bResult &= objRA.EndColumn == CRA.EndColumn;
+
+ return bResult;
+ }
+
+ /**
+ * Test gets the current source range, stores it and sets new source range.<p>
+ * Has <b> OK </b> status if the method successfully returns. <p>
+ * The following method tests are to be executed before :
+ * <ul>
+ * <li> <code> getColumnFields() </code> </li>
+ * <li> <code> getRowFields() </code> </li>
+ * <li> <code> getDataFields() </code> </li>
+ * <li> <code> getHiddenFields() </code> </li>
+ * <li> <code> getPageFields() </code> </li>
+ * </ul>
+ */
+ public boolean _setSourceRange(){
+/* executeMethod("getColumnFields()") ;
+ executeMethod("getRowFields()") ;
+ executeMethod("getDataFields()") ;
+ executeMethod("getHiddenFields()") ;
+ executeMethod("getPageFields()") ; */
+
+ oldCRA = oObj.getSourceRange() ;
+ oObj.setSourceRange(CRA);
+
+ return true;
+ }
+
+ /**
+ * Test calls the method and checks returned value with value that was set
+ * by method <code>setTag()</code>. <p>
+ * Has <b> OK </b> status if returned value is equal to value that was set
+ * by method <code>setTag()</code>. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> setTag() </code> : to have current tag </li>
+ * </ul>
+ */
+ public boolean _getTag(){
+// requiredMethod("setTag()");
+ boolean bResult = true;
+
+ String objTag = oObj.getTag();
+ bResult &= objTag.equals(sTag);
+
+ return bResult;
+ }
+
+ /**
+ * Test just calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns. <p>
+ */
+ public boolean _setTag(){
+ oObj.setTag(sTag);
+ return true;
+ }
+
+ /**
+ * Test calls the method , checks returned value, compares
+ * number of fields goten from returned value and obtained by object
+ * relation <code>'FIELDSAMOUNT'</code> and set property
+ * <code>Orientation</code> to one of DataPilotFieldOrientation values. <p>
+ * Has <b> OK </b> status if returned value isn't null, number of fields
+ * goten from returned value is less than number of fields obtained by relation
+ * and no exceptions were thrown. <p>
+ */
+ public boolean _getDataPilotFields(){
+ boolean bResult = true;
+ XIndexAccess IA = null;
+
+ IA = oObj.getDataPilotFields();
+ if (IA == null) {
+ log.println("Returned value is null.");
+ return false;
+ } else {log.println("getDataPilotFields returned not Null value -- OK");}
+
+ fieldsAmount = IA.getCount();
+ if (fieldsAmount < tEnvFieldsAmount) {
+ log.println("Number of fields is less than number goten by relation.");
+ return false;
+ } else {log.println("count of returned fields -- OK");}
+
+ fieldsNames = new String[tEnvFieldsAmount];
+ int i = -1 ;
+ int cnt = 0 ;
+ while (++i < fieldsAmount) {
+ Object field;
+ try {
+ field = IA.getByIndex(i);
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace((java.io.PrintWriter)log);
+ return false;
+ } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace((java.io.PrintWriter)log);
+ return false;
+ }
+
+ XNamed named = (XNamed)
+ UnoRuntime.queryInterface(XNamed.class, field);
+ String name = named.getName();
+
+ log.println("Field : '" + name + "' ... ") ;
+
+ if (!name.equals("Data")) {
+
+ fieldsNames[cnt] = name ;
+
+ XPropertySet props = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, field);
+
+ try {
+ switch (cnt % 5) {
+ case 0 :
+ props.setPropertyValue("Orientation",
+ DataPilotFieldOrientation.COLUMN);
+ log.println(" Column") ;
+ break;
+ case 1 :
+ props.setPropertyValue("Orientation",
+ DataPilotFieldOrientation.ROW);
+ log.println(" Row") ;
+ break;
+ case 2 :
+ props.setPropertyValue("Orientation",
+ DataPilotFieldOrientation.DATA);
+ log.println(" Data") ;
+ break;
+ case 3 :
+ props.setPropertyValue("Orientation",
+ DataPilotFieldOrientation.HIDDEN);
+ log.println(" Hidden") ;
+ break;
+ case 4 :
+ props.setPropertyValue("Orientation",
+ DataPilotFieldOrientation.PAGE);
+ log.println(" Page") ;
+ props.setPropertyValue("CurrentPage", "20");
+ break;
+ } } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace((java.io.PrintWriter)log);
+ return false;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace((java.io.PrintWriter)log);
+ return false;
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace((java.io.PrintWriter)log);
+ return false;
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace((java.io.PrintWriter)log);
+ return false;
+ }
+ if (++cnt > 4) break;
+ } else {
+ return false;
+ }
+ }
+
+ return bResult;
+ }
+
+ /**
+ * Test calls the method and checks returned collection using the method
+ * <code>CheckNames()</code>. <p>
+ * Has <b> OK </b> status if the method <code>CheckNames()</code> returns true
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getDataPilotFields() </code> : to have array of field names </li>
+ * </ul>
+ */
+ public boolean _getColumnFields(){
+// requiredMethod("getDataPilotFields()");
+ log.println("getColumnFields") ;
+ XIndexAccess IA = oObj.getColumnFields();
+ return CheckNames(IA, 0);
+ }
+
+ /**
+ * Test calls the method and checks returned collection using the method
+ * <code>CheckNames()</code>. <p>
+ * Has <b> OK </b> status if the method <code>CheckNames()</code> returned true
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getDataPilotFields() </code> : to have array of field names </li>
+ * </ul>
+ */
+ public boolean _getDataFields(){
+// requiredMethod("getDataPilotFields()");
+ log.println("getDataFields") ;
+ XIndexAccess IA = oObj.getDataFields();
+ return CheckNames(IA, 2);
+ }
+
+ /**
+ * Test calls the method and checks returned collection using the method
+ * <code>CheckNames()</code>. <p>
+ * Has <b> OK </b> status if the method <code>CheckNames()</code> returned true
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getDataPilotFields() </code> : to have array of field names </li>
+ * </ul>
+ */
+ public boolean _getHiddenFields(){
+// requiredMethod("getDataPilotFields()");
+ log.println("getHiddenFields") ;
+ XIndexAccess IA = oObj.getHiddenFields();
+ return CheckNames(IA, 3);
+ }
+
+ /**
+ * Test calls the method and checks returned collection using the method
+ * <code>CheckNames()</code>. <p>
+ * Has <b> OK </b> status if the method <code>CheckNames()</code> returned true
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getDataPilotFields() </code> : to have array of field names </li>
+ * </ul>
+ */
+ public boolean _getRowFields(){
+// requiredMethod("getDataPilotFields()");
+ log.println("getRowFields") ;
+ XIndexAccess IA = oObj.getRowFields();
+ boolean bResult = CheckNames(IA, 1);
+ return bResult;
+ }
+
+ /**
+ * setting of PageFields isn't supported by StarOffice Calc
+ * Has <b> OK </b> status if the returned IndexAccess
+ * isn't NULL. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getDataPilotFields() </code> : to have array of field names </li>
+ * </ul>
+ */
+ public boolean _getPageFields(){
+// requiredMethod("getDataPilotFields()");
+ log.println("getPageFields") ;
+ XIndexAccess IA = oObj.getPageFields();
+ boolean bResult = CheckNames(IA, 4);
+ return bResult;
+ }
+
+ /**
+ * Test calls the method and checks returned value. <p>
+ * Has <b> OK </b> status if returned value isn't null
+ * and no exceptions were thrown. <p>
+ */
+ public boolean _getFilterDescriptor(){
+ boolean bResult = oObj.getFilterDescriptor() != null;
+ return bResult;
+ }
+
+ /**
+ * Method checks that the field with index <code>rem</code> exists
+ * in the array <code>IA</code>.
+ * @param IA collection of elements that support interface <code>XNamed</code>
+ * @param rem index of field in the array of field names that was stored in
+ * the method <code>getDataPilotFields()</code>
+ * @return true if required field name exists in passed collection;
+ * false otherwise
+ * @see com.sun.star.container.XNamed
+ */
+ boolean CheckNames(XIndexAccess IA, int rem) {
+ String name = null;
+
+ if (IA == null) {
+ log.println("Null retruned.") ;
+ return false ;
+ }
+
+ if (fieldsNames[rem] == null) {
+ log.println("No fields were set to this orientation - cann't check result") ;
+ return true ;
+ }
+
+ if (IA.getCount() == 0) {
+ log.println("No fields found. Must be at least '"
+ + fieldsNames[rem] + "'") ;
+ return false ;
+ }
+
+ try {
+ log.println("Fields returned ") ;
+ for (int i = 0; i < IA.getCount(); i++) {
+ Object field = IA.getByIndex(i);
+ XNamed named = (XNamed)UnoRuntime.queryInterface
+ (XNamed.class, field);
+ name = named.getName();
+ log.println(" " + name) ;
+ if (fieldsNames[rem].equals(name)) {
+ log.println(" - OK") ;
+ return true ;
+ }
+ }
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace((java.io.PrintWriter)log);
+ return false ;
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace((java.io.PrintWriter)log);
+ return false ;
+ }
+ log.println(" - FAILED (field " + fieldsNames[rem] + " was not found.") ;
+ return false ;
+ }
+
+ /**
+ * Recreates object(to back old orientations of the fields).
+ *
+ protected void after() {
+ disposeEnvironment();
+ }*/
+}
+
diff --git a/sc/qa/complex/dataPilot/interfaceTests/sheet/_XDataPilotTable.java b/sc/qa/complex/dataPilot/interfaceTests/sheet/_XDataPilotTable.java
new file mode 100644
index 000000000000..d7f6e81b91e5
--- /dev/null
+++ b/sc/qa/complex/dataPilot/interfaceTests/sheet/_XDataPilotTable.java
@@ -0,0 +1,133 @@
+/*************************************************************************
+ *
+ * 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
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package complex.dataPilot.interfaceTests.sheet;
+
+import com.sun.star.sheet.XDataPilotTable;
+import com.sun.star.table.CellAddress;
+import com.sun.star.table.CellRangeAddress;
+import com.sun.star.table.XCell;
+import lib.Status;
+//import lib.StatusException;
+import lib.TestParameters;
+import share.LogWriter;
+
+/**
+* Testing <code>com.sun.star.sheet.XDataPilotTable</code>
+* interface methods :
+* <ul>
+* <li><code> getOutputRange()</code></li>
+* <li><code> refresh()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'OUTPUTRANGE'</code> (of type <code>CellAddress</code>):
+* to check value returned by method <code>getOutputRange()</code> </li>
+* <li> <code>'CELLFORCHANGE'</code> (of type <code>XCell</code>):
+* to check the method refresh(value of this cell will be changed)</li>
+* <li> <code>'CELLFORCHECK'</code> (of type <code>XCell</code>):
+* to check the method refresh (value of this cell must be changed after refresh
+* call) </li><ul> <p>
+* @see com.sun.star.sheet.XDataPilotTable
+* @see com.sun.star.table.CellAddress
+*/
+public class _XDataPilotTable {
+
+ public XDataPilotTable oObj = null;
+ XCell xCellForChange = null;
+ XCell xCellForCheck = null;
+ CellAddress OutputRange = null;
+ int changeValue = 0;
+
+ /**
+ * The test parameters
+ */
+ private TestParameters param = null;
+
+ /**
+ * The log writer
+ */
+ private LogWriter log = null;
+
+ /**
+ * Constructor: gets the object to test, a logger and the test parameters
+ * @param xObj The test object
+ * @param log A log writer
+ * @param param The test parameters
+ */
+ public _XDataPilotTable(XDataPilotTable xObj,
+ LogWriter log, TestParameters param) {
+ oObj = xObj;
+ this.log = log;
+ this.param = param;
+ }
+
+ public boolean before() {
+ xCellForChange = (XCell)param.get("CELLFORCHANGE");
+ xCellForCheck = (XCell)param.get("CELLFORCHECK");
+ OutputRange = (CellAddress)param.get("OUTPUTRANGE");
+ changeValue = ((Integer)param.get("CHANGEVALUE")).intValue();
+
+ if (xCellForChange == null || OutputRange == null ||
+ xCellForCheck == null) {
+ log.println("Relation not found");
+ return false;
+ }
+ return true;
+ }
+ /**
+ * Test calls the method and checks returned value using value obtained by
+ * object relation <code>'OUTPUTRANGE'</code>. <p>
+ * Has <b> OK </b> status if values are equal. <p>
+ */
+ public boolean _getOutputRange(){
+ boolean bResult = true;
+ CellRangeAddress objRange = oObj.getOutputRange();
+ bResult &= OutputRange.Sheet == objRange.Sheet;
+ bResult &= OutputRange.Row == objRange.StartRow;
+ bResult &= OutputRange.Column == objRange.StartColumn;
+ return bResult;
+ }
+
+ /**
+ * Test sets new value of the cell obtained by object relation
+ * 'CELLFORCHANGE', and checks value of the cell obtained by object
+ * relation 'CELLFORCHECK'.<p>
+ * Has <b>OK</b> status if value of the cell obtained by object relation
+ * 'CELLFORCHECK' is changed. <p>
+ */
+ public boolean _refresh(){
+ xCellForChange.setValue(changeValue);
+ double oldData = xCellForCheck.getValue();
+ oObj.refresh();
+ double newData = xCellForCheck.getValue();
+ log.println("Old data:" + oldData + "; new data:" + newData);
+
+ return oldData != newData;
+ }
+}
+
diff --git a/sc/qa/complex/dataPilot/interfaceTests/sheet/makefile.mk b/sc/qa/complex/dataPilot/interfaceTests/sheet/makefile.mk
new file mode 100644
index 000000000000..350e3fcb8f19
--- /dev/null
+++ b/sc/qa/complex/dataPilot/interfaceTests/sheet/makefile.mk
@@ -0,0 +1,46 @@
+#*************************************************************************
+#
+# 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
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ = ..$/..$/..$/..$/..
+TARGET = DataPilotInterfaceSheet
+PRJNAME = sc
+PACKAGE = complex$/dataPilot$/interfaceTests$/sheet
+
+# --- Settings -----------------------------------------------------
+.INCLUDE: settings.mk
+
+
+#----- compile .java files -----------------------------------------
+
+JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
+JAVAFILES = _XDataPilotDescriptor.java _XDataPilotTable.java
+JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
+
diff --git a/sc/qa/complex/dataPilot/makefile.mk b/sc/qa/complex/dataPilot/makefile.mk
new file mode 100644
index 000000000000..a0bf1df34d0e
--- /dev/null
+++ b/sc/qa/complex/dataPilot/makefile.mk
@@ -0,0 +1,58 @@
+#*************************************************************************
+#
+# 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
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ = ..$/..$/..
+TARGET = DataPilot
+PRJNAME = sc
+PACKAGE = complex$/dataPilot
+
+# --- Settings -----------------------------------------------------
+.INCLUDE: settings.mk
+
+
+#----- compile .java files -----------------------------------------
+
+JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
+JAVAFILES = CheckDataPilot.java
+JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
+
+SUBDIRS = interfaceTests$/beans interfaceTests$/container interfaceTests$/sheet
+#----- make a jar from compiled files ------------------------------
+
+MAXLINELENGTH = 100000
+
+JARCLASSDIRS = $(PACKAGE)
+JARTARGET = $(TARGET).jar
+JARCOMPRESS = TRUE
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
+
+
+run:
+ +java -cp $(CLASSPATH) org.openoffice.Runner -TimeOut 0 -tb java_complex -o $(PACKAGE:s#$/#.#).$(JAVAFILES:b)
diff --git a/sc/qa/complex/sc/CalcRTL.java b/sc/qa/complex/sc/CalcRTL.java
new file mode 100644
index 000000000000..9528c34b9267
--- /dev/null
+++ b/sc/qa/complex/sc/CalcRTL.java
@@ -0,0 +1,567 @@
+/*************************************************************************
+ *
+ * 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
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+package complex.sc;
+
+import com.sun.star.beans.Property;
+import com.sun.star.beans.PropertyAttribute;
+import com.sun.star.beans.PropertyVetoException;
+import com.sun.star.beans.UnknownPropertyException;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.beans.XPropertySetInfo;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.WrappedTargetException;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XCellRangeAddressable;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
+import com.sun.star.sheet.XSpreadsheets;
+import com.sun.star.table.XCell;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.util.XCloseable;
+
+import complexlib.ComplexTestCase;
+
+import java.io.PrintWriter;
+
+import util.DrawTools;
+import util.SOfficeFactory;
+import util.ValueComparer;
+
+
+public class CalcRTL extends ComplexTestCase {
+ XSpreadsheetDocument xSheetDoc = null;
+
+ /*
+ * This testcase checks the calcrtl feature added to cws_calcrtl in three steps
+ * <br>
+ * (<b>REMARK: </b> the testcases expects the TableLayout to be LR_TB)
+ * <br>
+ * 1. A calc document is opened and the properties in css.sheet.Spreadsheet are checked
+ * <br>
+ * 2. A calc document is opened and a shape inserted, afterwards the properties in css.sheet.Shape are checked
+ * <br>
+ * 3. A calc document is opened and a shape inserted, afterwards the effect of changing the TableLayout to the shape is checked
+ */
+ public String[] getTestMethodNames() {
+ return new String[] {
+ "checkSpreadsheetProperties", "checkShapeProperties",
+ "checkInfluenceOfSpreadsheetChange"
+ };
+ }
+
+ /*
+ * In this method a spreadsheet document is opened<br>
+ * afterwards all properties of the Spreadsheet are checked.<br>
+ * <p>
+ * These are
+ * <ul>
+ *<li> IsVisible
+ *<li> PageStyle
+ *<li> TableLayout
+ *</ul>
+ */
+ public void checkSpreadsheetProperties() {
+ assure("Couldn't open document", openSpreadsheetDocument());
+
+ XPropertySet set = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, getSpreadsheet());
+ assure("Problems when setting property 'IsVisible'",
+ changeProperty(set, "IsVisible", Boolean.FALSE));
+ assure("Problems when setting property 'IsVisible'",
+ changeProperty(set, "IsVisible", Boolean.TRUE));
+ assure("Problems when setting property 'PageStyle'",
+ changeProperty(set, "PageStyle", "Report"));
+ assure("Problems when setting property 'PageStyle'",
+ changeProperty(set, "PageStyle", "Default"));
+ assure("Problems when setting property 'TableLayout'",
+ changeProperty(set, "TableLayout",
+ new Short(com.sun.star.text.WritingMode2.RL_TB)));
+ assure("Problems when setting property 'TableLayout'",
+ changeProperty(set, "TableLayout",
+ new Short(com.sun.star.text.WritingMode2.LR_TB)));
+ assure("Couldn't close document", closeSpreadsheetDocument());
+ }
+
+ /*
+ * In this method a spreadsheet document is opened and a shape inserted<br>
+ * afterwards all calc specific properties of the Shape are checked.<br>
+ * <p>
+ * These are
+ * <ul>
+ *<li> Anchor
+ *<li> HoriOrientPosition
+ *<li> VertOrientPosition
+ *</ul>
+ */
+ public void checkShapeProperties() {
+ assure("Couldn't open document", openSpreadsheetDocument());
+
+ XPropertySet set = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, getInsertedShape());
+
+ try {
+ assure("Problems when setting property 'Anchor'",
+ changeProperty(set, "Anchor",
+ getSpreadsheet().getCellByPosition(5, 5)));
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ assure("Problems when setting property 'Anchor'", false);
+ }
+
+ assure("Problems when setting property 'HoriOrientPosition'",
+ changeProperty(set, "HoriOrientPosition", new Integer(1000)));
+
+ assure("Problems when setting property 'VertOrientPosition'",
+ changeProperty(set, "VertOrientPosition", new Integer(1000)));
+
+ assure("Couldn't close document", closeSpreadsheetDocument());
+ }
+
+ public void checkInfluenceOfSpreadsheetChange() {
+ assure("Couldn't open document", openSpreadsheetDocument());
+
+ XShape oShape = getInsertedShape();
+ XPropertySet sheetProps = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, getSpreadsheet());
+ XPropertySet shapeProps = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, oShape);
+
+ String[] previous = getShapeProps(shapeProps, oShape);
+ assure("Problems when setting property 'TableLayout'",
+ changeProperty(sheetProps, "TableLayout",
+ new Short(com.sun.star.text.WritingMode2.RL_TB)));
+
+ String[] RL_TB = getShapeProps(shapeProps, oShape);
+ assure("Problems when setting property 'TableLayout'",
+ changeProperty(sheetProps, "TableLayout",
+ new Short(com.sun.star.text.WritingMode2.LR_TB)));
+
+ String[] LR_TB = getShapeProps(shapeProps, oShape);
+ assure("Anchor has changed",
+ (previous[0].equals(RL_TB[0]) && previous[0].equals(LR_TB[0])));
+ assure("HoriOrientPosition has changed",
+ (Integer.valueOf(previous[1]).intValue() + Integer.valueOf(
+ RL_TB[1])
+ .intValue() +
+ Integer.valueOf(LR_TB[1]).intValue() == 2099));
+ assure("VertOrientPosition has changed",
+ (Integer.valueOf(previous[2]).intValue() + Integer.valueOf(
+ RL_TB[2])
+ .intValue() +
+ Integer.valueOf(LR_TB[2]).intValue() == 3*Integer.valueOf(previous[2]).intValue()));
+ assure("x-position hasn't changed",
+ (previous[3].equals(LR_TB[3]) &&
+ ((Integer.valueOf(previous[3]).intValue() * (-1)) -
+ oShape.getSize().Width != Integer.valueOf(LR_TB[2])
+ .intValue())));
+ assure("Couldn't close document", closeSpreadsheetDocument());
+ }
+
+ protected String[] getShapeProps(XPropertySet set, XShape oShape) {
+ String[] reValue = new String[4];
+
+ try {
+ reValue[0] = toString(getRealValue(set.getPropertyValue("Anchor")));
+ reValue[1] = toString(set.getPropertyValue("HoriOrientPosition"));
+ reValue[2] = toString(set.getPropertyValue("VertOrientPosition"));
+ reValue[3] = toString(new Integer(oShape.getPosition().X));
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ }
+
+ log.println("\t Anchor :" + reValue[0]);
+ log.println("\t HoriOrientPosition :" + reValue[1]);
+ log.println("\t VertOrientPosition :" + reValue[2]);
+ log.println("\t Shape Position (x,y) : (" + oShape.getPosition().X +
+ "," + oShape.getPosition().Y + ")");
+
+ return reValue;
+ }
+
+ /*
+ * this method opens a calc document and sets the corresponding class variable xSheetDoc
+ */
+ protected boolean openSpreadsheetDocument() {
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) param.getMSF());
+ boolean worked = true;
+
+ try {
+ log.println("creating a sheetdocument");
+ xSheetDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ worked = false;
+ e.printStackTrace((PrintWriter) log);
+ }
+
+ return worked;
+ }
+
+ /*
+ * this method closes a calc document and resets the corresponding class variable xSheetDoc
+ */
+ protected boolean closeSpreadsheetDocument() {
+ boolean worked = true;
+
+ log.println(" disposing xSheetDoc ");
+
+ try {
+ XCloseable oCloser = (XCloseable) UnoRuntime.queryInterface(
+ XCloseable.class, xSheetDoc);
+ oCloser.close(true);
+ } catch (com.sun.star.util.CloseVetoException e) {
+ worked = false;
+ log.println("Couldn't close document");
+ } catch (com.sun.star.lang.DisposedException e) {
+ worked = false;
+ log.println("Document already disposed");
+ } catch (java.lang.NullPointerException e) {
+ worked = false;
+ log.println("Couldn't get XCloseable");
+ }
+
+ xSheetDoc = null;
+
+ return worked;
+ }
+
+ /*
+ * This method gets the first Sheet of the SpreadsheetDocument
+ *
+ */
+ protected XSpreadsheet getSpreadsheet() {
+ XSpreadsheet oSheet = null;
+
+ log.println("getting sheets");
+
+ XSpreadsheets xSpreadsheets = (XSpreadsheets) xSheetDoc.getSheets();
+
+ log.println("getting a sheet");
+
+ XIndexAccess oIndexAccess = (XIndexAccess) UnoRuntime.queryInterface(
+ XIndexAccess.class, xSpreadsheets);
+
+ try {
+ oSheet = (XSpreadsheet) UnoRuntime.queryInterface(
+ XSpreadsheet.class, oIndexAccess.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace((PrintWriter) log);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ e.printStackTrace((PrintWriter) log);
+ }
+
+ return oSheet;
+ }
+
+ /*
+ * This method changes a given property to a given value
+ * Parameters:
+ * @param set : The XPropertySet that contains the properties
+ * @param pName : The name of the Property that has to be changed
+ * @param pValue : The value, the property should be changed too.
+ */
+ protected boolean changeProperty(XPropertySet set, String pName,
+ Object pValue) {
+ boolean worked = true;
+
+ try {
+ Object oldValue = set.getPropertyValue(pName);
+
+ // for an exception thrown during setting new value
+ // to pass it to checkResult method
+ Exception exception = null;
+
+ try {
+ set.setPropertyValue(pName, pValue);
+ } catch (IllegalArgumentException e) {
+ exception = e;
+ } catch (PropertyVetoException e) {
+ exception = e;
+ } catch (WrappedTargetException e) {
+ exception = e;
+ } catch (UnknownPropertyException e) {
+ exception = e;
+ } catch (RuntimeException e) {
+ exception = e;
+ }
+
+ // getting result value
+ Object resValue = set.getPropertyValue(pName);
+
+
+ // checking results
+ worked = checkResult(set, pName, oldValue, pValue, resValue,
+ exception);
+ } catch (Exception e) {
+ System.out.println("Exception occured while testing property '" +
+ pName + "'");
+ e.printStackTrace();
+ worked = false;
+ }
+
+ return worked;
+ }
+
+ /*
+ * This methods checks if a property has changed as expected
+ * Parameters:
+ * @param set : the given XPropertySet
+ * @param propName : the name of the property that has been changed
+ * @param oldValue : the value of the property before it has been changed
+ * @param newValue : the value the property has been set to
+ * @param resValue : the value getPropertyValue returned for the property
+ * @param exception : the exeption thrown during the change of the property
+ */
+ protected boolean checkResult(XPropertySet set, String propName,
+ Object oldValue, Object newValue,
+ Object resValue, Exception exception)
+ throws Exception {
+ XPropertySetInfo info = set.getPropertySetInfo();
+ Property prop = info.getPropertyByName(propName);
+
+ oldValue = getRealValue(oldValue);
+ newValue = getRealValue(newValue);
+ resValue = getRealValue(resValue);
+
+ short attr = prop.Attributes;
+ boolean readOnly = (prop.Attributes & PropertyAttribute.READONLY) != 0;
+ boolean maybeVoid = (prop.Attributes & PropertyAttribute.MAYBEVOID) != 0;
+
+ //check get-set methods
+ if (maybeVoid) {
+ log.println("Property " + propName + " is void");
+ }
+
+ if (readOnly) {
+ log.println("Property " + propName + " is readOnly");
+ }
+
+ if (util.utils.isVoid(oldValue) && !maybeVoid) {
+ log.println(propName + " is void, but it's not MAYBEVOID");
+
+ return false;
+ } else if (oldValue == null) {
+ log.println(propName +
+ " has null value, and therefore can't be changed");
+
+ return true;
+ } else if (readOnly) {
+ // check if exception was thrown
+ if (exception != null) {
+ if (exception instanceof PropertyVetoException) {
+ // the change of read only prohibited - OK
+ log.println("Property is ReadOnly and wasn't changed");
+ log.println("Property '" + propName + "' OK");
+
+ return true;
+ } else if (exception instanceof IllegalArgumentException) {
+ // the change of read only prohibited - OK
+ log.println("Property is ReadOnly and wasn't changed");
+ log.println("Property '" + propName + "' OK");
+
+ return true;
+ } else if (exception instanceof UnknownPropertyException) {
+ // the change of read only prohibited - OK
+ log.println("Property is ReadOnly and wasn't changed");
+ log.println("Property '" + propName + "' OK");
+
+ return true;
+ } else if (exception instanceof RuntimeException) {
+ // the change of read only prohibited - OK
+ log.println("Property is ReadOnly and wasn't changed");
+ log.println("Property '" + propName + "' OK");
+
+ return true;
+ } else {
+ throw exception;
+ }
+ } else {
+ // if no exception - check that value
+ // has not changed
+ if (!ValueComparer.equalValue(resValue, oldValue)) {
+ log.println("Read only property '" + propName +
+ "' has changed");
+
+ try {
+ if (!util.utils.isVoid(oldValue) &&
+ oldValue instanceof Any) {
+ oldValue = AnyConverter.toObject(
+ new Type(((Any) oldValue).getClass()),
+ oldValue);
+ }
+
+ log.println("old = " + toString(oldValue));
+ log.println("new = " + toString(newValue));
+ log.println("result = " + toString(resValue));
+ } catch (com.sun.star.lang.IllegalArgumentException iae) {
+ }
+
+ return false;
+ } else {
+ log.println("Read only property '" + propName +
+ "' hasn't changed");
+ log.println("Property '" + propName + "' OK");
+
+ return true;
+ }
+ }
+ } else {
+ if (exception == null) {
+ // if no exception thrown
+ // check that the new value is set
+ if ((!ValueComparer.equalValue(resValue, newValue)) ||
+ (ValueComparer.equalValue(resValue, oldValue))) {
+ log.println("Value for '" + propName +
+ "' hasn't changed as expected");
+
+ try {
+ if (!util.utils.isVoid(oldValue) &&
+ oldValue instanceof Any) {
+ oldValue = AnyConverter.toObject(
+ new Type(((Any) oldValue).getClass()),
+ oldValue);
+ }
+
+ log.println("old = " + toString(oldValue));
+ log.println("new = " + toString(newValue));
+ log.println("result = " + toString(resValue));
+ } catch (com.sun.star.lang.IllegalArgumentException iae) {
+ }
+
+ if (resValue != null) {
+ if ((!ValueComparer.equalValue(resValue, oldValue)) ||
+ (!resValue.equals(oldValue))) {
+ log.println("But it has changed.");
+
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ return false;
+ }
+
+ //tRes.tested(propName, false);
+ } else {
+ log.println("Property '" + propName + "' OK");
+
+ try {
+ if (!util.utils.isVoid(oldValue) &&
+ oldValue instanceof Any) {
+ oldValue = AnyConverter.toObject(
+ new Type(((Any) oldValue).getClass()),
+ oldValue);
+ }
+
+ log.println("old = " + toString(oldValue));
+ log.println("new = " + toString(newValue));
+ log.println("result = " + toString(resValue));
+ } catch (com.sun.star.lang.IllegalArgumentException iae) {
+ }
+
+ return true;
+ }
+ } else {
+ throw exception;
+ }
+ }
+ }
+
+ /*
+ * Returns a String representation of a given object, returns "null" in case of a NullObject
+ * @param obj : the given object
+ */
+ protected String toString(Object obj) {
+ return (obj == null) ? "null" : obj.toString();
+ }
+
+ /*
+ * Returns a human readable String representation for CellRangeAddressable
+ */
+ protected Object getRealValue(Object obj) {
+ Object value = null;
+
+ if (UnoRuntime.queryInterface(XCellRangeAddressable.class, obj) != null) {
+ XCellRangeAddressable aCell = (XCellRangeAddressable) UnoRuntime.queryInterface(
+ XCellRangeAddressable.class,
+ obj);
+ value = "Cell in Column " + aCell.getRangeAddress().StartColumn +
+ " and Row " + aCell.getRangeAddress().StartRow;
+ } else {
+ return obj;
+ }
+
+ return value;
+ }
+
+ /*
+ * This method inserts a RectangleShape into the calc document xSheetDoc and returns the resultung XShape-object
+ */
+ protected XShape getInsertedShape() {
+ XShape insertedShape = null;
+
+ try {
+ log.println("getting Drawpages");
+
+ XDrawPagesSupplier oDPS = (XDrawPagesSupplier) UnoRuntime.queryInterface(
+ XDrawPagesSupplier.class,
+ xSheetDoc);
+ XDrawPages oDP = (XDrawPages) oDPS.getDrawPages();
+ XDrawPage firstDrawPage = (XDrawPage) UnoRuntime.queryInterface(
+ XDrawPage.class,
+ oDP.getByIndex(0));
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) param.getMSF());
+ XComponent xComp = (XComponent) UnoRuntime.queryInterface(
+ XComponent.class, xSheetDoc);
+ insertedShape = SOF.createShape(xComp, 5000, 3500, 700, 500,
+ "Rectangle");
+ DrawTools.getShapes(firstDrawPage).add(insertedShape);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Couldn't create instance");
+ e.printStackTrace((PrintWriter) log);
+
+ return null;
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Couldn't create instance");
+ e.printStackTrace((PrintWriter) log);
+
+ return null;
+ }
+
+ return insertedShape;
+ }
+} \ No newline at end of file
diff --git a/sc/qa/complex/sc/makefile.mk b/sc/qa/complex/sc/makefile.mk
new file mode 100644
index 000000000000..097e6d0c5500
--- /dev/null
+++ b/sc/qa/complex/sc/makefile.mk
@@ -0,0 +1,57 @@
+#*************************************************************************
+#
+# 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
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ = ..$/..$/..
+TARGET = CalcRTL
+PRJNAME = sc
+PACKAGE = complex$/sc
+
+# --- Settings -----------------------------------------------------
+.INCLUDE: settings.mk
+
+
+#----- compile .java files -----------------------------------------
+
+JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar
+JAVAFILES = CalcRTL.java
+JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class)
+
+#----- make a jar from compiled files ------------------------------
+
+MAXLINELENGTH = 100000
+
+JARCLASSDIRS = $(PACKAGE)
+JARTARGET = $(TARGET).jar
+JARCOMPRESS = TRUE
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
+
+
+run:
+ +java -cp "$(CLASSPATH)" org.openoffice.Runner -TimeOut 0 -tb java_complex -o $(PACKAGE:s#$/#.#).$(JAVAFILES:b)
diff --git a/sc/qa/unoapi/Test.java b/sc/qa/unoapi/Test.java
new file mode 100644
index 000000000000..27d048b8bf51
--- /dev/null
+++ b/sc/qa/unoapi/Test.java
@@ -0,0 +1,51 @@
+/*************************************************************************
+* 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
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+************************************************************************/
+
+package org.openoffice.sc.qa.unoapi;
+
+import org.openoffice.Runner;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+
+public final class Test {
+ @org.junit.Before public void setUp() throws Exception {
+ connection.setUp();
+ }
+
+ @org.junit.After public void tearDown()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ connection.tearDown();
+ }
+
+ @org.junit.Test public void test() {
+ assertTrue(
+ Runner.run(
+ "-sce", "sc.sce", "-xcl", "knownissues.xcl", "-tdoc",
+ "testdocuments", "-cs", connection.getDescription()));
+ }
+
+ private final OfficeConnection connection = new OfficeConnection();
+}
diff --git a/sc/qa/unoapi/knownissues.xcl b/sc/qa/unoapi/knownissues.xcl
new file mode 100644
index 000000000000..205123fc0e48
--- /dev/null
+++ b/sc/qa/unoapi/knownissues.xcl
@@ -0,0 +1,199 @@
+### i84702 ###
+sc.AccessibleEditableTextPara_PreviewCell::com::sun::star::accessibility::XAccessibleEditableText
+
+### i84701 ###
+sc.ScAreaLinksObj::com::sun::star::sheet::XAreaLinks
+
+### i84711 ###
+sc.ScAreaLinkObj::com::sun::star::util::XRefreshable
+
+### i84697 ###
+sc.ScNamedRangesObj::com::sun::star::sheet::XNamedRanges
+
+### i84674 ###
+sc.ScCellTextCursor::com::sun::star::beans::XMultiPropertyStates
+sc.ScHeaderFooterTextCursor::com::sun::star::beans::XMultiPropertyStates
+
+### i20044 ###
+sc.ScCellObj::com::sun::star::sheet::XCellRangesQuery
+
+### i84672 ###
+sc.ScTableSheetObj::com::sun::star::table::XAutoFormattable
+
+### i84753 ###
+sc.ScCellRangeObj::com::sun::star::table::XAutoFormattable
+
+### i84671 ###
+sc.ScTableSheetObj::com::sun::star::sheet::XCellRangeData
+
+### i84669 ###
+sc.ScTabViewObj::com::sun::star::sheet::XRangeSelection
+
+### i23594 ###
+sc.ScAutoFormatsObj::com::sun::star::container::XNameReplace
+sc.ScStyleFamilyObj::com::sun::star::container::XNameReplace
+sc.ScTableSheetsObj::com::sun::star::container::XNameReplace
+
+### i31378 ###
+sc.ScDocumentConfiguration::com::sun::star::document::Settings
+
+### i33869 ###
+sc.ScHeaderFooterTextObj::com::sun::star::text::XTextRangeMover
+
+### i34066 ###
+sc.ScModelObj::com::sun::star::view::XPrintable::setPrinter()
+
+### i34878 ###
+sc.ScTableSheetObj::com::sun::star::sheet::XPrintAreas
+
+### i42534 ###
+sc.ScAccessibleDocument::com::sun::star::accessibility::XAccessibleSelection
+
+### i46730 ###
+sc.ScDataPilotFieldGroupObj::com::sun::star::container::XNameAccess
+
+### i53606 ###
+sc.ScTabViewObj::com::sun::star::awt::XUserInputInterception
+
+### i55490 ###
+sc.XMLExporter::com::sun::star::document::XFilter
+sc.XMLStylesExporter::com::sun::star::document::XFilter
+sc.XMLContentExporter::com::sun::star::document::XFilter
+sc.XMLMetaExporter::com::sun::star::document::XFilter
+sc.XMLSettingsExporter::com::sun::star::document::XFilter
+sc.XMLImporter::com::sun::star::document::XFilter
+sc.XMLStylesImporter::com::sun::star::document::XFilter
+sc.XMLContentImporter::com::sun::star::document::XFilter
+sc.XMLMetaImporter::com::sun::star::document::XFilter
+
+### i84666 ###
+sc.ScModelObj::com::sun::star::frame::XStorable
+
+### i34456 ###
+sc.ScModelObj::com::sun::star::view::XPrintJobBroadcaster
+
+### i73994 ###
+sc.ScAnnotationShapeObj::com::sun::star::style::ParagraphProperties
+sc.ScCellCursorObj::com::sun::star::style::ParagraphProperties
+sc.ScCellObj::com::sun::star::style::ParagraphProperties
+sc.ScCellRangeObj::com::sun::star::style::ParagraphProperties
+sc.ScCellRangesObj::com::sun::star::style::ParagraphProperties
+sc.ScCellTextCursor::com::sun::star::style::ParagraphProperties
+sc.ScTableSheetObj::com::sun::star::style::ParagraphProperties
+sc.ScHeaderFooterTextCursor::com::sun::star::style::ParagraphProperties
+
+### i84555 ###
+sc.ScAccessibleCsvCell::com::sun::star::accessibility::XAccessibleText
+sc.ScAccessibleCsvRuler::com::sun::star::accessibility::XAccessibleText
+
+### i84722 ###
+sc.ScAnnotationShapeObj::com::sun::star::drawing::FillProperties
+
+### i84727 ###
+sc.ScAccessibleCsvGrid::com::sun::star::accessibility::XAccessibleTable
+
+### i84761 ###
+sc.ScRecentFunctionsObj::com::sun::star::sheet::XRecentFunctions
+
+### i85566 ###
+sc.ScStyleObj::com::sun::star::style::Style
+
+### i86793 ###
+sc.ScTableSheetObj::com::sun::star::sheet::XFormulaQuery
+
+### i84554 ###
+sc.AccessibleEditableTextPara_PreviewNote
+#-> disabled in sc.sce
+
+### i84641 ###
+sc.ScAccessibleCsvRuler
+#-> disabled in sc.sce
+
+### i84653 ###
+sc.ScPageObj
+#-> disabled in sc.sce
+
+### i84656 ###
+sc.ScTabViewObj
+#-> disabled in sc.sce
+
+### i87698 ###
+sc.ScAnnotationShapeObj::com::sun::star::drawing::TextProperties
+
+### i87863 ###
+sc.ScTableSheetObj::com::sun::star::sheet::XMultipleOperation
+
+### i87876 ###
+sc.ScTableSheetObj::com::sun::star::sheet::XSheetFilterableEx
+
+### i88241 ###
+sc.AccessibleEditableTextPara_HeaderFooter
+#-> disabled in sc.sce
+
+### i88242 ###
+sc.ScModelObj::com::sun::star::view::XPrintable
+
+### i88311 ###
+sc.ScTableSheetObj::com::sun::star::sheet::XCellSeries
+
+### i88330 ###
+sc.ScAccessibleDocument
+
+### i89020 ###
+sc.ScCellCursorObj::com::sun::star::table::XAutoFormattable
+
+### i89411 ###
+sc.XMLContentExporter
+sc.XMLContentImporter
+sc.XMLExporter
+sc.XMLImporter
+sc.XMLMetaExporter
+sc.XMLMetaImporter
+#-> disabled in sc.sce
+
+### i90346 ###
+sc.ScTableValidationObj::com::sun::star::sheet::TableValidation
+
+### i91043 ###
+sc.ScModelObj::com::sun::star::document::XEventBroadcaster
+
+### i91044 ###
+sc.ScAccessibleCsvCell
+sc.ScAccessibleCsvGrid
+#-> disabled in sc.sce
+
+### i91045 ###
+sc.ScAccessibleDocumentPagePreview
+#-> disabled in sc.sce
+
+### i109517 ###
+sc.AccessibleEditableTextPara_PreviewCell::com::sun::star::accessibility::XAccessibleComponent
+sc.ScAccessiblePageHeaderArea::com::sun::star::accessibility::XAccessibleEventBroadcaster
+sc.ScAnnotationObj::com::sun::star::sheet::XSheetAnnotation
+sc.ScAnnotationObj::com::sun::star::text::XSimpleText
+sc.ScAnnotationObj::com::sun::star::text::XTextRange
+sc.ScAnnotationShapeObj::com::sun::star::beans::XPropertySet
+sc.ScAnnotationShapeObj::com::sun::star::drawing::CaptionShape
+sc.ScAnnotationShapeObj::com::sun::star::drawing::LineProperties
+sc.ScAnnotationShapeObj::com::sun::star::drawing::RotationDescriptor
+sc.ScAnnotationShapeObj::com::sun::star::drawing::ShadowProperties
+sc.ScAnnotationShapeObj::com::sun::star::drawing::Shape
+sc.ScAnnotationShapeObj::com::sun::star::drawing::XShape
+sc.ScAnnotationShapeObj::com::sun::star::drawing::XShapeDescriptor
+sc.ScAnnotationShapeObj::com::sun::star::lang::XComponent
+sc.ScAnnotationShapeObj::com::sun::star::style::CharacterProperties
+sc.ScAnnotationShapeObj::com::sun::star::style::CharacterPropertiesAsian
+sc.ScAnnotationShapeObj::com::sun::star::style::CharacterPropertiesComplex
+sc.ScAnnotationShapeObj::com::sun::star::style::ParagraphPropertiesAsian
+sc.ScAnnotationShapeObj::com::sun::star::style::ParagraphPropertiesComplex
+sc.ScAnnotationShapeObj::com::sun::star::text::XSimpleText
+sc.ScAnnotationShapeObj::com::sun::star::text::XTextRange
+sc.ScAnnotationsObj::com::sun::star::container::XElementAccess
+sc.ScCellObj::com::sun::star::sheet::XSheetAnnotationAnchor
+sc.ScDataPilotFieldObj::com::sun::star::sheet::XDataPilotFieldGrouping
+
+### i110862 ###
+sc.ScDataPilotTableObj::com::sun::star::sheet::XDataPilotTable
+
+### i111032 ###
+sc.ScAccessibleCell::com::sun::star::accessibility::XAccessibleText
diff --git a/sc/qa/unoapi/makefile.mk b/sc/qa/unoapi/makefile.mk
new file mode 100644
index 000000000000..a4781282a0b3
--- /dev/null
+++ b/sc/qa/unoapi/makefile.mk
@@ -0,0 +1,48 @@
+#*************************************************************************
+# 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
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#***********************************************************************/
+
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
+
+PRJ = ../..
+PRJNAME = sc
+TARGET = qa_unoapi
+
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = org/openoffice/sc/qa/unoapi
+JAVATESTFILES = Test.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
+
+ALLTAR : javatest
+
+.END
diff --git a/sc/qa/unoapi/sc.sce b/sc/qa/unoapi/sc.sce
new file mode 100644
index 000000000000..1a38b3af0cc9
--- /dev/null
+++ b/sc/qa/unoapi/sc.sce
@@ -0,0 +1,125 @@
+# i84653 -o sc.ScPageObj
+# i84554 -o sc.AccessibleEditableTextPara_PreviewNote
+# i88241 -o sc.AccessibleEditableTextPara_HeaderFooter
+-o sc.AccessibleEditableTextPara_PreviewCell
+-o sc.ScAccessibleCell
+# i91044 -o sc.ScAccessibleCsvCell
+# i91044 -o sc.ScAccessibleCsvGrid
+# i84641 -o sc.ScAccessibleCsvRuler
+# i88330 -o sc.ScAccessibleDocument
+# i91045 -o sc.ScAccessibleDocumentPagePreview
+-o sc.ScAccessiblePageHeader
+-o sc.ScAccessiblePageHeaderArea
+-o sc.ScAccessiblePreviewCell
+-o sc.ScAccessiblePreviewHeaderCell
+-o sc.ScAccessiblePreviewTable
+-o sc.ScAccessibleSpreadsheet
+-o sc.ScAnnotationObj
+-o sc.ScAnnotationShapeObj
+-o sc.ScAnnotationsObj
+-o sc.ScAreaLinkObj
+-o sc.ScAreaLinksObj
+-o sc.ScAutoFormatFieldObj
+-o sc.ScAutoFormatObj
+-o sc.ScAutoFormatsObj
+-o sc.ScCellCursorObj
+-o sc.ScCellFieldObj
+-o sc.ScCellFieldsObj
+-o sc.ScCellFormatsEnumeration
+-o sc.ScCellFormatsObj
+-o sc.ScCellObj
+-o sc.ScCellRangeObj
+-o sc.ScCellRangesObj
+-o sc.ScCellSearchObj
+-o sc.ScCellTextCursor
+-o sc.ScCellsEnumeration
+-o sc.ScCellsObj
+-o sc.ScChartObj
+-o sc.ScChartsObj
+-o sc.ScConsolidationDescriptor
+-o sc.ScDDELinkObj
+-o sc.ScDDELinksObj
+-o sc.ScDataPilotFieldGroupItemObj
+-o sc.ScDataPilotFieldGroupObj
+-o sc.ScDataPilotFieldGroupsObj
+-o sc.ScDataPilotFieldObj
+-o sc.ScDataPilotFieldsObj
+-o sc.ScDataPilotItemObj
+-o sc.ScDataPilotItemsObj
+-o sc.ScDataPilotTableObj
+-o sc.ScDataPilotTablesObj
+-o sc.ScDatabaseRangeObj
+# -o sc.ScDatabaseRangesObj
+# -o sc.ScDocumentConfiguration
+# -o sc.ScDrawPageObj
+# -o sc.ScDrawPagesObj
+# -o sc.ScFilterDescriptorBase
+# -o sc.ScFunctionListObj
+# -o sc.ScHeaderFieldObj
+# -o sc.ScHeaderFieldsObj
+# -o sc.ScHeaderFooterContentObj
+# -o sc.ScHeaderFooterTextCursor
+# -o sc.ScHeaderFooterTextObj
+# -o sc.ScIndexEnumeration_CellAnnotationsEnumeration
+# -o sc.ScIndexEnumeration_CellAreaLinksEnumeration
+# -o sc.ScIndexEnumeration_DDELinksEnumeration
+# -o sc.ScIndexEnumeration_DataPilotFieldsEnumeration
+# -o sc.ScIndexEnumeration_DataPilotItemsEnumeration
+# -o sc.ScIndexEnumeration_DataPilotTablesEnumeration
+# -o sc.ScIndexEnumeration_DatabaseRangesEnumeration
+# -o sc.ScIndexEnumeration_FunctionDescriptionEnumeration
+# -o sc.ScIndexEnumeration_LabelRangesEnumeration
+# -o sc.ScIndexEnumeration_NamedRangesEnumeration
+# -o sc.ScIndexEnumeration_ScenariosEnumeration
+# -o sc.ScIndexEnumeration_SheetCellRangesEnumeration
+# -o sc.ScIndexEnumeration_SheetLinksEnumeration
+# -o sc.ScIndexEnumeration_SpreadsheetViewPanesEnumeration
+# -o sc.ScIndexEnumeration_SpreadsheetsEnumeration
+# -o sc.ScIndexEnumeration_SubTotalFieldsEnumeration
+# -o sc.ScIndexEnumeration_TableAutoFormatEnumeration
+# -o sc.ScIndexEnumeration_TableChartsEnumeration
+# -o sc.ScIndexEnumeration_TableColumnsEnumeration
+# -o sc.ScIndexEnumeration_TableConditionalEntryEnumeration
+# -o sc.ScIndexEnumeration_TableRowsEnumeration
+# -o sc.ScIndexEnumeration_TextFieldEnumeration
+# -o sc.ScLabelRangeObj
+# -o sc.ScLabelRangesObj
+# -o sc.ScModelObj
+# -o sc.ScNamedRangeObj
+# -o sc.ScNamedRangesObj
+# -o sc.ScRecentFunctionsObj
+# -o sc.ScScenariosObj
+# -o sc.ScShapeObj
+# -o sc.ScSheetLinkObj
+# -o sc.ScSheetLinksObj
+# -o sc.ScSpreadsheetSettings
+# -o sc.ScSpreadsheetSettingsObj
+# -o sc.ScStyleFamiliesObj
+# -o sc.ScStyleFamilyObj
+# -o sc.ScStyleObj
+# -o sc.ScSubTotalDescriptorBase
+# -o sc.ScSubTotalFieldObj
+# # i84656 -o sc.ScTabViewObj
+# -o sc.ScTableColumnObj
+# -o sc.ScTableColumnsObj
+# -o sc.ScTableConditionalEntry
+# -o sc.ScTableConditionalFormat
+# -o sc.ScTableRowObj
+# -o sc.ScTableRowsObj
+# -o sc.ScTableSheetObj
+# -o sc.ScUniqueCellFormatsEnumeration
+# -o sc.ScUniqueCellFormatsObj
+# -o sc.ScTableSheetsObj
+# -o sc.ScTableValidationObj
+# -o sc.ScViewPaneObj
+# #i89411 -o sc.XMLContentExporter
+# #i89411 -o sc.XMLContentImporter
+# #i89411 -o sc.XMLExporter
+# #i89411 -o sc.XMLImporter
+# #i89411 -o sc.XMLMetaExporter
+# #i89411 -o sc.XMLMetaImporter
+# -o sc.XMLSettingsExporter
+# -o sc.XMLSettingsImporter
+# -o sc.XMLStylesExporter
+# -o sc.XMLStylesImporter
+# -o sc.XMLExporter
diff --git a/sc/qa/unoapi/testdocuments/10test.csv b/sc/qa/unoapi/testdocuments/10test.csv
new file mode 100644
index 000000000000..dce6f084824b
--- /dev/null
+++ b/sc/qa/unoapi/testdocuments/10test.csv
@@ -0,0 +1,19 @@
+"SwXBodyText";"com::sun::star::text::XTextRangeMover#optional";"moveTextRange()"
+"SwXBodyText";"com::sun::star::text::XTextRangeCompare#optional";"compareRegionStarts()"
+"SwXBodyText";"com::sun::star::text::XTextRangeCompare#optional";"compareRegionEnds()"
+"SwXBodyText";"com::sun::star::text::XSimpleText";"createTextCursor()"
+"SwXBodyText";"com::sun::star::text::XSimpleText";"createTextCursorByRange()"
+"SwXBodyText";"com::sun::star::text::XSimpleText";"insertString()"
+"SwXBodyText";"com::sun::star::text::XSimpleText";"insertControlCharacter()"
+"SwXBodyText";"com::sun::star::container::XElementAccess";"getElementType()"
+"SwXBodyText";"com::sun::star::container::XElementAccess";"hasElements()"
+"SwXBodyText";"com::sun::star::text::XTextRange";"getText()"
+"SwXBodyText";"com::sun::star::text::XTextRange";"getStart()"
+"SwXBodyText";"com::sun::star::text::XTextRange";"getEnd()"
+"SwXBodyText";"com::sun::star::text::XTextRange";"getString()"
+"SwXBodyText";"com::sun::star::text::XTextRange";"setString()"
+"SwXBodyText";"com::sun::star::container::XEnumerationAccess";"createEnumeration()"
+"SwXBodyText";"com::sun::star::text::XText";"insertTextContent()"
+"SwXBodyText";"com::sun::star::text::XText";"removeTextContent()"
+"SwXBodyText";"com::sun::star::text::XRelativeTextContentInsert#optional";"insertTextContentBefore()"
+"SwXBodyText";"com::sun::star::text::XRelativeTextContentInsert#optional";"insertTextContentAfter()"
diff --git a/sc/qa/unoapi/testdocuments/ScAnnotationShapeObj.sxc b/sc/qa/unoapi/testdocuments/ScAnnotationShapeObj.sxc
new file mode 100644
index 000000000000..20d130da0445
--- /dev/null
+++ b/sc/qa/unoapi/testdocuments/ScAnnotationShapeObj.sxc
Binary files differ
diff --git a/sc/qa/unoapi/testdocuments/ScDDELinksObj.sdc b/sc/qa/unoapi/testdocuments/ScDDELinksObj.sdc
new file mode 100644
index 000000000000..1abdbf4609e1
--- /dev/null
+++ b/sc/qa/unoapi/testdocuments/ScDDELinksObj.sdc
Binary files differ
diff --git a/sc/qa/unoapi/testdocuments/ScSheetLinksObj.sdc b/sc/qa/unoapi/testdocuments/ScSheetLinksObj.sdc
new file mode 100644
index 000000000000..a7f43fe87f75
--- /dev/null
+++ b/sc/qa/unoapi/testdocuments/ScSheetLinksObj.sdc
Binary files differ
diff --git a/sc/qa/unoapi/testdocuments/calcshapes.sxc b/sc/qa/unoapi/testdocuments/calcshapes.sxc
new file mode 100644
index 000000000000..7f98b1a501e0
--- /dev/null
+++ b/sc/qa/unoapi/testdocuments/calcshapes.sxc
Binary files differ
diff --git a/sc/qa/unoapi/testdocuments/crazy-blue.jpg b/sc/qa/unoapi/testdocuments/crazy-blue.jpg
new file mode 100644
index 000000000000..001c88b63d88
--- /dev/null
+++ b/sc/qa/unoapi/testdocuments/crazy-blue.jpg
Binary files differ
diff --git a/sc/qa/unoapi/testdocuments/space-metal.jpg b/sc/qa/unoapi/testdocuments/space-metal.jpg
new file mode 100644
index 000000000000..d23344389073
--- /dev/null
+++ b/sc/qa/unoapi/testdocuments/space-metal.jpg
Binary files differ