summaryrefslogtreecommitdiff
path: root/qadevOOo/tests/java/mod/_svx
diff options
context:
space:
mode:
Diffstat (limited to 'qadevOOo/tests/java/mod/_svx')
-rw-r--r--qadevOOo/tests/java/mod/_svx/AccessibleControlShape.java125
-rw-r--r--qadevOOo/tests/java/mod/_svx/AccessibleEditableTextPara.java162
-rw-r--r--qadevOOo/tests/java/mod/_svx/AccessibleGraphicShape.java129
-rw-r--r--qadevOOo/tests/java/mod/_svx/AccessibleOLEShape.java151
-rw-r--r--qadevOOo/tests/java/mod/_svx/AccessiblePageShape.java141
-rw-r--r--qadevOOo/tests/java/mod/_svx/AccessiblePresentationGraphicShape.java149
-rw-r--r--qadevOOo/tests/java/mod/_svx/AccessiblePresentationOLEShape.java158
-rw-r--r--qadevOOo/tests/java/mod/_svx/AccessiblePresentationShape.java147
-rw-r--r--qadevOOo/tests/java/mod/_svx/AccessibleShape.java128
-rw-r--r--qadevOOo/tests/java/mod/_svx/GraphicExporter.java237
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxDrawPage.java224
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxGraphCtrlAccessibleContext.java251
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxGraphicObject.java263
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxShape.java227
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxShapeCircle.java247
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxShapeCollection.java148
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxShapeConnector.java204
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxShapeControl.java158
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxShapeDimensioning.java169
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxShapeGroup.java195
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygon.java265
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygonBezier.java278
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxUnoNumberingRules.java94
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxUnoText.java170
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxUnoTextContent.java150
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxUnoTextContentEnum.java152
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxUnoTextCursor.java144
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxUnoTextField.java161
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxUnoTextRange.java156
-rw-r--r--qadevOOo/tests/java/mod/_svx/SvxUnoTextRangeEnumeration.java157
-rw-r--r--qadevOOo/tests/java/mod/_svx/package.html6
31 files changed, 5346 insertions, 0 deletions
diff --git a/qadevOOo/tests/java/mod/_svx/AccessibleControlShape.java b/qadevOOo/tests/java/mod/_svx/AccessibleControlShape.java
new file mode 100644
index 000000000000..c77b82fcd6fa
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/AccessibleControlShape.java
@@ -0,0 +1,125 @@
+/*************************************************************************
+ *
+ * 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 mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.FormTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.Size;
+import com.sun.star.awt.XWindow;
+import com.sun.star.drawing.XShape;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class AccessibleControlShape extends TestCase {
+
+ static XComponent xDrawDoc;
+ static XModel aModel;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = SOF.createDrawDoc(null);
+ aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xDrawDoc);
+
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes the Draw document loaded before.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ log.println( "creating a test environment" );
+
+ final XShape oShape = FormTools.insertControlShape
+ (xDrawDoc,3000,4500,15000,1000,"CommandButton");
+
+ AccessibilityTools at = new AccessibilityTools();
+ utils.shortWait(5000);
+ XWindow xWindow = at.getCurrentWindow ((XMultiServiceFactory)tParam.getMSF(),aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.getAccessibleObjectForRole(xRoot, AccessibleRole.SHAPE);
+
+ at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+// oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.SHAPE,
+// "Button");
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.UNKNOWN, "Button");
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ Size size = oShape.getSize();
+ size.Width += 100;
+ oShape.setSize(size);
+ } catch(com.sun.star.beans.PropertyVetoException e) {}
+ }
+ });
+
+ log.println("Implementation Name: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_svx/AccessibleEditableTextPara.java b/qadevOOo/tests/java/mod/_svx/AccessibleEditableTextPara.java
new file mode 100644
index 000000000000..104b10d5c0b1
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/AccessibleEditableTextPara.java
@@ -0,0 +1,162 @@
+/*************************************************************************
+ *
+ * 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 mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.accessibility.XAccessibleContext;
+import com.sun.star.accessibility.XAccessibleEditableText;
+import com.sun.star.awt.XWindow;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+
+public class AccessibleEditableTextPara extends TestCase {
+
+ static XComponent xSpreadsheetDoc = null;
+
+ /**
+ * Called to create an instance of <code>TestEnvironment</code>
+ * with an object to test and related objects.
+ * Obtains accissible object for the spreadsheet document.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see TestEnvironment
+ * @see #getTestEnvironment()
+ */
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow( (XMultiServiceFactory) Param.getMSF(), aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ XAccessibleContext InputLine = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TEXT_FRAME,"Input line");
+ try {
+ oObj = InputLine.getAccessibleChild(0);
+ XAccessibleEditableText et = (XAccessibleEditableText) UnoRuntime.queryInterface(XAccessibleEditableText.class, oObj);
+ et.setText("AccessibleEditablePara");
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+
+ }
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ final XAccessibleEditableText edText = (XAccessibleEditableText)
+ UnoRuntime.queryInterface(XAccessibleEditableText.class,oObj) ;
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ int l = new String("AccessibleEditablePara").length();
+ edText.deleteText(0, l);
+ edText.setText("Event");
+ edText.setText("AccessibleEditablePara");
+ }catch(com.sun.star.lang.IndexOutOfBoundsException e) {}
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes text document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+ log.println( " disposing xSheetDoc " );
+ util.DesktopTools.closeDoc(xSpreadsheetDoc);
+ }
+
+ /**
+ * Called while the <code>TestCase</code> initialization. In the
+ * implementation does nothing. Subclasses can override to initialize
+ * objects shared among all <code>TestEnvironment</code>s.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see #initializeTestCase()
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) Param.getMSF());
+
+ try {
+ log.println("creating a spreadsheetdocument");
+ xSpreadsheetDoc = (XComponent) UnoRuntime.queryInterface(XComponent.class,SOF.createCalcDoc(null));
+ shortWait();
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document ", e );
+ }
+ }
+
+ /**
+ * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
+ * reset</code> call.
+ */
+ private void shortWait() {
+ try {
+ Thread.sleep(500) ;
+ } catch (InterruptedException e) {
+ log.println("While waiting :" + e) ;
+ }
+ }
+
+} \ No newline at end of file
diff --git a/qadevOOo/tests/java/mod/_svx/AccessibleGraphicShape.java b/qadevOOo/tests/java/mod/_svx/AccessibleGraphicShape.java
new file mode 100644
index 000000000000..3a48179223ea
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/AccessibleGraphicShape.java
@@ -0,0 +1,129 @@
+/*************************************************************************
+ *
+ * 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 mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.DrawTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.Size;
+import com.sun.star.awt.XWindow;
+import com.sun.star.drawing.XShape;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class AccessibleGraphicShape extends TestCase {
+
+ static XComponent xDrawDoc;
+ static XModel aModel;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = SOF.createDrawDoc(null);
+ aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xDrawDoc);
+
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes the Draw document loaded before.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+ final XShape oShape = SOF.createShape(xDrawDoc,
+ 5000,5000,1500,1000,"GraphicObject");
+
+
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow ((XMultiServiceFactory)tParam.getMSF(),aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+
+// oObj = at.getAccessibleObjectForRole
+// (xRoot, AccessibleRole.SHAPE, "GraphicObject");
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.UNKNOWN, "GraphicObject");
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ Size size = oShape.getSize();
+ size.Width += 100;
+ oShape.setSize(size);
+ } catch(com.sun.star.beans.PropertyVetoException e) {}
+ }
+ });
+
+
+ log.println("Implementation Name: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_svx/AccessibleOLEShape.java b/qadevOOo/tests/java/mod/_svx/AccessibleOLEShape.java
new file mode 100644
index 000000000000..b541353c48b1
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/AccessibleOLEShape.java
@@ -0,0 +1,151 @@
+/*************************************************************************
+ *
+ * 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 mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.DrawTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.Size;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XShape;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class AccessibleOLEShape extends TestCase {
+
+ static XComponent xDrawDoc;
+ static XModel aModel;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = SOF.createDrawDoc(null);
+ aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xDrawDoc);
+
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes the Draw document loaded before.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+ final XShape oShape = SOF.createShape
+ (xDrawDoc,5000,5000,1500,1000,"OLE2");
+
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+
+ XPropertySet shape_props = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oShape);
+
+ log.println("Inserting a Chart");
+
+ try {
+ shape_props.
+ setPropertyValue("CLSID","12DCAE26-281F-416F-a234-c3086127382e");
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't change property", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't change property", e);
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't change property", e);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't change property", e);
+ }
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow ((XMultiServiceFactory)tParam.getMSF(),aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+// oObj = at.getAccessibleObjectForRole
+// (xRoot, AccessibleRole.SHAPE, "OLEShape");
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.UNKNOWN, "OLEShape");
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ Size size = oShape.getSize();
+ size.Width += 100;
+ oShape.setSize(size);
+ } catch(com.sun.star.beans.PropertyVetoException e) {}
+ }
+ });
+
+ log.println("Implementation Name: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_svx/AccessiblePageShape.java b/qadevOOo/tests/java/mod/_svx/AccessiblePageShape.java
new file mode 100644
index 000000000000..9be5cfdac65b
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/AccessiblePageShape.java
@@ -0,0 +1,141 @@
+/*************************************************************************
+ *
+ * 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 mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.DrawTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class AccessiblePageShape extends TestCase {
+
+ static XComponent xDrawDoc;
+ static XModel aModel;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = SOF.createDrawDoc(null);
+ aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xDrawDoc);
+
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes the Draw document loaded before.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ //XShape oShape = null;
+ XDrawPage oPage = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow ((XMultiServiceFactory)tParam.getMSF(),aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+// oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.SHAPE,
+// "PageShape");
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.UNKNOWN, "PageShape");
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ //at.getAccessibleObjectForRole(xRoot, AccessibleRole.SCROLLBAR);
+ //final XAccessibleValue xAccVal = (XAccessibleValue)
+ // UnoRuntime.queryInterface
+ // (XAccessibleValue.class, at.SearchedContext) ;
+ oPage = DrawTools.getDrawPage(xDrawDoc,0);
+ final XPropertySet PageProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oPage);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ PageProps.setPropertyValue("Height",new Integer(5000));
+ } catch (com.sun.star.beans.UnknownPropertyException upe) {
+ System.out.println("Don't no the Property Height");
+ } catch (com.sun.star.beans.PropertyVetoException pve) {
+ System.out.println(
+ "PropertyVetoException Exception while changing Height");
+ } catch (com.sun.star.lang.IllegalArgumentException iae) {
+ System.out.println(
+ "IllegalArgumentException Exception while changing Height");
+ } catch (com.sun.star.lang.WrappedTargetException wte) {
+ System.out.println(
+ "WrappedTargetException Exception while changing Height");
+ }
+ }
+ });
+
+ log.println("Implementation Name: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_svx/AccessiblePresentationGraphicShape.java b/qadevOOo/tests/java/mod/_svx/AccessiblePresentationGraphicShape.java
new file mode 100644
index 000000000000..fcd9ad664f84
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/AccessiblePresentationGraphicShape.java
@@ -0,0 +1,149 @@
+/*************************************************************************
+ *
+ * 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 mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.DrawTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.Size;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XShape;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class AccessiblePresentationGraphicShape extends TestCase {
+
+ static XComponent xDoc;
+ static XModel aModel;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a drawdoc" );
+ xDoc = SOF.createImpressDoc(null);
+ aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xDoc);
+
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes the Draw document loaded before.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XShape oShape = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ XMultiServiceFactory docMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xDoc);
+ try {
+ oShape = (XShape) UnoRuntime.queryInterface(XShape.class,
+ docMSF.createInstance
+ ("com.sun.star.presentation.GraphicObjectShape"));
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("couldn't create component", e);
+ }
+
+ DrawTools.getShapes(DrawTools.getDrawPage(xDoc,0)).add(oShape);
+
+ XPropertySet oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oShape);
+ try {
+ oShapeProps.setPropertyValue(
+ "GraphicURL",util.utils.getFullTestURL("space-metal.jpg"));
+ oShapeProps.setPropertyValue("IsEmptyPresentationObject", new Boolean(false));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ }
+
+ //DrawTools.getShapes(DrawTools.getDrawPage(xDoc,0)).add(oShape);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow ((XMultiServiceFactory)tParam.getMSF(),aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+// oObj = at.getAccessibleObjectForRole
+// (xRoot, AccessibleRole.SHAPE, "GraphicObject");
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.UNKNOWN, "GraphicObject");
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ final XShape fShape = oShape ;
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ Size size = fShape.getSize();
+ size.Width += 100;
+ fShape.setSize(size);
+ } catch(com.sun.star.beans.PropertyVetoException e) {}
+ }
+ });
+
+ log.println("Implementation Name: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_svx/AccessiblePresentationOLEShape.java b/qadevOOo/tests/java/mod/_svx/AccessiblePresentationOLEShape.java
new file mode 100644
index 000000000000..1c705a9b3067
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/AccessiblePresentationOLEShape.java
@@ -0,0 +1,158 @@
+/*************************************************************************
+ *
+ * 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 mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.DrawTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.Size;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XShape;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class AccessiblePresentationOLEShape extends TestCase {
+
+ static XComponent xDrawDoc;
+ static XModel aModel;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = SOF.createImpressDoc(null);
+ aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xDrawDoc);
+
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes the Draw document loaded before.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XShape oShape = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ XMultiServiceFactory docMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xDrawDoc);
+ try {
+ oShape = (XShape) UnoRuntime.queryInterface(XShape.class,
+ docMSF.createInstance("com.sun.star.presentation.OLE2Shape"));
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("couldn't create component", e);
+ }
+
+
+ //DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+
+ XPropertySet oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oShape);
+ try {
+ oShapeProps.setPropertyValue("IsEmptyPresentationObject", new Boolean(false));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ }
+
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+
+ try {
+ oShapeProps.setPropertyValue(
+ "CLSID","12DCAE26-281F-416F-a234-c3086127382e");
+ oShapeProps.setPropertyValue("IsEmptyPresentationObject", new Boolean(false));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ }
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow ((XMultiServiceFactory)tParam.getMSF(),aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+ at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+// oObj = at.getAccessibleObjectForRole
+// (xRoot, AccessibleRole.SHAPE, "ImpressOLE");
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.UNKNOWN, "ImpressOLE");
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ final XShape fShape = oShape ;
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ Size size = fShape.getSize();
+ size.Width += 100;
+ fShape.setSize(size);
+ } catch(com.sun.star.beans.PropertyVetoException e) {}
+ }
+ });
+
+ log.println("Implementation Name: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_svx/AccessiblePresentationShape.java b/qadevOOo/tests/java/mod/_svx/AccessiblePresentationShape.java
new file mode 100644
index 000000000000..8979255a6c48
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/AccessiblePresentationShape.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 mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.DrawTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.Size;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XShape;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class AccessiblePresentationShape extends TestCase {
+
+ static XComponent xDrawDoc;
+ static XModel aModel;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = SOF.createImpressDoc(null);
+ aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xDrawDoc);
+
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes the Draw document loaded before.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XShape oShape = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ XMultiServiceFactory docMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xDrawDoc);
+ try {
+ oShape = (XShape) UnoRuntime.queryInterface(XShape.class,
+ docMSF.createInstance
+ ("com.sun.star.presentation.HandoutShape"));
+ } catch (com.sun.star.uno.Exception e) {
+ throw new StatusException("couldn't create component", e);
+ }
+
+
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+
+ XPropertySet shapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oShape);
+
+ try {
+ shapeProps.setPropertyValue(
+ "IsEmptyPresentationObject", new Boolean(false));
+ } catch (Exception e) {}
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow ((XMultiServiceFactory)tParam.getMSF(),aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+// oObj = at.getAccessibleObjectForRole
+// (xRoot, AccessibleRole.SHAPE, "ImpressHandout");
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.UNKNOWN, "ImpressHandout");
+
+ log.println("Implementation Name: "+utils.getImplName(oObj));
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ final XShape fShape = oShape ;
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ Size size = fShape.getSize();
+ size.Width += 100;
+ fShape.setSize(size);
+ } catch(com.sun.star.beans.PropertyVetoException e) {}
+ }
+ });
+
+ log.println("Implementation Name: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_svx/AccessibleShape.java b/qadevOOo/tests/java/mod/_svx/AccessibleShape.java
new file mode 100644
index 000000000000..41210cbe9617
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/AccessibleShape.java
@@ -0,0 +1,128 @@
+/*************************************************************************
+ *
+ * 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 mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.DrawTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.Size;
+import com.sun.star.awt.XWindow;
+import com.sun.star.drawing.XShape;
+import com.sun.star.frame.XModel;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class AccessibleShape extends TestCase {
+
+ static XComponent xDrawDoc;
+ static XModel aModel;
+
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = SOF.createDrawDoc(null);
+ aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xDrawDoc);
+
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes the Draw document loaded before.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+ final XShape oShape = SOF.createShape(xDrawDoc,
+ 3000,4500,15000,1000,"Rectangle");
+
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = at.getCurrentWindow ((XMultiServiceFactory)tParam.getMSF(),aModel);
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+// oObj = at.getAccessibleObjectForRole
+// (xRoot, AccessibleRole.SHAPE, "Rectangle");
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.UNKNOWN, "Rectangle");
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ Size size = oShape.getSize();
+ size.Width += 100;
+ oShape.setSize(size);
+ } catch(com.sun.star.beans.PropertyVetoException e) {}
+ }
+ });
+
+ log.println("Implementation Name: " + utils.getImplName(oObj));
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_svx/GraphicExporter.java b/qadevOOo/tests/java/mod/_svx/GraphicExporter.java
new file mode 100644
index 000000000000..56ebf07d3729
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/GraphicExporter.java
@@ -0,0 +1,237 @@
+/*************************************************************************
+ *
+ * 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 mod._svx;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.document.XExporter;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.ucb.XSimpleFileAccess;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.DrawTools;
+import util.SOfficeFactory;
+import util.XMLTools;
+
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.drawing.GraphicExportFilter</code>. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::document::XFilter</code></li>
+ * <li> <code>com::sun::star::document::XMimeTypeInfo</code></li>
+ * <li> <code>com::sun::star::document::XExporter</code></li>
+ * </ul> <p>
+ *
+ * The following files used by this test :
+ * <ul>
+ * <li><b> space-metal.jpg </b> : the file used for GraphicObject
+ * creation. This image must be then exported. </li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.document.XFilter
+ * @see com.sun.star.document.XMimeTypeInfo
+ * @see com.sun.star.document.XExporter
+ * @see ifc.document._XFilter
+ * @see ifc.document._XMimeTypeInfo
+ * @see ifc.document._XExporter
+ */
+public class GraphicExporter extends TestCase {
+ static XComponent xDrawDoc;
+
+ /**
+ * Creates a new draw document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a drawdoc");
+ xDrawDoc = DrawTools.createDrawDoc(
+ (XMultiServiceFactory) tParam.getMSF());
+ }
+
+ /**
+ * Disposes the draw document created before
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xDrawDoc ");
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.drawing.GraphicExportFilter</code> as
+ * a tested component. Then a <code>GraphicObjectShape</code>
+ * instance is added into the document and its image is obtained
+ * from JPEG file. This shape content is intended to be exported.
+ *
+ * Object relations created :
+ * <ul>
+ * <li> <code>'MediaDescriptor'</code> for
+ * {@link ifc.document._XFilter} :
+ * descriptor which contains target file name in
+ * the temporary directory, file type (JPEG)
+ * </li>
+ * <li> <code>'XFilter.Checker'</code> for
+ * {@link ifc.document._XFilter} :
+ * checks if the target file exists.
+ * In the case if SOffice is started in 'Hide' mode
+ * ('soapi.test.hidewindows' test parameter is 'true')
+ * the checker always returns <code>true</code>.
+ * </li>
+ * <li> <code>'SourceDocument'</code> for
+ * {@link ifc.document._XExporter} :
+ * the <code>GraphicObjectShape</code> component
+ * with loaded image.
+ * </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XShape oShape = null;
+ Object go = null;
+
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println("creating a test environment");
+
+ try {
+ go = ((XMultiServiceFactory) tParam.getMSF()).createInstance(
+ "com.sun.star.drawing.GraphicExportFilter");
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't create instance");
+ e.printStackTrace(log);
+ }
+
+ // create testobject here
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+ oShape = SOF.createShape(xDrawDoc, 5000, 5000, 1500, 1000,
+ "GraphicObject");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc, 0)).add(oShape);
+
+ XPropertySet oShapeProps = (XPropertySet) UnoRuntime.queryInterface(
+ XPropertySet.class, oShape);
+ XComponent xComp = null;
+
+ try {
+ oShapeProps.setPropertyValue("GraphicURL",
+ util.utils.getFullTestURL(
+ "space-metal.jpg"));
+ xComp = (XComponent) UnoRuntime.queryInterface(XComponent.class,
+ oShape);
+
+ XExporter xEx = (XExporter) UnoRuntime.queryInterface(
+ XExporter.class, (XInterface) go);
+ xEx.setSourceDocument(xComp);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Error while preparing component", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Error while preparing component", e);
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Error while preparing component", e);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ throw new StatusException("Error while preparing component", e);
+ }
+
+ final URL aURL = new URL();
+ aURL.Complete = util.utils.getOfficeTemp(
+ (XMultiServiceFactory) tParam.getMSF()) +
+ "picture.jpg";
+
+ final XSimpleFileAccess fAcc;
+
+ try {
+ Object oFAcc = ((XMultiServiceFactory) tParam.getMSF()).createInstance(
+ "com.sun.star.ucb.SimpleFileAccess");
+ fAcc = (XSimpleFileAccess) UnoRuntime.queryInterface(
+ XSimpleFileAccess.class, oFAcc);
+
+ if (fAcc.exists(aURL.Complete)) {
+ fAcc.kill(aURL.Complete);
+ }
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Error accessing file system :");
+ e.printStackTrace(log);
+ throw new StatusException("Error accessing file system.", e);
+ }
+
+ oObj = (XInterface) go;
+ log.println("ImplName " + util.utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+ tEnv.addObjRelation("MediaDescriptor",
+ XMLTools.createMediaDescriptor(
+ new String[] {
+ "FilterName", "URL", "MediaType"
+ }, new Object[] { "JPG", aURL, "image/jpeg" }));
+ tEnv.addObjRelation("SourceDocument", xComp);
+
+ log.println("adding ObjRelation for XFilter");
+ log.println("This Component doesn't really support the cancel method");
+ log.println("See #101725");
+ tEnv.addObjRelation("NoFilter.cancel()", new Boolean(true));
+
+ final String hideMode = (String) tParam.get("soapi.test.hidewindows");
+ tEnv.addObjRelation("XFilter.Checker",
+ new ifc.document._XFilter.FilterChecker() {
+ public boolean checkFilter() {
+ try {
+ if ((hideMode != null) && hideMode.equals("true")) {
+ return true;
+ }
+
+ return fAcc.exists(aURL.Complete);
+ } catch (com.sun.star.uno.Exception e) {
+ return false;
+ }
+ }
+ });
+
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class GraphicExporter
diff --git a/qadevOOo/tests/java/mod/_svx/SvxDrawPage.java b/qadevOOo/tests/java/mod/_svx/SvxDrawPage.java
new file mode 100644
index 000000000000..15aa351c625a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxDrawPage.java
@@ -0,0 +1,224 @@
+/*************************************************************************
+ *
+ * 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 mod._svx;
+
+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.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sheet.XSpreadsheetDocument;
+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 lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.DrawTools;
+import util.FormTools;
+import util.InstCreator;
+import util.SOfficeFactory;
+import util.ShapeDsc;
+
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.drawing.DrawPage</code>. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::drawing::GenericDrawPage</code></li>
+ * <li> <code>com::sun::star::drawing::XShapeBinder</code></li>
+ * <li> <code>com::sun::star::drawing::XShapeGrouper</code></li>
+ * <li> <code>com::sun::star::drawing::XShapes</code></li>
+ * <li> <code>com::sun::star::lang::XServiceInfo</code></li>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * <li> <code>com::sun::star::container::XIndexAccess</code></li>
+ * <li> <code>com::sun::star::container::XElementAccess</code></li>
+ * <li> <code>com::sun::star::drawing::XMasterPageTarget</code></li>
+ * <li> <code>com::sun::star::container::XNamed</code></li>
+ * <li> <code>com::sun::star::drawing::XShapeCombiner</code></li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.drawing.GenericDrawPage
+ * @see com.sun.star.drawing.XShapeBinder
+ * @see com.sun.star.drawing.XShapeGrouper
+ * @see com.sun.star.drawing.XShapes
+ * @see com.sun.star.lang.XServiceInfo
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.container.XIndexAccess
+ * @see com.sun.star.container.XElementAccess
+ * @see com.sun.star.drawing.XMasterPageTarget
+ * @see com.sun.star.container.XNamed
+ * @see com.sun.star.drawing.XShapeCombiner
+ * @see ifc.drawing._GenericDrawPage
+ * @see ifc.drawing._XShapeBinder
+ * @see ifc.drawing._XShapeGrouper
+ * @see ifc.drawing._XShapes
+ * @see ifc.lang._XServiceInfo
+ * @see ifc.beans._XPropertySet
+ * @see ifc.container._XIndexAccess
+ * @see ifc.container._XElementAccess
+ * @see ifc.drawing._XMasterPageTarget
+ * @see ifc.container._XNamed
+ * @see ifc.drawing._XShapeCombiner
+ */
+public class SvxDrawPage extends TestCase {
+ static XSpreadsheetDocument xDoc = null;
+
+ /**
+ * Creates a new Draw document.
+ */
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ try {
+ log.println("creating a sheetdocument");
+ xDoc = SOF.createCalcDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create document", e);
+ }
+ }
+
+ /**
+ * Disposes the Draw document created before
+ */
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xSheetDoc ");
+ util.DesktopTools.closeDoc(xDoc);
+ ;
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * From the Draw document created a collection of its draw
+ * pages is obtained. Two new pages are inserted. And one
+ * page is obtained as a testing component. A shape is added
+ * to this page. <p>
+ *
+ * Object relations created :
+ * <ul>
+ * <li> <code>'DrawPage'</code> for
+ * {@link ifc.drawing._XShapeGrouper} :
+ * the draw page tested. </li>
+ * <li> <code>'Shape'</code> for
+ * {@link ifc.drawing._XShapes} :
+ * the creator which can create instances of
+ * <code>com.sun.star.drawing.Line</code> service </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ XInterface oObj = null;
+ XShape oShape = null;
+ XDrawPages oDP = null;
+
+ XComponent xComp = (XComponent) UnoRuntime.queryInterface(
+ XComponent.class, xDoc);
+
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println("creating a test environment");
+
+ try {
+ log.println("getting Drawpages");
+
+ XDrawPagesSupplier oDPS = (XDrawPagesSupplier) UnoRuntime.queryInterface(
+ XDrawPagesSupplier.class, xDoc);
+ oDP = (XDrawPages) oDPS.getDrawPages();
+ oDP.insertNewByIndex(1);
+ oDP.insertNewByIndex(2);
+ oObj = (XDrawPage) AnyConverter.toObject(new Type(XDrawPage.class),
+ oDP.getByIndex(0));
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory(
+ (XMultiServiceFactory) tParam.getMSF());
+
+ oShape = SOF.createShape(xComp, 5000, 3500, 7500, 5000,
+ "Rectangle");
+ DrawTools.getShapes((XDrawPage) oObj).add(oShape);
+
+ XShape oShape1 = SOF.createShape(xComp, 5000, 5500, 5000, 5000,
+ "Rectangle");
+ DrawTools.getShapes((XDrawPage) oObj).add(oShape1);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Couldn't create insance");
+ e.printStackTrace(log);
+ throw new StatusException("Can't create enviroment", e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Couldn't create insance");
+ e.printStackTrace(log);
+ throw new StatusException("Can't create enviroment", e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Couldn't create insance");
+ e.printStackTrace(log);
+ throw new StatusException("Can't create enviroment", e);
+ }
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+
+ //adding a controlButton to have a Form
+ FormTools.insertControlShape(
+ (XComponent) UnoRuntime.queryInterface(XComponent.class, xDoc),
+ 3000, 4500, 15000, 1000, "CommandButton");
+
+ // relation for XShapes interface
+ ShapeDsc sDsc = new ShapeDsc(5000, 3500, 7500, 10000, "Line");
+ tEnv.addObjRelation("Shape", new InstCreator(xDoc, sDsc));
+
+ log.println("ImplementationName: " + util.utils.getImplName(oObj));
+
+
+ // adding relation for XShapeGrouper
+ tEnv.addObjRelation("DrawPage", oObj);
+
+ // adding relation for XMasterPageTarget
+
+ /*XMasterPagesSupplier oMPS = (XMasterPagesSupplier)
+ UnoRuntime.queryInterface(XMasterPagesSupplier.class, xDoc);
+ XDrawPages oGroup = oMPS.getMasterPages();
+ tEnv.addObjRelation("MasterPageSupplier",oGroup); */
+ return tEnv;
+ } // finish method getTestEnvironment
+} // finish class SvxDrawPage
diff --git a/qadevOOo/tests/java/mod/_svx/SvxGraphCtrlAccessibleContext.java b/qadevOOo/tests/java/mod/_svx/SvxGraphCtrlAccessibleContext.java
new file mode 100644
index 000000000000..f6cd2accc6ba
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxGraphCtrlAccessibleContext.java
@@ -0,0 +1,251 @@
+/*************************************************************************
+ *
+ * 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 mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.AccessibilityTools;
+import util.DrawTools;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.accessibility.AccessibleRole;
+import com.sun.star.accessibility.XAccessible;
+import com.sun.star.awt.XExtendedToolkit;
+import com.sun.star.awt.XWindow;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XShape;
+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.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.URL;
+import com.sun.star.util.XURLTransformer;
+import com.sun.star.view.XSelectionSupplier;
+
+
+/**
+ *
+ * @author sw93809
+ * @version
+ */
+public class SvxGraphCtrlAccessibleContext extends TestCase{
+
+ static XComponent xDrawDoc = null;
+
+ /**
+ * Called to create an instance of <code>TestEnvironment</code>
+ * with an object to test and related objects.
+ * Switchs the document to Print Preview mode.
+ * Obtains accissible object for the page view.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see TestEnvironment
+ * @see #getTestEnvironment()
+ */
+
+ protected TestEnvironment createTestEnvironment(
+ TestParameters Param, PrintWriter log) {
+
+ XInterface oObj = null;
+
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xDrawDoc);
+
+ XController xController = aModel.getCurrentController();
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+ final XShape oShape = SOF.createShape(xDrawDoc,
+ 5000,5000,1500,1000,"GraphicObject");
+
+
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+
+ XPropertySet shapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class, oShape);
+
+ String url = util.utils.getFullTestURL("space-metal.jpg");
+
+ log.println("Inserting Graphic: "+url);
+
+ try {
+ shapeProps.setPropertyValue("GraphicURL", url);
+ } catch (com.sun.star.beans.UnknownPropertyException upe) {
+ log.println("Property GraphicURL is unknown");
+ } catch (com.sun.star.beans.PropertyVetoException pve) {
+ log.println("Property GraphicURL is read only");
+ } catch (com.sun.star.lang.IllegalArgumentException iae) {
+ log.println("Property GraphicURL tried to set to illegal argument");
+ } catch (com.sun.star.lang.WrappedTargetException wte) {
+ log.println("Wrapped Target Exception was thrown while setting Property GraphicURL");
+ }
+
+
+ //Opening ImageMapDialog
+ try {
+ String aSlotID = "slot:10371";
+ XDispatchProvider xDispProv = (XDispatchProvider)
+ UnoRuntime.queryInterface( XDispatchProvider.class, xController );
+ XURLTransformer xParser = (com.sun.star.util.XURLTransformer)
+ UnoRuntime.queryInterface(XURLTransformer.class,
+ ((XMultiServiceFactory)Param.getMSF()).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 = aSlotID;
+ xParser.parseStrict(aParseURL);
+ URL aURL = aParseURL[0];
+ XDispatch xDispatcher = xDispProv.queryDispatch( aURL,"",0);
+ if( xDispatcher != null )
+ xDispatcher.dispatch( aURL, null );
+ utils.shortWait(Param.getInt(util.PropertyName.SHORT_WAIT));
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't change mode");
+ }
+
+
+ try {
+ oObj = (XInterface) ((XMultiServiceFactory)Param.getMSF()).createInstance
+ ("com.sun.star.awt.Toolkit") ;
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't get toolkit");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't get toolkit", e );
+ }
+
+ XExtendedToolkit tk = (XExtendedToolkit)
+ UnoRuntime.queryInterface(XExtendedToolkit.class,oObj);
+
+
+ AccessibilityTools at = new AccessibilityTools();
+
+ XWindow xWindow = (XWindow)
+ UnoRuntime.queryInterface(XWindow.class,tk.getActiveTopWindow());
+
+ XAccessible xRoot = at.getAccessibleObject(xWindow);
+
+ at.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
+
+ oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PANEL);
+
+ log.println("ImplementationName " + utils.getImplName(oObj));
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ //selecting the inserted shape
+ final XSelectionSupplier SelSupp = (XSelectionSupplier)
+ UnoRuntime.queryInterface(XSelectionSupplier.class,xController);
+
+ tEnv.addObjRelation("EventProducer",
+ new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
+ public void fireEvent() {
+ try {
+ SelSupp.select(oShape);
+ } catch (com.sun.star.lang.IllegalArgumentException iae) {
+ System.out.println("Couldn't select shape");
+ }
+ }
+ });
+
+ return tEnv;
+
+ }
+
+ /**
+ * Called while disposing a <code>TestEnvironment</code>.
+ * Disposes text document.
+ * @param tParam test parameters
+ * @param tEnv the environment to cleanup
+ * @param log writer to log information while testing
+ */
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+
+ XModel aModel = (XModel)
+ UnoRuntime.queryInterface(XModel.class, xDrawDoc);
+
+ XController xController = aModel.getCurrentController();
+
+ //Closing ImageMapDialog
+ try {
+ String aSlotID = "slot:10371";
+ XDispatchProvider xDispProv = (XDispatchProvider)
+ UnoRuntime.queryInterface( XDispatchProvider.class, xController );
+ XURLTransformer xParser = (com.sun.star.util.XURLTransformer)
+ UnoRuntime.queryInterface(XURLTransformer.class,
+ ((XMultiServiceFactory)Param.getMSF()).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 = aSlotID;
+ 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) {
+ log.println("Couldn't change mode");
+ }
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+ /**
+ * Called while the <code>TestCase</code> initialization. In the
+ * implementation does nothing. Subclasses can override to initialize
+ * objects shared among all <code>TestEnvironment</code>s.
+ *
+ * @param tParam test parameters
+ * @param log writer to log information while testing
+ *
+ * @see #initializeTestCase()
+ */
+ protected void initialize(TestParameters Param, PrintWriter log) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println("creating a draw document");
+ xDrawDoc = SOF.createDrawDoc(null);
+ } catch (com.sun.star.uno.Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document ", e );
+ }
+ }
+
+}
diff --git a/qadevOOo/tests/java/mod/_svx/SvxGraphicObject.java b/qadevOOo/tests/java/mod/_svx/SvxGraphicObject.java
new file mode 100644
index 000000000000..28a5cdcaaff6
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxGraphicObject.java
@@ -0,0 +1,263 @@
+/*************************************************************************
+ *
+ * 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 mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DefaultDsc;
+import util.DrawTools;
+import util.InstCreator;
+import util.SOfficeFactory;
+
+import com.sun.star.awt.XBitmap;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyle;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.drawing.GraphicObject</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::drawing::ShadowProperties</code></li>
+ * <li> <code>com::sun::star::drawing::RotationDescriptor</code></li>
+ * <li> <code>com::sun::star::text::XSimpleText</code></li>
+ * <li> <code>com::sun::star::drawing::XShape</code></li>
+ * <li> <code>com::sun::star::drawing::GraphicObjectShape</code></li>
+ * <li> <code>com::sun::star::drawing::Shape</code></li>
+ * <li> <code>com::sun::star::text::XTextRange</code></li>
+ * <li> <code>com::sun::star::drawing::XGluePointsSupplier</code></li>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * <li> <code>com::sun::star::drawing::TextProperties</code></li>
+ * <li> <code>com::sun::star::style::CharacterProperties</code></li>
+ * <li> <code>com::sun::star::drawing::XShapeDescriptor</code></li>
+ * <li> <code>com::sun::star::style::ParagraphProperties</code></li>
+ * <li> <code>com::sun::star::text::XText</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.drawing.ShadowProperties
+ * @see com.sun.star.drawing.RotationDescriptor
+ * @see com.sun.star.text.XSimpleText
+ * @see com.sun.star.drawing.XShape
+ * @see com.sun.star.drawing.GraphicObjectShape
+ * @see com.sun.star.drawing.Shape
+ * @see com.sun.star.text.XTextRange
+ * @see com.sun.star.drawing.XGluePointsSupplier
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.drawing.TextProperties
+ * @see com.sun.star.style.CharacterProperties
+ * @see com.sun.star.drawing.XShapeDescriptor
+ * @see com.sun.star.style.ParagraphProperties
+ * @see com.sun.star.text.XText
+ * @see com.sun.star.lang.XComponent
+ * @see ifc.drawing._ShadowProperties
+ * @see ifc.drawing._RotationDescriptor
+ * @see ifc.text._XSimpleText
+ * @see ifc.drawing._XShape
+ * @see ifc.drawing._GraphicObjectShape
+ * @see ifc.drawing._Shape
+ * @see ifc.text._XTextRange
+ * @see ifc.drawing._XGluePointsSupplier
+ * @see ifc.beans._XPropertySet
+ * @see ifc.drawing._TextProperties
+ * @see ifc.style._CharacterProperties
+ * @see ifc.drawing._XShapeDescriptor
+ * @see ifc.style._ParagraphProperties
+ * @see ifc.text._XText
+ * @see ifc.lang._XComponent
+ */
+public class SvxGraphicObject extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * Creates a new Draw document.
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ log.println( "creating a drawdoc" );
+ xDrawDoc = DrawTools.createDrawDoc((XMultiServiceFactory)tParam.getMSF());
+ }
+
+ /**
+ * Disposes the Draw document created before
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.drawing.GraphicObject</code> as a tested
+ * component and inserts it to one of draw pages of the document.
+ * <p>
+ *
+ * Object relations created :
+ * <ul>
+ * <li> <code>'Style1', 'Style2'</code> for
+ * {@link ifc.drawing._Shape} :
+ * two values of 'Style' property. The first is taken
+ * from the shape tested, the second from another
+ * shape added to the draw page. </li>
+ * <li> <code>'Bitmap1', 'Bitmap2'</code> for
+ * {@link ifc.drawing._GraphicObjectShape} :</li>
+ * two bitmap objects which are created by setting
+ * 'GraphicURL' property of component tested and
+ * getting its 'GraphicObjectFillBitmap' property.
+ * <li> <code>'IMAP'</code> for
+ * {@link ifc.drawing._GraphicObjectShape} :
+ * <code>com.sun.star.image.ImageMapRectangleObject</code>
+ * service instance. </li>
+ * <li> <code>'XTEXTINFO'</code> for
+ * {@link ifc.text._XText} :
+ * creator which can create instnaces of
+ * <code>com.sun.star.text.TextField.URL</code>
+ * service. </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XShape oShape = null;
+ Object imap=null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ // create testobject here
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+ oShape = SOF.createShape(xDrawDoc,5000,5000,1500,1000,"GraphicObject");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+ oObj = oShape;
+
+ TestEnvironment tEnv = new TestEnvironment( oShape );
+
+ // adding two styles as ObjRelation for Shape
+ oShape = SOF.createShape(xDrawDoc,3000,4500,15000,1000,"Ellipse");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+
+ XPropertySet oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oObj);
+ XStyle aStyle = null;
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ }
+ tEnv.addObjRelation("Style1",aStyle);
+
+ oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oShape);
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ }
+ tEnv.addObjRelation("Style2",aStyle);
+
+
+ // adding graphic as ObjRelation for GraphicObjectShape
+ oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oObj);
+ XBitmap aBitmap = null;
+ try {
+ oShapeProps.setPropertyValue(
+ "GraphicURL",util.utils.getFullTestURL("space-metal.jpg"));
+ aBitmap = (XBitmap) AnyConverter.toObject(
+ new Type(XBitmap.class),oShapeProps.getPropertyValue
+ ("GraphicObjectFillBitmap"));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ }
+
+
+ tEnv.addObjRelation("Bitmap1",aBitmap);
+
+ try {
+ oShapeProps.setPropertyValue(
+ "GraphicURL",util.utils.getFullTestURL("crazy-blue.jpg"));
+ aBitmap = (XBitmap) AnyConverter.toObject(
+ new Type(XBitmap.class),oShapeProps.getPropertyValue
+ ("GraphicObjectFillBitmap"));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ }
+
+ tEnv.addObjRelation("Bitmap2",aBitmap);
+
+ try {
+ XMultiServiceFactory oDocMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class,xDrawDoc);
+ imap = oDocMSF.createInstance
+ ( "com.sun.star.image.ImageMapRectangleObject" );
+ } catch (com.sun.star.uno.Exception e) {
+ log.println("Couldn't create instance");
+ e.printStackTrace(log);
+ }
+
+
+ tEnv.addObjRelation("IMAP",imap);
+ tEnv.addObjRelation("ImapObject",imap);
+
+ // adding relation for XText interface
+ DefaultDsc tDsc = new DefaultDsc("com.sun.star.text.XTextContent",
+ "com.sun.star.text.TextField.URL");
+ log.println( " adding InstCreator object" );
+ tEnv.addObjRelation( "XTEXTINFO", new InstCreator( xDrawDoc, tDsc ) );
+
+ tEnv.addObjRelation("NoShear",new Boolean(true));
+
+ return tEnv;
+
+ } // finish method getTestEnvironment
+
+} // finish class SvxGraphicObject
diff --git a/qadevOOo/tests/java/mod/_svx/SvxShape.java b/qadevOOo/tests/java/mod/_svx/SvxShape.java
new file mode 100644
index 000000000000..6c3b3bc8bb8a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxShape.java
@@ -0,0 +1,227 @@
+/*************************************************************************
+ *
+ * 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 mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DefaultDsc;
+import util.DrawTools;
+import util.InstCreator;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyle;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.drawing.Shape</code>. <p>
+ *
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::style::ParagraphProperties</code></li>
+ * <li> <code>com::sun::star::drawing::LineProperties</code></li>
+ * <li> <code>com::sun::star::drawing::FillProperties</code></li>
+ * <li> <code>com::sun::star::drawing::TextShape</code></li>
+ * <li> <code>com::sun::star::drawing::ShadowProperties</code></li>
+ * <li> <code>com::sun::star::drawing::XGluePointsSupplier</code></li>
+ * <li> <code>com::sun::star::style::CharacterProperties</code></li>
+ * <li> <code>com::sun::star::drawing::RotationDescriptor</code></li>
+ * <li> <code>com::sun::star::text::XTextRange</code></li>
+ * <li> <code>com::sun::star::drawing::XShape</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::drawing::TextProperties</code></li>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * <li> <code>com::sun::star::text::XText</code></li>
+ * <li> <code>com::sun::star::drawing::XShapeDescriptor</code></li>
+ * <li> <code>com::sun::star::text::XSimpleText</code></li>
+ * <li> <code>com::sun::star::drawing::Shape</code></li>
+ * </ul> <p>
+ *
+ * The following files used by this test :
+ * <ul>
+ * <li><b> SvxShape.sxd </b> : this document is loaded for
+ * adding a shape tested to it. </li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.style.ParagraphProperties
+ * @see com.sun.star.drawing.LineProperties
+ * @see com.sun.star.drawing.FillProperties
+ * @see com.sun.star.drawing.TextShape
+ * @see com.sun.star.drawing.ShadowProperties
+ * @see com.sun.star.drawing.XGluePointsSupplier
+ * @see com.sun.star.style.CharacterProperties
+ * @see com.sun.star.drawing.RotationDescriptor
+ * @see com.sun.star.text.XTextRange
+ * @see com.sun.star.drawing.XShape
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.drawing.TextProperties
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.text.XText
+ * @see com.sun.star.drawing.XShapeDescriptor
+ * @see com.sun.star.text.XSimpleText
+ * @see com.sun.star.drawing.Shape
+ * @see ifc.style._ParagraphProperties
+ * @see ifc.drawing._LineProperties
+ * @see ifc.drawing._FillProperties
+ * @see ifc.drawing._TextShape
+ * @see ifc.drawing._ShadowProperties
+ * @see ifc.drawing._XGluePointsSupplier
+ * @see ifc.style._CharacterProperties
+ * @see ifc.drawing._RotationDescriptor
+ * @see ifc.text._XTextRange
+ * @see ifc.drawing._XShape
+ * @see ifc.lang._XComponent
+ * @see ifc.drawing._TextProperties
+ * @see ifc.beans._XPropertySet
+ * @see ifc.text._XText
+ * @see ifc.drawing._XShapeDescriptor
+ * @see ifc.text._XSimpleText
+ * @see ifc.drawing._Shape
+ */
+public class SvxShape extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * Loads a Draw document with name 'SvxShape.sxd' from test
+ * documents directory
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = SOF.loadDocument(
+ utils.getFullTestURL("SvxShape.sxd"));
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes the Draw document loaded before.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.drawing.EllipseShape</code> as tested component
+ * and adds it to the document.
+ * Object relations created :
+ * <ul>
+ * <li> <code>'Style1', 'Style2'</code> for
+ * {@link ifc.drawing._Shape} :
+ * two values of 'Style' property. The first is taken
+ * from the shape tested, the second from another
+ * shape added to the draw page. </li>
+ * <li> <code>'XTEXTINFO'</code> for
+ * {@link ifc.text._XText} :
+ * creator which can create instnaces of
+ * <code>com.sun.star.text.TextField.URL</code>
+ * service. </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XShape oShape = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+ oShape = SOF.createShape(xDrawDoc,3000,4500,15000,1000,"Text");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+ oObj = oShape ;
+
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oShape );
+
+ // adding relations for Shape service
+ oShape = SOF.createShape(xDrawDoc,5000,3500,7500,5000,"Text");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+
+ log.println( "adding two style as ObjRelation for ShapeDescriptor" );
+ XPropertySet oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oObj);
+ XStyle aStyle = null;
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ }
+ tEnv.addObjRelation("Style1",aStyle);
+
+ oShapeProps = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class,oShape);
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ }
+ tEnv.addObjRelation("Style2",aStyle);
+
+ // adding relation for XText
+ DefaultDsc tDsc = new DefaultDsc("com.sun.star.text.XTextContent",
+ "com.sun.star.text.TextField.URL");
+ log.println( " adding InstCreator object" );
+ tEnv.addObjRelation( "XTEXTINFO", new InstCreator( xDrawDoc, tDsc ) );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SvxShape
diff --git a/qadevOOo/tests/java/mod/_svx/SvxShapeCircle.java b/qadevOOo/tests/java/mod/_svx/SvxShapeCircle.java
new file mode 100644
index 000000000000..0225dbab878f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxShapeCircle.java
@@ -0,0 +1,247 @@
+/*************************************************************************
+ *
+ * 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 mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DefaultDsc;
+import util.DrawTools;
+import util.InstCreator;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyle;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.drawing.EllipseShape</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::style::ParagraphProperties</code></li>
+ * <li> <code>com::sun::star::drawing::LineProperties</code></li>
+ * <li> <code>com::sun::star::drawing::EllipseShape</code></li>
+ * <li> <code>com::sun::star::drawing::FillProperties</code></li>
+ * <li> <code>com::sun::star::drawing::ShadowProperties</code></li>
+ * <li> <code>com::sun::star::drawing::XGluePointsSupplier</code></li>
+ * <li> <code>com::sun::star::style::CharacterProperties</code></li>
+ * <li> <code>com::sun::star::drawing::RotationDescriptor</code></li>
+ * <li> <code>com::sun::star::text::XTextRange</code></li>
+ * <li> <code>com::sun::star::drawing::XShape</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::drawing::TextProperties</code></li>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * <li> <code>com::sun::star::text::XText</code></li>
+ * <li> <code>com::sun::star::drawing::XShapeDescriptor</code></li>
+ * <li> <code>com::sun::star::text::XSimpleText</code></li>
+ * <li> <code>com::sun::star::drawing::Shape</code></li>
+ * </ul> <p>
+ * The following files used by this test :
+ * <ul>
+ * <li><b> SvxShape.sxd </b> : this document is loaded for
+ * adding a shape tested to it. </li>
+ * </ul> <p>
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.style.ParagraphProperties
+ * @see com.sun.star.drawing.LineProperties
+ * @see com.sun.star.drawing.EllipseShape
+ * @see com.sun.star.drawing.FillProperties
+ * @see com.sun.star.drawing.ShadowProperties
+ * @see com.sun.star.drawing.XGluePointsSupplier
+ * @see com.sun.star.style.CharacterProperties
+ * @see com.sun.star.drawing.RotationDescriptor
+ * @see com.sun.star.text.XTextRange
+ * @see com.sun.star.drawing.XShape
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.drawing.TextProperties
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.text.XText
+ * @see com.sun.star.drawing.XShapeDescriptor
+ * @see com.sun.star.text.XSimpleText
+ * @see com.sun.star.drawing.Shape
+ * @see ifc.style._ParagraphProperties
+ * @see ifc.drawing._LineProperties
+ * @see ifc.drawing._EllipseShape
+ * @see ifc.drawing._FillProperties
+ * @see ifc.drawing._ShadowProperties
+ * @see ifc.drawing._XGluePointsSupplier
+ * @see ifc.style._CharacterProperties
+ * @see ifc.drawing._RotationDescriptor
+ * @see ifc.text._XTextRange
+ * @see ifc.drawing._XShape
+ * @see ifc.lang._XComponent
+ * @see ifc.drawing._TextProperties
+ * @see ifc.beans._XPropertySet
+ * @see ifc.text._XText
+ * @see ifc.drawing._XShapeDescriptor
+ * @see ifc.text._XSimpleText
+ * @see ifc.drawing._Shape
+ */
+public class SvxShapeCircle extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * Loads a Draw document with name 'SvxShape.sxd' from test
+ * documents directory
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() );
+
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = SOF.loadDocument(
+ utils.getFullTestURL("SvxShape.sxd"));
+ } catch ( com.sun.star.uno.Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * Disposes the Draw document loaded before.
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+
+ /**
+ * Creating a Testenvironment for the interfaces to be tested.
+ * Creates an instance of the service
+ * <code>com.sun.star.drawing.EllipseShape</code> as tested component
+ * and adds it to the document. Then the FULL type of circle is set.
+ *
+ * Object relations created :
+ * <ul>
+ * <li> <code>'Style1', 'Style2'</code> for
+ * {@link ifc.drawing._Shape} :
+ * two values of 'Style' property. The first is taken
+ * from the shape tested, the second from another
+ * shape added to the draw page. </li>
+ * <li> <code>'XTEXTINFO'</code> for
+ * {@link ifc.text._XText} :
+ * creator which can create instnaces of
+ * <code>com.sun.star.text.TextField.URL</code>
+ * service. </li>
+ * </ul>
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XShape oShape = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)tParam.getMSF()) ;
+ oShape = SOF.createShape(xDrawDoc,5000,5000,3000,3000,"Ellipse");
+
+ XPropertySet props = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, oShape) ;
+
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ;
+ try {
+ props.setPropertyValue("CircleKind",
+ com.sun.star.drawing.CircleKind.FULL) ;
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Cann't set 'CircleKind' property : " + e);
+ throw new StatusException("Can't create component", e) ;
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Cann't set 'CircleKind' property : " + e);
+ throw new StatusException("Can't create component", e) ;
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println("Cann't set 'CircleKind' property : " + e);
+ throw new StatusException("Can't create component", e) ;
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Cann't set 'CircleKind' property : " + e);
+ throw new StatusException("Can't create component", e) ;
+ }
+
+
+ oObj = oShape ;
+
+ oShape = SOF.createShape(xDrawDoc,5000,3500,7500,5000,"Line");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ;
+
+ // test environment creation
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ log.println( "adding two styles as ObjRelation for ShapeDescriptor" );
+ XPropertySet oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oObj);
+ XStyle aStyle = null;
+
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ }
+
+ tEnv.addObjRelation("Style1",aStyle);
+ oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oShape);
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ }
+
+ tEnv.addObjRelation("Style2",aStyle);
+
+ DefaultDsc tDsc = new DefaultDsc("com.sun.star.text.XTextContent",
+ "com.sun.star.text.TextField.URL");
+ log.println( " adding InstCreator object" );
+ tEnv.addObjRelation( "XTEXTINFO", new InstCreator( xDrawDoc, tDsc ) );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SvxShapeCircle
diff --git a/qadevOOo/tests/java/mod/_svx/SvxShapeCollection.java b/qadevOOo/tests/java/mod/_svx/SvxShapeCollection.java
new file mode 100644
index 000000000000..b20595ec5f53
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxShapeCollection.java
@@ -0,0 +1,148 @@
+/*************************************************************************
+ *
+ * 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 mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DrawTools;
+import util.InstCreator;
+import util.SOfficeFactory;
+import util.ShapeDsc;
+
+import com.sun.star.drawing.XShape;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class SvxShapeCollection extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = DrawTools.createDrawDoc((XMultiServiceFactory)tParam.getMSF());
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XShape oShape = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ try {
+ // adding some shapes for testing.
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+ Object col = ((XMultiServiceFactory)tParam.getMSF()).createInstance
+ ("com.sun.star.drawing.ShapeCollection");
+ XShapes shapes = (XShapes) UnoRuntime.queryInterface
+ (XShapes.class,col);
+
+ oShape = SOF.createShape(xDrawDoc,3000,4500,15000,1000,"Ellipse");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+ shapes.add(oShape);
+
+ oShape = SOF.createShape(xDrawDoc,5000,3500,7500,5000,"Rectangle");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ;
+ shapes.add(oShape);
+
+ oObj = (XInterface) col ;
+
+ }
+ catch (Exception e) {
+ log.println("Couldn't create insance");
+ e.printStackTrace(log);
+ }
+
+ // test environment creation
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+ System.out.println("IName: "+util.utils.getImplName(oObj));
+ ShapeDsc sDsc = new ShapeDsc(5000,3500,7500,10000,"Line");
+ tEnv.addObjRelation("Shape", new InstCreator(xDrawDoc, sDsc)) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SvxShapeCollection
+
diff --git a/qadevOOo/tests/java/mod/_svx/SvxShapeConnector.java b/qadevOOo/tests/java/mod/_svx/SvxShapeConnector.java
new file mode 100644
index 000000000000..9c38e394ff98
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxShapeConnector.java
@@ -0,0 +1,204 @@
+/*************************************************************************
+ *
+ * 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 mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DefaultDsc;
+import util.DrawTools;
+import util.InstCreator;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyle;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ *
+ * initial description
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.document.LinkTarget
+ * @see com.sun.star.document.XLinkTargetSupplier
+ * @see com.sun.star.drawing.ConnectorShapeDescriptor
+ * @see com.sun.star.drawing.LineShapeDescriptor
+ * @see com.sun.star.drawing.PolyPolygonDescriptor
+ * @see com.sun.star.drawing.RotationDescriptor
+ * @see com.sun.star.drawing.ShadowDescriptor
+ * @see com.sun.star.drawing.ShapeDescriptor
+ * @see com.sun.star.drawing.Text
+ * @see com.sun.star.drawing.XConnectorShape
+ * @see com.sun.star.drawing.XShape
+ * @see com.sun.star.drawing.XShapeDescriptor
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.style.CharacterProperties
+ * @see com.sun.star.style.ParagraphProperties
+ * @see com.sun.star.text.XSimpleText
+ * @see com.sun.star.text.XText
+ * @see com.sun.star.text.XTextRange
+ *
+ */
+public class SvxShapeConnector extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = DrawTools.createDrawDoc((XMultiServiceFactory)tParam.getMSF());
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+
+ /**
+ * * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * * @see PrintWriter
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XShape oShape = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+ try {
+ XMultiServiceFactory oDocMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class,xDrawDoc);
+ Object oInt = oDocMSF.createInstance
+ ( "com.sun.star.drawing.ConnectorShape" );
+
+ oShape = (XShape)UnoRuntime.queryInterface( XShape.class, oInt );
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+ }
+ catch (Exception e) {
+ log.println("Couldn't create insance");
+ e.printStackTrace(log);
+ }
+
+ // create testobject here
+ oObj = oShape;
+
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+ oShape = SOF.createShape(xDrawDoc,3000,4500,15000,1000,"Ellipse");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+
+ for (int i=0;i<10;i++) {
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(
+ SOF.createShape(xDrawDoc,
+ 3000,4500,7510+10*i,5010+10*i,"Rectangle"));
+ }
+
+ log.println( "adding two style as ObjRelation for ShapeDescriptor" );
+ XPropertySet oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oObj);
+ XStyle aStyle = null;
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (Exception e) {}
+
+ tEnv.addObjRelation("Style1",aStyle);
+ oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oShape);
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (Exception e) {}
+
+ tEnv.addObjRelation("Style2",aStyle);
+
+ DefaultDsc tDsc = new DefaultDsc("com.sun.star.text.XTextContent",
+ "com.sun.star.text.TextField.URL");
+ log.println( " adding InstCreator object" );
+ tEnv.addObjRelation( "XTEXTINFO", new InstCreator( xDrawDoc, tDsc ) );
+ tEnv.addObjRelation("NoSetSize","SvxShapeConnector");
+ // adding relation for XConnectorShape
+ XShape oShape1 = SOF.createShape(xDrawDoc,1000,2000,1500,1000,"Line");
+ XShape oShape2 = SOF.createShape(xDrawDoc,1000,2000,4000,3000,"Line");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape1);
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape2);
+ tEnv.addObjRelation("XConnectorShape.Shapes",
+ new XShape[] {oShape1, oShape2}) ;
+ System.out.println("IName: "+util.utils.getImplName(oObj));
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SvxShapeConnector
+
diff --git a/qadevOOo/tests/java/mod/_svx/SvxShapeControl.java b/qadevOOo/tests/java/mod/_svx/SvxShapeControl.java
new file mode 100644
index 000000000000..09b4ecb72226
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxShapeControl.java
@@ -0,0 +1,158 @@
+/*************************************************************************
+ *
+ * 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 mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DrawTools;
+import util.FormTools;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyle;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class SvxShapeControl extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = DrawTools.createDrawDoc((XMultiServiceFactory)tParam.getMSF());
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XShape oShape = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ try {
+
+ oShape = FormTools.insertControlShape(
+ xDrawDoc,3000,4500,15000,1000,"CommandButton");
+
+ oObj = oShape ;
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)tParam.getMSF()) ;
+ oShape = SOF.createShape(xDrawDoc,5000,3500,7500,5000,"Line");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ;
+ }
+ catch (Exception e) {
+ log.println("Couldn't create insance");
+ e.printStackTrace(log);
+ }
+
+ // test environment creation
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ log.println( "adding two styles as ObjRelation for ShapeDescriptor" );
+ XPropertySet oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oObj);
+ XStyle aStyle = null;
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (Exception e) {}
+ tEnv.addObjRelation("Style1",aStyle);
+ oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oShape);
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (Exception e) {}
+ tEnv.addObjRelation("Style2",aStyle);
+
+ log.println( "adding document relation for XControlShape" );
+ tEnv.addObjRelation("xDoc", xDrawDoc) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SvxShapeControl
+
diff --git a/qadevOOo/tests/java/mod/_svx/SvxShapeDimensioning.java b/qadevOOo/tests/java/mod/_svx/SvxShapeDimensioning.java
new file mode 100644
index 000000000000..8a7c1d0300b3
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxShapeDimensioning.java
@@ -0,0 +1,169 @@
+/*************************************************************************
+ *
+ * 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 mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DefaultDsc;
+import util.DrawTools;
+import util.InstCreator;
+import util.SOfficeFactory;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyle;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class SvxShapeDimensioning extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = DrawTools.createDrawDoc((XMultiServiceFactory)tParam.getMSF());
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XShape oShape = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ try {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+ oShape = SOF.createShape(xDrawDoc,4000,4000,3000,3000,"Measure");
+
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+
+ for (int i=0;i<10;i++) {
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(
+ SOF.createShape(xDrawDoc,
+ 3000,4500,7510+10*i,5010+10*i,"Rectangle"));
+ }
+
+ oObj = oShape ;
+
+ //SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)tParam.getMSF()) ;
+ oShape = SOF.createShape(xDrawDoc,5000,3500,7500,5000,"Line");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ;
+ }
+ catch (Exception e) {
+ log.println("Couldn't create insance");
+ e.printStackTrace(log);
+ }
+
+ // test environment creation
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ log.println( "adding two styles as ObjRelation for ShapeDescriptor" );
+ XPropertySet oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oObj);
+ XStyle aStyle = null;
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (Exception e) {}
+ tEnv.addObjRelation("Style1",aStyle);
+ oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oShape);
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (Exception e) {}
+ tEnv.addObjRelation("Style2",aStyle);
+
+ DefaultDsc tDsc = new DefaultDsc("com.sun.star.text.XTextContent",
+ "com.sun.star.text.TextField.URL");
+ log.println( " adding InstCreator object" );
+ tEnv.addObjRelation( "XTEXTINFO", new InstCreator( xDrawDoc, tDsc ) );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SvxShapeDimensioning
+
diff --git a/qadevOOo/tests/java/mod/_svx/SvxShapeGroup.java b/qadevOOo/tests/java/mod/_svx/SvxShapeGroup.java
new file mode 100644
index 000000000000..427c26046ff8
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxShapeGroup.java
@@ -0,0 +1,195 @@
+/*************************************************************************
+ *
+ * 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 mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.InstCreator;
+import util.SOfficeFactory;
+import util.ShapeDsc;
+
+import com.sun.star.beans.XPropertySet;
+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.drawing.XShapeGrouper;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyle;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ *
+ * initial description
+ * @see com.sun.star.drawing._XDrawPage
+ *
+ */
+
+public class SvxShapeGroup extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * in general this method initializes the document
+ */
+
+ protected void initialize(TestParameters Param, PrintWriter log) {
+
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+
+ try {
+ log.println( "creating a draw document" );
+ xDrawDoc = SOF.createDrawDoc(null);;
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+
+ }
+
+ /**
+ * in general this method disposes the document
+ */
+
+ protected void cleanup( TestParameters Param, PrintWriter log) {
+
+ log.println("disposing xDrawDoc");
+ util.DesktopTools.closeDoc(xDrawDoc);
+
+ }
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ */
+ public synchronized TestEnvironment createTestEnvironment
+ (TestParameters Param, PrintWriter log ) {
+
+ XInterface oObj = null;
+ XShapes oShapes = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)Param.getMSF());
+
+ // get the drawpage of drawing here
+ try {
+ log.println( "getting Drawpage" );
+ XDrawPagesSupplier oDPS = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface(XDrawPagesSupplier.class,xDrawDoc);
+ XDrawPages oDPn = oDPS.getDrawPages();
+ XIndexAccess oDPi = (XIndexAccess)
+ UnoRuntime.queryInterface(XIndexAccess.class,oDPn);
+ oObj = (XDrawPage) AnyConverter.toObject(
+ new Type(XDrawPage.class),oDPi.getByIndex(0));
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't get DrawPage", e );
+ }
+
+ if (oObj == null) {
+ System.out.println("**************************");
+ System.out.println(" XDrawPage is NULL");
+ System.out.println("**************************");
+ }
+
+ //put something on the drawpage
+ log.println( "inserting some Shapes" );
+ oShapes = (XShapes) UnoRuntime.queryInterface(XShapes.class,oObj);
+ XShape Shape1 = SOF.createShape(xDrawDoc,
+ 3000,4500,15000,1000,"Ellipse");
+ oShapes.add(SOF.createShape(xDrawDoc,
+ 2000,1500,1000,1000,"Line"));
+ oShapes.add(Shape1);
+ XShape Shape2 = SOF.createShape(xDrawDoc,
+ 5000,3500,7500,5000,"Rectangle");
+ oShapes.add(Shape2);
+
+ log.println( "adding two style as ObjRelation for ShapeDescriptor" );
+ XPropertySet oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,Shape1);
+ XStyle aStyle1 = null;
+ try {
+ aStyle1 = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (Exception e) {}
+ oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,Shape2);
+ XStyle aStyle2 = null;
+ try {
+ aStyle2 = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (Exception e) {}
+
+
+ //get the XShapeGrouper
+ try{
+ log.println("get XShapeGroup");
+ XShapeGrouper oSG = (XShapeGrouper)UnoRuntime.queryInterface
+ (XShapeGrouper.class, oObj);
+ oObj = oSG.group(oShapes);
+ } catch ( Exception e) {
+ e.printStackTrace( log );
+ throw new StatusException(" Couldn't get XShapeGroup: ", e);
+ }
+
+ log.println( "creating a new environment for drawpage object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ ShapeDsc sDsc = new ShapeDsc(5000,3500,7500,10000,"Rectangle");
+ log.println( "adding Shape as mod relation to environment" );
+ tEnv.addObjRelation("Shape", new InstCreator( xDrawDoc, sDsc));
+ //tEnv.addObjRelation("DrawPage", oObj);
+ //tEnv.addObjRelation("MasterPageSupplier",oGroup);
+
+ tEnv.addObjRelation("Style1",aStyle1);
+ tEnv.addObjRelation("Style2",aStyle2);
+ for (int i=0;i<6;i++) {
+ Shape2 = SOF.createShape(xDrawDoc,
+ 5000+100*i,3500+100*i,7500+100*i,5000+100*i,"Rectangle");
+ oShapes.add(Shape2);
+ }
+ return tEnv;
+ } // finish method createTestEnvironment
+
+} // finish class SvxShapeGroup
+
diff --git a/qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygon.java b/qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygon.java
new file mode 100644
index 000000000000..7e26f764f40e
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygon.java
@@ -0,0 +1,265 @@
+/*************************************************************************
+ *
+ * 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 mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DefaultDsc;
+import util.DrawTools;
+import util.InstCreator;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.awt.Point;
+import com.sun.star.awt.Size;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyle;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.drawing.PolyPolygonShape</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::style::ParagraphProperties</code></li>
+ * <li> <code>com::sun::star::drawing::LineProperties</code></li>
+ * <li> <code>com::sun::star::drawing::FillProperties</code></li>
+ * <li> <code>com::sun::star::drawing::PolyPolygonDescriptor</code></li>
+ * <li> <code>com::sun::star::drawing::ShadowProperties</code></li>
+ * <li> <code>com::sun::star::drawing::XGluePointsSupplier</code></li>
+ * <li> <code>com::sun::star::style::CharacterProperties</code></li>
+ * <li> <code>com::sun::star::drawing::RotationDescriptor</code></li>
+ * <li> <code>com::sun::star::text::XTextRange</code></li>
+ * <li> <code>com::sun::star::drawing::XShape</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::drawing::TextProperties</code></li>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * <li> <code>com::sun::star::text::XText</code></li>
+ * <li> <code>com::sun::star::drawing::XShapeDescriptor</code></li>
+ * <li> <code>com::sun::star::text::XSimpleText</code></li>
+ * <li> <code>com::sun::star::drawing::Shape</code></li>
+ * </ul> <p>
+ * The following files used by this test :
+ * <ul>
+ * <li><b> TransparencyChart.sxs </b> : to load predefined chart
+ * document where two 'automatic' transparency styles exists :
+ * 'Transparency 1' and 'Transparency 2'.</li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.style.ParagraphProperties
+ * @see com.sun.star.drawing.LineProperties
+ * @see com.sun.star.drawing.FillProperties
+ * @see com.sun.star.drawing.PolyPolygonDescriptor
+ * @see com.sun.star.drawing.ShadowProperties
+ * @see com.sun.star.drawing.XGluePointsSupplier
+ * @see com.sun.star.style.CharacterProperties
+ * @see com.sun.star.drawing.RotationDescriptor
+ * @see com.sun.star.text.XTextRange
+ * @see com.sun.star.drawing.XShape
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.drawing.TextProperties
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.text.XText
+ * @see com.sun.star.drawing.XShapeDescriptor
+ * @see com.sun.star.text.XSimpleText
+ * @see com.sun.star.drawing.Shape
+ * @see ifc.style._ParagraphProperties
+ * @see ifc.drawing._LineProperties
+ * @see ifc.drawing._FillProperties
+ * @see ifc.drawing._PolyPolygonDescriptor
+ * @see ifc.drawing._ShadowProperties
+ * @see ifc.drawing._XGluePointsSupplier
+ * @see ifc.style._CharacterProperties
+ * @see ifc.drawing._RotationDescriptor
+ * @see ifc.text._XTextRange
+ * @see ifc.drawing._XShape
+ * @see ifc.lang._XComponent
+ * @see ifc.drawing._TextProperties
+ * @see ifc.beans._XPropertySet
+ * @see ifc.text._XText
+ * @see ifc.drawing._XShapeDescriptor
+ * @see ifc.text._XSimpleText
+ * @see ifc.drawing._Shape
+ */
+public class SvxShapePolyPolygon extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a chartdocument" );
+ xDrawDoc = SOF.loadDocument(
+ utils.getFullTestURL("SvxShape.sxd"));
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+
+ /**
+ * * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * * @see PrintWriter
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XShape oShape = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ try {
+ // adding some shapes for testing.
+ //SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+ //oShape = SOF.createShape(xDrawDoc,6000,6000,5000,5000,"PolyPolygon");
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xDrawDoc) ;
+ XInterface oInst = (XInterface) xMSF.createInstance
+ ("com.sun.star.drawing.PolyPolygonShape") ;
+ oShape = (XShape) UnoRuntime.queryInterface
+ (XShape.class, oInst) ;
+
+ oShape.setSize(new Size(0,0)) ;
+ oShape.setPosition(new Point(0,0)) ;
+
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+
+ Point[] square1 = new Point[] {
+ new Point(5000, 5000),
+ new Point(10000, 5000),
+ new Point(10000, 10000),
+ new Point(5000, 10000)} ;
+
+ Point[] square2 = new Point[] {
+ new Point(6500, 6500),
+ new Point(8500, 6500),
+ new Point(8500, 8500),
+ new Point(6500, 8500)} ;
+
+ Point[][] polygon = new Point[][] {square1, square2};
+
+ ((XPropertySet) UnoRuntime.queryInterface(XPropertySet.class,
+ oShape)).setPropertyValue("PolyPolygon", polygon) ;
+
+ oObj = oShape ;
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)tParam.getMSF()) ;
+ oShape = SOF.createShape(xDrawDoc,5000,3500,7500,5000,"Line");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ;
+ }
+ catch (Exception e) {
+ log.println("Couldn't create insance");
+ e.printStackTrace(log);
+ }
+
+ // test environment creation
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ log.println( "adding two styles as ObjRelation for ShapeDescriptor" );
+ XPropertySet oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oObj);
+ XStyle aStyle = null;
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (Exception e) {}
+ tEnv.addObjRelation("Style1",aStyle);
+ oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oShape);
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (Exception e) {}
+ tEnv.addObjRelation("Style2",aStyle);
+
+ // adding relation for XText
+ DefaultDsc tDsc = new DefaultDsc("com.sun.star.text.XTextContent",
+ "com.sun.star.text.TextField.URL");
+ log.println( " adding InstCreator object" );
+ tEnv.addObjRelation( "XTEXTINFO", new InstCreator( xDrawDoc, tDsc ) );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SvxShapeCollection
+
diff --git a/qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygonBezier.java b/qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygonBezier.java
new file mode 100644
index 000000000000..7ac67194b299
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxShapePolyPolygonBezier.java
@@ -0,0 +1,278 @@
+/*************************************************************************
+ *
+ * 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 mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DrawTools;
+import util.InstCreator;
+import util.SOfficeFactory;
+import util.utils;
+
+import com.sun.star.awt.Point;
+import com.sun.star.awt.Size;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.drawing.PolyPolygonBezierCoords;
+import com.sun.star.drawing.PolygonFlags;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.style.XStyle;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ * Test for object which is represented by service
+ * <code>com.sun.star.drawing.ClosedBezierShape</code>. <p>
+ * Object implements the following interfaces :
+ * <ul>
+ * <li> <code>com::sun::star::style::ParagraphProperties</code></li>
+ * <li> <code>com::sun::star::drawing::PolyPolygonBezierDescriptor</code></li>
+ * <li> <code>com::sun::star::drawing::LineProperties</code></li>
+ * <li> <code>com::sun::star::drawing::FillProperties</code></li>
+ * <li> <code>com::sun::star::drawing::ShadowProperties</code></li>
+ * <li> <code>com::sun::star::drawing::XGluePointsSupplier</code></li>
+ * <li> <code>com::sun::star::style::CharacterProperties</code></li>
+ * <li> <code>com::sun::star::drawing::RotationDescriptor</code></li>
+ * <li> <code>com::sun::star::text::XTextRange</code></li>
+ * <li> <code>com::sun::star::drawing::XShape</code></li>
+ * <li> <code>com::sun::star::lang::XComponent</code></li>
+ * <li> <code>com::sun::star::drawing::TextProperties</code></li>
+ * <li> <code>com::sun::star::beans::XPropertySet</code></li>
+ * <li> <code>com::sun::star::text::XText</code></li>
+ * <li> <code>com::sun::star::drawing::XShapeDescriptor</code></li>
+ * <li> <code>com::sun::star::text::XSimpleText</code></li>
+ * <li> <code>com::sun::star::drawing::Shape</code></li>
+ * </ul> <p>
+ *
+ * The following files used by this test :
+ * <ul>
+ * <li><b> TransparencyChart.sxs </b> : to load predefined chart
+ * document where two 'automatic' transparency styles exists :
+ * 'Transparency 1' and 'Transparency 2'.</li>
+ * </ul> <p>
+ *
+ * This object test <b> is NOT </b> designed to be run in several
+ * threads concurently.
+ *
+ * @see com.sun.star.style.ParagraphProperties
+ * @see com.sun.star.drawing.PolyPolygonBezierDescriptor
+ * @see com.sun.star.drawing.LineProperties
+ * @see com.sun.star.drawing.FillProperties
+ * @see com.sun.star.drawing.ShadowProperties
+ * @see com.sun.star.drawing.XGluePointsSupplier
+ * @see com.sun.star.style.CharacterProperties
+ * @see com.sun.star.drawing.RotationDescriptor
+ * @see com.sun.star.text.XTextRange
+ * @see com.sun.star.drawing.XShape
+ * @see com.sun.star.lang.XComponent
+ * @see com.sun.star.drawing.TextProperties
+ * @see com.sun.star.beans.XPropertySet
+ * @see com.sun.star.text.XText
+ * @see com.sun.star.drawing.XShapeDescriptor
+ * @see com.sun.star.text.XSimpleText
+ * @see com.sun.star.drawing.Shape
+ * @see ifc.style._ParagraphProperties
+ * @see ifc.drawing._PolyPolygonBezierDescriptor
+ * @see ifc.drawing._LineProperties
+ * @see ifc.drawing._FillProperties
+ * @see ifc.drawing._ShadowProperties
+ * @see ifc.drawing._XGluePointsSupplier
+ * @see ifc.style._CharacterProperties
+ * @see ifc.drawing._RotationDescriptor
+ * @see ifc.text._XTextRange
+ * @see ifc.drawing._XShape
+ * @see ifc.lang._XComponent
+ * @see ifc.drawing._TextProperties
+ * @see ifc.beans._XPropertySet
+ * @see ifc.text._XText
+ * @see ifc.drawing._XShapeDescriptor
+ * @see ifc.text._XSimpleText
+ * @see ifc.drawing._Shape
+ */
+public class SvxShapePolyPolygonBezier extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ // get a soffice factory object
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ try {
+ log.println( "creating a chartdocument" );
+ xDrawDoc = SOF.loadDocument(
+ utils.getFullTestURL("SvxShape.sxd"));
+ } catch (com.sun.star.uno.Exception e) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+
+ /**
+ * * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * * @see PrintWriter
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XShape oShape = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+
+ try {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
+
+ XMultiServiceFactory xMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface(XMultiServiceFactory.class, xDrawDoc) ;
+
+ XInterface oInst = (XInterface) xMSF.createInstance
+ ("com.sun.star.drawing.ClosedBezierShape") ;
+ oShape = (XShape) UnoRuntime.queryInterface
+ (XShape.class, oInst) ;
+
+ Point[] points = new Point[2];
+ points[0] = new Point();
+ points[0].X = 50;
+ points[0].Y = 50;
+ points[1] = new Point();
+ points[1].X = 5000;
+ points[1].Y = 5000;
+
+ Point[][] the_points = new Point[1][2];
+ the_points[0] = points;
+
+ PolygonFlags[] flags = new PolygonFlags[2];
+ flags[0] = PolygonFlags.NORMAL;
+ flags[1] = PolygonFlags.NORMAL;
+
+ PolygonFlags[][] the_flags = new PolygonFlags[1][2];
+ the_flags[0] = flags;
+
+ PolyPolygonBezierCoords coords = new PolyPolygonBezierCoords();
+ coords.Coordinates=the_points;
+ coords.Flags = the_flags;
+
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+
+ oShape.setSize(new Size(3000,3000)) ;
+ oShape.setPosition(new Point(4000,4000)) ;
+
+ oObj = oShape ;
+
+ XPropertySet shapeProps = (XPropertySet) UnoRuntime.queryInterface
+ (XPropertySet.class, oObj);
+
+ shapeProps.setPropertyValue("PolyPolygonBezier",coords);
+
+ //SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)tParam.getMSF()) ;
+ oShape = SOF.createShape(xDrawDoc,5000,3500,7500,5000,"Line");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ;
+ }
+ catch (Exception e) {
+ log.println("Couldn't create instance");
+ e.printStackTrace(log);
+ }
+
+ // test environment creation
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ log.println( "adding two styles as ObjRelation for ShapeDescriptor" );
+ XPropertySet oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oObj);
+ XStyle aStyle = null;
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (Exception e) {}
+ tEnv.addObjRelation("Style1",aStyle);
+ oShapeProps = (XPropertySet)
+ UnoRuntime.queryInterface(XPropertySet.class,oShape);
+ try {
+ aStyle = (XStyle) AnyConverter.toObject(
+ new Type(XStyle.class),oShapeProps.getPropertyValue("Style"));
+ } catch (Exception e) {}
+ tEnv.addObjRelation("Style2",aStyle);
+
+ // adding relation for XText
+ util.DefaultDsc tDsc = new util.DefaultDsc
+ ("com.sun.star.text.XTextContent",
+ "com.sun.star.text.TextField.URL");
+ log.println( " adding InstCreator object" );
+ tEnv.addObjRelation( "XTEXTINFO", new InstCreator( xDrawDoc, tDsc ) );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SvxShapePolyPolygonBezier
diff --git a/qadevOOo/tests/java/mod/_svx/SvxUnoNumberingRules.java b/qadevOOo/tests/java/mod/_svx/SvxUnoNumberingRules.java
new file mode 100644
index 000000000000..c7d7e8e13a7d
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxUnoNumberingRules.java
@@ -0,0 +1,94 @@
+/*************************************************************************
+ *
+ * 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 mod._svx;
+
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.uno.Exception;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+
+import util.DrawTools;
+
+
+public class SvxUnoNumberingRules extends TestCase {
+ static XComponent xDrawDoc;
+
+ protected void initialize(TestParameters tParam, PrintWriter log) {
+ log.println("creating a drawdoc");
+ xDrawDoc = DrawTools.createDrawDoc(
+ (XMultiServiceFactory) tParam.getMSF());
+ }
+
+ protected TestEnvironment createTestEnvironment(TestParameters tParam,
+ PrintWriter log) {
+ XMultiServiceFactory docMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(
+ XMultiServiceFactory.class,
+ xDrawDoc);
+ XInterface oObj = null;
+
+ try {
+ oObj = (XInterface) docMSF.createInstance(
+ "com.sun.star.text.NumberingRules");
+ } catch (Exception e) {
+ e.printStackTrace(log);
+ throw new StatusException("Unexpected exception", e);
+ }
+
+ TestEnvironment tEnv = new TestEnvironment(oObj);
+
+ log.println("Implementationname: " + util.utils.getImplName(oObj));
+
+ Object NewRules=null;
+
+ try{
+ XIndexAccess xIA = (XIndexAccess) UnoRuntime.queryInterface(XIndexAccess.class, oObj);
+ NewRules = xIA.getByIndex(2);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Couldn't get new Rules for XIndexReplace");
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Couldn't get new Rules for XIndexReplace");
+ }
+
+ tEnv.addObjRelation("INSTANCE1",NewRules);
+
+ return tEnv;
+ }
+
+ protected void cleanup(TestParameters tParam, PrintWriter log) {
+ log.println(" disposing xDrawDoc ");
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+}
diff --git a/qadevOOo/tests/java/mod/_svx/SvxUnoText.java b/qadevOOo/tests/java/mod/_svx/SvxUnoText.java
new file mode 100644
index 000000000000..611b0e203c8a
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxUnoText.java
@@ -0,0 +1,170 @@
+/*************************************************************************
+ *
+ * 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 mod._svx;
+
+import com.sun.star.text.XText;
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DefaultDsc;
+import util.DrawTools;
+import util.InstCreator;
+import util.SOfficeFactory;
+
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.ControlCharacter;
+import com.sun.star.text.XSimpleText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.text.XTextRange;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class SvxUnoText extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = DrawTools.createDrawDoc((XMultiServiceFactory)tParam.getMSF());
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+
+ /**
+ * * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ * Object relations created :
+ * <ul>
+ * <li> <code>'RangeForMove'</code> for
+ * {@link ifc.text._XTextRangeMover} (the range to be moved)</li>
+ * <li> <code>'XTextRange'</code> for
+ * {@link ifc.text._XTextRangeMover} (the range that includes moving
+ * range)</li>
+ * </ul>
+ * @see TestParameters
+ * * @see PrintWriter
+ */
+ protected TestEnvironment createTestEnvironment
+ (TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ // create testobject here
+ XTextRange aRange = null;
+ XShape oShape = null;
+
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)tParam.getMSF()) ;
+ oShape = SOF.createShape
+ (xDrawDoc,5000,3500,7500,5000,"Text");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+
+ XSimpleText text = (XSimpleText) UnoRuntime.queryInterface
+ (XSimpleText.class, oShape) ;
+
+ XTextCursor cursor = text.createTextCursor() ;
+ text.insertString(cursor, "Paragraph 1", false) ;
+ text.insertControlCharacter(cursor,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+ cursor.setString("TextForMove");
+ aRange = cursor;
+ XTextCursor cursor1 = text.createTextCursorByRange(text.getEnd());
+ text.insertControlCharacter(cursor1,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+ text.insertString(cursor1, "Paragraph 2", false);
+ text.insertControlCharacter(cursor1,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+ text.insertString(cursor1, "Paragraph 3", false) ;
+ text.insertControlCharacter(cursor1,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+ oObj = text.getText() ;
+ } catch (Exception e) {
+ log.println("Can't create test object") ;
+ e.printStackTrace(log) ;
+ }
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+ // adding relation for XText
+ DefaultDsc tDsc = new DefaultDsc("com.sun.star.text.XTextContent",
+ "com.sun.star.text.TextField.DateTime");
+ log.println( " adding InstCreator object" );
+ tEnv.addObjRelation( "XTEXTINFO", new InstCreator( xDrawDoc, tDsc ) );
+
+ // adding relation for XTextRangeMover
+ tEnv.addObjRelation("RangeForMove", aRange);
+ tEnv.addObjRelation("XTextRange", oObj);
+
+ // adding relation for XTextRangeComapre
+ tEnv.addObjRelation("TEXT", (XText) UnoRuntime.queryInterface(XText.class, oShape)) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SvxUnoText
+
diff --git a/qadevOOo/tests/java/mod/_svx/SvxUnoTextContent.java b/qadevOOo/tests/java/mod/_svx/SvxUnoTextContent.java
new file mode 100644
index 000000000000..af72326d32fd
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxUnoTextContent.java
@@ -0,0 +1,150 @@
+/*************************************************************************
+ *
+ * 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 mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DrawTools;
+import util.SOfficeFactory;
+
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.ControlCharacter;
+import com.sun.star.text.XSimpleText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class SvxUnoTextContent extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = DrawTools.createDrawDoc((XMultiServiceFactory)tParam.getMSF());
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ // create testobject here
+
+ XEnumerationAccess xEA = null ;
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)tParam.getMSF()) ;
+ XShape oShape = SOF.createShape(xDrawDoc,
+ 5000,3500,7500,5000,"Text");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ;
+
+ XSimpleText text = (XSimpleText) UnoRuntime.queryInterface
+ (XSimpleText.class, oShape) ;
+
+ XTextCursor cursor = text.createTextCursor() ;
+
+ text.insertString(cursor, "Paragraph 1", false) ;
+ text.insertControlCharacter(cursor,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+ text.insertString(cursor, "Paragraph 2", false) ;
+ text.insertControlCharacter(cursor,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+ text.insertString(cursor, "Paragraph 3", false) ;
+ text.insertControlCharacter(cursor,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+
+ xEA = (XEnumerationAccess) UnoRuntime.queryInterface
+ (XEnumerationAccess.class, text) ;
+
+ oObj = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),xEA.createEnumeration().nextElement());
+ } catch (Exception e) {
+ log.println("Can't create test object") ;
+ e.printStackTrace(log) ;
+ throw new StatusException("Unexpected exception", e);
+ }
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_svx/SvxUnoTextContentEnum.java b/qadevOOo/tests/java/mod/_svx/SvxUnoTextContentEnum.java
new file mode 100644
index 000000000000..4e27561e01bc
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxUnoTextContentEnum.java
@@ -0,0 +1,152 @@
+/*************************************************************************
+ *
+ * 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 mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DrawTools;
+import util.SOfficeFactory;
+
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.ControlCharacter;
+import com.sun.star.text.XSimpleText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class SvxUnoTextContentEnum extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = DrawTools.createDrawDoc((XMultiServiceFactory)tParam.getMSF());
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ public TestEnvironment createTestEnvironment( TestParameters tParam,
+ PrintWriter log )
+ throws StatusException {
+
+ XInterface oObj = null;
+ // create testobject here
+
+ XEnumerationAccess xEA = null ;
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)tParam.getMSF()) ;
+ XShape oShape = SOF.createShape
+ (xDrawDoc,5000,3500,7500,5000,"Text");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ;
+
+ XSimpleText text = (XSimpleText) UnoRuntime.queryInterface
+ (XSimpleText.class, oShape) ;
+
+ XTextCursor cursor = text.createTextCursor() ;
+
+ text.insertString(cursor, "Paragraph 1", false) ;
+ text.insertControlCharacter(cursor,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+ text.insertString(cursor, "Paragraph 2", false) ;
+ text.insertControlCharacter(cursor,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+ text.insertString(cursor, "Paragraph 3", false) ;
+ text.insertControlCharacter(cursor,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+
+ xEA = (XEnumerationAccess) UnoRuntime.queryInterface
+ (XEnumerationAccess.class, text) ;
+
+ oObj = xEA.createEnumeration() ;
+ } catch (Exception e) {
+ log.println("Can't create test object") ;
+ e.printStackTrace(log) ;
+ throw new StatusException("Unexpected exception", e);
+ }
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ // adding relation for XEnumeration test
+ tEnv.addObjRelation("ENUM", xEA) ;
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_svx/SvxUnoTextCursor.java b/qadevOOo/tests/java/mod/_svx/SvxUnoTextCursor.java
new file mode 100644
index 000000000000..c4521c9aadcf
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxUnoTextCursor.java
@@ -0,0 +1,144 @@
+/*************************************************************************
+ *
+ * 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 mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DrawTools;
+import util.SOfficeFactory;
+
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.ControlCharacter;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class SvxUnoTextCursor extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = DrawTools.createDrawDoc((XMultiServiceFactory)tParam.getMSF());
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ public TestEnvironment createTestEnvironment( TestParameters tParam,
+ PrintWriter log )
+ throws StatusException {
+
+ XInterface oObj = null;
+ // create testobject here
+
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)tParam.getMSF()) ;
+ XShape oShape = SOF.createShape
+ (xDrawDoc,5000,3500,7500,5000,"Text");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ;
+
+ XText text = (XText) UnoRuntime.queryInterface(XText.class, oShape) ;
+
+ XTextCursor cursor = text.createTextCursor() ;
+
+ text.insertString(cursor, "Paragraph 1", false) ;
+ text.insertControlCharacter(cursor,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+ text.insertString(cursor, "Paragraph 2", false) ;
+ text.insertControlCharacter(cursor,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+ text.insertString(cursor, "Paragraph 3", false) ;
+ text.insertControlCharacter(cursor,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+
+ oObj = cursor ;
+
+ } catch (Exception e) {
+ log.println("Can't create test object") ;
+ e.printStackTrace(log) ;
+ }
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SvxUnoTextCursor
+
diff --git a/qadevOOo/tests/java/mod/_svx/SvxUnoTextField.java b/qadevOOo/tests/java/mod/_svx/SvxUnoTextField.java
new file mode 100644
index 000000000000..30226c575931
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxUnoTextField.java
@@ -0,0 +1,161 @@
+/*************************************************************************
+ *
+ * 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 mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DrawTools;
+import util.SOfficeFactory;
+
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.XText;
+import com.sun.star.text.XTextContent;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+ *
+ * initial description
+ * @see ifc._XComponent
+ * @see ifc._TextContent
+ * @see ifc._XTextContent
+ * @see ifc._XTextField
+ *
+ */
+public class SvxUnoTextField extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = DrawTools.createDrawDoc( (XMultiServiceFactory) tParam.getMSF());
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ XShape oShape = null;
+
+ // creation of testobject here
+ // first we write what we are intend to do to log file
+ log.println( "creating a test environment" );
+ try {
+
+ SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) tParam.getMSF());
+ oShape = SOF.createShape(xDrawDoc,5000,3500,7500,5000,"Rectangle");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape);
+ }
+ catch (Exception e) {
+ log.println("Couldn't create Shape");
+ e.printStackTrace(log);
+ throw new StatusException("Couldn't create Shape ",e);
+ }
+
+ XTextCursor the_Cursor = null;
+
+ // create testobject here
+ try {
+
+ XText the_Text = (XText) UnoRuntime.queryInterface(XText.class,oShape);
+ XMultiServiceFactory oDocMSF = (XMultiServiceFactory)
+ UnoRuntime.queryInterface( XMultiServiceFactory.class, xDrawDoc );
+ the_Cursor = the_Text.createTextCursor();
+ oObj = (XInterface)
+ oDocMSF.createInstance( "com.sun.star.text.TextField.DateTime" );
+ XTextContent the_Field = (XTextContent)
+ UnoRuntime.queryInterface(XTextContent.class,oObj);
+
+
+ the_Text.insertTextContent(the_Cursor,the_Field,false);
+ }
+ catch (Exception ex) {
+ log.println("Couldn't create Textfield");
+ ex.printStackTrace(log);
+ throw new StatusException("Couldn't create TextField ",ex);
+ }
+
+ log.println( "creating a new environment for FieldMaster object" );
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+ tEnv.addObjRelation("RANGE", the_Cursor);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+} // finish class SvxUnoTextField
+
diff --git a/qadevOOo/tests/java/mod/_svx/SvxUnoTextRange.java b/qadevOOo/tests/java/mod/_svx/SvxUnoTextRange.java
new file mode 100644
index 000000000000..ed6c61579b66
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxUnoTextRange.java
@@ -0,0 +1,156 @@
+/*************************************************************************
+ *
+ * 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 mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DrawTools;
+import util.SOfficeFactory;
+
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.ControlCharacter;
+import com.sun.star.text.XSimpleText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class SvxUnoTextRange extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = DrawTools.createDrawDoc((XMultiServiceFactory)tParam.getMSF());
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ // create testobject here
+
+ XEnumerationAccess xEA = null ;
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)tParam.getMSF()) ;
+ XShape oShape = SOF.createShape
+ (xDrawDoc,5000,3500,7500,5000,"Text");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ;
+
+ XSimpleText text = (XSimpleText) UnoRuntime.queryInterface
+ (XSimpleText.class, oShape) ;
+
+ XTextCursor cursor = text.createTextCursor() ;
+
+ text.insertString(cursor, "Paragraph 1", false) ;
+ text.insertControlCharacter(cursor,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+ text.insertString(cursor, "Paragraph 2", false) ;
+ text.insertControlCharacter(cursor,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+ text.insertString(cursor, "Paragraph 3", false) ;
+ text.insertControlCharacter(cursor,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+
+ xEA = (XEnumerationAccess) UnoRuntime.queryInterface
+ (XEnumerationAccess.class, text) ;
+
+ XInterface oTextContent = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),xEA.createEnumeration().nextElement());
+
+ xEA = (XEnumerationAccess) UnoRuntime.queryInterface
+ (XEnumerationAccess.class, oTextContent) ;
+
+ oObj = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),xEA.createEnumeration().nextElement());
+
+ } catch (Exception e) {
+ log.println("Can't create test object") ;
+ e.printStackTrace(log) ;
+ }
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_svx/SvxUnoTextRangeEnumeration.java b/qadevOOo/tests/java/mod/_svx/SvxUnoTextRangeEnumeration.java
new file mode 100644
index 000000000000..d9ef393e966f
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/SvxUnoTextRangeEnumeration.java
@@ -0,0 +1,157 @@
+/*************************************************************************
+ *
+ * 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 mod._svx;
+
+import java.io.PrintWriter;
+
+import lib.StatusException;
+import lib.TestCase;
+import lib.TestEnvironment;
+import lib.TestParameters;
+import util.DrawTools;
+import util.SOfficeFactory;
+
+import com.sun.star.container.XEnumerationAccess;
+import com.sun.star.drawing.XShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.text.ControlCharacter;
+import com.sun.star.text.XSimpleText;
+import com.sun.star.text.XTextCursor;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+public class SvxUnoTextRangeEnumeration extends TestCase {
+
+ static XComponent xDrawDoc;
+
+ /**
+ * in general this method creates a testdocument
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void initialize( TestParameters tParam, PrintWriter log ) {
+ try {
+ log.println( "creating a drawdoc" );
+ xDrawDoc = DrawTools.createDrawDoc((XMultiServiceFactory)tParam.getMSF());
+ } catch ( Exception e ) {
+ // Some exception occures.FAILED
+ e.printStackTrace( log );
+ throw new StatusException( "Couldn't create document", e );
+ }
+ }
+
+ /**
+ * in general this method disposes the testenvironment and document
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ *
+ */
+ protected void cleanup( TestParameters tParam, PrintWriter log ) {
+ log.println( " disposing xDrawDoc " );
+ util.DesktopTools.closeDoc(xDrawDoc);
+ }
+
+
+ /**
+ * creating a Testenvironment for the interfaces to be tested
+ *
+ * @param tParam class which contains additional test parameters
+ * @param log class to log the test state and result
+ *
+ * @return Status class
+ *
+ * @see TestParameters
+ * @see PrintWriter
+ */
+ protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {
+
+ XInterface oObj = null;
+ // create testobject here
+
+ XEnumerationAccess xEA = null ;
+ try {
+ SOfficeFactory SOF = SOfficeFactory.getFactory((XMultiServiceFactory)tParam.getMSF()) ;
+ XShape oShape = SOF.createShape
+ (xDrawDoc,5000,3500,7500,5000,"Text");
+ DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape) ;
+
+ XSimpleText text = (XSimpleText) UnoRuntime.queryInterface
+ (XSimpleText.class, oShape) ;
+
+ XTextCursor cursor = text.createTextCursor() ;
+
+ text.insertString(cursor, "Paragraph 1", false) ;
+ text.insertControlCharacter(cursor,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+ text.insertString(cursor, "Paragraph 2", false) ;
+ text.insertControlCharacter(cursor,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+ text.insertString(cursor, "Paragraph 3", false) ;
+ text.insertControlCharacter(cursor,
+ ControlCharacter.PARAGRAPH_BREAK, false) ;
+
+ xEA = (XEnumerationAccess) UnoRuntime.queryInterface
+ (XEnumerationAccess.class, text) ;
+
+ XInterface oTextContent = (XInterface) AnyConverter.toObject(
+ new Type(XInterface.class),xEA.createEnumeration().nextElement());
+
+ xEA = (XEnumerationAccess) UnoRuntime.queryInterface
+ (XEnumerationAccess.class, oTextContent) ;
+
+ oObj = xEA.createEnumeration();
+
+ } catch (Exception e) {
+ log.println("Can't create test object") ;
+ e.printStackTrace(log) ;
+ }
+
+ // create test environment here
+ TestEnvironment tEnv = new TestEnvironment( oObj );
+
+ tEnv.addObjRelation("ENUM", xEA);
+
+ return tEnv;
+ } // finish method getTestEnvironment
+
+}
+
diff --git a/qadevOOo/tests/java/mod/_svx/package.html b/qadevOOo/tests/java/mod/_svx/package.html
new file mode 100644
index 000000000000..23cadeba3819
--- /dev/null
+++ b/qadevOOo/tests/java/mod/_svx/package.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<BODY>
+<P>Containes all test cases for the module 'svx'.</P>
+</BODY>
+</HTML> \ No newline at end of file