tdf#130857 qt weld: Introduce QtInstanceScrolledWindow
[LibreOffice.git] / qadevOOo / tests / java / mod / _sch / ChXDataPoint.java
blobabad0f6ca1adebce205d76147efa18e5cde9f57b
1 /*
2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 package mod._sch;
21 import java.io.PrintWriter;
23 import lib.TestCase;
24 import lib.TestEnvironment;
25 import lib.TestParameters;
26 import util.SOfficeFactory;
27 import util.utils;
29 import com.sun.star.beans.XPropertySet;
30 import com.sun.star.chart.XChartDocument;
31 import com.sun.star.chart.XDiagram;
32 import com.sun.star.lang.XComponent;
33 import com.sun.star.uno.UnoRuntime;
35 /**
36 * Test for object which is represented by service
37 * <code>com.sun.star.chart.ChartDataPointProperties</code>. <p>
38 * Object implements the following interfaces
39 * <ul>
40 * <li> <code>com::sun::star::chart::ChartDataPointProperties</code></li>
41 * <li> <code>com::sun::star::drawing::FillProperties</code></li>
42 * <li> <code>com::sun::star::drawing::LineProperties</code></li>
43 * <li> <code>com::sun::star::style::CharacterProperties</code></li>
44 * <li> <code>com::sun::star::beans::XPropertySet</code></li>
45 * <li> <code>com::sun::star::chart::Chart3DBarProperties</code></li>
46 * </ul>
47 * The following files used by this test :
48 * <ul>
49 * <li><b> TransparencyChart.sxs </b> : to load predefined chart
50 * document where two 'automatic' transparency styles exists :
51 * 'Transparency 1' and 'Transparency 2'.</li>
52 * </ul> <p>
53 * @see com.sun.star.chart.ChartDataPointProperties
54 * @see com.sun.star.drawing.FillProperties
55 * @see com.sun.star.drawing.LineProperties
56 * @see com.sun.star.style.CharacterProperties
57 * @see com.sun.star.beans.XPropertySet
58 * @see com.sun.star.chart.Chart3DBarProperties
59 * @see ifc.chart._ChartDataPointProperties
60 * @see ifc.drawing._FillProperties
61 * @see ifc.drawing._LineProperties
62 * @see ifc.style._CharacterProperties
63 * @see ifc.beans._XPropertySet
64 * @see ifc.chart._Chart3DBarProperties
66 public class ChXDataPoint extends TestCase {
67 XChartDocument xChartDoc = null;
69 /**
70 * Creates Chart document.
72 @Override
73 protected void initialize( TestParameters tParam, PrintWriter log ) throws Exception {
74 // get a soffice factory object
75 SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF());
76 log.println( "creating a chartdocument" );
77 XComponent xComp = SOF.loadDocument(
78 utils.getFullTestURL("TransparencyChart.sxs"));
79 xChartDoc = UnoRuntime.queryInterface(XChartDocument.class,xComp);
82 /**
83 * Disposes Chart document.
85 @Override
86 protected void cleanup( TestParameters tParam, PrintWriter log ) {
87 if( xChartDoc!=null ) {
88 log.println( " closing xChartDoc" );
89 util.DesktopTools.closeDoc(xChartDoc);
90 xChartDoc = null;
94 /**
95 * Creating a TestEnvironment for the interfaces to be tested.
96 * Retrieves the diagram of the chart document. Obtains the properties of
97 * the specified data point. The obtained properties is the instance of
98 * the service <code>com.sun.star.chart.ChartDataPointProperties</code>.
99 * Creates a XY-diagram and bar-diagram also.
100 * Object relations created :
101 * <ul>
102 * <li> <code>'LINE'</code> for
103 * {@link ifc.chart._ChartDataPointProperties}(the created XY-diagram)</li>
104 * <li> <code>'CHARTDOC'</code> for
105 * {@link ifc.chart._ChartDataPointProperties},
106 * {@link ifc.chart._Chart3DBarProperties}(the chart document)</li>
107 * <li> <code>'BAR'</code> for
108 * {@link ifc.chart._Chart3DBarProperties}(the created bar-diagram)</li>
109 * </ul>
111 @Override
112 protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) throws Exception {
114 XPropertySet oObj = null;
115 XDiagram oDiagram = null;
117 SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF());
119 // get the DataRowPoint_Point
120 log.println( "getting ChXDataRowPoint_Point" );
121 oDiagram = xChartDoc.getDiagram();
122 oObj = oDiagram.getDataPointProperties(1,1);
124 log.println( "creating a new environment for chartdocument object" );
125 TestEnvironment tEnv = new TestEnvironment( oObj );
127 Object line = SOF.createDiagram(xChartDoc,"XYDiagram");
128 tEnv.addObjRelation("LINE",line);
130 Object bar = SOF.createDiagram(xChartDoc,"BarDiagram");
131 tEnv.addObjRelation("BAR",bar);
133 log.println( "adding ChartDocument as mod relation to environment" );
134 tEnv.addObjRelation("CHARTDOC", xChartDoc);
136 return tEnv;
137 } // finish method getTestEnvironment
139 } // finish class ChXDataPoint