summaryrefslogtreecommitdiff
path: root/qadevOOo/tests/java/ifc/drawing
diff options
context:
space:
mode:
Diffstat (limited to 'qadevOOo/tests/java/ifc/drawing')
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_AreaShapeDescriptor.java115
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_CaptionShape.java35
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_ConnectorProperties.java48
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_ConnectorShape.java78
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_ConnectorShapeDescriptor.java43
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_DimensioningShapeDescriptor.java48
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_DrawingDocument.java45
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_DrawingDocumentDrawView.java177
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_EllipseShape.java46
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_EllipseShapeDescriptor.java36
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_FillProperties.java219
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_GenericDrawPage.java96
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_GenericDrawingDocument.java34
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_GraphicObjectShape.java177
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_GraphicObjectShapeDescriptor.java71
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_Layer.java47
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_LineProperties.java86
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_LineShapeDescriptor.java150
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_MeasureProperties.java60
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_MeasureShape.java46
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_PolyPolygonBezierDescriptor.java47
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_PolyPolygonDescriptor.java47
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_RotationDescriptor.java102
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_ShadowDescriptor.java43
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_ShadowProperties.java48
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_Shape.java158
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_ShapeDescriptor.java147
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_Text.java72
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_TextProperties.java67
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_TextShape.java44
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_TextShapeDescriptor.java36
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XConnectorShape.java147
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XControlShape.java106
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XDrawPageDuplicator.java91
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XDrawPageExpander.java74
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XDrawPageSummarizer.java74
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XDrawPageSupplier.java44
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XDrawPages.java94
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XDrawPagesSupplier.java64
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XDrawView.java113
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XGluePointsSupplier.java64
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XLayerManager.java166
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XLayerSupplier.java70
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XMasterPageTarget.java108
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XMasterPagesSupplier.java63
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XShape.java196
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XShapeBinder.java109
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XShapeCombiner.java110
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XShapeDescriptor.java97
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XShapeGroup.java70
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XShapeGrouper.java110
-rw-r--r--qadevOOo/tests/java/ifc/drawing/_XShapes.java109
52 files changed, 4547 insertions, 0 deletions
diff --git a/qadevOOo/tests/java/ifc/drawing/_AreaShapeDescriptor.java b/qadevOOo/tests/java/ifc/drawing/_AreaShapeDescriptor.java
new file mode 100644
index 000000000000..cfa23536a205
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_AreaShapeDescriptor.java
@@ -0,0 +1,115 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+public class _AreaShapeDescriptor extends MultiPropertyTest {
+
+ protected boolean compare(Object ob1, Object ob2) {
+
+ return super.compare(ob1, ob2);
+
+ }
+
+ protected PropertyTester URLTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue)
+ throws java.lang.IllegalArgumentException {
+ if (oldValue.equals(util.utils.getFullTestURL("space-metal.jpg")))
+ return util.utils.getFullTestURL("crazy-blue.jpg"); else
+ return util.utils.getFullTestURL("space-metal.jpg");
+ }
+ } ;
+
+ protected PropertyTester StringTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue)
+ throws java.lang.IllegalArgumentException {
+ if (oldValue.equals(str1))
+ return str2; else
+ return str1;
+ }
+ } ;
+
+ public void _FillBitmapURL() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("FillBitmapURL", URLTester) ;
+ }
+
+ public String str1 = "";
+ public String str2 = "";
+
+ public void _FillGradientName() {
+ log.println("Testing with custom Property tester") ;
+ str1 = "Gradient 1";
+ str2 = "Gradient 3";
+ testProperty("FillGradientName", StringTester) ;
+ }
+
+ public void _FillBitmapName() {
+ log.println("Testing with custom Property tester") ;
+ str1 = "Sky";
+ str2 = "Blank";
+ testProperty("FillBitmapName", StringTester) ;
+ }
+
+ public void _FillTransparenceGradientName() {
+ log.println("Testing with custom Property tester") ;
+ str1 = "Standard 1";
+ str2 = "Standard 2";
+ testProperty("FillTransparenceGradientName", StringTester) ;
+ }
+
+ public void _FillHatchName() {
+ log.println("Testing with custom Property tester") ;
+ str1 = "Black 0 degrees";
+ str2 = "Black 45 degrees";
+ testProperty("FillHatchName", StringTester) ;
+ }
+
+ public void _FillBitmapMode() {
+ log.println("Testing with custom Property tester") ;
+ try {
+ Object getting = oObj.getPropertyValue("FillBitmapMode");
+ if (! (getting instanceof com.sun.star.drawing.BitmapMode)) {
+ log.println("getting the property 'FillBitmapMode'");
+ log.println("return "+ oObj.getClass().getName());
+ log.println("Expected was 'com.sun.star.drawing.BitmapMode'");
+ tRes.tested("FillBitmapMode",false);
+ } else testProperty("FillBitmapMode");
+ }
+ catch (Exception ex) {
+ log.println("Exception while checking 'FillBitmapMode'");
+ ex.printStackTrace(log);
+ tRes.tested("FillBitmapMode",false);
+ }
+
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_CaptionShape.java b/qadevOOo/tests/java/ifc/drawing/_CaptionShape.java
new file mode 100644
index 000000000000..a4c7441d63e0
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_CaptionShape.java
@@ -0,0 +1,35 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+public class _CaptionShape extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_ConnectorProperties.java b/qadevOOo/tests/java/ifc/drawing/_ConnectorProperties.java
new file mode 100644
index 000000000000..68438641a353
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_ConnectorProperties.java
@@ -0,0 +1,48 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.drawing.ConnectorProperties</code>
+* service properties :
+* <ul>
+* <li><code> EdgeKind</code></li>
+* <li><code> EdgeNode1HorzDist</code></li>
+* <li><code> EdgeNode1VertDist</code></li>
+* <li><code> EdgeNode2HorzDist</code></li>
+* <li><code> EdgeNode2VertDist</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.ConnectorProperties
+*/
+public class _ConnectorProperties extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_ConnectorShape.java b/qadevOOo/tests/java/ifc/drawing/_ConnectorShape.java
new file mode 100644
index 000000000000..6b9a27841ae5
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_ConnectorShape.java
@@ -0,0 +1,78 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+import com.sun.star.drawing.XShape;
+/**
+* Testing <code>com.sun.star.drawing.ConnectorShape</code>
+* service properties :
+* <ul>
+* <li><code> EdgeLine1Delta</code></li>
+* <li><code> EdgeLine2Delta</code></li>
+* <li><code> EdgeLine3Delta</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.ConnectorShape
+*/
+public class _ConnectorShape extends MultiPropertyTest {
+ public XShape[] conShapes = null;
+
+ protected void before() {
+ conShapes = (XShape[]) tEnv.getObjRelation("XConnectorShape.Shapes");
+ }
+
+ public void _EndShape() {
+ Object oldProp = null;
+ try {
+ oldProp = oObj.getPropertyValue("EndShape");
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace();
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace();
+ }
+ testProperty("EndShape",oldProp,conShapes[0]);
+ }
+
+ public void _StartShape() {
+ Object oldProp = null;
+ log.println("Special for StartShape");
+ try {
+ oldProp = oObj.getPropertyValue("StartShape");
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace();
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace();
+ }
+ testProperty("StartShape",oldProp,conShapes[1]);
+ }
+
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_ConnectorShapeDescriptor.java b/qadevOOo/tests/java/ifc/drawing/_ConnectorShapeDescriptor.java
new file mode 100644
index 000000000000..509ca7b15a87
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_ConnectorShapeDescriptor.java
@@ -0,0 +1,43 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+public class _ConnectorShapeDescriptor extends MultiPropertyTest {
+
+ protected boolean compare(Object ob1, Object ob2) {
+
+ return super.compare(ob1, ob2);
+
+ }
+
+} // finish class _ConnectorShapeDescriptor
+
+
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_DimensioningShapeDescriptor.java b/qadevOOo/tests/java/ifc/drawing/_DimensioningShapeDescriptor.java
new file mode 100644
index 000000000000..29b7be1de0cf
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_DimensioningShapeDescriptor.java
@@ -0,0 +1,48 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+
+public class _DimensioningShapeDescriptor extends MultiPropertyTest {
+
+/*
+ protected PropertyTester lengthTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue)
+ throws java.lang.IllegalArgumentException {
+
+ int val = ((Integer)oldValue).intValue() ;
+ return new Integer(val + 100) ;
+ }
+ } ;
+*/
+
+} // finish class _ParagraphProperties
+
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_DrawingDocument.java b/qadevOOo/tests/java/ifc/drawing/_DrawingDocument.java
new file mode 100644
index 000000000000..c74760addd35
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_DrawingDocument.java
@@ -0,0 +1,45 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.drawing.DrawingDocument</code>
+* service properties :
+* <ul>
+* <li><code> TabStop</code></li>
+* <li><code> CharLocale</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.DrawingDocument
+*/
+public class _DrawingDocument extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_DrawingDocumentDrawView.java b/qadevOOo/tests/java/ifc/drawing/_DrawingDocumentDrawView.java
new file mode 100644
index 000000000000..23e54d39d2e8
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_DrawingDocumentDrawView.java
@@ -0,0 +1,177 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+import com.sun.star.container.XNamed;
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.uno.UnoRuntime;
+import util.ValueChanger;
+
+/**
+* Testing <code>com.sun.star.drawing.DrawingDocumentDrawView</code>
+* service properties :
+* <ul>
+* <li><code> IsMasterPageMode</code></li>
+* <li><code> IsLayerMode</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'DrawPage'</code> (of type <code>XDrawPage</code>):
+* a draw page which will be current page. </li>
+* <ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.DrawingDocumentDrawView
+*/
+public class _DrawingDocumentDrawView extends MultiPropertyTest {
+
+ XDrawPage drawPage = null;
+ static String test_name = "For DrawingDocumentDrawView";
+
+ protected void before() {
+ drawPage = (XDrawPage)tEnv.getObjRelation("DrawPage");
+ XNamed xNamed = (XNamed)
+ UnoRuntime.queryInterface(XNamed.class, drawPage);
+ xNamed.setName(test_name);
+ }
+
+ /**
+ * Property tester which returns new <code>XDrawPage</code> object
+ * and compares draw pages.
+ */
+ protected PropertyTester CurPageTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ return drawPage;
+ }
+
+ protected boolean compare(Object obj1, Object obj2) {
+ XNamed named1 = (XNamed)UnoRuntime.queryInterface(XNamed.class, obj1);
+ XNamed named2 = (XNamed)UnoRuntime.queryInterface(XNamed.class, obj2);
+ boolean res = false;
+
+ if (named1 != null && named2 != null) {
+ String name1 = named1.getName();
+ String name2 = named2.getName();
+ res = name1.equals(name2);
+ } else {
+ log.println("Interface XNamed not supported");
+ }
+
+ return res;
+ }
+
+ protected String toString(Object obj) {
+ XNamed named = (XNamed)UnoRuntime.queryInterface(XNamed.class, obj);
+ String res = (named == null) ? "null" : named.getName();
+ return res;
+ }
+ } ;
+
+ public void _CurrentPage() {
+ log.println("Testing with custom Property tester");
+ Object oldCurPage = null;
+ try {
+ oldCurPage = oObj.getPropertyValue("CurrentPage");
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ }
+
+ testProperty("CurrentPage", CurPageTester);
+
+ try {
+ log.println("Back old current page");
+ oObj.setPropertyValue("CurrentPage", oldCurPage);
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+ }
+ }
+
+ public void _IsMasterPageMode() {
+ testProperty("IsMasterPageMode");
+ try {
+ oObj.setPropertyValue("IsMasterPageMode", new Boolean(false));
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+ }
+ }
+
+ public void _IsLayerMode() {
+ testProperty("IsLayerMode");
+ try {
+ oObj.setPropertyValue("IsLayerMode", new Boolean(false));
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+ }
+ }
+
+ public void _ZoomType() {
+ Object oldValue=null;
+ Object newValue=null;
+ try {
+ oldValue = oObj.getPropertyValue("ZoomValue");
+ Object oldZoom = oObj.getPropertyValue("ZoomType");
+ Object newZoom = ValueChanger.changePValue(oldZoom);
+ oObj.setPropertyValue("ZoomType", newZoom);
+ newValue = oObj.getPropertyValue("ZoomValue");
+ } catch(com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ } catch(com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ } catch(com.sun.star.lang.IllegalArgumentException e) {
+ e.printStackTrace(log);
+ } catch(com.sun.star.beans.PropertyVetoException e) {
+ e.printStackTrace(log);
+ }
+ log.println("oldZoomValue: "+oldValue);
+ log.println("newZoomValue: "+newValue);
+ tRes.tested("ZoomType",(!oldValue.equals(newValue)));
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_EllipseShape.java b/qadevOOo/tests/java/ifc/drawing/_EllipseShape.java
new file mode 100644
index 000000000000..5f312f823a97
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_EllipseShape.java
@@ -0,0 +1,46 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.drawing.EllipseShape</code>
+* service properties :
+* <ul>
+* <li><code> CircleKind</code></li>
+* <li><code> CircleStartAngle</code></li>
+* <li><code> CircleEndAngle</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.EllipseShape
+*/
+public class _EllipseShape extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_EllipseShapeDescriptor.java b/qadevOOo/tests/java/ifc/drawing/_EllipseShapeDescriptor.java
new file mode 100644
index 000000000000..c043369b5f29
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_EllipseShapeDescriptor.java
@@ -0,0 +1,36 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+
+public class _EllipseShapeDescriptor extends MultiPropertyTest {
+
+} // finish class _EllipseShapeDescriptor
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_FillProperties.java b/qadevOOo/tests/java/ifc/drawing/_FillProperties.java
new file mode 100644
index 000000000000..ba1dc4925664
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_FillProperties.java
@@ -0,0 +1,219 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import com.sun.star.beans.XPropertySetInfo;
+import lib.MultiPropertyTest;
+
+import com.sun.star.awt.XBitmap;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+
+/**
+ * Testing <code>com.sun.star.drawing.FillProperties</code>
+ * service properties :
+ * <ul>
+ * <li><code> FillStyle</code></li>
+ * <li><code> FillColor</code></li>
+ * <li><code> FillTransparence</code></li>
+ * <li><code> FillTransparenceGradientName</code></li>
+ * <li><code> FillTransparenceGradient</code></li>
+ * <li><code> FillGradientName</code></li>
+ * <li><code> FillGradient</code></li>
+ * <li><code> FillHatchName</code></li>
+ * <li><code> FillHatch</code></li>
+ * <li><code> FillBitmapName</code></li>
+ * <li><code> FillBitmap</code></li>
+ * <li><code> FillBitmapURL</code></li>
+ * <li><code> FillBitmapOffsetX</code></li>
+ * <li><code> FillBitmapOffsetY</code></li>
+ * <li><code> FillBitmapPositionOffsetX</code></li>
+ * <li><code> FillBitmapPositionOffsetY</code></li>
+ * <li><code> FillBitmapRectanglePoint</code></li>
+ * <li><code> FillBitmapLogicalSize</code></li>
+ * <li><code> FillBitmapSizeX</code></li>
+ * <li><code> FillBitmapSizeY</code></li>
+ * <li><code> FillBitmapMode</code></li>
+ * <li><code> FillBackground</code></li>
+ * </ul> <p>
+ * Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+ * @see com.sun.star.drawing.FillProperties
+ */
+public class _FillProperties extends MultiPropertyTest {
+
+ XBitmap the_bitmap = null;
+ XBitmap the_secondBitmap = null;
+ /**
+ * Property tester which changes URL.
+ */
+ protected PropertyTester URLTester = new PropertyTester() {
+
+ protected Object getNewValue(String propName, Object oldValue)
+ throws java.lang.IllegalArgumentException {
+ if (oldValue.equals(util.utils.getFullTestURL("space-metal.jpg"))) {
+ return util.utils.getFullTestURL("crazy-blue.jpg");
+ } else {
+ return util.utils.getFullTestURL("space-metal.jpg");
+ }
+ }
+ };
+ /**
+ * Property tester which switches two strings.
+ */
+ protected PropertyTester StringTester = new PropertyTester() {
+
+ protected Object getNewValue(String propName, Object oldValue)
+ throws java.lang.IllegalArgumentException {
+ if (oldValue.equals(str1)) {
+ return str2;
+ } else {
+ return str1;
+ }
+ }
+ };
+ /**
+ * Property tester which switches two XBitmap objects.
+ */
+ protected PropertyTester BitmapTester = new PropertyTester() {
+
+ protected Object getNewValue(String propName, Object oldValue)
+ throws java.lang.IllegalArgumentException {
+ if (util.ValueComparer.equalValue(oldValue, the_bitmap)) {
+ return the_secondBitmap;
+ } else {
+ return the_bitmap;
+ }
+ }
+ };
+
+ /**
+ * This property must have an URL format
+ */
+ public void _FillBitmapURL() {
+ log.println("Testing with custom Property tester");
+ testProperty("FillBitmapURL", URLTester);
+ }
+ public String str1 = "";
+ public String str2 = "";
+
+ /**
+ * This property must have predefined values
+ */
+ public void _FillGradientName() {
+ log.println("Testing with custom Property tester");
+ str1 = "Gradient 1";
+ str2 = "Gradient 3";
+ testProperty("FillGradientName", StringTester);
+ }
+
+ /**
+ * This property must have predefined values
+ */
+ public void _FillBitmapName() {
+ log.println("Testing with custom Property tester");
+ str1 = "Sky";
+ str2 = "Blank";
+ testProperty("FillBitmapName", StringTester);
+ }
+
+ /**
+ * This property must have predefined values
+ */
+ public void _FillTransparenceGradientName() {
+ log.println("Testing with custom Property tester");
+ str1 = "Transparency 2";
+ str2 = "Transparency 1";
+ testProperty("FillTransparenceGradientName", StringTester);
+ }
+
+ /**
+ * This property must have predefined values
+ */
+ public void _FillHatchName() {
+ log.println("Testing with custom Property tester");
+ str1 = "Black 0 degrees";
+ str2 = "Black 45 degrees";
+ testProperty("FillHatchName", StringTester);
+ }
+
+ /**
+ * This property is very interesting. After setting URL of bitmap you get
+ * <code>XBitmap</code> interface of the image file specified.
+ * The method first gets two different bitmaps and then tests the property.
+ */
+ public void _FillBitmap() {
+
+ String propName = "FillBitmap";
+
+ XPropertySetInfo info = oObj.getPropertySetInfo();
+
+ if (!info.hasPropertyByName(propName)) {
+ if (isOptional(propName)) {
+ // skipping optional property test
+ log.println("Property '" + propName + "' is optional and not supported");
+ tRes.tested(propName, true);
+ return;
+ }
+ } else {
+
+ try {
+
+ oObj.setPropertyValue("FillBitmapURL", util.utils.getFullTestURL("crazy-blue.jpg"));
+
+ the_bitmap = (XBitmap) AnyConverter.toObject(
+ new Type(XBitmap.class), oObj.getPropertyValue("FillBitmap"));
+
+ oObj.setPropertyValue("FillBitmapURL", util.utils.getFullTestURL("space-metal.jpg"));
+
+ the_secondBitmap = (XBitmap) AnyConverter.toObject(
+ new Type(XBitmap.class), oObj.getPropertyValue("FillBitmap"));
+
+ testProperty("FillBitmap", BitmapTester);
+
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println("Couldn't change Bitmap");
+ e.printStackTrace(log);
+ tRes.tested("FillBitmap", false);
+
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Couldn't change Bitmap");
+ e.printStackTrace(log);
+ tRes.tested("FillBitmap", false);
+
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Couldn't change Bitmap");
+ e.printStackTrace(log);
+ tRes.tested("FillBitmap", false);
+
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Couldn't change Bitmap");
+ e.printStackTrace(log);
+ tRes.tested("FillBitmap", false);
+ }
+ }
+ }
+ }
diff --git a/qadevOOo/tests/java/ifc/drawing/_GenericDrawPage.java b/qadevOOo/tests/java/ifc/drawing/_GenericDrawPage.java
new file mode 100644
index 000000000000..836abbe75f85
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_GenericDrawPage.java
@@ -0,0 +1,96 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+
+/**
+* Testing <code>com.sun.star.drawing.GenericDrawPage</code>
+* service properties :
+* <ul>
+* <li><code> BorderBottom</code></li>
+* <li><code> BorderLeft</code></li>
+* <li><code> BorderRight</code></li>
+* <li><code> BorderTop</code></li>
+* <li><code> Height</code></li>
+* <li><code> Width</code></li>
+* <li><code> Number</code></li>
+* <li><code> Orientation</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.GenericDrawPage
+*/
+public class _GenericDrawPage extends MultiPropertyTest {
+
+ public void _Number() {
+ log.println("Number started");
+ boolean res = false;
+ log.println("trying to get the value");
+ try {
+ Short wat = (Short) oObj.getPropertyValue("Number");
+ if (wat == null) {
+ log.println("it is null");
+ } else {
+ log.println("it isn't null");
+ res=true;
+ }
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("an UnknownPropertyException occured");
+
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("an WrappedTargetException occured");
+ }
+
+ tRes.tested("Number",res);
+ }
+
+ public void _UserDefinedAttributes() {
+ log.println("Userdefined started");
+ boolean res = false;
+ log.println("trying to get the value");
+ try {
+ Object wat = oObj.getPropertyValue("UserDefinedAttributes");
+ if (wat == null) {
+ log.println("it is null");
+ } else {
+ log.println("it isn't null");
+ res=true;
+ }
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("an UnknownPropertyException occured");
+
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("an WrappedTargetException occured");
+ }
+
+ tRes.tested("UserDefinedAttributes",res);
+ }
+
+} // end of GenericDrawPage
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_GenericDrawingDocument.java b/qadevOOo/tests/java/ifc/drawing/_GenericDrawingDocument.java
new file mode 100644
index 000000000000..53afa0cd3cb0
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_GenericDrawingDocument.java
@@ -0,0 +1,34 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+public class _GenericDrawingDocument extends MultiPropertyTest {
+
+}
diff --git a/qadevOOo/tests/java/ifc/drawing/_GraphicObjectShape.java b/qadevOOo/tests/java/ifc/drawing/_GraphicObjectShape.java
new file mode 100644
index 000000000000..4e2483dc8630
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_GraphicObjectShape.java
@@ -0,0 +1,177 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+import com.sun.star.awt.XBitmap;
+import com.sun.star.container.XIndexContainer;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.UnoRuntime;
+
+/**
+* Testing <code>com.sun.star.drawing.GraphicObjectShape</code>
+* service properties :
+* <ul>
+* <li><code> GraphicURL</code></li>
+* <li><code> GraphicStreamURL</code></li>
+* <li><code> GraphicObjectFillBitmap</code></li>
+* <li><code> AdjustLuminance</code></li>
+* <li><code> AdjustContrast</code></li>
+* <li><code> AdjustRed</code></li>
+* <li><code> AdjustGreen</code></li>
+* <li><code> AdjustBlue</code></li>
+* <li><code> Gamma</code></li>
+* <li><code> Transparency</code></li>
+* <li><code> GraphicColorMode</code></li>
+* <li><code> ImageMap</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'Bitmap1', 'Bitmap2'</code> (of type <code>XBitmap</code>):
+* values to be set for property GraphicObjectFillBitmap </li>
+* <li> <code>'IMAP'</code>
+* (<code>com.sun.star.image.ImageMapRectangleObject</code> service instance):
+* is used to be added to ImageMap container.</li>
+* <ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.GraphicObjectShape
+*/
+public class _GraphicObjectShape extends MultiPropertyTest {
+
+ /**
+ * Property tester which changes URL.
+ */
+ protected PropertyTester URLTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ if (oldValue.equals(util.utils.getFullTestURL("space-metal.jpg")))
+ return util.utils.getFullTestURL("crazy-blue.jpg"); else
+ return util.utils.getFullTestURL("space-metal.jpg");
+ }
+ } ;
+
+ /**
+ * Property tester which switches two XBitmap objects.
+ * It also uses two object relations with bitmaps.
+ */
+ protected PropertyTester BitmapTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue){
+ XBitmap aBitmap1=(XBitmap) tEnv.getObjRelation("Bitmap1");
+ XBitmap aBitmap2=(XBitmap) tEnv.getObjRelation("Bitmap2");
+ if (oldValue.equals(aBitmap1)) return aBitmap2;
+ else return aBitmap1;
+ }
+ } ;
+
+ public Any set = null;
+
+ /**
+ * Property tester which returns new <code>XIndexAccess</code> object.
+ */
+ protected PropertyTester ImapTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ return set;
+ }
+ } ;
+
+
+ /**
+ * This property must have URL format
+ */
+ public void _GraphicURL() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("GraphicURL", URLTester) ;
+ }
+
+ public void _GraphicStreamURL() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("GraphicStreamURL", URLTester) ;
+ }
+
+ public void _GraphicObjectFillBitmap() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("GraphicObjectFillBitmap", BitmapTester) ;
+ }
+
+ /**
+ * The test first retrieves ImageMap relation, then inserts it
+ * to the current container.
+ */
+ public void _ImageMap() {
+ if (! util.utils.hasPropertyByName(oObj,"ImageMap")) {
+ log.println("optional property 'ImageMap' isn't available");
+ tRes.tested("ImageMap",true);
+ return;
+ }
+ try {
+ boolean result = true;
+ Object imapObject = tEnv.getObjRelation("ImapObject");
+
+ if ( imapObject == null){
+ System.out.println("ERROR: object relation 'ImapObject' isn't available");
+ tRes.tested("ImageMap", false);
+ return;
+ }
+
+ Object o = oObj.getPropertyValue("ImageMap");
+ XIndexContainer xIndexContainer = (XIndexContainer)UnoRuntime.queryInterface(XIndexContainer.class, o);
+ util.dbg.printInterfaces(xIndexContainer);
+ int elementCountFirst = xIndexContainer.getCount();
+ xIndexContainer.insertByIndex(elementCountFirst, imapObject);
+
+ // this does not really change the property: the implementation
+ // behind "ImageMap" stays the same, but for a real change a C++
+ // implementation is needed. See css.lang.XUnoTunnel
+ oObj.setPropertyValue("ImageMap", xIndexContainer);
+ Object newObject = oObj.getPropertyValue("ImageMap");
+ xIndexContainer = (XIndexContainer)UnoRuntime.queryInterface(XIndexContainer.class, newObject);
+
+ int elementCountSecond = xIndexContainer.getCount();
+ result = (elementCountFirst + 1 == elementCountSecond);
+
+ tRes.tested("ImageMap", result);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ log.println("Exception while checking 'ImageMap'");
+ e.printStackTrace(log);
+ tRes.tested("ImageMap",false);
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception while checking 'ImageMap'");
+ e.printStackTrace(log);
+ tRes.tested("ImageMap",false);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception while checking 'ImageMap'");
+ e.printStackTrace(log);
+ tRes.tested("ImageMap",false);
+ }
+ catch(Exception e) {
+ e.printStackTrace(log);
+ }
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_GraphicObjectShapeDescriptor.java b/qadevOOo/tests/java/ifc/drawing/_GraphicObjectShapeDescriptor.java
new file mode 100644
index 000000000000..21a113fd58f8
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_GraphicObjectShapeDescriptor.java
@@ -0,0 +1,71 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+import com.sun.star.awt.XBitmap;
+
+public class _GraphicObjectShapeDescriptor extends MultiPropertyTest {
+
+ protected boolean compare(Object ob1, Object ob2) {
+
+ return super.compare(ob1, ob2);
+
+ }
+
+ protected PropertyTester URLTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue)
+ throws java.lang.IllegalArgumentException {
+ if (oldValue.equals(util.utils.getFullTestURL("space-metal.jpg")))
+ return util.utils.getFullTestURL("crazy-blue.jpg"); else
+ return util.utils.getFullTestURL("space-metal.jpg");
+ }
+ } ;
+
+ protected PropertyTester BitmapTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue)
+ throws java.lang.IllegalArgumentException {
+ XBitmap aBitmap1=(XBitmap) tEnv.getObjRelation("Bitmap1");
+ XBitmap aBitmap2=(XBitmap) tEnv.getObjRelation("Bitmap2");
+ if (oldValue.equals(aBitmap1)) return aBitmap2; else return aBitmap1;
+ }
+ } ;
+
+ public void _GraphicURL() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("GraphicURL", URLTester) ;
+ }
+
+ public void _GraphicObjectFillBitmap() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("GraphicObjectFillBitmap", BitmapTester) ;
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_Layer.java b/qadevOOo/tests/java/ifc/drawing/_Layer.java
new file mode 100644
index 000000000000..62ab7ebbdd08
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_Layer.java
@@ -0,0 +1,47 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.drawing.Layer</code>
+* service properties :
+* <ul>
+* <li><code> Name</code></li>
+* <li><code> IsVisible</code></li>
+* <li><code> IsPrintable</code></li>
+* <li><code> IsLocked</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.Layer
+*/
+public class _Layer extends MultiPropertyTest {
+
+}// end of _Layer.java
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_LineProperties.java b/qadevOOo/tests/java/ifc/drawing/_LineProperties.java
new file mode 100644
index 000000000000..b6fb1f2186a1
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_LineProperties.java
@@ -0,0 +1,86 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.drawing.LineDash;
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.drawing.LineProperties</code>
+* service properties :
+* <ul>
+* <li><code> LineStyle</code></li>
+* <li><code> LineDash</code></li>
+* <li><code> LineColor</code></li>
+* <li><code> LineTransparence</code></li>
+* <li><code> LineWidth</code></li>
+* <li><code> LineJoint</code></li>
+* <li><code> LineStartName</code></li>
+* <li><code> LineStart</code></li>
+* <li><code> LineEnd</code></li>
+* <li><code> LineStartCenter</code></li>
+* <li><code> LineStartWidth</code></li>
+* <li><code> LineEndCenter</code></li>
+* <li><code> LineEndWidth</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.LineProperties
+*/
+public class _LineProperties extends MultiPropertyTest {
+
+ /**
+ * Tester used for property LineStartName which can have
+ * only predefined String values.
+ */
+ protected PropertyTester LineTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue)
+ throws java.lang.IllegalArgumentException {
+ if (oldValue.equals("Arrow"))
+ return "Square"; else
+ return "Arrow";
+ }
+ } ;
+
+ /**
+ * The property switched between 'Square' and 'Arrow' values.
+ */
+ public void _LineStartName() {
+ log.println("Testing with custom Property tester");
+ testProperty("LineStartName", LineTester) ;
+ }
+
+ public void _LineDash() {
+ LineDash aLineDash = new LineDash();
+ LineDash aLineDash2 = new LineDash();
+ aLineDash.DashLen = 5;
+ aLineDash2.DashLen = 1;
+ testProperty("LineDash",aLineDash,aLineDash2);
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_LineShapeDescriptor.java b/qadevOOo/tests/java/ifc/drawing/_LineShapeDescriptor.java
new file mode 100644
index 000000000000..1b3ae8920357
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_LineShapeDescriptor.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 ifc.drawing;
+
+import lib.MultiMethodTest;
+import util.ValueChanger;
+
+import com.sun.star.awt.Point;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.lang.XServiceInfo;
+import com.sun.star.uno.UnoRuntime;
+
+
+public class _LineShapeDescriptor extends MultiMethodTest {
+
+ public XPropertySet oObj = null; // oObj filled by MultiMethodTest
+
+
+ public void _LineColor() {
+ XServiceInfo xInfo = (XServiceInfo)
+ UnoRuntime.queryInterface(XServiceInfo.class, oObj);
+ if ( ! xInfo.supportsService
+ ("com.sun.star.drawing.LineShapeDescriptor")) {
+ log.println("Service not available !!!!!!!!!!!!!");
+ tRes.tested("Supported", false);
+ }
+ changeProp("LineColor");
+ }
+
+ public void _LineDash() {
+ changeProp("LineDash");
+ }
+ public void _LineEnd() {
+ changeProp("LineEnd");
+ }
+ public void _LineEndCenter() {
+ changeProp("LineEndCenter");
+ }
+ public void _LineEndWidth() {
+ changeProp("LineEndWidth");
+ }
+ public void _LineJoint() {
+ changeProp("LineJoint");
+ }
+ public void _LineStart() {
+ changeProp("LineStart");
+ }
+ public void _LineStartCenter() {
+ changeProp("LineStartCenter");
+ }
+ public void _LineStartWidth() {
+ changeProp("LineStartWidth");
+ }
+ public void _LineStyle() {
+ changeProp("LineStyle");
+ }
+ public void _LineTransparence() {
+ changeProp("LineTransparence");
+ }
+ public void _LineWidth() {
+ changeProp("LineWidth");
+ }
+
+ public void changeProp(String name) {
+
+ Object gValue = null;
+ Object sValue = null;
+ Object ValueToSet = null;
+
+ try {
+ //waitForAllThreads();
+ gValue = oObj.getPropertyValue(name);
+ //waitForAllThreads();
+ if ( (name.equals("LineEnd")) || (name.equals("LineStart")) ) {
+ if (gValue == null) gValue = newPoints(null);
+ ValueToSet = newPoints( (Point[]) gValue);
+ }
+ else {
+ ValueToSet = ValueChanger.changePValue(gValue);
+ }
+ //waitForAllThreads();
+ oObj.setPropertyValue(name,ValueToSet);
+ sValue = oObj.getPropertyValue(name);
+
+
+ //check get-set methods
+ if (gValue.equals(sValue)) {
+ log.println("Value for '"+name+"' hasn't changed");
+ tRes.tested(name, false);
+ }
+ else {
+ log.println("Property '"+name+"' OK");
+ tRes.tested(name, true);
+ }
+ } catch (Exception e) {
+ log.println("Exception occured while testing property '" +
+ name + "'");
+ e.printStackTrace(log);
+ tRes.tested(name, false);
+ }
+
+
+ } // end of ChangeProp
+
+ public Point[] newPoints(Point[] old) {
+
+ Point [] newP = new Point[3];
+
+ if (old == null) {
+ newP[0] = new Point(0, 2);
+ newP[1] = new Point(2, 0);
+ newP[2] = new Point(0, -2);
+ }
+ else {
+ newP = old;
+ newP[0].X += 1;
+ newP[1].X += 1;
+ newP[2].X += 1;
+ }
+ return newP;
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_MeasureProperties.java b/qadevOOo/tests/java/ifc/drawing/_MeasureProperties.java
new file mode 100644
index 000000000000..6715d6c08e92
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_MeasureProperties.java
@@ -0,0 +1,60 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.drawing.MeasureProperties</code>
+* service properties :
+* <ul>
+* <li><code> MeasureBelowReferenceEdge</code></li>
+* <li><code> MeasureHelpLine1Length</code></li>
+* <li><code> MeasureHelpLine2Length</code></li>
+* <li><code> MeasureHelpLineDistance</code></li>
+* <li><code> MeasureHelpLineOverhang</code></li>
+* <li><code> MeasureKind</code></li>
+* <li><code> MeasureLineDistance</code></li>
+* <li><code> MeasureOverhang</code></li>
+* <li><code> MeasureShowUnit</code></li>
+* <li><code> MeasureTextAutoAngle</code></li>
+* <li><code> MeasureTextAutoAngleView</code></li>
+* <li><code> MeasureTextFixedAngle</code></li>
+* <li><code> MeasureTextHorizontalPosition</code></li>
+* <li><code> MeasureTextVerticalPosition</code></li>
+* <li><code> MeasureTextIsFixedAngle</code></li>
+* <li><code> MeasureTextRotate90</code></li>
+* <li><code> MeasureTextUpsideDown</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.MeasureProperties
+*/
+public class _MeasureProperties extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_MeasureShape.java b/qadevOOo/tests/java/ifc/drawing/_MeasureShape.java
new file mode 100644
index 000000000000..65b0d32134be
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_MeasureShape.java
@@ -0,0 +1,46 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.drawing.MeasureShape</code>
+* service properties :
+* <ul>
+* <li><code> StartPosition</code></li>
+* <li><code> EndPosition</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.MeasureShape
+*/
+public class _MeasureShape extends MultiPropertyTest {
+
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_PolyPolygonBezierDescriptor.java b/qadevOOo/tests/java/ifc/drawing/_PolyPolygonBezierDescriptor.java
new file mode 100644
index 000000000000..674444a361c7
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_PolyPolygonBezierDescriptor.java
@@ -0,0 +1,47 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.drawing.PolyPolygonBezierDescriptor</code>
+* service properties :
+* <ul>
+* <li><code> PolygonKind</code></li>
+* <li><code> PolyPolygonBezier</code></li>
+* <li><code> Geometry</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.PolyPolygonBezierDescriptor
+*/
+public class _PolyPolygonBezierDescriptor extends MultiPropertyTest {
+
+} // finish class _PolyPolygonBezierDescriptor
+
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_PolyPolygonDescriptor.java b/qadevOOo/tests/java/ifc/drawing/_PolyPolygonDescriptor.java
new file mode 100644
index 000000000000..9b9c1ccbead3
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_PolyPolygonDescriptor.java
@@ -0,0 +1,47 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.drawing.PolyPolygonDescriptor</code>
+* service properties :
+* <ul>
+* <li><code> PolygonKind</code></li>
+* <li><code> PolyPolygon</code></li>
+* <li><code> Geometry</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.PolyPolygonDescriptor
+*/
+public class _PolyPolygonDescriptor extends MultiPropertyTest {
+
+} // finish class _PolyPolygonDescriptor
+
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_RotationDescriptor.java b/qadevOOo/tests/java/ifc/drawing/_RotationDescriptor.java
new file mode 100644
index 000000000000..2a09eeb4dac5
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_RotationDescriptor.java
@@ -0,0 +1,102 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiPropertyTest;
+import lib.Status;
+
+/**
+* Testing <code>com.sun.star.drawing.RotationDescriptor</code>
+* service properties :
+* <ul>
+* <li><code> RotateAngle</code></li>
+* <li><code> ShearAngle</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.RotationDescriptor
+*/
+public class _RotationDescriptor extends MultiPropertyTest {
+
+ /**
+ * Custom tester which increases value by 200
+ */
+ protected PropertyTester drawMeasureTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue) {
+ int val = ((Integer)oldValue).intValue() ;
+ return new Integer(val + 200) ;
+ }
+ } ;
+
+ /**
+ * !!! DEPRECATED !!!
+ */
+ public void _RotationPointX() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("RotationPointX", drawMeasureTester) ;
+ }
+
+ /**
+ * !!! DEPRECATED !!!
+ */
+ public void _RotationPointY() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("RotationPointY", drawMeasureTester) ;
+ }
+
+ /**
+ * Tests the property with custom tester
+ */
+ public void _ShearAngle() {
+
+ Object noShear = tEnv.getObjRelation("NoShear");
+
+ if (noShear != null) {
+ log.println("This shape type doesn't support shear, see #85556#");
+ tRes.tested("ShearAngle",Status.skipped(true));
+ return;
+ }
+
+ try {
+ oObj.setPropertyValue("RotateAngle",new Short((short) 0));
+ } catch (Exception e) {
+ }
+ log.println("Testing with custom Property tester") ;
+ testProperty("ShearAngle", drawMeasureTester) ;
+ }
+
+ /**
+ * Tests the property with custom tester
+ */
+ public void _RotateAngle() {
+ log.println("Testing with custom Property tester") ;
+ testProperty("RotateAngle", drawMeasureTester) ;
+ }
+
+} // finish class _RotationDescriptor
+
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_ShadowDescriptor.java b/qadevOOo/tests/java/ifc/drawing/_ShadowDescriptor.java
new file mode 100644
index 000000000000..00ff64c2a49d
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_ShadowDescriptor.java
@@ -0,0 +1,43 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+public class _ShadowDescriptor extends MultiPropertyTest {
+
+ protected boolean compare(Object ob1, Object ob2) {
+
+ return super.compare(ob1, ob2);
+
+ }
+
+} // finish class _ShadowDescriptor
+
+
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_ShadowProperties.java b/qadevOOo/tests/java/ifc/drawing/_ShadowProperties.java
new file mode 100644
index 000000000000..8ea905755992
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_ShadowProperties.java
@@ -0,0 +1,48 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.drawing.ShadowProperties</code>
+* service properties :
+* <ul>
+* <li><code> Shadow</code></li>
+* <li><code> ShadowColor</code></li>
+* <li><code> ShadowTransparence</code></li>
+* <li><code> ShadowXDistance</code></li>
+* <li><code> ShadowYDistance</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.ShadowProperties
+*/
+public class _ShadowProperties extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_Shape.java b/qadevOOo/tests/java/ifc/drawing/_Shape.java
new file mode 100644
index 000000000000..5a64f7012b88
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_Shape.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 ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+import com.sun.star.style.XStyle;
+
+/**
+* Testing <code>com.sun.star.drawing.Shape</code>
+* service properties :
+* <ul>
+* <li><code> ZOrder</code></li>
+* <li><code> LayerID</code></li>
+* <li><code> LayerName</code></li>
+* <li><code> Printable</code></li>
+* <li><code> MoveProtect</code></li>
+* <li><code> Name</code></li>
+* <li><code> SizeProtect</code></li>
+* <li><code> Style</code></li>
+* <li><code> Transformation</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'Style1', 'Style2'</code>
+* (of type <code>com.sun.star.style.XStyle</code>):
+* relations used to change property 'Style'</li>
+* <ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.Shape
+*/
+public class _Shape extends MultiPropertyTest {
+
+ XStyle style1 = null;
+ XStyle style2 = null;
+
+ /**
+ * Custom tester which switches between two styles.
+ */
+ protected PropertyTester StyleTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue)
+ throws java.lang.IllegalArgumentException {
+ if (util.ValueComparer.equalValue(oldValue,style1))
+ return style2; else
+ return style1;
+ }
+ } ;
+
+ /**
+ * Custom tester for 'LayerName' property which switches two
+ * Strings ('layout' and 'controls').
+ */
+ protected PropertyTester StringTester = new PropertyTester() {
+ protected Object getNewValue(String propName, Object oldValue)
+ throws java.lang.IllegalArgumentException {
+ if (util.ValueComparer.equalValue(oldValue,"layout"))
+ return "controls"; else
+ return "layout";
+ }
+ } ;
+
+ /**
+ * Tested with custom StyleTester which switches between two
+ * styles.
+ */
+ public void _Style() {
+ log.println("Testing with custom Property tester") ;
+ style1 = (XStyle) tEnv.getObjRelation("Style1");
+ style2 = (XStyle) tEnv.getObjRelation("Style2");
+ testProperty("Style", StyleTester) ;
+ }
+
+ /**
+ * Tested with custom StringTester which switches two
+ * Strings ('layout' and 'controls')
+ */
+ public void _LayerName() {
+ if (tEnv.getTestCase().getObjectName().equals("SwXShape")) {
+ log.println("There is only one Layer for SwXShape");
+ log.println("Therefore this property can't be changed");
+ tRes.tested("LayerName",true);
+ } else if (tEnv.getTestCase().getObjectName().equals("ScShapeObj")) {
+ log.println("There is only one Layer for ScShapeObj");
+ log.println("Therefore this property can't be changed");
+ tRes.tested("LayerName",true);
+ } else if (tEnv.getTestCase().getObjectName().equals("ScAnnotationShapeObj")) {
+ log.println("There is only one Layer for ScAnnotationShapeObj");
+ log.println("Therefore this property can't be changed");
+ String aName = null;
+ try {
+ aName = (String) oObj.getPropertyValue ("LayerName");
+ log.println("LayerName: '"+aName+"'");
+ } catch (Exception e) {
+ e.printStackTrace (log);
+ }
+ tRes.tested("LayerName",aName != null);
+ } else {
+ log.println("Testing with custom Property tester") ;
+ testProperty("LayerName", StringTester) ;
+ }
+ }
+
+ public void _ZOrder() {
+ if (tEnv.getTestCase().getObjectName().equals("ScAnnotationShapeObj")) {
+ log.println("There is only one Layer for ScAnnotationShapeObj");
+ log.println("Therefore this property can't be changed");
+ tRes.tested("ZOrder",true);
+ } else {
+ testProperty("ZOrder", new Integer(0), new Integer(1));
+ }
+ }
+
+ public void _LayerID() {
+ if (tEnv.getTestCase().getObjectName().equals("ScAnnotationShapeObj")) {
+ log.println("There is only one Layer for ScAnnotationShapeObj");
+ log.println("Therefore this property can't be changed");
+ Short aID = null;
+ try {
+ aID = (Short) oObj.getPropertyValue ("LayerID");
+ log.println("LayerID: '"+aID.intValue ()+"'");
+ } catch (Exception e) {
+ e.printStackTrace (log);
+ }
+ tRes.tested("LayerID",aID != null);
+ } else {
+ log.println("Testing with custom Property tester") ;
+ testProperty("LayerID");
+ }
+ }
+
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_ShapeDescriptor.java b/qadevOOo/tests/java/ifc/drawing/_ShapeDescriptor.java
new file mode 100644
index 000000000000..abeb24bf1e33
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_ShapeDescriptor.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 ifc.drawing;
+
+import lib.MultiMethodTest;
+import util.ValueChanger;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.style.XStyle;
+import com.sun.star.uno.UnoRuntime;
+
+
+public class _ShapeDescriptor extends MultiMethodTest {
+
+ public XPropertySet oObj = null; // oObj filled by MultiMethodTest
+ public boolean ro = false;
+
+ public void _LayerID() {
+ com.sun.star.lang.XServiceInfo xInfo = (com.sun.star.lang.XServiceInfo)
+ UnoRuntime.queryInterface
+ (com.sun.star.lang.XServiceInfo.class, oObj);
+ if ( ! xInfo.supportsService("com.sun.star.drawing.ShapeDescriptor")) {
+ log.println("Service not available !!!!!!!!!!!!!");
+ tRes.tested("Supported", false);
+ }
+ ro = true;
+ changeProp("LayerID");
+ ro = false;
+ }
+ public void _LayerName() {
+ ro = true;
+ changeProp("LayerName");
+ ro = false;
+ }
+ public void _MoveProtect() {
+ changeProp("MoveProtect");
+ }
+ public void _Name() {
+ changeProp("Name");
+ }
+ public void _Printable() {
+ changeProp("Printable");
+ }
+ public void _SizeProtect() {
+ changeProp("SizeProtect");
+ }
+ public void _Style() {
+ changeProp("Style");
+ }
+
+ public void _Transformation() {
+ changeProp("Transformation");
+ }
+
+ public void changeProp(String name) {
+
+ Object gValue = null;
+ Object sValue = null;
+ Object ValueToSet = null;
+
+
+ try {
+ //waitForAllThreads();
+ gValue = oObj.getPropertyValue(name);
+ //waitForAllThreads();
+ if (!ro) {
+ ValueToSet = ValueChanger.changePValue(gValue);
+ if ( name.equals("Style") ) {
+ ValueToSet = newStyle(gValue);
+ }
+ //waitForAllThreads();
+ oObj.setPropertyValue(name,ValueToSet);
+ sValue = oObj.getPropertyValue(name);
+ }
+
+ //check get-set methods
+ if (gValue.equals(sValue)) {
+ log.println("Value for '"+name+"' hasn't changed");
+ tRes.tested(name, false);
+ } else {
+ log.println("Property '"+name+"' OK");
+ tRes.tested(name, true);
+ }
+ } catch (com.sun.star.beans.UnknownPropertyException ex) {
+ if (isOptional(name)) {
+ log.println("Property '"+name+
+ "' is optional and not supported");
+ tRes.tested(name,true);
+ } else {
+ log.println("Exception occured while testing property '" +
+ name + "'");
+ ex.printStackTrace(log);
+ tRes.tested(name, false);
+ }
+ }
+ catch (Exception e) {
+ log.println("Exception occured while testing property '" +
+ name + "'");
+ e.printStackTrace(log);
+ tRes.tested(name, false);
+ }
+
+
+ }// end of changeProp
+
+ public XStyle newStyle(Object oldStyle) {
+ XStyle Style1 = (XStyle) tEnv.getObjRelation("Style1");
+ XStyle Style2 = (XStyle) tEnv.getObjRelation("Style2");
+ XStyle back = null;
+ if ( (Style1!=null) && (Style2!=null) ) {
+ if ( ((XStyle) oldStyle).equals(Style1) ) {
+ back = Style2;
+ } else {
+ back = Style1;
+ }
+ }
+ return back;
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_Text.java b/qadevOOo/tests/java/ifc/drawing/_Text.java
new file mode 100644
index 000000000000..588ff1efe3c4
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_Text.java
@@ -0,0 +1,72 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+import com.sun.star.container.XIndexReplace;
+
+public class _Text extends MultiPropertyTest {
+
+ protected boolean compare(Object ob1, Object ob2) {
+
+ return super.compare(ob1, ob2);
+
+ }
+
+ public void _NumberingRules() {
+ //This property is readOnly
+ boolean bResult = false;
+
+ try {
+ Object theRules2 = oObj.getPropertyValue( "NumberingRules" );
+ if (!(theRules2 instanceof com.sun.star.container.XIndexReplace)) {
+ log.println("Property 'NumberingRules' is an instance of "+
+ theRules2.getClass().getName());
+ log.println("Expected was an instance of "+
+ "com.sun.star.container.XIndexReplace");
+ }
+ log.println("Trying to cast property 'NumberingRules' "+
+ "to XIndexReplace");
+ XIndexReplace theRules = (XIndexReplace)
+ oObj.getPropertyValue( "NumberingRules" );
+ bResult = true;
+ } catch( Exception e ) {
+ log.println("Error occured while trying to get property"+
+ " 'NumberingRules'");
+ e.printStackTrace( log );
+ bResult = false;
+ }
+
+ tRes.tested( "NumberingRules", bResult);
+ }
+
+} // finish class _Text
+
+
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_TextProperties.java b/qadevOOo/tests/java/ifc/drawing/_TextProperties.java
new file mode 100644
index 000000000000..e7e8190e4a46
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_TextProperties.java
@@ -0,0 +1,67 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.drawing.TextProperties</code>
+* service properties :
+* <ul>
+* <li><code> IsNumbering</code></li>
+* <li><code> NumberingRules</code></li>
+* <li><code> TextAutoGrowHeight</code></li>
+* <li><code> TextAutoGrowWidth</code></li>
+* <li><code> TextContourFrame</code></li>
+* <li><code> TextFitToSize</code></li>
+* <li><code> HorizontalAdjust</code></li>
+* <li><code> VerticalAdjust</code></li>
+* <li><code> TextLeftDistance</code></li>
+* <li><code> TextRightDistance</code></li>
+* <li><code> TextUpperDistance</code></li>
+* <li><code> TextLowerDistance</code></li>
+* <li><code> TextMaximumFrameHeight</code></li>
+* <li><code> TextMaximumFrameWidth</code></li>
+* <li><code> TextMinimumFrameHeight</code></li>
+* <li><code> TextMinimumFrameWidth</code></li>
+* <li><code> TextAnimationAmount</code></li>
+* <li><code> TextAnimationCount</code></li>
+* <li><code> TextAnimationDelay</code></li>
+* <li><code> TextAnimationDirection</code></li>
+* <li><code> TextAnimationKind</code></li>
+* <li><code> TextAnimationStartInside</code></li>
+* <li><code> TextAnimationStopInside</code></li>
+* <li><code> TextWritingMode</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.TextProperties
+*/
+public class _TextProperties extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_TextShape.java b/qadevOOo/tests/java/ifc/drawing/_TextShape.java
new file mode 100644
index 000000000000..9fa917bae4a3
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_TextShape.java
@@ -0,0 +1,44 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+/**
+* Testing <code>com.sun.star.drawing.TextShape</code>
+* service properties :
+* <ul>
+* <li><code> CornerRadius</code></li>
+* </ul> <p>
+* Properties testing is automated by <code>lib.MultiPropertyTest</code>.
+* @see com.sun.star.drawing.TextShape
+*/
+public class _TextShape extends MultiPropertyTest {
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_TextShapeDescriptor.java b/qadevOOo/tests/java/ifc/drawing/_TextShapeDescriptor.java
new file mode 100644
index 000000000000..c5651534bf90
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_TextShapeDescriptor.java
@@ -0,0 +1,36 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiPropertyTest;
+
+
+public class _TextShapeDescriptor extends MultiPropertyTest {
+
+} // finish class _TextShapeDescriptor
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XConnectorShape.java b/qadevOOo/tests/java/ifc/drawing/_XConnectorShape.java
new file mode 100644
index 000000000000..319c5a7c2ee5
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XConnectorShape.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 ifc.drawing;
+
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+import com.sun.star.drawing.ConnectionType;
+import com.sun.star.drawing.XConnectableShape;
+import com.sun.star.drawing.XConnectorShape;
+import com.sun.star.drawing.XShape;
+import com.sun.star.uno.UnoRuntime;
+
+/**
+* Testing <code>com.sun.star.drawing.XConnectorShape</code>
+* interface methods :
+* <ul>
+* <li><code> connectStart()</code></li>
+* <li><code> connectEnd()</code></li>
+* <li><code> disconnectBegin()</code></li>
+* <li><code> disconnectEnd()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'XConnectorShape.Shapes'</code>
+* (of type <code>com.sun.star.drawing.XShape[]</code>):
+* an array of two shapes which <b>must</b> implement
+* <code>com.sun.star.drawing.XConnectableShape</code>
+* interface and are used for being connected by
+* connector shape.</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XConnectorShape
+*/
+public class _XConnectorShape extends MultiMethodTest {
+
+ public XConnectorShape oObj = null; //oObj filled by MultiMethodTest
+ private XConnectableShape shape1 = null,
+ shape2 = null ;
+
+ /**
+ * Retrieves object relation.
+ * @throw StatusException If the relation is not found or shapes don't
+ * support <code>XConnectableShape</code> interface.
+ */
+ public void before() {
+ log.println("No shapes implementing XConnectableShape still found.");
+ XShape[] shapes = (XShape[])
+ tEnv.getObjRelation("XConnectorShape.Shapes") ;
+ if (shapes == null) throw new StatusException(Status.failed
+ ("Relation not found.")) ;
+ shape1 = (XConnectableShape) UnoRuntime.queryInterface
+ (XConnectableShape.class, shapes[0]) ;
+ shape2 = (XConnectableShape) UnoRuntime.queryInterface
+ (XConnectableShape.class, shapes[1]) ;
+ if (shape1 == null || shape2 == null) throw new StatusException
+ (Status.failed("Shapes don't implement XConnectableShape"+
+ " interface.")) ;
+ }
+
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _connectStart() {
+ oObj.connectStart(shape1, ConnectionType.AUTO);
+
+ tRes.tested("connectStart()", true) ;
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _connectEnd() {
+ oObj.connectEnd(shape2, ConnectionType.AUTO);
+
+ tRes.tested("connectEnd()", true) ;
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> connectStart() </code> : first shape needs to be
+ * connected. </li>
+ * </ul>
+ */
+ public void _disconnectBegin() {
+ requiredMethod("connectStart()");
+
+ oObj.disconnectBegin(shape1);
+
+ tRes.tested("disconnectBegin()", true) ;
+ }
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> connectEnd() </code> : first shape needs to be
+ * connected. </li>
+ * </ul>
+ */
+ public void _disconnectEnd() {
+ requiredMethod("connectEnd()");
+
+ oObj.disconnectEnd(shape2);
+
+ tRes.tested("disconnectEnd()", true) ;
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XControlShape.java b/qadevOOo/tests/java/ifc/drawing/_XControlShape.java
new file mode 100644
index 000000000000..7141ce155f3f
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XControlShape.java
@@ -0,0 +1,106 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiMethodTest;
+import util.FormTools;
+
+import com.sun.star.awt.XControlModel;
+import com.sun.star.drawing.XControlShape;
+import com.sun.star.lang.XComponent;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+/**
+* Testing <code>com.sun.star.drawing.XControlShape</code>
+* interface methods :
+* <ul>
+* <li><code> getControl()</code></li>
+* <li><code> setControl()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'xDoc'</code> (of type <code>XComponent</code>):
+* the document where shape tested is situated. This document
+* must also implement <code>XMultiServiceFactory</code> interface
+* to create some control model. </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XControlShape
+*/
+public class _XControlShape extends MultiMethodTest {
+
+ public XControlShape oObj = null;
+
+ XControlModel model = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _getControl() {
+ model = oObj.getControl() ;
+
+ tRes.tested("getControl()", true) ;
+ }
+
+ /**
+ * With the help of document passed as relation, a new button control
+ * model is created and set as a control. <p>
+ * Has <b> OK </b> status if <code>getControl()</code> method returns
+ * the same control as was set. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getControl() </code> </li>
+ * </ul>
+ */
+ public void _setControl() {
+ requiredMethod("getControl()") ;
+
+ XInterface oNewControl = FormTools.createControl
+ ((XComponent)tEnv.getObjRelation("xDoc"), "ComboBox") ;
+
+ XControlModel xControl = (XControlModel) UnoRuntime.queryInterface
+ (XControlModel.class, oNewControl) ;
+
+ oObj.setControl(xControl) ;
+
+ XControlModel gControl = oObj.getControl() ;
+
+ if (oNewControl.equals(gControl))
+ tRes.tested("setControl()", true) ;
+ else {
+ log.println("Control set is not equal to control get") ;
+ tRes.tested("setControl()", false) ;
+ }
+ }
+
+} // finish class _XControlShape
+
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XDrawPageDuplicator.java b/qadevOOo/tests/java/ifc/drawing/_XDrawPageDuplicator.java
new file mode 100644
index 000000000000..5bbb6560fe59
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XDrawPageDuplicator.java
@@ -0,0 +1,91 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPageDuplicator;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+
+
+/**
+* Testing <code>com.sun.star.drawing.XDrawPageDuplicator</code>
+* interface methods :
+* <ul>
+* <li><code> duplicate()</code></li>
+* </ul> <p>
+* The object tested <b> must implement </b>
+* <code>XDrawPagesSupplier</code> interface to have access to draw
+* pages collection. <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* After test completion object environment has to be recreated.
+* @see com.sun.star.drawing.XDrawPageDuplicator
+*/
+public class _XDrawPageDuplicator extends MultiMethodTest {
+ public XDrawPageDuplicator oObj = null;
+
+ /**
+ * First queries object tested for <code>XDrawPagesSupplier</code>
+ * interface and obtains one draw page from document. Then it
+ * tries to duplicate it.<p>
+ * Has <b> OK </b> status if the method returns not null value and
+ * this value is not equal to the page which was duplicated. <p>
+ */
+ public void _duplicate(){
+ boolean result = false;
+ XInterface testobj = tEnv.getTestObject();
+ XDrawPagesSupplier PS = (XDrawPagesSupplier)
+ UnoRuntime.queryInterface(XDrawPagesSupplier.class, testobj);
+ XDrawPages DPs = PS.getDrawPages();
+ XDrawPage DP = null;
+ try {
+ DP = (XDrawPage) AnyConverter.toObject(
+ new Type(XDrawPage.class),DPs.getByIndex(0));
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ log.println("Exception occured while testing: " + e);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
+ log.println("Exception occured while testing: " + e);
+ } catch (com.sun.star.lang.IllegalArgumentException e) {
+ log.println("Exception occured while testing: " + e);
+ }
+
+ if (DP != null) {
+ XDrawPage newPage = oObj.duplicate(DP);
+ result = (newPage != null) && !(newPage.equals(DP));
+ }
+ tRes.tested("duplicate()", result);
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XDrawPageExpander.java b/qadevOOo/tests/java/ifc/drawing/_XDrawPageExpander.java
new file mode 100644
index 000000000000..01afaee841c1
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XDrawPageExpander.java
@@ -0,0 +1,74 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiMethodTest;
+import lib.Status;
+
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPageExpander;
+import com.sun.star.drawing.XDrawPages;
+
+/**
+* Testing <code>com.sun.star.drawing.XDrawPageExpander</code>
+* interface methods :
+* <ul>
+* <li><code> expand()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'DrawPage'</code> (of type <code>XDrawPage</code>):
+* draw page to be expanded. </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XDrawPageExpander
+*/
+public class _XDrawPageExpander extends MultiMethodTest {
+ public XDrawPageExpander oObj = null;
+
+ /**
+ * First the relation is retrieved. Then the method is called.<p>
+ * Has <b> OK </b> status if the method returns not null value. <p>
+ */
+ public void _expand() {
+ boolean result = true;
+ XDrawPage oDrawPage = (XDrawPage) tEnv.getObjRelation("DrawPage");
+ if ( oDrawPage == null ) {
+ // SKIPPED.FAILED - the ObjectRelation is not available
+ Status.failed( "ObjectRelation('DrawPages') XDrawPages n.a.");
+ return;
+ }
+ log.println("testing expand() ... ");
+
+ XDrawPages pages = oObj.expand(oDrawPage);
+ result = pages != null;
+
+ tRes.tested("expand()", result);
+ } // end expand
+} // end DrawPageExpander
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XDrawPageSummarizer.java b/qadevOOo/tests/java/ifc/drawing/_XDrawPageSummarizer.java
new file mode 100644
index 000000000000..fe0d5a9eca77
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XDrawPageSummarizer.java
@@ -0,0 +1,74 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiMethodTest;
+import lib.Status;
+
+import com.sun.star.drawing.XDrawPageSummarizer;
+import com.sun.star.drawing.XDrawPages;
+
+/**
+* Testing <code>com.sun.star.drawing.XDrawPageSummarizer</code>
+* interface methods :
+* <ul>
+* <li><code> summarize()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'DrawPages'</code> (of type <code>XDrawPages</code>):
+* a collection of pages to be summarized. </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XDrawPageSummarizer
+*/
+public class _XDrawPageSummarizer extends MultiMethodTest {
+ public XDrawPageSummarizer oObj = null;
+
+ /**
+ * First the relation is retrieved. Then the method is called.<p>
+ * Has <b> OK </b> status if the method returns not null value. <p>
+ */
+ public void summarize(){
+ boolean result = true;
+ XDrawPages oDrawPages = (XDrawPages) tEnv.getObjRelation("DrawPages");
+ if ( oDrawPages == null ) {
+ // SKIPPED.FAILED - the ObjectRelation is not available
+ Status.failed( "ObjectRelation('DrawPages') XDrawPages n.a." );
+ return;
+ }
+ log.println("testing summarize() ... ");
+
+ oObj.summarize(oDrawPages);
+ result=true;
+
+ tRes.tested("summarize()", result);
+ } // end of summarize()
+
+} // end of XDrawPageSummarizer
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XDrawPageSupplier.java b/qadevOOo/tests/java/ifc/drawing/_XDrawPageSupplier.java
new file mode 100644
index 000000000000..c504e2d864ea
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XDrawPageSupplier.java
@@ -0,0 +1,44 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPageSupplier;
+import lib.MultiMethodTest;
+
+/**
+ *
+ */
+public class _XDrawPageSupplier extends MultiMethodTest {
+ public XDrawPageSupplier oObj = null;
+
+ public void _getDrawPage() {
+ XDrawPage xPage = oObj.getDrawPage();
+ log.println("xPage: " + util.utils.getImplName(xPage));
+ tRes.tested("getDrawPage()", xPage != null);
+ }
+}
diff --git a/qadevOOo/tests/java/ifc/drawing/_XDrawPages.java b/qadevOOo/tests/java/ifc/drawing/_XDrawPages.java
new file mode 100644
index 000000000000..078fb1fba876
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XDrawPages.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 ifc.drawing;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPages;
+
+/**
+* Testing <code>com.sun.star.drawing.XDrawPages</code>
+* interface methods :
+* <ul>
+* <li><code> insertNewByIndex()</code></li>
+* <li><code> remove()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XDrawPages
+*/
+public class _XDrawPages extends MultiMethodTest {
+ public XDrawPages oObj = null;
+ public XDrawPage DrawPage;
+
+ /**
+ * Inserts a draw page at index 0. Number of pages is obtained
+ * before and after insertion.<p>
+ * Has <b> OK </b> status if the value returned is not null and
+ * number of pages increases by one after insertion. <p>
+ */
+ public void _insertNewByIndex(){
+ boolean result = true;
+ log.println("testing insertNewByIndex() ... ");
+
+ int cntBefore = oObj.getCount();
+ DrawPage = oObj.insertNewByIndex(0);
+ int cntAfter = oObj.getCount();
+ result = DrawPage != null &&
+ cntAfter == cntBefore + 1 ;
+
+ tRes.tested("insertNewByIndex()", result);
+ } // end InsertNewByIndex
+
+ /**
+ * Removes the draw page inserted before. Number of pages is obtained
+ * before and after removing.<p>
+ * Has <b> OK </b> status if the number of pages decreases by one
+ * after removing. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> insertByIndex() </code> : the page to be removed must
+ * be inserted first.</li>
+ * </ul>
+ */
+ public void _remove(){
+ requiredMethod("insertNewByIndex()") ;
+
+ boolean result = true;
+ log.println("removing DrawPage...");
+
+ int cntBefore = oObj.getCount();
+ oObj.remove(DrawPage);
+ int cntAfter = oObj.getCount();
+ result = cntAfter + 1 == cntBefore ;
+
+ tRes.tested("remove()", result);
+ } // end remove()
+
+} // end XDrawPages
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XDrawPagesSupplier.java b/qadevOOo/tests/java/ifc/drawing/_XDrawPagesSupplier.java
new file mode 100644
index 000000000000..912051db3dcd
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XDrawPagesSupplier.java
@@ -0,0 +1,64 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawPagesSupplier;
+
+/**
+* Testing <code>com.sun.star.drawing.XDrawPagesSupplier</code>
+* interface methods :
+* <ul>
+* <li><code> getDrawPages()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XDrawPagesSupplier
+*/
+public class _XDrawPagesSupplier extends MultiMethodTest {
+ public XDrawPagesSupplier oObj = null;
+
+ /**
+ * Gets draw page collection. <p>
+ * Has <b> OK </b> status if the value returned is not null. <p>
+ */
+ public void _getDrawPages(){
+ boolean result = true;
+ XDrawPages DrawPages = null;
+
+ log.println("testing getDrawPages() ... ");
+
+ DrawPages = oObj.getDrawPages();
+ result = DrawPages != null;
+
+ tRes.tested("getDrawPages()", result);
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XDrawView.java b/qadevOOo/tests/java/ifc/drawing/_XDrawView.java
new file mode 100644
index 000000000000..643f68865de6
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XDrawView.java
@@ -0,0 +1,113 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XDrawView;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+
+/**
+* Testing <code>com.sun.star.drawing.XDrawView</code>
+* interface methods :
+* <ul>
+* <li><code> setCurrentPage()</code></li>
+* <li><code> getCurrentPage()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'Pages'</code> (of type <code>XDrawPages</code>):
+* needed to have the access to pages collection.</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XDrawView
+*/
+public class _XDrawView extends MultiMethodTest {
+
+ public XDrawView oObj = null;
+ public XDrawPage the_page = null;
+
+ /**
+ * This methods gets the current DrawPage.<p>
+ * Has <b> OK </b> status if the returned DrawPage
+ * isn't empty.
+ */
+ public void _getCurrentPage(){
+ the_page = oObj.getCurrentPage();
+ tRes.tested("getCurrentPage()",the_page != null);
+ } // end getCurrentPage
+
+ /**
+ * This methods sets the current DrawPage<br>
+ * First a new DrawPage is inserted in the document.
+ * Then this DrawPage is set as current Page.
+ * Has <b> OK </b> status if the getCurrentPage() method returns
+ * the DrawPage that was previously set.
+ * @see ifc.drawing._XDrawPages
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getCurrentPage() </code> </li>
+ * </ul>
+ */
+ public void _setCurrentPage(){
+ requiredMethod("getCurrentPage()");
+ try {
+ XDrawPages the_pages = (XDrawPages) tEnv.getObjRelation("Pages");
+ the_pages.insertNewByIndex(0);
+ XDrawPage newPage = (XDrawPage) AnyConverter.toObject(
+ new Type(XDrawPage.class),the_pages.getByIndex(1));
+ oObj.setCurrentPage(newPage);
+ XDrawPage getting = oObj.getCurrentPage();
+ boolean eq = newPage.equals(getting);
+ if (!eq) {
+ log.println("Getting: "+getting.hasElements());
+ log.println("Expected: "+newPage.hasElements());
+ }
+ //back to the previous page
+ oObj.setCurrentPage(the_page);
+ tRes.tested("setCurrentPage()",eq);
+ } catch (com.sun.star.lang.WrappedTargetException ex) {
+ log.println("Exception occured while checking 'setCurrentPage()'");
+ ex.printStackTrace(log);
+ tRes.tested("setCurrentPage()",false);
+ } catch (com.sun.star.lang.IndexOutOfBoundsException ex) {
+ log.println("Exception occured while checking 'setCurrentPage()'");
+ ex.printStackTrace(log);
+ tRes.tested("setCurrentPage()",false);
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ log.println("Exception occured while checking 'setCurrentPage()'");
+ ex.printStackTrace(log);
+ tRes.tested("setCurrentPage()",false);
+ }
+ } // end setCurrentPage
+
+} // end DrawView
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XGluePointsSupplier.java b/qadevOOo/tests/java/ifc/drawing/_XGluePointsSupplier.java
new file mode 100644
index 000000000000..b0eb03245414
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XGluePointsSupplier.java
@@ -0,0 +1,64 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.container.XIndexContainer;
+import com.sun.star.drawing.XGluePointsSupplier;
+
+/**
+* Testing <code>com.sun.star.drawing.XGluePointsSupplier</code>
+* interface methods :
+* <ul>
+* <li><code> getGluePoints()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XGluePointsSupplier
+*/
+public class _XGluePointsSupplier extends MultiMethodTest {
+ public XGluePointsSupplier oObj = null;
+
+ /**
+ * Gets glue points collection. <p>
+ * Has <b> OK </b> status if the value returned is not null. <p>
+ */
+ public void _getGluePoints(){
+ boolean result = true;
+ XIndexContainer points = null;
+
+ log.println("testing getDrawPages() ... ");
+
+ points = oObj.getGluePoints();
+ result = points != null;
+
+ tRes.tested("getGluePoints()", result);
+ }
+
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XLayerManager.java b/qadevOOo/tests/java/ifc/drawing/_XLayerManager.java
new file mode 100644
index 000000000000..c971df91ee9b
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XLayerManager.java
@@ -0,0 +1,166 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiMethodTest;
+import util.ValueComparer;
+import util.XInstCreator;
+
+import com.sun.star.drawing.XLayer;
+import com.sun.star.drawing.XLayerManager;
+import com.sun.star.drawing.XShape;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.uno.XInterface;
+
+/**
+* Testing <code>com.sun.star.drawing.XLayerManager</code>
+* interface methods :
+* <ul>
+* <li><code> insertNewByIndex()</code></li>
+* <li><code> remove()</code></li>
+* <li><code> attachShapeToLayer()</code></li>
+* <li><code> getLayerForShape()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'Shape'</code> (of type <code>util.XInstCreator</code>):
+* instance creator which can create shapes.</li>
+* <li> <code>'Shapes'</code>
+* (of type <code>com.sun.star.drawing.XShapes</code>):
+* The collection of shapes in the document. Is used
+* to add new created shapes.</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XLayerManager
+*/
+public class _XLayerManager extends MultiMethodTest {
+
+ public XLayerManager oObj = null; // oObj filled by MultiMethodTest
+ XInstCreator shape = null;
+ public XInterface oShape = null;
+ public XLayer oL = null;
+
+ /**
+ * Inserts a new layer into collection. <p>
+ * Has <b> OK </b> status if the value returned is not null. <p>
+ */
+ public void _insertNewByIndex(){
+ log.println("insertNewByName() ... ");
+ oL = oObj.insertNewByIndex(0);
+ tRes.tested("insertNewByIndex()", oL != null);
+ }
+
+ /**
+ * First a shape created and inserted into the document using
+ * relations retrieved. Attaches this shape to layer created before. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> insertNewByIndex </code> : to have a layer attach to.</li>
+ * </ul>
+ */
+ public void _attachShapeToLayer() {
+ requiredMethod("insertNewByIndex()");
+ shape = (XInstCreator)tEnv.getObjRelation("Shape");
+ oShape = shape.createInstance();
+ XShape oSh = (XShape) oShape;
+ XShapes oShapes = (XShapes) tEnv.getObjRelation("Shapes");
+ oShapes.add(oSh);
+ boolean result = false;
+
+ log.println("attachShapeToLayer() ... ");
+
+ oObj.attachShapeToLayer((XShape) oShape,oL);
+ result = true;
+
+ tRes.tested("attachShapeToLayer()", result);
+ }
+
+ /**
+ * Gets the layer for shape which was attached before. <p>
+ * Has <b> OK </b> status if the names of layer get and
+ * the layer attached before are equal. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> attachShapeToLayer() </code> </li>
+ * </ul>
+ */
+ public void _getLayerForShape() {
+ requiredMethod("attachShapeToLayer()");
+ log.println("getLayerForShape() ... ");
+ XLayer Lay1 = oL;
+ XLayer Lay2 = oObj.getLayerForShape((XShape)oShape);
+ Object Obj1 = null;
+ Object Obj2 = null;
+
+ try {
+ Obj1 = Lay1.getPropertyValue("Name");
+ Obj2 = Lay2.getPropertyValue("Name");
+ } catch (com.sun.star.lang.WrappedTargetException e) {
+ e.printStackTrace(log);
+ } catch (com.sun.star.beans.UnknownPropertyException e) {
+ e.printStackTrace(log);
+ }
+
+ tRes.tested("getLayerForShape()",ValueComparer.equalValue(Obj1,Obj2));
+ }
+
+ /**
+ * Test removes the layer added before. Number of layers are get before
+ * and after removing.<p>
+ * Has <b> OK </b> status if number of layers decreases by one. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getLayerForShape() </code> </li>
+ * </ul>
+ */
+ public void _remove () {
+ requiredMethod("getLayerForShape()");
+ boolean result = true ;
+ // get the current thread's holder
+ log.println("removing the Layer...");
+
+ int cntBefore = oObj.getCount();
+
+ try {
+ oObj.remove(oL);
+ } catch (com.sun.star.container.NoSuchElementException e) {
+ e.printStackTrace(log);
+ result = false;
+ }
+
+ int cntAfter = oObj.getCount();
+
+ result = cntBefore == cntAfter + 1;
+
+ tRes.tested("remove()", result);
+ }
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XLayerSupplier.java b/qadevOOo/tests/java/ifc/drawing/_XLayerSupplier.java
new file mode 100644
index 000000000000..770abc9c4eba
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XLayerSupplier.java
@@ -0,0 +1,70 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.container.XNameAccess;
+import com.sun.star.drawing.XLayerManager;
+import com.sun.star.drawing.XLayerSupplier;
+import com.sun.star.uno.UnoRuntime;
+
+/**
+* Testing <code>com.sun.star.drawing.XLayerSupplier</code>
+* interface methods :
+* <ul>
+* <li><code> getLayerManager()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XLayerSupplier
+*/
+public class _XLayerSupplier extends MultiMethodTest{
+ public XLayerSupplier oObj = null;
+
+ /**
+ * Gets the manager and it is queried for <code>XLayerManager</code>. <p>
+ * Has <b> OK </b> status if returned value is successfully
+ * queried for <code>XLayerManager</code>. <p>
+ */
+ public void _getLayerManager(){
+ XNameAccess oNA =null;
+ XLayerManager oLM = null;
+ boolean result = true;
+
+ log.println("testing getLayerManager() ... ");
+
+ oNA = oObj.getLayerManager();
+ oLM = (XLayerManager)
+ UnoRuntime.queryInterface ( XLayerManager.class, oNA);
+ result = oLM != null;
+
+ tRes.tested("getLayerManager()", result);
+ } // finished test
+
+} // end XLayerSupplier
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XMasterPageTarget.java b/qadevOOo/tests/java/ifc/drawing/_XMasterPageTarget.java
new file mode 100644
index 000000000000..393469bd21e0
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XMasterPageTarget.java
@@ -0,0 +1,108 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XMasterPageTarget;
+
+/**
+* Testing <code>com.sun.star.drawing.XMasterPageTarget</code>
+* interface methods :
+* <ul>
+* <li><code> getMasterPage()</code></li>
+* <li><code> setMasterPage()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'MasterPageSupplier'</code>
+* (of type <code>XDrawPages</code>):
+* the relation is used to create a new draw page. </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XMasterPageTarget
+*/
+public class _XMasterPageTarget extends MultiMethodTest{
+
+ public XMasterPageTarget oObj = null;
+ public XDrawPage DrawPage = null;
+
+ /**
+ * Gets the master page and stores. <p>
+ * Has <b> OK </b> status if the value returned is not null. <p>
+ */
+ public void _getMasterPage(){
+ boolean result = false;
+ log.println("get the MasterPage");
+
+ DrawPage = oObj.getMasterPage();
+ result = DrawPage != null ;
+
+ tRes.tested("getMasterPage()",result);
+ }
+
+ /**
+ * Gets the pages supplier from relation. Then a new page is created,
+ * inserted and set as master page.<p>
+ * Has <b> OK </b> status if the master page get is equal to page
+ * which was set. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getMasterPage() </code> : to get old master page.</li>
+ * </ul>
+ */
+ public void _setMasterPage() {
+ requiredMethod("getMasterPage()") ;
+
+ boolean result = true;
+ XDrawPage oNewPage = null;
+
+ XDrawPages oPages = (XDrawPages) tEnv.getObjRelation("MasterPageSupplier");
+ log.println("inserting new MasterPage");
+ oNewPage = oPages.insertNewByIndex(oPages.getCount());
+
+ // save the old MasterPage
+ XDrawPage oOldPage = DrawPage;
+
+ // set the new Page as MasterPage
+ log.println("set the new MasterPage");
+ oObj.setMasterPage(oNewPage);
+
+ // get the new MasterPage
+ DrawPage = oObj.getMasterPage();
+
+ // test the diffrent MasterPages
+ if (DrawPage.equals(oOldPage)) result = false;
+
+ tRes.tested("setMasterPage()",result);
+ }
+
+} // end of XMasterPageTarget
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XMasterPagesSupplier.java b/qadevOOo/tests/java/ifc/drawing/_XMasterPagesSupplier.java
new file mode 100644
index 000000000000..3cf4adae07aa
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XMasterPagesSupplier.java
@@ -0,0 +1,63 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.drawing.XDrawPages;
+import com.sun.star.drawing.XMasterPagesSupplier;
+
+/**
+* Testing <code>com.sun.star.drawing.XMasterPagesSupplier</code>
+* interface methods :
+* <ul>
+* <li><code> getMasterPages()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XMasterPagesSupplier
+*/
+public class _XMasterPagesSupplier extends MultiMethodTest{
+ public XMasterPagesSupplier oObj = null;
+
+ /**
+ * Test calls the method. <p>
+ * Has <b> OK </b> status if the value returned is not null.
+ */
+ public void _getMasterPages(){
+ boolean result = false;
+ XDrawPages DrawPages = null;
+
+ log.println("get the MasterPages");
+
+ DrawPages = oObj.getMasterPages();
+ result = DrawPages != null;
+
+ tRes.tested("getMasterPages()",result);
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XShape.java b/qadevOOo/tests/java/ifc/drawing/_XShape.java
new file mode 100644
index 000000000000..e774721c9fdc
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XShape.java
@@ -0,0 +1,196 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.awt.Point;
+import com.sun.star.awt.Size;
+import com.sun.star.drawing.XShape;
+
+/**
+* Testing <code>com.sun.star.drawing.XShape</code>
+* interface methods :
+* <ul>
+* <li><code> getPosition()</code></li>
+* <li><code> setPosition()</code></li>
+* <li><code> getSize()</code></li>
+* <li><code> setSize()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'NoPos'</code> <b>optional</b>
+* (of type <code>Object</code>):
+* if this relation exists then position setting is
+* not supported by the object.</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XShape
+*/
+public class _XShape extends MultiMethodTest {
+
+ public XShape oObj = null; //oObj filled by MultiMethodTest
+
+ Size sOld = new Size();
+ Point pOld = new Point();
+ Size sNew = new Size();
+ Point pNew = new Point();
+
+ /**
+ * Gets the size and stores it. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ */
+ public void _getSize(){
+
+ boolean result = false;
+
+ log.println("get the size");
+
+ sOld = (Size) oObj.getSize();
+ result = true;
+
+ tRes.tested("getSize()", result);
+ }
+
+ /**
+ * Gets the current position and stores it if the object
+ * supports position setting. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown or object doesn't
+ * support position setting. <p>
+ */
+ public void _getPosition(){
+ boolean result = false;
+
+ String obj = (String) tEnv.getObjRelation("NoPos");
+ if (obj != null) {
+ log.println("Can't be used with "+obj);
+ result = true;
+ tRes.tested("getPosition()", result);
+ return;
+ }
+
+ log.println("get the position");
+ pOld = (Point) oObj.getPosition();
+ result = true;
+
+ tRes.tested("getPosition()", result);
+ }
+
+ /**
+ * Sets a new size different from the size get before. <p>
+ * Has <b> OK </b> status if the size returned by <code>getSize()</code>
+ * is equal to the size which was set. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getSize() </code> : to set the original size changed.</li>
+ * </ul>
+ */
+ public void _setSize(){
+ requiredMethod("getSize()");
+
+ boolean result = true;
+
+ String obj = (String) tEnv.getObjRelation("NoSetSize");
+ if (obj != null) {
+ log.println("Can't be used with " + obj);
+ tRes.tested("setSize()", true);
+ return;
+ }
+ // get the current thread's holder
+ sNew = new Size(sOld.Width + 10,sOld.Height + 10) ;
+
+ //set new size
+ log.println("change the size");
+ try {
+ oObj.setSize(sNew);
+ } catch (com.sun.star.beans.PropertyVetoException e) {
+ log.println("Exception while calling the method :" + e);
+ result = true ;
+ }
+
+ Size gSize = oObj.getSize() ;
+
+ log.println("Previously: "+sOld.Height+";"+sOld.Width);
+ log.println("Expected: "+sNew.Height+";"+sNew.Width);
+ log.println("Getting: "+gSize.Height+";"+gSize.Width);
+
+ //result &= util.ValueComparer.equalValue(sNew, gSize) ;
+ //errors in calculation from points/twips less then 1 are acceptable
+ result &= (sNew.Height-gSize.Height <= 2) && (sNew.Width-gSize.Width <= 2);
+
+ if (result && ((sNew.Height-gSize.Height != 0) || (sNew.Width-gSize.Width != 0))){
+ log.println("NOTE: there is a difference between the expected and the getted value. " +
+ "This might be ok because of problems in calculation from points <-> twips");
+ }
+ tRes.tested("setSize()", result);
+ }
+
+ /**
+ * If object doesn't support position setting the test does nothing.
+ * Else a new position is created and set.<p>
+ * Has <b> OK </b> status if get position is equal to set position or
+ * if the position setting isn't supported. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> getPosition() </code> : to change old position. </li>
+ * </ul>
+ */
+ public void _setPosition(){
+ requiredMethod("getPosition()");
+
+ boolean result = true;
+
+ String obj = (String) tEnv.getObjRelation("NoPos");
+ if (obj != null) {
+ log.println("Can't be used with " + obj);
+ tRes.tested("setPosition()", true);
+ return;
+ }
+
+ // get the current thread's holder
+ pNew = new Point(pOld.X + 100, pOld.Y + 100) ;
+ oObj.setPosition(pNew);
+
+ Point gPos = oObj.getPosition() ;
+
+ log.println("Previously: "+pOld.X+";"+pOld.Y);
+ log.println("Expected: "+pNew.X+";"+pNew.Y);
+ log.println("Getting: "+gPos.X+";"+gPos.Y);
+
+ result = !util.ValueComparer.equalValue(pOld, gPos) ;
+
+ tRes.tested("setPosition()", result);
+ }
+
+
+} // finish class _XShape
+
+
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XShapeBinder.java b/qadevOOo/tests/java/ifc/drawing/_XShapeBinder.java
new file mode 100644
index 000000000000..d150aa986815
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XShapeBinder.java
@@ -0,0 +1,109 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XShape;
+import com.sun.star.drawing.XShapeBinder;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.uno.UnoRuntime;
+
+/**
+* Testing <code>com.sun.star.drawing.XShapeBinder</code>
+* interface methods :
+* <ul>
+* <li><code> bind()</code></li>
+* <li><code> unbind()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'DrawPage'</code> (must implement <code>XShapes</code>):
+* the collection of shapes in a document which used to create a group.</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XShapeBinder
+*/
+public class _XShapeBinder extends MultiMethodTest {
+
+ public XShapeBinder oObj = null;
+ XShape group = null;
+ int countBeforeBind = 0;
+ XShapes oShapes = null;
+
+ /**
+ * Retrieves draw page collection from relation and binds them. <p>
+ *
+ * Has <b> OK </b> status if the shape group returned is not null
+ * number of shapes in collection is 1 (shapes are binded into a single
+ * shape). <p>
+ */
+ public void _bind () {
+ XDrawPage dp = (XDrawPage) tEnv.getObjRelation("DrawPage");
+ oShapes = (XShapes)UnoRuntime.queryInterface( XShapes.class, dp );
+ boolean result = false;
+ log.println("testing bind() ... ");
+ countBeforeBind = oShapes.getCount();
+ log.println("Count before bind:" + countBeforeBind);
+ group = oObj.bind(oShapes);
+ int countAfterBind = oShapes.getCount();
+ log.println("Count after bind:" + countAfterBind);
+ result = group != null && countAfterBind == 1;
+
+ tRes.tested("bind()", result);
+
+ }
+
+ /**
+ * Unbinds the group created before. <p>
+ *
+ * Has <b> OK </b> status if number of shapes in collection
+ * increases after the method call. <p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> bind() </code> : to create a shape group </li>
+ * </ul>
+ */
+ public void _unbind () {
+ requiredMethod("bind()");
+ boolean result = false;
+
+ // get the current thread's holder
+ log.println("unbinding the shape...");
+
+ oObj.unbind(group);
+ int countAfterUnbind = oShapes.getCount();
+ log.println("Count after unbind:" + countAfterUnbind);
+ result = countAfterUnbind >= countBeforeBind;
+
+ tRes.tested("unbind()", result);
+ }
+}
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XShapeCombiner.java b/qadevOOo/tests/java/ifc/drawing/_XShapeCombiner.java
new file mode 100644
index 000000000000..f83025c08a84
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XShapeCombiner.java
@@ -0,0 +1,110 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.drawing.XDrawPage;
+import com.sun.star.drawing.XShape;
+import com.sun.star.drawing.XShapeCombiner;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.uno.UnoRuntime;
+
+/**
+* Testing <code>com.sun.star.drawing.XShapeCombiner</code>
+* interface methods :
+* <ul>
+* <li><code> combine()</code></li>
+* <li><code> split()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'DrawPage'</code> (must implement <code>XShapes</code>):
+* the collection of shapes in a document which used to create a group.</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XShapeCombiner
+*/
+public class _XShapeCombiner extends MultiMethodTest {
+
+ public XShapeCombiner oObj = null; //filled by MultiMethodTest
+ protected XShape oGroup = null;
+ int countBeforeComb = 0;
+ XShapes oShapes = null;
+
+ /**
+ * Retrieves draw page collection from relation and combines them. <p>
+ * Has <b> OK </b> status if the shape group returned is not null nd
+ * number of shapes in collection is 1 (shapes are combined into a single
+ * shape). <p>
+ */
+ public void _combine () {
+ XDrawPage dp = (XDrawPage) tEnv.getObjRelation("DrawPage");
+ oShapes = (XShapes)UnoRuntime.queryInterface( XShapes.class, dp );
+
+ boolean result = false;
+
+ log.println("testing combine() ... ");
+ countBeforeComb = oShapes.getCount();
+ log.println("Count before combining:" + countBeforeComb);
+ oGroup = oObj.combine(oShapes);
+ int countAfterComb = oShapes.getCount();
+ log.println("Count after combining:" + countAfterComb);
+ result = oGroup != null && countAfterComb == 1;
+
+ tRes.tested("combine()", result);
+ }
+
+ /**
+ * Splits the group created before. <p>
+ *
+ * Has <b> OK </b> status if number of shapes in collection after
+ * <code>split</code> is the same as before <code>combine</code>. <p>
+ *
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> combine() </code> : to create a shape group </li>
+ * </ul>
+ */
+ public void _split() {
+ requiredMethod("combine()");
+
+ boolean result = false;
+
+ log.println("spiltting the shape...");
+
+ oObj.split(oGroup);
+ int countAfterSplit = oShapes.getCount();
+ log.println("Count after split:" + countAfterSplit);
+ result = countAfterSplit == countBeforeComb;
+
+ tRes.tested("split()", result);
+ } // end of split
+
+} // end of XShapeCombiner
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XShapeDescriptor.java b/qadevOOo/tests/java/ifc/drawing/_XShapeDescriptor.java
new file mode 100644
index 000000000000..6ebcc1897402
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XShapeDescriptor.java
@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.drawing.XShapeDescriptor;
+import com.sun.star.lang.XServiceInfo;
+import com.sun.star.uno.UnoRuntime;
+
+/**
+* Testing <code>com.sun.star.drawing.XShapeDescriptor</code>
+* interface methods :
+* <ul>
+* <li><code> getShapeType()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XShapeDescriptor
+*/
+public class _XShapeDescriptor extends MultiMethodTest {
+
+ public XShapeDescriptor oObj = null;
+ boolean result = true;
+
+ /**
+ * Gets the type of shape. This type must be a service name which
+ * is supported by object (except of ChartObject and Frame shapes).
+ * The object is queried for <code>XServiceInfo</code> and
+ * the type is checked to be among supported service names.<p>
+ *
+ * Has <b> OK </b> status if the type is found among supported
+ * services. Or if the object represents a text frame.<p>
+ */
+ public void _getShapeType() {
+ result = false;
+
+ String stype = oObj.getShapeType();
+ log.println("Current Shape Type is " + stype);
+
+ XServiceInfo SI = (XServiceInfo)
+ UnoRuntime.queryInterface(XServiceInfo.class, oObj);
+
+ String[] serviceNames = SI.getSupportedServiceNames();
+
+ log.println("Supported services :");
+ for (int i = 0; i < serviceNames.length; i++) {
+ log.println(" " + serviceNames[i]);
+ if (serviceNames[i].equals(stype))
+ result = true;
+ }
+
+ //remark: we should provide the expected name as ObjRelation
+
+ //Chart has its own behaviour it always return 'ChartObject'
+ if (stype.equals("com.sun.star.chart.ChartObject")) result=true;
+ if (stype.equals("com.sun.star.drawing.ControlShape")) result=true;
+ if (stype.equals("com.sun.star.drawing.ClosedBezierShape")) result=true;
+ if (stype.equals("com.sun.star.drawing.CaptionShape")) result=true;
+
+ //Writer has its own behaviour it returns a 'FrameShape'
+ if (stype.equals("FrameShape")) result=true;
+
+ if (!result) {
+ log.println("Service " + stype + " not supported in the object.");
+ }
+
+ tRes.tested("getShapeType()", result);
+ }
+
+}
+
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XShapeGroup.java b/qadevOOo/tests/java/ifc/drawing/_XShapeGroup.java
new file mode 100644
index 000000000000..5c7dd2d724f4
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XShapeGroup.java
@@ -0,0 +1,70 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiMethodTest;
+
+import com.sun.star.drawing.XShapeGroup;
+
+/**
+* Testing <code>com.sun.star.drawing.XShapeGroup</code>
+* interface methods :
+* <ul>
+* <li><code> enterGroup()</code></li>
+* <li><code> leaveGroup()</code></li>
+* </ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XShapeGroup
+*/
+public class _XShapeGroup extends MultiMethodTest {
+ public XShapeGroup oObj = null;
+
+ /**
+ * The method called.
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown.
+ */
+ public void _enterGroup() {
+ log.println("Testing enterGroup()...");
+ oObj.enterGroup();
+ tRes.tested("enterGroup()", true);
+ }
+
+ /**
+ * The method called.
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown.
+ */
+ public void _leaveGroup() {
+ log.println("Testing leaveGroup()...");
+ oObj.leaveGroup();
+ tRes.tested("leaveGroup()", true);
+ }
+
+} // end of _XShapeGroup
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XShapeGrouper.java b/qadevOOo/tests/java/ifc/drawing/_XShapeGrouper.java
new file mode 100644
index 000000000000..9831886ca7c2
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XShapeGrouper.java
@@ -0,0 +1,110 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiMethodTest;
+import lib.Status;
+import lib.StatusException;
+
+import com.sun.star.drawing.XShape;
+import com.sun.star.drawing.XShapeGroup;
+import com.sun.star.drawing.XShapeGrouper;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.uno.UnoRuntime;
+
+/**
+* Testing <code>com.sun.star.drawing.XShapeGrouper</code>
+* interface methods :
+* <ul>
+* <li><code> group()</code></li>
+* <li><code> ungroup()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'DrawPage'</code> (must implement <code>XShapes</code>):
+* the collection of shapes in a document which used to create a group.</li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XShapeGrouper
+*/
+public class _XShapeGrouper extends MultiMethodTest {
+
+ public XShapeGrouper oObj = null; // oObj filled by MultiMethodTest
+ XShape oGroup = null;
+ int countAfterGr = 0;
+ XShapes oShapes = null;
+
+ /**
+ * Retrieves draw page collection from relation and groups them. <p>
+ * Has <b> OK </b> status if the shape group returned is not null. <p>
+ */
+ public void _group() {
+ Object dp = tEnv.getObjRelation("DrawPage");
+ if (dp == null)
+ throw new StatusException(Status.failed("Relation not found")) ;
+
+ oShapes = (XShapes)UnoRuntime.queryInterface( XShapes.class, dp );
+ boolean result = false;
+ log.println("Grouping " + oShapes.getCount() + " shapes ... ");
+
+ int countBeforeGr = oShapes.getCount();
+ oGroup = oObj.group(oShapes);
+ countAfterGr = oShapes.getCount();
+ log.println("Number of shapes after grouping: " + countAfterGr);
+ result = oGroup != null ;
+ result &= countAfterGr < countBeforeGr;
+
+ tRes.tested("group()", result);
+ }
+
+ /**
+ * Ungroups the group created before. <p>
+ * Has <b> OK </b> status if the method successfully returns
+ * and no exceptions were thrown. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> group() </code> : to create a shape group </li>
+ * </ul>
+ */
+ public void _ungroup() {
+ requiredMethod("group()");
+ boolean result = false;
+ log.println("ungrouping the shape...");
+
+ oObj.ungroup((XShapeGroup)oGroup);
+ int countAfterUnGr = oShapes.getCount();
+ log.println("Number of shapes after ungrouping: " + countAfterUnGr);
+
+ result = countAfterUnGr != countAfterGr;
+
+ tRes.tested("ungroup()", result);
+ }
+}
+
+
+
diff --git a/qadevOOo/tests/java/ifc/drawing/_XShapes.java b/qadevOOo/tests/java/ifc/drawing/_XShapes.java
new file mode 100644
index 000000000000..a28833819e09
--- /dev/null
+++ b/qadevOOo/tests/java/ifc/drawing/_XShapes.java
@@ -0,0 +1,109 @@
+/*************************************************************************
+ *
+ * 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 ifc.drawing;
+
+import lib.MultiMethodTest;
+import util.XInstCreator;
+
+import com.sun.star.drawing.XShape;
+import com.sun.star.drawing.XShapes;
+import com.sun.star.uno.XInterface;
+
+
+/**
+* Testing <code>com.sun.star.drawing.XShapes</code>
+* interface methods :
+* <ul>
+* <li><code> add()</code></li>
+* <li><code> remove()</code></li>
+* </ul> <p>
+* This test needs the following object relations :
+* <ul>
+* <li> <code>'Shape'</code> (of type <code>XShape</code>):
+* a shape which can be inserted into shape collection. </li>
+* <ul> <p>
+* Test is <b> NOT </b> multithread compilant. <p>
+* @see com.sun.star.drawing.XShapes
+*/
+public class _XShapes extends MultiMethodTest {
+
+ public XShapes oObj = null; // oObj filled by MultiMethodTest
+ XInstCreator shape = null;
+ XInterface oShape = null;
+
+
+ /**
+ * Retrieves a shape from relation and adds it to the collection.
+ * Number of shapes is checked before and after adding.<p>
+ * Has <b> OK </b> status if after adding number of shapes increases by
+ * 1. <p>
+ */
+ public void _add () {
+
+ boolean result = false;
+ shape = (XInstCreator)tEnv.getObjRelation("Shape");
+ oShape = shape.createInstance();
+ XShape oSh = (XShape) oShape;
+
+ log.println("testing add() ... ");
+
+ int cntBefore = oObj.getCount();
+ oObj.add(oSh);
+ int cntAfter = oObj.getCount();
+ result = cntBefore + 1 == cntAfter ;
+
+ tRes.tested("add()", result);
+ }
+
+ /**
+ * Removes the shape added before from the collection.
+ * Number of shapes is checked before and after removing.<p>
+ * Has <b> OK </b> status if after removing number of shapes decreases by
+ * 1. <p>
+ * The following method tests are to be completed successfully before :
+ * <ul>
+ * <li> <code> add() </code> : a shape added. </li>
+ * </ul>
+ */
+ public void _remove () {
+ requiredMethod("add()");
+ boolean result = false;
+
+ log.println("removing the shape...");
+
+ int cntBefore = oObj.getCount();
+ oObj.remove((XShape) oShape);
+ int cntAfter = oObj.getCount();
+ result = cntBefore == cntAfter + 1;
+
+ tRes.tested("remove()", result);
+ }
+
+}
+
+