From 267c6f2ac71f92999e969232431ba04678e7437e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 07:54:39 +0200 Subject: Adding upstream version 4:24.2.0. Signed-off-by: Daniel Baumann --- qadevOOo/tests/java/mod/_sch/AccArea.java | 101 ++++++ qadevOOo/tests/java/mod/_sch/AccAxis.java | 99 ++++++ qadevOOo/tests/java/mod/_sch/AccDataPoint.java | 100 ++++++ qadevOOo/tests/java/mod/_sch/AccDataSeries.java | 100 ++++++ qadevOOo/tests/java/mod/_sch/AccDiagram.java | 100 ++++++ qadevOOo/tests/java/mod/_sch/AccFloor.java | 106 ++++++ qadevOOo/tests/java/mod/_sch/AccGrid.java | 101 ++++++ qadevOOo/tests/java/mod/_sch/AccLegend.java | 99 ++++++ qadevOOo/tests/java/mod/_sch/AccLegendEntry.java | 99 ++++++ qadevOOo/tests/java/mod/_sch/AccTitle.java | 99 ++++++ qadevOOo/tests/java/mod/_sch/AccWall.java | 105 ++++++ .../java/mod/_sch/AccessibleDocumentView.java | 112 +++++++ qadevOOo/tests/java/mod/_sch/ChXChartAxis.java | 113 +++++++ qadevOOo/tests/java/mod/_sch/ChXChartData.java | 88 +++++ .../tests/java/mod/_sch/ChXChartDataArray.java | 91 +++++ qadevOOo/tests/java/mod/_sch/ChXChartDocument.java | 156 +++++++++ qadevOOo/tests/java/mod/_sch/ChXChartView.java | 127 +++++++ qadevOOo/tests/java/mod/_sch/ChXDataPoint.java | 140 ++++++++ qadevOOo/tests/java/mod/_sch/ChXDataRow.java | 147 +++++++++ qadevOOo/tests/java/mod/_sch/ChXDiagram.java | 367 +++++++++++++++++++++ qadevOOo/tests/java/mod/_sch/ChartArea.java | 106 ++++++ qadevOOo/tests/java/mod/_sch/ChartGrid.java | 105 ++++++ qadevOOo/tests/java/mod/_sch/ChartLegend.java | 126 +++++++ qadevOOo/tests/java/mod/_sch/ChartLine.java | 112 +++++++ qadevOOo/tests/java/mod/_sch/ChartTitle.java | 105 ++++++ 25 files changed, 3004 insertions(+) create mode 100644 qadevOOo/tests/java/mod/_sch/AccArea.java create mode 100644 qadevOOo/tests/java/mod/_sch/AccAxis.java create mode 100644 qadevOOo/tests/java/mod/_sch/AccDataPoint.java create mode 100644 qadevOOo/tests/java/mod/_sch/AccDataSeries.java create mode 100644 qadevOOo/tests/java/mod/_sch/AccDiagram.java create mode 100644 qadevOOo/tests/java/mod/_sch/AccFloor.java create mode 100644 qadevOOo/tests/java/mod/_sch/AccGrid.java create mode 100644 qadevOOo/tests/java/mod/_sch/AccLegend.java create mode 100644 qadevOOo/tests/java/mod/_sch/AccLegendEntry.java create mode 100644 qadevOOo/tests/java/mod/_sch/AccTitle.java create mode 100644 qadevOOo/tests/java/mod/_sch/AccWall.java create mode 100644 qadevOOo/tests/java/mod/_sch/AccessibleDocumentView.java create mode 100644 qadevOOo/tests/java/mod/_sch/ChXChartAxis.java create mode 100644 qadevOOo/tests/java/mod/_sch/ChXChartData.java create mode 100644 qadevOOo/tests/java/mod/_sch/ChXChartDataArray.java create mode 100644 qadevOOo/tests/java/mod/_sch/ChXChartDocument.java create mode 100644 qadevOOo/tests/java/mod/_sch/ChXChartView.java create mode 100644 qadevOOo/tests/java/mod/_sch/ChXDataPoint.java create mode 100644 qadevOOo/tests/java/mod/_sch/ChXDataRow.java create mode 100644 qadevOOo/tests/java/mod/_sch/ChXDiagram.java create mode 100644 qadevOOo/tests/java/mod/_sch/ChartArea.java create mode 100644 qadevOOo/tests/java/mod/_sch/ChartGrid.java create mode 100644 qadevOOo/tests/java/mod/_sch/ChartLegend.java create mode 100644 qadevOOo/tests/java/mod/_sch/ChartLine.java create mode 100644 qadevOOo/tests/java/mod/_sch/ChartTitle.java (limited to 'qadevOOo/tests/java/mod/_sch') diff --git a/qadevOOo/tests/java/mod/_sch/AccArea.java b/qadevOOo/tests/java/mod/_sch/AccArea.java new file mode 100644 index 0000000000..19cf04550b --- /dev/null +++ b/qadevOOo/tests/java/mod/_sch/AccArea.java @@ -0,0 +1,101 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +package mod._sch; + +import java.io.PrintWriter; + +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.AccessibilityTools; +import util.SOfficeFactory; +import util.utils; + +import com.sun.star.accessibility.AccessibleRole; +import com.sun.star.accessibility.XAccessible; +import com.sun.star.accessibility.XAccessibleComponent; +import com.sun.star.accessibility.XAccessibleContext; +import com.sun.star.awt.XWindow; +import com.sun.star.chart.XChartDocument; +import com.sun.star.frame.XModel; +import com.sun.star.uno.UnoRuntime; +import com.sun.star.uno.XInterface; + +public class AccArea extends TestCase { + + XChartDocument xChartDoc = null; + + @Override + protected TestEnvironment createTestEnvironment( + TestParameters Param, PrintWriter log) throws Exception { + + if (xChartDoc != null) cleanup(Param, log); + log.println( "creating a chart document" ); + SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF()); + log.println( "creating a chartdocument" ); + xChartDoc = SOF.createChartDoc(); + + XInterface oObj = null; + + XModel aModel = UnoRuntime.queryInterface(XModel.class, xChartDoc); + + XWindow xWindow = AccessibilityTools.getCurrentWindow(aModel); + XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); + + AccessibilityTools.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE)); + + XAccessibleContext cont = AccessibilityTools.getAccessibleObjectForRole( + xRoot, AccessibleRole.SHAPE, "", "AccArea"); + + + oObj = cont; + + log.println("ImplementationName " + utils.getImplName(oObj)); + log.println("AccessibleName " + cont.getAccessibleName()); + + TestEnvironment tEnv = new TestEnvironment(oObj); + + final XAccessibleComponent acc = UnoRuntime.queryInterface( + XAccessibleComponent.class,oObj); + tEnv.addObjRelation("EventProducer", + new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { + public void fireEvent() { + acc.grabFocus(); + } + }); + + return tEnv; + + } + + /** + * Called while disposing a TestEnvironment. + * Disposes text document. + * @param Param test parameters + * @param log writer to log information while testing + */ + @Override + protected void cleanup( TestParameters Param, PrintWriter log) { + if( xChartDoc!=null ) { + log.println( " closing xChartDoc" ); + util.DesktopTools.closeDoc(xChartDoc); + xChartDoc = null; + } + } + +} diff --git a/qadevOOo/tests/java/mod/_sch/AccAxis.java b/qadevOOo/tests/java/mod/_sch/AccAxis.java new file mode 100644 index 0000000000..8b3eb65c43 --- /dev/null +++ b/qadevOOo/tests/java/mod/_sch/AccAxis.java @@ -0,0 +1,99 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +package mod._sch; + +import java.io.PrintWriter; + +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.AccessibilityTools; +import util.SOfficeFactory; +import util.utils; + +import com.sun.star.accessibility.AccessibleRole; +import com.sun.star.accessibility.XAccessible; +import com.sun.star.accessibility.XAccessibleComponent; +import com.sun.star.accessibility.XAccessibleContext; +import com.sun.star.awt.XWindow; +import com.sun.star.chart.XChartDocument; +import com.sun.star.frame.XModel; +import com.sun.star.uno.UnoRuntime; +import com.sun.star.uno.XInterface; + +public class AccAxis extends TestCase { + + XChartDocument xChartDoc = null; + + @Override + protected TestEnvironment createTestEnvironment( + TestParameters Param, PrintWriter log) throws Exception { + + if (xChartDoc != null) cleanup(Param, log); + log.println( "creating a chart document" ); + SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF()); + log.println( "creating a chartdocument" ); + xChartDoc = SOF.createChartDoc(); + + XInterface oObj = null; + + XModel aModel = UnoRuntime.queryInterface(XModel.class, xChartDoc); + + XWindow xWindow = AccessibilityTools.getCurrentWindow(aModel); + XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); + + XAccessibleContext cont = AccessibilityTools.getAccessibleObjectForRole( + xRoot, AccessibleRole.SHAPE, "", "AccAxis"); + + + oObj = cont; + + log.println("ImplementationName " + utils.getImplName(oObj)); + log.println("AccessibleName " + cont.getAccessibleName()); + + TestEnvironment tEnv = new TestEnvironment(oObj); + + final XAccessibleComponent acc = UnoRuntime.queryInterface( + XAccessibleComponent.class,oObj); + tEnv.addObjRelation("EventProducer", + new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { + public void fireEvent() { + acc.grabFocus(); + } + }); + + return tEnv; + + } + + /** + * Called while disposing a TestEnvironment. + * Disposes text document. + * @param Param test parameters + * @param log writer to log information while testing + */ + @Override + protected void cleanup( TestParameters Param, PrintWriter log) { + if( xChartDoc!=null ) { + log.println( " closing xChartDoc" ); + util.DesktopTools.closeDoc(xChartDoc); + xChartDoc = null; + } + } + +} diff --git a/qadevOOo/tests/java/mod/_sch/AccDataPoint.java b/qadevOOo/tests/java/mod/_sch/AccDataPoint.java new file mode 100644 index 0000000000..b5ce67dfc4 --- /dev/null +++ b/qadevOOo/tests/java/mod/_sch/AccDataPoint.java @@ -0,0 +1,100 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +package mod._sch; + +import java.io.PrintWriter; + +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.AccessibilityTools; +import util.SOfficeFactory; +import util.utils; + +import com.sun.star.accessibility.AccessibleRole; +import com.sun.star.accessibility.XAccessible; +import com.sun.star.accessibility.XAccessibleComponent; +import com.sun.star.accessibility.XAccessibleContext; +import com.sun.star.awt.XWindow; +import com.sun.star.chart.XChartDocument; +import com.sun.star.frame.XModel; +import com.sun.star.uno.UnoRuntime; +import com.sun.star.uno.XInterface; + +public class AccDataPoint extends TestCase { + + XChartDocument xChartDoc = null; + + @Override + protected TestEnvironment createTestEnvironment( + TestParameters Param, PrintWriter log) throws Exception { + + if (xChartDoc != null) cleanup(Param, log); + log.println( "creating a chart document" ); + SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF()); + log.println( "creating a chartdocument" ); + xChartDoc = SOF.createChartDoc(); + + XInterface oObj = null; + + XModel aModel = UnoRuntime.queryInterface(XModel.class, xChartDoc); + + XWindow xWindow = AccessibilityTools.getCurrentWindow(aModel); + XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); + + AccessibilityTools.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE)); + + XAccessibleContext cont = AccessibilityTools.getAccessibleObjectForRole( + xRoot, AccessibleRole.SHAPE, "", "AccDataPoint"); + + oObj = cont; + + log.println("ImplementationName " + utils.getImplName(oObj)); + log.println("AccessibleName " + cont.getAccessibleName()); + + TestEnvironment tEnv = new TestEnvironment(oObj); + + final XAccessibleComponent acc = UnoRuntime.queryInterface( + XAccessibleComponent.class,oObj); + tEnv.addObjRelation("EventProducer", + new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { + public void fireEvent() { + acc.grabFocus(); + } + }); + + return tEnv; + + } + + /** + * Called while disposing a TestEnvironment. + * Disposes text document. + * @param Param test parameters + * @param log writer to log information while testing + */ + @Override + protected void cleanup( TestParameters Param, PrintWriter log) { + if( xChartDoc!=null ) { + log.println( " closing xChartDoc" ); + util.DesktopTools.closeDoc(xChartDoc); + xChartDoc = null; + } + } + +} diff --git a/qadevOOo/tests/java/mod/_sch/AccDataSeries.java b/qadevOOo/tests/java/mod/_sch/AccDataSeries.java new file mode 100644 index 0000000000..007ef7d584 --- /dev/null +++ b/qadevOOo/tests/java/mod/_sch/AccDataSeries.java @@ -0,0 +1,100 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +package mod._sch; + +import java.io.PrintWriter; + +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.AccessibilityTools; +import util.SOfficeFactory; +import util.utils; + +import com.sun.star.accessibility.AccessibleRole; +import com.sun.star.accessibility.XAccessible; +import com.sun.star.accessibility.XAccessibleComponent; +import com.sun.star.accessibility.XAccessibleContext; +import com.sun.star.awt.XWindow; +import com.sun.star.chart.XChartDocument; +import com.sun.star.frame.XModel; +import com.sun.star.uno.UnoRuntime; +import com.sun.star.uno.XInterface; + +public class AccDataSeries extends TestCase { + + XChartDocument xChartDoc = null; + + @Override + protected TestEnvironment createTestEnvironment( + TestParameters Param, PrintWriter log) throws Exception { + + if (xChartDoc != null) cleanup(Param, log); + log.println( "creating a chart document" ); + SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF()); + log.println( "creating a chartdocument" ); + xChartDoc = SOF.createChartDoc(); + + XInterface oObj = null; + + XModel aModel = UnoRuntime.queryInterface(XModel.class, xChartDoc); + + XWindow xWindow = AccessibilityTools.getCurrentWindow(aModel); + XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); + + AccessibilityTools.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE)); + + XAccessibleContext cont = AccessibilityTools.getAccessibleObjectForRole( + xRoot, AccessibleRole.SHAPE, "", "AccDataSeries"); + + oObj = cont; + + log.println("ImplementationName " + utils.getImplName(oObj)); + log.println("AccessibleName " + cont.getAccessibleName()); + + TestEnvironment tEnv = new TestEnvironment(oObj); + + final XAccessibleComponent acc = UnoRuntime.queryInterface( + XAccessibleComponent.class,oObj); + tEnv.addObjRelation("EventProducer", + new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { + public void fireEvent() { + acc.grabFocus(); + } + }); + + return tEnv; + + } + + /** + * Called while disposing a TestEnvironment. + * Disposes text document. + * @param Param test parameters + * @param log writer to log information while testing + */ + @Override + protected void cleanup( TestParameters Param, PrintWriter log) { + if( xChartDoc!=null ) { + log.println( " closing xChartDoc" ); + util.DesktopTools.closeDoc(xChartDoc); + xChartDoc = null; + } + } + +} diff --git a/qadevOOo/tests/java/mod/_sch/AccDiagram.java b/qadevOOo/tests/java/mod/_sch/AccDiagram.java new file mode 100644 index 0000000000..55593914ce --- /dev/null +++ b/qadevOOo/tests/java/mod/_sch/AccDiagram.java @@ -0,0 +1,100 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +package mod._sch; + +import java.io.PrintWriter; + +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.AccessibilityTools; +import util.SOfficeFactory; +import util.utils; + +import com.sun.star.accessibility.AccessibleRole; +import com.sun.star.accessibility.XAccessible; +import com.sun.star.accessibility.XAccessibleComponent; +import com.sun.star.accessibility.XAccessibleContext; +import com.sun.star.awt.XWindow; +import com.sun.star.chart.XChartDocument; +import com.sun.star.frame.XModel; +import com.sun.star.uno.UnoRuntime; +import com.sun.star.uno.XInterface; + +public class AccDiagram extends TestCase { + + XChartDocument xChartDoc = null; + + @Override + protected TestEnvironment createTestEnvironment( + TestParameters Param, PrintWriter log) throws Exception { + + if (xChartDoc != null) cleanup(Param, log); + log.println( "creating a chart document" ); + SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF()); + log.println( "creating a chartdocument" ); + xChartDoc = SOF.createChartDoc(); + + XInterface oObj = null; + + XModel aModel = UnoRuntime.queryInterface(XModel.class, xChartDoc); + + XWindow xWindow = AccessibilityTools.getCurrentWindow(aModel); + XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); + + AccessibilityTools.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE)); + + XAccessibleContext cont = AccessibilityTools.getAccessibleObjectForRole( + xRoot, AccessibleRole.SHAPE, "", "AccDiagram"); + + oObj = cont; + + log.println("ImplementationName " + utils.getImplName(oObj)); + log.println("AccessibleName " + cont.getAccessibleName()); + + TestEnvironment tEnv = new TestEnvironment(oObj); + + final XAccessibleComponent acc = UnoRuntime.queryInterface( + XAccessibleComponent.class,oObj); + tEnv.addObjRelation("EventProducer", + new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { + public void fireEvent() { + acc.grabFocus(); + } + }); + + return tEnv; + + } + + /** + * Called while disposing a TestEnvironment. + * Disposes text document. + * @param Param test parameters + * @param log writer to log information while testing + */ + @Override + protected void cleanup( TestParameters Param, PrintWriter log) { + if( xChartDoc!=null ) { + log.println( " closing xChartDoc" ); + util.DesktopTools.closeDoc(xChartDoc); + xChartDoc = null; + } + } + +} diff --git a/qadevOOo/tests/java/mod/_sch/AccFloor.java b/qadevOOo/tests/java/mod/_sch/AccFloor.java new file mode 100644 index 0000000000..3d5426faba --- /dev/null +++ b/qadevOOo/tests/java/mod/_sch/AccFloor.java @@ -0,0 +1,106 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +package mod._sch; + +import java.io.PrintWriter; + +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.AccessibilityTools; +import util.SOfficeFactory; +import util.utils; + +import com.sun.star.accessibility.AccessibleRole; +import com.sun.star.accessibility.XAccessible; +import com.sun.star.accessibility.XAccessibleComponent; +import com.sun.star.accessibility.XAccessibleContext; +import com.sun.star.awt.XWindow; +import com.sun.star.beans.XPropertySet; +import com.sun.star.chart.XChartDocument; +import com.sun.star.frame.XModel; +import com.sun.star.uno.UnoRuntime; +import com.sun.star.uno.XInterface; + +public class AccFloor extends TestCase { + + XChartDocument xChartDoc = null; + + @Override + protected TestEnvironment createTestEnvironment( + TestParameters Param, PrintWriter log) throws Exception { + + if (xChartDoc != null) cleanup(Param, log); + log.println( "creating a chart document" ); + SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF()); + log.println( "creating a chartdocument" ); + xChartDoc = SOF.createChartDoc(); + + log.println("Change Diagram to 3D"); + XPropertySet ChartProps = UnoRuntime.queryInterface( XPropertySet.class, xChartDoc.getDiagram() ); + ChartProps.setPropertyValue("Dim3D", Boolean.TRUE); + + XInterface oObj = null; + + XModel aModel = UnoRuntime.queryInterface(XModel.class, xChartDoc); + + XWindow xWindow = AccessibilityTools.getCurrentWindow(aModel); + XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); + + AccessibilityTools.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE)); + + XAccessibleContext cont = AccessibilityTools.getAccessibleObjectForRole( + xRoot, AccessibleRole.SHAPE, "", "AccFloor"); + + + oObj = cont; + + log.println("ImplementationName " + utils.getImplName(oObj)); + log.println("AccessibleName " + cont.getAccessibleName()); + + TestEnvironment tEnv = new TestEnvironment(oObj); + + final XAccessibleComponent acc = UnoRuntime.queryInterface( + XAccessibleComponent.class,oObj); + tEnv.addObjRelation("EventProducer", + new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { + public void fireEvent() { + acc.grabFocus(); + } + }); + + return tEnv; + + } + + /** + * Called while disposing a TestEnvironment. + * Disposes text document. + * @param Param test parameters + * @param log writer to log information while testing + */ + @Override + protected void cleanup( TestParameters Param, PrintWriter log) { + if( xChartDoc!=null ) { + log.println( " closing xChartDoc" ); + util.DesktopTools.closeDoc(xChartDoc); + xChartDoc = null; + } + } + +} diff --git a/qadevOOo/tests/java/mod/_sch/AccGrid.java b/qadevOOo/tests/java/mod/_sch/AccGrid.java new file mode 100644 index 0000000000..c0d6e6c207 --- /dev/null +++ b/qadevOOo/tests/java/mod/_sch/AccGrid.java @@ -0,0 +1,101 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +package mod._sch; + +import java.io.PrintWriter; + +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.AccessibilityTools; +import util.SOfficeFactory; +import util.utils; + +import com.sun.star.accessibility.AccessibleRole; +import com.sun.star.accessibility.XAccessible; +import com.sun.star.accessibility.XAccessibleComponent; +import com.sun.star.accessibility.XAccessibleContext; +import com.sun.star.awt.XWindow; +import com.sun.star.chart.XChartDocument; +import com.sun.star.frame.XModel; +import com.sun.star.uno.UnoRuntime; +import com.sun.star.uno.XInterface; + +public class AccGrid extends TestCase { + + XChartDocument xChartDoc = null; + + @Override + protected TestEnvironment createTestEnvironment( + TestParameters Param, PrintWriter log) throws Exception { + + if (xChartDoc != null) cleanup(Param, log); + log.println( "creating a chart document" ); + SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF()); + log.println( "creating a chartdocument" ); + xChartDoc = SOF.createChartDoc(); + + XInterface oObj = null; + + XModel aModel = UnoRuntime.queryInterface(XModel.class, xChartDoc); + + XWindow xWindow = AccessibilityTools.getCurrentWindow(aModel); + XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); + + AccessibilityTools.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE)); + + XAccessibleContext cont = AccessibilityTools.getAccessibleObjectForRole( + xRoot, AccessibleRole.SHAPE, "", "AccGrid"); + + + oObj = cont; + + log.println("ImplementationName " + utils.getImplName(oObj)); + log.println("AccessibleName " + cont.getAccessibleName()); + + TestEnvironment tEnv = new TestEnvironment(oObj); + + final XAccessibleComponent acc = UnoRuntime.queryInterface( + XAccessibleComponent.class,oObj); + tEnv.addObjRelation("EventProducer", + new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { + public void fireEvent() { + acc.grabFocus(); + } + }); + + return tEnv; + + } + + /** + * Called while disposing a TestEnvironment. + * Disposes text document. + * @param Param test parameters + * @param log writer to log information while testing + */ + @Override + protected void cleanup( TestParameters Param, PrintWriter log) { + if( xChartDoc!=null ) { + log.println( " closing xChartDoc" ); + util.DesktopTools.closeDoc(xChartDoc); + xChartDoc = null; + } + } + +} diff --git a/qadevOOo/tests/java/mod/_sch/AccLegend.java b/qadevOOo/tests/java/mod/_sch/AccLegend.java new file mode 100644 index 0000000000..5cda48c80a --- /dev/null +++ b/qadevOOo/tests/java/mod/_sch/AccLegend.java @@ -0,0 +1,99 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +package mod._sch; + +import java.io.PrintWriter; + +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.AccessibilityTools; +import util.SOfficeFactory; +import util.utils; + +import com.sun.star.accessibility.AccessibleRole; +import com.sun.star.accessibility.XAccessible; +import com.sun.star.accessibility.XAccessibleComponent; +import com.sun.star.accessibility.XAccessibleContext; +import com.sun.star.awt.XWindow; +import com.sun.star.chart.XChartDocument; +import com.sun.star.frame.XModel; +import com.sun.star.uno.UnoRuntime; +import com.sun.star.uno.XInterface; + +public class AccLegend extends TestCase { + + XChartDocument xChartDoc = null; + + @Override + protected TestEnvironment createTestEnvironment( + TestParameters Param, PrintWriter log) throws Exception { + + if (xChartDoc != null) cleanup(Param, log); + log.println( "creating a chart document" ); + SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF()); + log.println( "creating a chartdocument" ); + xChartDoc = SOF.createChartDoc(); + + XInterface oObj = null; + + XModel aModel = UnoRuntime.queryInterface(XModel.class, xChartDoc); + + XWindow xWindow = AccessibilityTools.getCurrentWindow(aModel); + XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); + + XAccessibleContext cont = AccessibilityTools.getAccessibleObjectForRole( + xRoot, AccessibleRole.SHAPE, "", "AccLegend"); + + + oObj = cont; + + log.println("ImplementationName " + utils.getImplName(oObj)); + log.println("AccessibleName " + cont.getAccessibleName()); + + TestEnvironment tEnv = new TestEnvironment(oObj); + + final XAccessibleComponent acc = UnoRuntime.queryInterface( + XAccessibleComponent.class,oObj); + tEnv.addObjRelation("EventProducer", + new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { + public void fireEvent() { + acc.grabFocus(); + } + }); + + return tEnv; + + } + + /** + * Called while disposing a TestEnvironment. + * Disposes text document. + * @param Param test parameters + * @param log writer to log information while testing + */ + @Override + protected void cleanup( TestParameters Param, PrintWriter log) { + if( xChartDoc!=null ) { + log.println( " closing xChartDoc" ); + util.DesktopTools.closeDoc(xChartDoc); + xChartDoc = null; + } + } + +} diff --git a/qadevOOo/tests/java/mod/_sch/AccLegendEntry.java b/qadevOOo/tests/java/mod/_sch/AccLegendEntry.java new file mode 100644 index 0000000000..28635af5cc --- /dev/null +++ b/qadevOOo/tests/java/mod/_sch/AccLegendEntry.java @@ -0,0 +1,99 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +package mod._sch; + +import java.io.PrintWriter; + +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.AccessibilityTools; +import util.SOfficeFactory; +import util.utils; + +import com.sun.star.accessibility.AccessibleRole; +import com.sun.star.accessibility.XAccessible; +import com.sun.star.accessibility.XAccessibleComponent; +import com.sun.star.accessibility.XAccessibleContext; +import com.sun.star.awt.XWindow; +import com.sun.star.chart.XChartDocument; +import com.sun.star.frame.XModel; +import com.sun.star.uno.UnoRuntime; +import com.sun.star.uno.XInterface; + +public class AccLegendEntry extends TestCase { + + XChartDocument xChartDoc = null; + + @Override + protected TestEnvironment createTestEnvironment( + TestParameters Param, PrintWriter log) throws Exception { + + if (xChartDoc != null) cleanup(Param, log); + log.println( "creating a chart document" ); + SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF()); + log.println( "creating a chartdocument" ); + xChartDoc = SOF.createChartDoc(); + + XInterface oObj = null; + + XModel aModel = UnoRuntime.queryInterface(XModel.class, xChartDoc); + + XWindow xWindow = AccessibilityTools.getCurrentWindow(aModel); + XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); + + XAccessibleContext cont = AccessibilityTools.getAccessibleObjectForRole( + xRoot, AccessibleRole.SHAPE, "", "AccLegendEntry"); + + + oObj = cont; + + log.println("ImplementationName " + utils.getImplName(oObj)); + log.println("AccessibleName " + cont.getAccessibleName()); + + TestEnvironment tEnv = new TestEnvironment(oObj); + + final XAccessibleComponent acc = UnoRuntime.queryInterface( + XAccessibleComponent.class,oObj); + tEnv.addObjRelation("EventProducer", + new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { + public void fireEvent() { + acc.grabFocus(); + } + }); + + return tEnv; + + } + + /** + * Called while disposing a TestEnvironment. + * Disposes text document. + * @param Param test parameters + * @param log writer to log information while testing + */ + @Override + protected void cleanup( TestParameters Param, PrintWriter log) { + if( xChartDoc!=null ) { + log.println( " closing xChartDoc" ); + util.DesktopTools.closeDoc(xChartDoc); + xChartDoc = null; + } + } + +} diff --git a/qadevOOo/tests/java/mod/_sch/AccTitle.java b/qadevOOo/tests/java/mod/_sch/AccTitle.java new file mode 100644 index 0000000000..27486a00ef --- /dev/null +++ b/qadevOOo/tests/java/mod/_sch/AccTitle.java @@ -0,0 +1,99 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +package mod._sch; + +import java.io.PrintWriter; + +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.AccessibilityTools; +import util.SOfficeFactory; +import util.utils; + +import com.sun.star.accessibility.AccessibleRole; +import com.sun.star.accessibility.XAccessible; +import com.sun.star.accessibility.XAccessibleComponent; +import com.sun.star.accessibility.XAccessibleContext; +import com.sun.star.awt.XWindow; +import com.sun.star.chart.XChartDocument; +import com.sun.star.frame.XModel; +import com.sun.star.uno.UnoRuntime; +import com.sun.star.uno.XInterface; + +public class AccTitle extends TestCase { + + XChartDocument xChartDoc = null; + + @Override + protected TestEnvironment createTestEnvironment( + TestParameters Param, PrintWriter log) throws Exception { + + if (xChartDoc != null) cleanup(Param, log); + log.println( "creating a chart document" ); + SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF()); + log.println( "creating a chartdocument" ); + xChartDoc = SOF.createChartDoc(); + + XInterface oObj = null; + + XModel aModel = UnoRuntime.queryInterface(XModel.class, xChartDoc); + + XWindow xWindow = AccessibilityTools.getCurrentWindow(aModel); + XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); + + XAccessibleContext cont = AccessibilityTools.getAccessibleObjectForRole( + xRoot, AccessibleRole.SHAPE, "", "AccTitle"); + + + oObj = cont; + + log.println("ImplementationName " + utils.getImplName(oObj)); + log.println("AccessibleName " + cont.getAccessibleName()); + + TestEnvironment tEnv = new TestEnvironment(oObj); + + final XAccessibleComponent acc = UnoRuntime.queryInterface( + XAccessibleComponent.class,oObj); + tEnv.addObjRelation("EventProducer", + new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { + public void fireEvent() { + acc.grabFocus(); + } + }); + + return tEnv; + + } + + /** + * Called while disposing a TestEnvironment. + * Disposes text document. + * @param Param test parameters + * @param log writer to log information while testing + */ + @Override + protected void cleanup( TestParameters Param, PrintWriter log) { + if( xChartDoc!=null ) { + log.println( " closing xChartDoc" ); + util.DesktopTools.closeDoc(xChartDoc); + xChartDoc = null; + } + } + +} diff --git a/qadevOOo/tests/java/mod/_sch/AccWall.java b/qadevOOo/tests/java/mod/_sch/AccWall.java new file mode 100644 index 0000000000..fe3f0388e1 --- /dev/null +++ b/qadevOOo/tests/java/mod/_sch/AccWall.java @@ -0,0 +1,105 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +package mod._sch; + +import java.io.PrintWriter; + +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.AccessibilityTools; +import util.SOfficeFactory; +import util.utils; + +import com.sun.star.accessibility.AccessibleRole; +import com.sun.star.accessibility.XAccessible; +import com.sun.star.accessibility.XAccessibleComponent; +import com.sun.star.accessibility.XAccessibleContext; +import com.sun.star.awt.XWindow; +import com.sun.star.beans.XPropertySet; +import com.sun.star.chart.XChartDocument; +import com.sun.star.frame.XModel; +import com.sun.star.uno.UnoRuntime; +import com.sun.star.uno.XInterface; + +public class AccWall extends TestCase { + + XChartDocument xChartDoc = null; + + @Override + protected TestEnvironment createTestEnvironment( + TestParameters Param, PrintWriter log) throws Exception { + + if (xChartDoc != null) cleanup(Param, log); + log.println( "creating a chart document" ); + SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF()); + log.println( "creating a chartdocument" ); + xChartDoc = SOF.createChartDoc(); + + log.println("Change Diagram to 3D"); + XPropertySet ChartProps = UnoRuntime.queryInterface( XPropertySet.class, xChartDoc.getDiagram() ); + ChartProps.setPropertyValue("Dim3D", Boolean.TRUE); + + XInterface oObj = null; + + XModel aModel = UnoRuntime.queryInterface(XModel.class, xChartDoc); + + XWindow xWindow = AccessibilityTools.getCurrentWindow(aModel); + XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); + + AccessibilityTools.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE)); + + XAccessibleContext cont = AccessibilityTools.getAccessibleObjectForRole( + xRoot, AccessibleRole.SHAPE, "", "AccWall"); + + oObj = cont; + + log.println("ImplementationName " + utils.getImplName(oObj)); + log.println("AccessibleName " + cont.getAccessibleName()); + + TestEnvironment tEnv = new TestEnvironment(oObj); + + final XAccessibleComponent acc = UnoRuntime.queryInterface( + XAccessibleComponent.class,oObj); + tEnv.addObjRelation("EventProducer", + new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { + public void fireEvent() { + acc.grabFocus(); + } + }); + + return tEnv; + + } + + /** + * Called while disposing a TestEnvironment. + * Disposes text document. + * @param Param test parameters + * @param log writer to log information while testing + */ + @Override + protected void cleanup( TestParameters Param, PrintWriter log) { + if( xChartDoc!=null ) { + log.println( " closing xChartDoc" ); + util.DesktopTools.closeDoc(xChartDoc); + xChartDoc = null; + } + } + +} diff --git a/qadevOOo/tests/java/mod/_sch/AccessibleDocumentView.java b/qadevOOo/tests/java/mod/_sch/AccessibleDocumentView.java new file mode 100644 index 0000000000..f2217435e1 --- /dev/null +++ b/qadevOOo/tests/java/mod/_sch/AccessibleDocumentView.java @@ -0,0 +1,112 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +package mod._sch; + +import java.io.PrintWriter; + +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.AccessibilityTools; +import util.SOfficeFactory; +import util.utils; + +import com.sun.star.accessibility.AccessibleRole; +import com.sun.star.accessibility.XAccessible; +import com.sun.star.awt.PosSize; +import com.sun.star.awt.Rectangle; +import com.sun.star.awt.XWindow; +import com.sun.star.chart.XChartDocument; +import com.sun.star.frame.XModel; +import com.sun.star.uno.UnoRuntime; +import com.sun.star.uno.XInterface; + +public class AccessibleDocumentView extends TestCase { + + XChartDocument xChartDoc = null; + + @Override + protected TestEnvironment createTestEnvironment( + TestParameters Param, PrintWriter log) { + + XInterface oObj = null; + + XModel aModel = UnoRuntime.queryInterface(XModel.class, xChartDoc); + + XWindow xWindow = AccessibilityTools.getCurrentWindow(aModel); + XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); + + oObj = AccessibilityTools.getAccessibleObjectForRole(xRoot, AccessibleRole.DOCUMENT); + + if (oObj == null) { + log.println("DocumentView hasn't the role 'Document'"); + log.println("trying the role 'Shape'"); + oObj = AccessibilityTools.getAccessibleObjectForRole(xRoot, AccessibleRole.SHAPE); + } + + log.println("ImplementationName " + utils.getImplName(oObj)); + + TestEnvironment tEnv = new TestEnvironment(oObj); + + final XWindow xDocWin = xWindow; + tEnv.addObjRelation("EventProducer", + new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { + public void fireEvent() { + Rectangle rect = xDocWin.getPosSize(); + xDocWin.setPosSize(100,100,100,100,PosSize.POSSIZE); + xDocWin.setPosSize(rect.X,rect.Y,rect.Width,rect.Height, + PosSize.POSSIZE); + } + }); + + return tEnv; + + } + + /** + * Called while disposing a TestEnvironment. + * Disposes text document. + * @param Param test parameters + * @param log writer to log information while testing + */ + @Override + protected void cleanup( TestParameters Param, PrintWriter log) { + if( xChartDoc!=null ) { + log.println( " closing xChartDoc" ); + util.DesktopTools.closeDoc(xChartDoc); + xChartDoc = null; + } + } + + /** + * Called while the TestCase initialization. + * Creates a chart document. + * + * @param Param test parameters + * @param log writer to log information while testing + * + * @see #initializeTestCase + */ + @Override + protected void initialize(TestParameters Param, PrintWriter log) throws Exception { + log.println( "creating a text document" ); + SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF()); + log.println( "creating a chartdocument" ); + xChartDoc = SOF.createChartDoc(); + } +} diff --git a/qadevOOo/tests/java/mod/_sch/ChXChartAxis.java b/qadevOOo/tests/java/mod/_sch/ChXChartAxis.java new file mode 100644 index 0000000000..844d1ce9cf --- /dev/null +++ b/qadevOOo/tests/java/mod/_sch/ChXChartAxis.java @@ -0,0 +1,113 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +package mod._sch; + +import java.io.PrintWriter; + +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.SOfficeFactory; + +import com.sun.star.beans.XPropertySet; +import com.sun.star.chart.XAxisYSupplier; +import com.sun.star.chart.XChartDocument; +import com.sun.star.drawing.XShape; +import com.sun.star.uno.UnoRuntime; + +/** +* Test for object which is represented by service +* com.sun.star.chart.ChartAxis.

+* Object implements the following interfaces : +*

+* @see com.sun.star.drawing.LineProperties +* @see com.sun.star.style.CharacterProperties +* @see com.sun.star.beans.XPropertySet +* @see com.sun.star.chart.ChartAxis +* @see ifc.drawing._LineProperties +* @see ifc.style._CharacterProperties +* @see ifc.beans._XPropertySet +* @see ifc.chart._ChartAxis +*/ +public class ChXChartAxis extends TestCase { + XChartDocument xChartDoc = null; + + /** + * Creates Chart document. + */ + @Override + protected void initialize( TestParameters tParam, PrintWriter log ) throws Exception { + // get a soffice factory object + SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF()); + log.println( "creating a chartdocument" ); + xChartDoc = SOF.createChartDoc(); + } + + /** + * Disposes Chart document. + */ + @Override + protected void cleanup( TestParameters tParam, PrintWriter log ) { + if( xChartDoc!=null ) { + log.println( " closing xChartDoc" ); + util.DesktopTools.closeDoc(xChartDoc); + xChartDoc = null; + } + } + + /** + * Creating a TestEnvironment for the interfaces to be tested. + * Retrieves the diagram of the chart document. Then obtains the properties + * of the y-axis of the diagram using the interface + * XAxisYSupplier. The obatined property is the instance + * of the service com.sun.star.chart.ChartAxis. + * @see com.sun.star.chart.XAxisYSupplier + * @see com.sun.star.chart.ChartAxis + */ + @Override + protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { + + XPropertySet oObj = null; + XShape oDiagram = null; + + // create testobject here + // get the Diagram + log.println( "getting Diagram" ); + oDiagram = xChartDoc.getDiagram(); + + // get the Axis + log.println( "getting ChartAxis" ); + XAxisYSupplier oAxisSup = UnoRuntime.queryInterface(XAxisYSupplier.class,oDiagram); + oObj = oAxisSup.getYAxis(); + + log.println( "creating a new environment for chartdocument object" ); + TestEnvironment tEnv = new TestEnvironment( oObj ); + + return tEnv; + } // finish method getTestEnvironment + + + +} // finish class ChXChartAxis + diff --git a/qadevOOo/tests/java/mod/_sch/ChXChartData.java b/qadevOOo/tests/java/mod/_sch/ChXChartData.java new file mode 100644 index 0000000000..ffe9259252 --- /dev/null +++ b/qadevOOo/tests/java/mod/_sch/ChXChartData.java @@ -0,0 +1,88 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +package mod._sch; +import java.io.PrintWriter; + +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.SOfficeFactory; + +import com.sun.star.chart.XChartData; +import com.sun.star.chart.XChartDocument; + +/** +* Test for object which is represented by service +* com.sun.star.chart.ChartData.

+* Object implements the following interfaces : +*

+* @see com.sun.star.chart.ChartData +* @see com.sun.star.chart.XChartData +* @see ifc.chart._XChartData +*/ +public class ChXChartData extends TestCase { + XChartDocument xChartDoc = null; + + /** + * Creates Chart document. + */ + @Override + protected void initialize( TestParameters tParam, PrintWriter log ) throws Exception { + // get a soffice factory object + SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF()); + + log.println( "creating a chartdocument" ); + xChartDoc = SOF.createChartDoc(); + } + + /** + * Disposes Chart document. + */ + @Override + protected void cleanup( TestParameters tParam, PrintWriter log ) { + if( xChartDoc!=null ) { + log.println( " closing xChartDoc" ); + util.DesktopTools.closeDoc(xChartDoc); + xChartDoc = null; + } + } + + /** + * Creating a TestEnvironment for the interfaces to be tested. + * Retrieves the data source of the chart. This data source is the instance + * of the service com.sun.star.chart.ChartData. + * @see com.sun.star.chart.ChartData + */ + @Override + protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { + + // get the Data + log.println( "getting Data" ); + XChartData oObj = xChartDoc.getData(); + + log.println( "creating a new environment for chartdocument object" ); + TestEnvironment tEnv = new TestEnvironment( oObj ); + + return tEnv; + } // finish method getTestEnvironment + +} // finish class ChXChartData + diff --git a/qadevOOo/tests/java/mod/_sch/ChXChartDataArray.java b/qadevOOo/tests/java/mod/_sch/ChXChartDataArray.java new file mode 100644 index 0000000000..fca97a6ab6 --- /dev/null +++ b/qadevOOo/tests/java/mod/_sch/ChXChartDataArray.java @@ -0,0 +1,91 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +package mod._sch; +import java.io.PrintWriter; + +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.SOfficeFactory; + +import com.sun.star.chart.XChartData; +import com.sun.star.chart.XChartDocument; + +/** +* Test for object which is represented by service +* com.sun.star.chart.ChartDataArray.

+* Object implements the following interfaces : +*

+* @see com.sun.star.chart.ChartDataArray +* @see com.sun.star.chart.XChartData +* @see com.sun.star.chart.XChartDataArray +* @see ifc.chart._XChartData +* @see ifc.chart._XChartDataArray +*/ +public class ChXChartDataArray extends TestCase { + XChartDocument xChartDoc = null; + + /** + * Creates Chart document. + */ + @Override + protected void initialize( TestParameters tParam, PrintWriter log ) throws Exception { + // get a soffice factory object + SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF()); + log.println( "creating a chartdocument" ); + xChartDoc = SOF.createChartDoc(); + } + + /** + * Disposes Chart document. + */ + @Override + protected void cleanup( TestParameters tParam, PrintWriter log ) { + if( xChartDoc!=null ) { + log.println( " closing xChartDoc" ); + util.DesktopTools.closeDoc(xChartDoc); + xChartDoc = null; + } + } + + /** + * Creating a TestEnvironment for the interfaces to be tested. + * Retrieves the data source of the chart. This data source is the instance + * of the service com.sun.star.chart.ChartDataArray. + * com.sun.star.chart.ChartDataArray. + * @see com.sun.star.chart.ChartDataArray + */ + @Override + protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { + + // get the Data + log.println( "getting Data" ); + XChartData oObj = xChartDoc.getData(); + + log.println( "creating a new environment for chartdocument object" ); + TestEnvironment tEnv = new TestEnvironment( oObj ); + + return tEnv; + } // finish method getTestEnvironment + +} // finish class ChXChartDataArray + diff --git a/qadevOOo/tests/java/mod/_sch/ChXChartDocument.java b/qadevOOo/tests/java/mod/_sch/ChXChartDocument.java new file mode 100644 index 0000000000..91388fd923 --- /dev/null +++ b/qadevOOo/tests/java/mod/_sch/ChXChartDocument.java @@ -0,0 +1,156 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +package mod._sch; + +import com.sun.star.chart.XChartData; +import com.sun.star.chart.XChartDocument; +import com.sun.star.frame.XController; +import com.sun.star.uno.UnoRuntime; +import com.sun.star.uno.XInterface; +import com.sun.star.view.XSelectionSupplier; + +import java.io.PrintWriter; + +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.SOfficeFactory; + + +/** +* Test for object which is represented by service +* com.sun.star.chart.ChartDocument.

+* Object implements the following interfaces : +*

+* @see com.sun.star.lang.XComponent +* @see com.sun.star.frame.XModel +* @see com.sun.star.chart.XChartDocument +* @see com.sun.star.beans.XPropertySet +* @see com.sun.star.chart.ChartTableAddressSupplier +* @see com.sun.star.chart.ChartDocument +* @see ifc.lang._XComponent +* @see ifc.frame._XModel +* @see ifc.chart._XChartDocument +* @see ifc.beans._XPropertySet +* @see ifc.chart._ChartTableAddressSupplier +* @see ifc.chart._ChartDocument +*/ +public class ChXChartDocument extends TestCase { + XChartDocument xChartDoc = null; + XChartDocument doc2 = null; + + /** + * Disposes Chart documents. + */ + @Override + protected void cleanup(TestParameters Param, PrintWriter log) { + if( xChartDoc!=null ) { + log.println( " closing xChartDoc" ); + util.DesktopTools.closeDoc(xChartDoc); + xChartDoc = null; + } + if( doc2!=null ) { + log.println( " closing xChartDoc2" ); + util.DesktopTools.closeDoc(doc2); + doc2 = null; + } + } + + /** + * Creating a TestEnvironment for the interfaces to be tested. + * Creates two chart documents and retrieves current controllers from them + * using the interface XChartDocument. The created documents + * is the instances of the service com.sun.star.chart.ChartDocument. + * Obtains the data source of the second created chart and creates + * a pie diagram. + * Object relations created : + * + * @see com.sun.star.chart.XChartData + * @see com.sun.star.chart.ChartDocument + */ + @Override + protected TestEnvironment createTestEnvironment(TestParameters tParam, + PrintWriter log) throws Exception { + // get a soffice factory object + SOfficeFactory SOF = SOfficeFactory.getFactory( + tParam.getMSF()); + + log.println("creating a chartdocument"); + xChartDoc = SOF.createChartDoc(); + log.println("Waiting before opening second document"); + doc2 = SOF.createChartDoc(); + + + // get the chartdocument + log.println("getting ChartDocument"); + + XInterface oObj = xChartDoc; + + XController cont1 = xChartDoc.getCurrentController(); + XController cont2 = doc2.getCurrentController(); + + cont1.getFrame().setName("cont1"); + cont2.getFrame().setName("cont2"); + + XSelectionSupplier sel = UnoRuntime.queryInterface( + XSelectionSupplier.class, cont1); + + log.println("creating a new environment for chartdocument object"); + + TestEnvironment tEnv = new TestEnvironment(oObj); + + log.println("Adding SelectionSupplier and Shape to select for XModel"); + tEnv.addObjRelation("SELSUPP", sel); + tEnv.addObjRelation("TOSELECT", xChartDoc.getTitle()); + + log.println("adding Controller as ObjRelation for XModel"); + tEnv.addObjRelation("CONT2", cont2); + + log.println("adding another Diagram as mod relation to environment"); + tEnv.addObjRelation("DIAGRAM", + SOF.createDiagram(xChartDoc, "PieDiagram")); + + log.println("adding another ChartData as mod relation to environment"); + + XChartData ChartData = doc2.getData(); + tEnv.addObjRelation("CHARTDATA", ChartData); + + return tEnv; + } // finish method getTestEnvironment +} // finish class ChXChartDocument diff --git a/qadevOOo/tests/java/mod/_sch/ChXChartView.java b/qadevOOo/tests/java/mod/_sch/ChXChartView.java new file mode 100644 index 0000000000..89873574de --- /dev/null +++ b/qadevOOo/tests/java/mod/_sch/ChXChartView.java @@ -0,0 +1,127 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +package mod._sch; + +import java.io.PrintWriter; +import java.util.Comparator; + +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.SOfficeFactory; + +import com.sun.star.chart.XChartDocument; +import com.sun.star.drawing.XShapeDescriptor; +import com.sun.star.frame.XController; +import com.sun.star.frame.XModel; +import com.sun.star.uno.UnoRuntime; + +/** +* Test for object which is represented by service +* com.sun.star.view.OfficeDocumentView.

+* Object implements the following interfaces : +*

+* @see com.sun.star.view.OfficeDocumentView +* @see com.sun.star.view.XViewSettingsSupplier +* @see com.sun.star.view.XControlAccess +* @see com.sun.star.view.XSelectionSupplier +* @see ifc.view._XViewSettingsSupplier +* @see ifc.view._XControlAccess +* @see ifc.view._XSelectionSupplier +*/ +public class ChXChartView extends TestCase { + XChartDocument xChartDoc = null; + + /** + * Creates Chart document. + */ + @Override + protected void initialize( TestParameters tParam, PrintWriter log ) throws Exception { + // get a soffice factory object + SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF()); + log.println( "creating a chartdocument" ); + xChartDoc = SOF.createChartDoc(); + } + + /** + * Disposes Chart document. + */ + @Override + protected void cleanup( TestParameters tParam, PrintWriter log ) { + if( xChartDoc!=null ) { + log.println( " closing xChartDoc" ); + util.DesktopTools.closeDoc(xChartDoc); + xChartDoc = null; + } + } + + /** + * Creating a TestEnvironment for the interfaces to be tested. + * Retrieves the current controller of the chart document using + * the interface XModel.The retrieved controller is the instance + * of the service com.sun.star.view.OfficeDocumentView. + * Obtains the main title and the legend of the chart document. + * Object relations created : + * + * @see com.sun.star.frame.XModel + */ + @Override + protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { + + XController oObj = null; + XModel oModel = null; + + // get the ChartView + log.println( "getting ChartView" ); + oModel = UnoRuntime.queryInterface(XModel.class, xChartDoc); + oObj = oModel.getCurrentController(); + + log.println( "creating a new environment for chartdocument object" ); + TestEnvironment tEnv = new TestEnvironment( oObj ); + + tEnv.addObjRelation("Selections", new Object[] + {xChartDoc.getArea(), xChartDoc.getDiagram(), xChartDoc.getTitle(), + xChartDoc.getLegend()} ); + + tEnv.addObjRelation("Comparer", new Comparator() { + public int compare(Object o1, Object o2) { + XShapeDescriptor descr1 = UnoRuntime.queryInterface(XShapeDescriptor.class, o1); + XShapeDescriptor descr2 = UnoRuntime.queryInterface(XShapeDescriptor.class, o2); + if (descr1 == null || descr2 == null) { + return -1; + } + if (descr1.getShapeType().equals(descr2.getShapeType())) { + return 0; + } + return 1; + } + } ); + + return tEnv; + } // finish method getTestEnvironment + + +} // finish class ChXChartView + diff --git a/qadevOOo/tests/java/mod/_sch/ChXDataPoint.java b/qadevOOo/tests/java/mod/_sch/ChXDataPoint.java new file mode 100644 index 0000000000..abad0f6ca1 --- /dev/null +++ b/qadevOOo/tests/java/mod/_sch/ChXDataPoint.java @@ -0,0 +1,140 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +package mod._sch; + +import java.io.PrintWriter; + +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.SOfficeFactory; +import util.utils; + +import com.sun.star.beans.XPropertySet; +import com.sun.star.chart.XChartDocument; +import com.sun.star.chart.XDiagram; +import com.sun.star.lang.XComponent; +import com.sun.star.uno.UnoRuntime; + +/** +* Test for object which is represented by service +* com.sun.star.chart.ChartDataPointProperties.

+* Object implements the following interfaces +*

    +*
  • com::sun::star::chart::ChartDataPointProperties
  • +*
  • com::sun::star::drawing::FillProperties
  • +*
  • com::sun::star::drawing::LineProperties
  • +*
  • com::sun::star::style::CharacterProperties
  • +*
  • com::sun::star::beans::XPropertySet
  • +*
  • com::sun::star::chart::Chart3DBarProperties
  • +*
+* The following files used by this test : +*
    +*
  • TransparencyChart.sxs : to load predefined chart +* document where two 'automatic' transparency styles exists : +* 'Transparency 1' and 'Transparency 2'.
  • +*

+* @see com.sun.star.chart.ChartDataPointProperties +* @see com.sun.star.drawing.FillProperties +* @see com.sun.star.drawing.LineProperties +* @see com.sun.star.style.CharacterProperties +* @see com.sun.star.beans.XPropertySet +* @see com.sun.star.chart.Chart3DBarProperties +* @see ifc.chart._ChartDataPointProperties +* @see ifc.drawing._FillProperties +* @see ifc.drawing._LineProperties +* @see ifc.style._CharacterProperties +* @see ifc.beans._XPropertySet +* @see ifc.chart._Chart3DBarProperties +*/ +public class ChXDataPoint extends TestCase { + XChartDocument xChartDoc = null; + + /** + * Creates Chart document. + */ + @Override + protected void initialize( TestParameters tParam, PrintWriter log ) throws Exception { + // get a soffice factory object + SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF()); + log.println( "creating a chartdocument" ); + XComponent xComp = SOF.loadDocument( + utils.getFullTestURL("TransparencyChart.sxs")); + xChartDoc = UnoRuntime.queryInterface(XChartDocument.class,xComp); + } + + /** + * Disposes Chart document. + */ + @Override + protected void cleanup( TestParameters tParam, PrintWriter log ) { + if( xChartDoc!=null ) { + log.println( " closing xChartDoc" ); + util.DesktopTools.closeDoc(xChartDoc); + xChartDoc = null; + } + } + + /** + * Creating a TestEnvironment for the interfaces to be tested. + * Retrieves the diagram of the chart document. Obtains the properties of + * the specified data point. The obtained properties is the instance of + * the service com.sun.star.chart.ChartDataPointProperties. + * Creates a XY-diagram and bar-diagram also. + * Object relations created : + *

    + *
  • 'LINE' for + * {@link ifc.chart._ChartDataPointProperties}(the created XY-diagram)
  • + *
  • 'CHARTDOC' for + * {@link ifc.chart._ChartDataPointProperties}, + * {@link ifc.chart._Chart3DBarProperties}(the chart document)
  • + *
  • 'BAR' for + * {@link ifc.chart._Chart3DBarProperties}(the created bar-diagram)
  • + *
+ */ + @Override + protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) throws Exception { + + XPropertySet oObj = null; + XDiagram oDiagram = null; + + SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF()); + + // get the DataRowPoint_Point + log.println( "getting ChXDataRowPoint_Point" ); + oDiagram = xChartDoc.getDiagram(); + oObj = oDiagram.getDataPointProperties(1,1); + + log.println( "creating a new environment for chartdocument object" ); + TestEnvironment tEnv = new TestEnvironment( oObj ); + + Object line = SOF.createDiagram(xChartDoc,"XYDiagram"); + tEnv.addObjRelation("LINE",line); + + Object bar = SOF.createDiagram(xChartDoc,"BarDiagram"); + tEnv.addObjRelation("BAR",bar); + + log.println( "adding ChartDocument as mod relation to environment" ); + tEnv.addObjRelation("CHARTDOC", xChartDoc); + + return tEnv; + } // finish method getTestEnvironment + +} // finish class ChXDataPoint + diff --git a/qadevOOo/tests/java/mod/_sch/ChXDataRow.java b/qadevOOo/tests/java/mod/_sch/ChXDataRow.java new file mode 100644 index 0000000000..e723aa7161 --- /dev/null +++ b/qadevOOo/tests/java/mod/_sch/ChXDataRow.java @@ -0,0 +1,147 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +package mod._sch; + +import java.io.PrintWriter; + +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.SOfficeFactory; +import util.utils; + +import com.sun.star.beans.XPropertySet; +import com.sun.star.chart.XChartDocument; +import com.sun.star.chart.XDiagram; +import com.sun.star.lang.XComponent; +import com.sun.star.uno.UnoRuntime; + +/** +* Test for object which is represented by service +* com.sun.star.chart.ChartDataRowProperties.

+* Object implements the following interfaces : +*

    +*
  • com::sun::star::drawing::FillProperties
  • +*
  • com::sun::star::chart::ChartStatistics
  • +*
  • com::sun::star::chart::ChartDataRowProperties
  • +*
  • com::sun::star::drawing::LineProperties
  • +*
  • com::sun::star::beans::XPropertySet
  • +*
  • com::sun::star::chart::ChartDataPointProperties
  • +*
  • com::sun::star::chart::Chart3DBarProperties
  • +*
  • com::sun::star::style::CharacterProperties
  • +*
+* The following files used by this test : +*
    +*
  • TransparencyChart.sxs : to load predefined chart +* document where two 'automatic' transparency styles exists : +* 'Transparency 1' and 'Transparency 2'.
  • +*

+* @see com.sun.star.drawing.FillProperties +* @see com.sun.star.chart.ChartStatistics +* @see com.sun.star.chart.ChartDataRowProperties +* @see com.sun.star.drawing.LineProperties +* @see com.sun.star.beans.XPropertySet +* @see com.sun.star.chart.ChartDataPointProperties +* @see com.sun.star.chart.Chart3DBarProperties +* @see com.sun.star.style.CharacterProperties +* @see ifc.drawing._FillProperties +* @see ifc.chart._ChartStatistics +* @see ifc.chart._ChartDataRowProperties +* @see ifc.drawing._LineProperties +* @see ifc.beans._XPropertySet +* @see ifc.chart._ChartDataPointProperties +* @see ifc.chart._Chart3DBarProperties +* @see ifc.style._CharacterProperties +*/ +public class ChXDataRow extends TestCase { + XChartDocument xChartDoc = null; + + /** + * Creates Chart document. + */ + @Override + protected void initialize( TestParameters tParam, PrintWriter log ) throws Exception { + // get a soffice factory object + SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF()); + log.println( "creating a chartdocument" ); + XComponent xComp = SOF.loadDocument( + utils.getFullTestURL("TransparencyChart.sxs")); + xChartDoc = UnoRuntime.queryInterface(XChartDocument.class,xComp); + } + + /** + * Disposes Chart document. + */ + @Override + protected synchronized void cleanup( TestParameters tParam, PrintWriter log ) { + if( xChartDoc!=null ) { + log.println( " closing xChartDoc" ); + util.DesktopTools.closeDoc(xChartDoc); + xChartDoc = null; + } + } + + + /** + * Creating a TestEnvironment for the interfaces to be tested. + * Retrieves the diagram of the chart document. Obtains the properties of + * the specified data row. The obtained properties is the instance of + * the service com.sun.star.chart.ChartDataRowProperties. + * Creates a XY-diagram and bar-diagram also. + * Object relations created : + *

    + *
  • 'LINE' for + * {@link ifc.chart._ChartDataPointProperties}(the created XY-diagram)
  • + *
  • 'CHARTDOC' for + * {@link ifc.chart._ChartDataPointProperties}, + * {@link ifc.chart._Chart3DBarProperties}(the chart document)
  • + *
  • 'BAR' for + * {@link ifc.chart._Chart3DBarProperties}(the created bar-diagram)
  • + *
+ */ + @Override + protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) throws Exception { + + XPropertySet oObj = null; + XDiagram oDiagram = null; + // get the ChXDataRowPoint_Row + log.println( "getting ChXDataRowPoint_Row" ); + oDiagram = xChartDoc.getDiagram(); + oObj = oDiagram.getDataRowProperties(1); + + log.println( "creating a new environment for chartdocument object" ); + TestEnvironment tEnv = new TestEnvironment( oObj ); + + SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF()); + + Object line = SOF.createDiagram(xChartDoc,"XYDiagram"); + tEnv.addObjRelation("LINE",line); + + Object bar = SOF.createDiagram(xChartDoc,"BarDiagram"); + tEnv.addObjRelation("BAR",bar); + + log.println( "adding ChartDocument as mod relation to environment" ); + tEnv.addObjRelation("CHARTDOC", xChartDoc); + + return tEnv; + } // finish method getTestEnvironment + + +} // finish class ChXDataRow + diff --git a/qadevOOo/tests/java/mod/_sch/ChXDiagram.java b/qadevOOo/tests/java/mod/_sch/ChXDiagram.java new file mode 100644 index 0000000000..c9433e6b99 --- /dev/null +++ b/qadevOOo/tests/java/mod/_sch/ChXDiagram.java @@ -0,0 +1,367 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +package mod._sch; + +import java.io.PrintWriter; + +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.SOfficeFactory; + +import com.sun.star.awt.Rectangle; +import com.sun.star.chart.XChartDataArray; +import com.sun.star.chart.XChartDocument; +import com.sun.star.chart.XDiagram; +import com.sun.star.container.XIndexAccess; +import com.sun.star.container.XNameAccess; +import com.sun.star.document.XEmbeddedObjectSupplier; +import com.sun.star.sheet.XCellRangeAddressable; +import com.sun.star.sheet.XSpreadsheet; +import com.sun.star.sheet.XSpreadsheetDocument; +import com.sun.star.sheet.XSpreadsheets; +import com.sun.star.table.CellRangeAddress; +import com.sun.star.table.XCell; +import com.sun.star.table.XCellRange; +import com.sun.star.table.XTableChart; +import com.sun.star.table.XTableCharts; +import com.sun.star.table.XTableChartsSupplier; +import com.sun.star.uno.AnyConverter; +import com.sun.star.uno.Type; +import com.sun.star.uno.UnoRuntime; +import com.sun.star.uno.XInterface; + +/** +* Test for object which is represented by the following services: +*
    +*
  • com.sun.star.chart.Dim3DDiagram
  • +*
  • com.sun.star.chart.StockDiagram
  • +*
  • com.sun.star.chart.LineDiagram
  • +*
  • com.sun.star.chart.BarDiagram
  • +*
  • com.sun.star.chart.StackableDiagram
  • +*
+*

+* Object implements the following interfaces : +*

    +*
  • com::sun::star::chart::XDiagram
  • +*
  • com::sun::star::chart::ChartAxisXSupplier
  • +*
  • com::sun::star::chart::Dim3DDiagram
  • +*
  • com::sun::star::chart::StockDiagram
  • +*
  • com::sun::star::chart::ChartAxisZSupplier
  • +*
  • com::sun::star::chart::XTwoAxisXSupplier
  • +*
  • com::sun::star::chart::LineDiagram
  • +*
  • com::sun::star::chart::BarDiagram
  • +*
  • com::sun::star::chart::XAxisYSupplier
  • +*
  • com::sun::star::chart::Diagram
  • +*
  • com::sun::star::chart::X3DDisplay
  • +*
  • com::sun::star::chart::ChartTwoAxisYSupplier
  • +*
  • com::sun::star::chart::StackableDiagram
  • +*
  • com::sun::star::chart::ChartAxisYSupplier
  • +*
  • com::sun::star::chart::XAxisXSupplier
  • +*
  • com::sun::star::chart::ChartTwoAxisXSupplier
  • +*
  • com::sun::star::drawing::XShape
  • +*
  • com::sun::star::chart::XTwoAxisYSupplier
  • +*
  • com::sun::star::chart::ChartStatistics
  • +*
  • com::sun::star::beans::XPropertySet
  • +*
  • com::sun::star::drawing::XShapeDescriptor
  • +*
  • com::sun::star::chart::XAxisZSupplier
  • +*
  • com::sun::star::chart::XStatisticDisplay
  • +*
+* @see com.sun.star.chart.XDiagram +* @see com.sun.star.chart.ChartAxisXSupplier +* @see com.sun.star.chart.Dim3DDiagram +* @see com.sun.star.chart.StockDiagram +* @see com.sun.star.chart.ChartAxisZSupplier +* @see com.sun.star.chart.XTwoAxisXSupplier +* @see com.sun.star.chart.LineDiagram +* @see com.sun.star.chart.BarDiagram +* @see com.sun.star.chart.XAxisYSupplier +* @see com.sun.star.chart.Diagram +* @see com.sun.star.chart.X3DDisplay +* @see com.sun.star.chart.ChartTwoAxisYSupplier +* @see com.sun.star.chart.StackableDiagram +* @see com.sun.star.chart.ChartAxisYSupplier +* @see com.sun.star.chart.XAxisXSupplier +* @see com.sun.star.chart.ChartTwoAxisXSupplier +* @see com.sun.star.drawing.XShape +* @see com.sun.star.chart.XTwoAxisYSupplier +* @see com.sun.star.chart.ChartStatistics +* @see com.sun.star.beans.XPropertySet +* @see com.sun.star.drawing.XShapeDescriptor +* @see com.sun.star.chart.XAxisZSupplier +* @see com.sun.star.chart.XStatisticDisplay +* @see ifc.chart._XDiagram +* @see ifc.chart._ChartAxisXSupplier +* @see ifc.chart._Dim3DDiagram +* @see ifc.chart._StockDiagram +* @see ifc.chart._ChartAxisZSupplier +* @see ifc.chart._XTwoAxisXSupplier +* @see ifc.chart._LineDiagram +* @see ifc.chart._BarDiagram +* @see ifc.chart._XAxisYSupplier +* @see ifc.chart._Diagram +* @see ifc.chart._X3DDisplay +* @see ifc.chart._ChartTwoAxisYSupplier +* @see ifc.chart._StackableDiagram +* @see ifc.chart._ChartAxisYSupplier +* @see ifc.chart._XAxisXSupplier +* @see ifc.chart._ChartTwoAxisXSupplier +* @see ifc.drawing._XShape +* @see ifc.chart._XTwoAxisYSupplier +* @see ifc.chart._ChartStatistics +* @see ifc.beans._XPropertySet +* @see ifc.drawing._XShapeDescriptor +* @see ifc.chart._XAxisZSupplier +* @see ifc.chart._XStatisticDisplay +*/ +public class ChXDiagram extends TestCase { + XSpreadsheetDocument xSheetDoc = null; + + /** + * Creates Spreadsheet document. + */ + @Override + protected void initialize( TestParameters tParam, PrintWriter log ) throws Exception { + // get a soffice factory object + SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF()); + log.println( "creating a sheetdocument" ); + xSheetDoc = SOF.createCalcDoc(null); + } + + /** + * Disposes Spreadsheet document. + */ + @Override + protected void cleanup( TestParameters tParam, PrintWriter log ) { + log.println( " closing xSheetDoc " ); + util.DesktopTools.closeDoc(xSheetDoc); + } + + /** + * Creating a TestEnvironment for the interfaces to be tested. + * Retrieves a collection of spreadsheets from a document + * and takes one of them. Inserts some values into the cells of the same cell + * range address. Adds and retrieves the chart that using the data from + * the cells of this cell range address. Obtains the chart document which is + * embedded into the retrieved chart using the interface + * XEmbeddedObjectSupplier. Retrieves the diagram from + * the obtained chart document. The retrieved diagram is the instance of + * the service com.sun.star.chart.Diagram. + * Obtains the data source of the chart from the chart document. + * Creates a stock-diagram, a bar-diagram, a XY-diagram and line-diagram + * that are the instances of the following services: + *
    + *
  • com.sun.star.chart.StockDiagram
  • + *
  • com.sun.star.chart.BarDiagram
  • + *
  • com.sun.star.chart.LineDiagram
  • + *
  • com.sun.star.chart.StackableDiagram
  • + *
. + * Object relations created : + *
    + *
  • 'CHARTDOC' for + * {@link ifc.chart._Dim3DDiagram}, {@link ifc.chart._StockDiagram}, + * {@link ifc.chart._ChartAxisZSupplier}, {@link ifc.chart._LineDiagram}, + * {@link ifc.chart._BarDiagram}, {@link ifc.chart._Diagram}, + * {@link ifc.chart._ChartTwoAxisYSupplier}, + * {@link ifc.chart._StackableDiagram}, {@link ifc.chart._Diagram}, + * {@link ifc.chart._ChartAxisYSupplier}, + * {@link ifc.chart._ChartTwoAxisXSupplier}, + * {@link ifc.chart._ChartStatistics} (the obtained chart document)
  • + *
  • 'ROWAMOUNT', 'COLAMOUNT' for + * {@link ifc.chart._XDiagram}(the number of chart columns and + * the number of chart rows)
  • + *
  • 'STOCK' for + * {@link ifc.chart._StockDiagram}(the created stock-diagram)
  • + *
  • 'BAR' for + * {@link ifc.chart._BarDiagram}, {@link ifc.chart._ChartAxisZSupplier}, + * {@link ifc.chart._ChartTwoAxisXSupplier}, + * {@link ifc.chart._ChartTwoAxisYSupplier}(the created bar-diagram)
  • + *
  • 'LINE' for + * {@link ifc.chart._LineDiagram}(the created XY-diagram)
  • + *
  • 'STACK' for + * {@link ifc.chart._StackableDiagram}(the created Line-diagram)
  • + *
+ * @see com.sun.star.document.XEmbeddedObjectSupplier + * @see com.sun.star.chart.Diagram + * @see com.sun.star.chart.StockDiagram + */ + @Override + protected TestEnvironment createTestEnvironment + (TestParameters Param, PrintWriter log) throws Exception { + + XSpreadsheet oSheet=null; + XChartDocument xChartDoc=null; + XDiagram oObj = null; + + System.out.println("Getting spreadsheet") ; + XSpreadsheets oSheets = xSheetDoc.getSheets() ; + XIndexAccess oIndexSheets = UnoRuntime.queryInterface(XIndexAccess.class, oSheets); + oSheet = (XSpreadsheet) AnyConverter.toObject( + new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0)); + + log.println("Creating the Header") ; + + insertIntoCell(1,0,"JAN",oSheet,""); + insertIntoCell(2,0,"FEB",oSheet,""); + insertIntoCell(3,0,"MAR",oSheet,""); + insertIntoCell(4,0,"APR",oSheet,""); + insertIntoCell(5,0,"MAI",oSheet,""); + insertIntoCell(6,0,"JUN",oSheet,""); + insertIntoCell(7,0,"JUL",oSheet,""); + insertIntoCell(8,0,"AUG",oSheet,""); + insertIntoCell(9,0,"SEP",oSheet,""); + insertIntoCell(10,0,"OCT",oSheet,""); + insertIntoCell(11,0,"NOV",oSheet,""); + insertIntoCell(12,0,"DEC",oSheet,""); + insertIntoCell(13,0,"SUM",oSheet,""); + + log.println("Fill the lines"); + + insertIntoCell(0,1,"Smith",oSheet,""); + insertIntoCell(1,1,"42",oSheet,"V"); + insertIntoCell(2,1,"58.9",oSheet,"V"); + insertIntoCell(3,1,"-66.5",oSheet,"V"); + insertIntoCell(4,1,"43.4",oSheet,"V"); + insertIntoCell(5,1,"44.5",oSheet,"V"); + insertIntoCell(6,1,"45.3",oSheet,"V"); + insertIntoCell(7,1,"-67.3",oSheet,"V"); + insertIntoCell(8,1,"30.5",oSheet,"V"); + insertIntoCell(9,1,"23.2",oSheet,"V"); + insertIntoCell(10,1,"-97.3",oSheet,"V"); + insertIntoCell(11,1,"22.4",oSheet,"V"); + insertIntoCell(12,1,"23.5",oSheet,"V"); + insertIntoCell(13,1,"=SUM(B2:M2)",oSheet,""); + + insertIntoCell(0,2,"Jones",oSheet,""); + insertIntoCell(1,2,"21",oSheet,"V"); + insertIntoCell(2,2,"40.9",oSheet,"V"); + insertIntoCell(3,2,"-57.5",oSheet,"V"); + insertIntoCell(4,2,"-23.4",oSheet,"V"); + insertIntoCell(5,2,"34.5",oSheet,"V"); + insertIntoCell(6,2,"59.3",oSheet,"V"); + insertIntoCell(7,2,"27.3",oSheet,"V"); + insertIntoCell(8,2,"-38.5",oSheet,"V"); + insertIntoCell(9,2,"43.2",oSheet,"V"); + insertIntoCell(10,2,"57.3",oSheet,"V"); + insertIntoCell(11,2,"25.4",oSheet,"V"); + insertIntoCell(12,2,"28.5",oSheet,"V"); + insertIntoCell(13,2,"=SUM(B3:M3)",oSheet,""); + + insertIntoCell(0,3,"Brown",oSheet,""); + insertIntoCell(1,3,"31.45",oSheet,"V"); + insertIntoCell(2,3,"-20.9",oSheet,"V"); + insertIntoCell(3,3,"-117.5",oSheet,"V"); + insertIntoCell(4,3,"23.4",oSheet,"V"); + insertIntoCell(5,3,"-114.5",oSheet,"V"); + insertIntoCell(6,3,"115.3",oSheet,"V"); + insertIntoCell(7,3,"-171.3",oSheet,"V"); + insertIntoCell(8,3,"89.5",oSheet,"V"); + insertIntoCell(9,3,"41.2",oSheet,"V"); + insertIntoCell(10,3,"71.3",oSheet,"V"); + insertIntoCell(11,3,"25.4",oSheet,"V"); + insertIntoCell(12,3,"38.5",oSheet,"V"); + insertIntoCell(13,3,"=SUM(A4:L4)",oSheet,""); + + // insert a chart + Rectangle oRect = new Rectangle(500, 3000, 25000, 11000); + + XCellRange oRange = UnoRuntime.queryInterface(XCellRange.class, oSheet); + XCellRange myRange = oRange.getCellRangeByName("A1:N4"); + XCellRangeAddressable oRangeAddr = UnoRuntime.queryInterface(XCellRangeAddressable.class, myRange); + CellRangeAddress myAddr = oRangeAddr.getRangeAddress(); + + CellRangeAddress[] oAddr = new CellRangeAddress[1]; + oAddr[0] = myAddr; + XTableChartsSupplier oSupp = UnoRuntime.queryInterface(XTableChartsSupplier.class, oSheet); + + log.println("Insert Chart"); + XTableCharts oCharts = oSupp.getCharts(); + + + if (!oCharts.hasByName("ChXDiagram")) { + oCharts.addNewByName("ChXDiagram", oRect, oAddr, true, true); + } + + // get the TableChart + XTableChart oChart = (XTableChart) AnyConverter.toObject( + new Type(XTableChart.class),UnoRuntime.queryInterface( + XNameAccess.class, oCharts).getByName("ChXDiagram")); + + XEmbeddedObjectSupplier oEOS = UnoRuntime.queryInterface(XEmbeddedObjectSupplier.class, oChart); + XInterface oInt = oEOS.getEmbeddedObject(); + xChartDoc = UnoRuntime.queryInterface(XChartDocument.class,oInt); + oObj = xChartDoc.getDiagram(); + + log.println( "creating a new environment for chartdocument object" ); + TestEnvironment tEnv = new TestEnvironment( oObj ); + + log.println( "adding ChartDocument as mod relation to environment" ); + tEnv.addObjRelation("CHARTDOC", xChartDoc); + + XChartDataArray da = UnoRuntime.queryInterface(XChartDataArray.class, xChartDoc.getData()); + int cols = da.getColumnDescriptions().length; + int rows = da.getRowDescriptions().length; + + tEnv.addObjRelation("ROWAMOUNT", Integer.valueOf(rows)); + tEnv.addObjRelation("COLAMOUNT", Integer.valueOf(cols)); + + SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF()); + Object stock = SOF.createDiagram(xChartDoc,"StockDiagram"); + tEnv.addObjRelation("STOCK",stock); + + Object bar = SOF.createDiagram(xChartDoc,"BarDiagram"); + tEnv.addObjRelation("BAR",bar); + + Object line = SOF.createDiagram(xChartDoc,"XYDiagram"); + tEnv.addObjRelation("LINE",line); + + Object stack = SOF.createDiagram(xChartDoc,"LineDiagram"); + tEnv.addObjRelation("STACK",stack); + + return tEnv; + } // finish method getTestEnvironment + + /** + * Inserts a value or a formula in the cell of the spreadsheet. + * @param CellX is the column index of the cell + * @param CellY is the row index of the cell + * @param theValue string representation of the value + * @param TT1 specify the spreadsheet, the interface + * com.sun.star.sheet.XSpreadsheet + * @param flag if it's equal to 'V' then the method inserts + * a double-value in the cell else it inserts a formula in the cell + */ + public static void insertIntoCell( + int CellX, int CellY, String theValue, XSpreadsheet TT1, String flag) + throws com.sun.star.lang.IndexOutOfBoundsException { + + XCell oCell = TT1.getCellByPosition(CellX, CellY); + + if (flag.equals("V")) { + oCell.setValue(Float.parseFloat(theValue)); + } + else { + oCell.setFormula(theValue); + } + + } // end of insertIntoCell + + +} // finish class ChXDiagram + diff --git a/qadevOOo/tests/java/mod/_sch/ChartArea.java b/qadevOOo/tests/java/mod/_sch/ChartArea.java new file mode 100644 index 0000000000..c81a7cea2f --- /dev/null +++ b/qadevOOo/tests/java/mod/_sch/ChartArea.java @@ -0,0 +1,106 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +package mod._sch; + +import java.io.PrintWriter; + +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.SOfficeFactory; +import util.utils; + +import com.sun.star.beans.XPropertySet; +import com.sun.star.chart.XChartDocument; +import com.sun.star.lang.XComponent; +import com.sun.star.uno.UnoRuntime; + +/** +* Test for object which is represented by service +* com.sun.star.chart.ChartArea.

+* Object implements the following interfaces : +*

    +*
  • com::sun::star::drawing::FillProperties
  • +*
  • com::sun::star::drawing::LineProperties
  • +*
  • com::sun::star::beans::XPropertySet
  • +*
+* The following files used by this test : +*
    +*
  • TransparencyChart.sxs : to load predefined chart +* document where two 'automatic' transparency styles exists : +* 'Transparency 1' and 'Transparency 2'.
  • +*

+* @see com.sun.star.chart.ChartArea +* @see com.sun.star.drawing.FillProperties +* @see com.sun.star.drawing.LineProperties +* @see com.sun.star.beans.XPropertySet +* @see ifc.drawing._FillProperties +* @see ifc.drawing._LineProperties +* @see ifc.beans._XPropertySet +*/ +public class ChartArea extends TestCase { + XChartDocument xChartDoc = null; + + /** + * Creates Chart document. + */ + @Override + protected void initialize( TestParameters tParam, PrintWriter log ) throws Exception { + // get a soffice factory object + SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF()); + log.println( "creating a chartdocument" ); + XComponent xComp = SOF.loadDocument( + utils.getFullTestURL("TransparencyChart.sxs")); + xChartDoc = UnoRuntime.queryInterface(XChartDocument.class,xComp); + } + + /** + * Disposes Chart document. + */ + @Override + protected void cleanup( TestParameters tParam, PrintWriter log ) { + if( xChartDoc!=null ) { + log.println( " closing xChartDoc" ); + util.DesktopTools.closeDoc(xChartDoc); + xChartDoc = null; + } + } + + /** + * Creating a TestEnvironment for the interfaces to be tested. + * Retrieved the instance of the service com.sun.star.chart.ChartArea + * using the interface XChartDocument. + * @see com.sun.star.chart.XChartDocument + * @see com.sun.star.chart.ChartArea + */ + @Override + protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { + + // get the Area + log.println( "getting Area" ); + XPropertySet oObj = xChartDoc.getArea(); + + log.println( "creating a new environment for chartdocument object" ); + TestEnvironment tEnv = new TestEnvironment( oObj ); + + return tEnv; + } // finish method getTestEnvironment + +} // finish class ChartArea + diff --git a/qadevOOo/tests/java/mod/_sch/ChartGrid.java b/qadevOOo/tests/java/mod/_sch/ChartGrid.java new file mode 100644 index 0000000000..79b3aa3f02 --- /dev/null +++ b/qadevOOo/tests/java/mod/_sch/ChartGrid.java @@ -0,0 +1,105 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +package mod._sch; + +import java.io.PrintWriter; + +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.SOfficeFactory; + +import com.sun.star.beans.XPropertySet; +import com.sun.star.chart.XAxisXSupplier; +import com.sun.star.chart.XChartDocument; +import com.sun.star.drawing.XShape; +import com.sun.star.uno.UnoRuntime; + +/** +* Test for object which is represented by service +* com.sun.star.chart.ChartGrid.

+* Object implements the following interfaces : +*

    +*
  • com::sun::star::drawing::LineProperties
  • +*
  • com::sun::star::beans::XPropertySet
  • +*
+* @see com.sun.star.chart.ChartGrid +* @see com.sun.star.drawing.LineProperties +* @see com.sun.star.beans.XPropertySet +* @see ifc.drawing._LineProperties +* @see ifc.beans._XPropertySet +*/ +public class ChartGrid extends TestCase { + XChartDocument xChartDoc = null; + + /** + * Creates Chart document. + */ + @Override + protected void initialize( TestParameters tParam, PrintWriter log ) throws Exception { + // get a soffice factory object + SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF()); + log.println( "creating a chartdocument" ); + xChartDoc = SOF.createChartDoc(); + } + + /** + * Disposes Chart document. + */ + @Override + protected void cleanup( TestParameters tParam, PrintWriter log ) { + if( xChartDoc!=null ) { + log.println( " closing xChartDoc" ); + util.DesktopTools.closeDoc(xChartDoc); + xChartDoc = null; + } + } + + /** + * Creating a TestEnvironment for the interfaces to be tested. + * Retrieves the diagram of the chart document. Then obtains + * the properties of the main grid of the x-axis of the diagram + * using the interface XAxisXSupplier. This properties is + * the instance of the service com.sun.star.chart.ChartGrid. + * @see com.sun.star.chart.XAxisXSupplier + * @see com.sun.star.chart.ChartGrid + */ + @Override + protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { + XPropertySet oObj = null; + XShape oDiagram = null; + + // get the Diagram + log.println( "getting Diagram" ); + oDiagram = xChartDoc.getDiagram(); + + // get the Grid + log.println( "getting ChartGrid" ); + XAxisXSupplier oAxisSup = UnoRuntime.queryInterface(XAxisXSupplier.class,oDiagram); + oObj = oAxisSup.getXMainGrid(); + + log.println( "creating a new environment for chartdocument object" ); + TestEnvironment tEnv = new TestEnvironment( oObj ); + + return tEnv; + } // finish method getTestEnvironment + + +} // finish class ChartGrid + diff --git a/qadevOOo/tests/java/mod/_sch/ChartLegend.java b/qadevOOo/tests/java/mod/_sch/ChartLegend.java new file mode 100644 index 0000000000..c8cfaa4774 --- /dev/null +++ b/qadevOOo/tests/java/mod/_sch/ChartLegend.java @@ -0,0 +1,126 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +package mod._sch; + +import java.io.PrintWriter; + +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.SOfficeFactory; +import util.utils; + +import com.sun.star.chart.XChartDocument; +import com.sun.star.drawing.XShape; +import com.sun.star.lang.XComponent; +import com.sun.star.uno.UnoRuntime; + +/** +* Test for object which is represented by service +* com.sun.star.chart.ChartLegend.

+* Object implements the following interfaces : +*

    +*
  • com::sun::star::drawing::FillProperties
  • +*
  • com::sun::star::drawing::XShape
  • +*
  • com::sun::star::drawing::Shape
  • +*
  • com::sun::star::chart::ChartLegend
  • +*
  • com::sun::star::drawing::LineProperties
  • +*
  • com::sun::star::beans::XPropertySet
  • +*
  • com::sun::star::style::CharacterProperties
  • +*
  • com::sun::star::drawing::XShapeDescriptor
  • +*
  • com::sun::star::lang::XComponent
  • +*
+* The following files used by this test : +*
    +*
  • TransparencyChart.sxs : to load predefined chart +* document where two 'automatic' transparency styles exists : +* 'Transparency 1' and 'Transparency 2'.
  • +*

+* @see com.sun.star.drawing.FillProperties +* @see com.sun.star.drawing.XShape +* @see com.sun.star.drawing.Shape +* @see com.sun.star.chart.ChartLegend +* @see com.sun.star.drawing.LineProperties +* @see com.sun.star.beans.XPropertySet +* @see com.sun.star.style.CharacterProperties +* @see com.sun.star.drawing.XShapeDescriptor +* @see com.sun.star.lang.XComponent +* @see ifc.drawing._FillProperties +* @see ifc.drawing._XShape +* @see ifc.drawing._Shape +* @see ifc.chart._ChartLegend +* @see ifc.drawing._LineProperties +* @see ifc.beans._XPropertySet +* @see ifc.style._CharacterProperties +* @see ifc.drawing._XShapeDescriptor +* @see ifc.lang._XComponent +*/ +public class ChartLegend extends TestCase { + XChartDocument xChartDoc = null; + + /** + * Creates Chart document. + */ + @Override + protected void initialize( TestParameters tParam, PrintWriter log ) throws Exception { + // get a soffice factory object + SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF()); + log.println( "creating a chartdocument" ); + XComponent xComp = SOF.loadDocument( + utils.getFullTestURL("TransparencyChart.sxs")); + xChartDoc = UnoRuntime.queryInterface(XChartDocument.class,xComp); + } + + /** + * Disposes Chart document. + */ + @Override + protected void cleanup( TestParameters tParam, PrintWriter log ) { + if( xChartDoc!=null ) { + log.println( " closing xChartDoc" ); + util.DesktopTools.closeDoc(xChartDoc); + xChartDoc = null; + } + } + + /** + * Creating a TestEnvironment for the interfaces to be tested. + * Retrieves the diagram of the chart document. The retrieved + * diagram is the instance of the service + * com.sun.star.chart.ChartLegend. + */ + @Override + protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { + + XShape oObj = null; + + // get the Legend + log.println( "getting Legend" ); + oObj = xChartDoc.getLegend(); + + log.println( "creating a new environment for chartdocument object" ); + TestEnvironment tEnv = new TestEnvironment( oObj ); + + tEnv.addObjRelation("NoSetSize", "sch.ChartLegend"); + return tEnv; + } // finish method getTestEnvironment + + +} // finish class ChartLegend + diff --git a/qadevOOo/tests/java/mod/_sch/ChartLine.java b/qadevOOo/tests/java/mod/_sch/ChartLine.java new file mode 100644 index 0000000000..69c0a510aa --- /dev/null +++ b/qadevOOo/tests/java/mod/_sch/ChartLine.java @@ -0,0 +1,112 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +package mod._sch; + +import java.io.PrintWriter; + +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.SOfficeFactory; + +import com.sun.star.beans.XPropertySet; +import com.sun.star.chart.XChartDocument; +import com.sun.star.chart.XDiagram; +import com.sun.star.uno.AnyConverter; +import com.sun.star.uno.Type; + +/** +* Test for object which is represented by service +* com.sun.star.chart.ChartLine.

+* Object implements the following interfaces : +*

    +*
  • com::sun::star::drawing::LineProperties
  • +*
  • com::sun::star::beans::XPropertySet
  • +*
+* @see com.sun.star.drawing.LineProperties +* @see com.sun.star.beans.XPropertySet +* @see ifc.drawing._LineProperties +* @see ifc.beans._XPropertySet +*/ +public class ChartLine extends TestCase { + XChartDocument xChartDoc = null; + + /** + * Creates Chart document. + */ + @Override + protected void initialize( TestParameters tParam, PrintWriter log ) throws Exception { + // get a soffice factory object + SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF()); + log.println( "creating a chartdocument" ); + xChartDoc = SOF.createChartDoc(); + } + + /** + * Disposes Chart document. + */ + @Override + protected void cleanup( TestParameters tParam, PrintWriter log ) { + if( xChartDoc!=null ) { + log.println( " closing xChartDoc" ); + util.DesktopTools.closeDoc(xChartDoc); + xChartDoc = null; + } + } + + /** + * Creating a TestEnvironment for the interfaces to be tested. + * Creates a bar diagram and sets the created diagram for the chart document. + * Retrieves the property 'DataMeanValueProperties' of + * the specified data row. The retrieved property is the instance of + * the service com.sun.star.chart.ChartLine. + * @see com.sun.star.chart.ChartLine + */ + @Override + protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) throws Exception { + + XPropertySet oObj = null; + XDiagram oDiagram = null; + SOfficeFactory SOF = null; + + //get LineDiagram + SOF = SOfficeFactory.getFactory( Param.getMSF()); + oDiagram = SOF.createDiagram(xChartDoc, "LineDiagram"); + + log.println( "getting Line-Diagram" ); + xChartDoc.setDiagram(oDiagram); + + // get the Line + log.println( "getting Line" ); + XPropertySet RowProps = oDiagram.getDataRowProperties(1); + RowProps.setPropertyValue("MeanValue", Boolean.TRUE); + oObj = (XPropertySet) AnyConverter.toObject( + new Type(XPropertySet.class), + RowProps.getPropertyValue("DataMeanValueProperties")); + + log.println( "creating a new environment for chartdocument object" ); + TestEnvironment tEnv = new TestEnvironment( oObj ); + + + return tEnv; + } // finish method getTestEnvironment + + +} // finish class ChartLine + diff --git a/qadevOOo/tests/java/mod/_sch/ChartTitle.java b/qadevOOo/tests/java/mod/_sch/ChartTitle.java new file mode 100644 index 0000000000..1a4aaccfb8 --- /dev/null +++ b/qadevOOo/tests/java/mod/_sch/ChartTitle.java @@ -0,0 +1,105 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +package mod._sch; + +import java.io.PrintWriter; + +import lib.TestCase; +import lib.TestEnvironment; +import lib.TestParameters; +import util.SOfficeFactory; + +import com.sun.star.chart.XChartDocument; +import com.sun.star.drawing.XShape; + +/** +* Test for object which is represented by service +* com.sun.star.chart.ChartTitle.

+* Object implements the following interfaces : +*

    +*
  • com::sun::star::lang::XComponent
  • +*
  • com::sun::star::chart::ChartTitle
  • +*
  • com::sun::star::drawing::XShape
  • +*
  • com::sun::star::drawing::XShapeDescriptor
  • +*
  • com::sun::star::style::CharacterProperties
  • +*
  • com::sun::star::beans::XPropertySet
  • +*
  • com::sun::star::drawing::Shape
  • +*
+* @see com.sun.star.lang.XComponent +* @see com.sun.star.chart.ChartTitle +* @see com.sun.star.drawing.XShape +* @see com.sun.star.drawing.XShapeDescriptor +* @see com.sun.star.style.CharacterProperties +* @see com.sun.star.beans.XPropertySet +* @see com.sun.star.drawing.Shape +* @see ifc.lang._XComponent +* @see ifc.chart._ChartTitle +* @see ifc.drawing._XShape +* @see ifc.drawing._XShapeDescriptor +* @see ifc.style._CharacterProperties +* @see ifc.beans._XPropertySet +* @see ifc.drawing._Shape +*/ +public class ChartTitle extends TestCase { + XChartDocument xChartDoc = null; + + /** + * Creates Chart document. + */ + @Override + protected void initialize( TestParameters tParam, PrintWriter log ) throws Exception { + // get a soffice factory object + SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF()); + log.println( "creating a chartdocument" ); + xChartDoc = SOF.createChartDoc(); + } + + /** + * Disposes Chart document. + */ + @Override + protected void cleanup( TestParameters tParam, PrintWriter log ) { + if( xChartDoc!=null ) { + log.println( " closing xChartDoc" ); + util.DesktopTools.closeDoc(xChartDoc); + xChartDoc = null; + } + } + + /** + * Creating a TestEnvironment for the interfaces to be tested. + * Retrieves the shape of the main title of the chart document. + * The retrieved shape is the instance of the service + * com.sun.star.chart.ChartTitle. + */ + @Override + protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { + + // get the Title + log.println( "getting Title" ); + XShape oObj = xChartDoc.getTitle(); + + log.println( "creating a new environment for chartdocument object" ); + TestEnvironment tEnv = new TestEnvironment( oObj ); + tEnv.addObjRelation("NoSetSize","sch.ChartTitle"); + return tEnv; + } // finish method getTestEnvironment + +} // finish class ChXChartObject_Title + -- cgit v1.2.3