tdf#130857 qt weld: Introduce QtInstanceScrolledWindow
[LibreOffice.git] / qadevOOo / tests / java / mod / _sch / ChartArea.java
blobc81a7cea2fa70b2af03d95898d52e6c083c45824
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.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.ChartArea</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::LineProperties</code></li>
41 * <li> <code>com::sun::star::beans::XPropertySet</code></li>
42 * </ul>
43 * The following files used by this test :
44 * <ul>
45 * <li><b> TransparencyChart.sxs </b> : to load predefined chart
46 * document where two 'automatic' transparency styles exists :
47 * 'Transparency 1' and 'Transparency 2'.</li>
48 * </ul> <p>
49 * @see com.sun.star.chart.ChartArea
50 * @see com.sun.star.drawing.FillProperties
51 * @see com.sun.star.drawing.LineProperties
52 * @see com.sun.star.beans.XPropertySet
53 * @see ifc.drawing._FillProperties
54 * @see ifc.drawing._LineProperties
55 * @see ifc.beans._XPropertySet
57 public class ChartArea extends TestCase {
58 XChartDocument xChartDoc = null;
60 /**
61 * Creates Chart document.
63 @Override
64 protected void initialize( TestParameters tParam, PrintWriter log ) throws Exception {
65 // get a soffice factory object
66 SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF());
67 log.println( "creating a chartdocument" );
68 XComponent xComp = SOF.loadDocument(
69 utils.getFullTestURL("TransparencyChart.sxs"));
70 xChartDoc = UnoRuntime.queryInterface(XChartDocument.class,xComp);
73 /**
74 * Disposes Chart document.
76 @Override
77 protected void cleanup( TestParameters tParam, PrintWriter log ) {
78 if( xChartDoc!=null ) {
79 log.println( " closing xChartDoc" );
80 util.DesktopTools.closeDoc(xChartDoc);
81 xChartDoc = null;
85 /**
86 * Creating a TestEnvironment for the interfaces to be tested.
87 * Retrieved the instance of the service <code>com.sun.star.chart.ChartArea</code>
88 * using the interface <code>XChartDocument</code>.
89 * @see com.sun.star.chart.XChartDocument
90 * @see com.sun.star.chart.ChartArea
92 @Override
93 protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
95 // get the Area
96 log.println( "getting Area" );
97 XPropertySet oObj = xChartDoc.getArea();
99 log.println( "creating a new environment for chartdocument object" );
100 TestEnvironment tEnv = new TestEnvironment( oObj );
102 return tEnv;
103 } // finish method getTestEnvironment
105 } // finish class ChartArea