tdf#130857 qt weld: Introduce QtInstanceScrolledWindow
[LibreOffice.git] / qadevOOo / tests / java / mod / _sch / ChartGrid.java
blob79b3aa3f0282a72105afec533b70fbf135ef2c0f
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;
28 import com.sun.star.beans.XPropertySet;
29 import com.sun.star.chart.XAxisXSupplier;
30 import com.sun.star.chart.XChartDocument;
31 import com.sun.star.drawing.XShape;
32 import com.sun.star.uno.UnoRuntime;
34 /**
35 * Test for object which is represented by service
36 * <code>com.sun.star.chart.ChartGrid</code>. <p>
37 * Object implements the following interfaces :
38 * <ul>
39 * <li> <code>com::sun::star::drawing::LineProperties</code></li>
40 * <li> <code>com::sun::star::beans::XPropertySet</code></li>
41 * </ul>
42 * @see com.sun.star.chart.ChartGrid
43 * @see com.sun.star.drawing.LineProperties
44 * @see com.sun.star.beans.XPropertySet
45 * @see ifc.drawing._LineProperties
46 * @see ifc.beans._XPropertySet
48 public class ChartGrid extends TestCase {
49 XChartDocument xChartDoc = null;
51 /**
52 * Creates Chart document.
54 @Override
55 protected void initialize( TestParameters tParam, PrintWriter log ) throws Exception {
56 // get a soffice factory object
57 SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF());
58 log.println( "creating a chartdocument" );
59 xChartDoc = SOF.createChartDoc();
62 /**
63 * Disposes Chart document.
65 @Override
66 protected void cleanup( TestParameters tParam, PrintWriter log ) {
67 if( xChartDoc!=null ) {
68 log.println( " closing xChartDoc" );
69 util.DesktopTools.closeDoc(xChartDoc);
70 xChartDoc = null;
74 /**
75 * Creating a TestEnvironment for the interfaces to be tested.
76 * Retrieves the diagram of the chart document. Then obtains
77 * the properties of the main grid of the x-axis of the diagram
78 * using the interface <code>XAxisXSupplier</code>. This properties is
79 * the instance of the service <code>com.sun.star.chart.ChartGrid</code>.
80 * @see com.sun.star.chart.XAxisXSupplier
81 * @see com.sun.star.chart.ChartGrid
83 @Override
84 protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
85 XPropertySet oObj = null;
86 XShape oDiagram = null;
88 // get the Diagram
89 log.println( "getting Diagram" );
90 oDiagram = xChartDoc.getDiagram();
92 // get the Grid
93 log.println( "getting ChartGrid" );
94 XAxisXSupplier oAxisSup = UnoRuntime.queryInterface(XAxisXSupplier.class,oDiagram);
95 oObj = oAxisSup.getXMainGrid();
97 log.println( "creating a new environment for chartdocument object" );
98 TestEnvironment tEnv = new TestEnvironment( oObj );
100 return tEnv;
101 } // finish method getTestEnvironment
104 } // finish class ChartGrid