tdf#130857 qt weld: Introduce QtInstanceScrolledWindow
[LibreOffice.git] / qadevOOo / tests / java / mod / _sch / ChartLegend.java
blobc8cfaa47746e7d940637f6826701e1c299678e7e
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.chart.XChartDocument;
30 import com.sun.star.drawing.XShape;
31 import com.sun.star.lang.XComponent;
32 import com.sun.star.uno.UnoRuntime;
34 /**
35 * Test for object which is represented by service
36 * <code>com.sun.star.chart.ChartLegend</code>. <p>
37 * Object implements the following interfaces :
38 * <ul>
39 * <li> <code>com::sun::star::drawing::FillProperties</code></li>
40 * <li> <code>com::sun::star::drawing::XShape</code></li>
41 * <li> <code>com::sun::star::drawing::Shape</code></li>
42 * <li> <code>com::sun::star::chart::ChartLegend</code></li>
43 * <li> <code>com::sun::star::drawing::LineProperties</code></li>
44 * <li> <code>com::sun::star::beans::XPropertySet</code></li>
45 * <li> <code>com::sun::star::style::CharacterProperties</code></li>
46 * <li> <code>com::sun::star::drawing::XShapeDescriptor</code></li>
47 * <li> <code>com::sun::star::lang::XComponent</code></li>
48 * </ul>
49 * The following files used by this test :
50 * <ul>
51 * <li><b> TransparencyChart.sxs </b> : to load predefined chart
52 * document where two 'automatic' transparency styles exists :
53 * 'Transparency 1' and 'Transparency 2'.</li>
54 * </ul> <p>
55 * @see com.sun.star.drawing.FillProperties
56 * @see com.sun.star.drawing.XShape
57 * @see com.sun.star.drawing.Shape
58 * @see com.sun.star.chart.ChartLegend
59 * @see com.sun.star.drawing.LineProperties
60 * @see com.sun.star.beans.XPropertySet
61 * @see com.sun.star.style.CharacterProperties
62 * @see com.sun.star.drawing.XShapeDescriptor
63 * @see com.sun.star.lang.XComponent
64 * @see ifc.drawing._FillProperties
65 * @see ifc.drawing._XShape
66 * @see ifc.drawing._Shape
67 * @see ifc.chart._ChartLegend
68 * @see ifc.drawing._LineProperties
69 * @see ifc.beans._XPropertySet
70 * @see ifc.style._CharacterProperties
71 * @see ifc.drawing._XShapeDescriptor
72 * @see ifc.lang._XComponent
74 public class ChartLegend extends TestCase {
75 XChartDocument xChartDoc = null;
77 /**
78 * Creates Chart document.
80 @Override
81 protected void initialize( TestParameters tParam, PrintWriter log ) throws Exception {
82 // get a soffice factory object
83 SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF());
84 log.println( "creating a chartdocument" );
85 XComponent xComp = SOF.loadDocument(
86 utils.getFullTestURL("TransparencyChart.sxs"));
87 xChartDoc = UnoRuntime.queryInterface(XChartDocument.class,xComp);
90 /**
91 * Disposes Chart document.
93 @Override
94 protected void cleanup( TestParameters tParam, PrintWriter log ) {
95 if( xChartDoc!=null ) {
96 log.println( " closing xChartDoc" );
97 util.DesktopTools.closeDoc(xChartDoc);
98 xChartDoc = null;
103 * Creating a TestEnvironment for the interfaces to be tested.
104 * Retrieves the diagram of the chart document. The retrieved
105 * diagram is the instance of the service
106 * <code>com.sun.star.chart.ChartLegend</code>.
108 @Override
109 protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
111 XShape oObj = null;
113 // get the Legend
114 log.println( "getting Legend" );
115 oObj = xChartDoc.getLegend();
117 log.println( "creating a new environment for chartdocument object" );
118 TestEnvironment tEnv = new TestEnvironment( oObj );
120 tEnv.addObjRelation("NoSetSize", "sch.ChartLegend");
121 return tEnv;
122 } // finish method getTestEnvironment
125 } // finish class ChartLegend