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 .
21 import java
.io
.PrintWriter
;
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
;
35 * Test for object which is represented by service
36 * <code>com.sun.star.chart.ChartGrid</code>. <p>
37 * Object implements the following interfaces :
39 * <li> <code>com::sun::star::drawing::LineProperties</code></li>
40 * <li> <code>com::sun::star::beans::XPropertySet</code></li>
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;
52 * Creates Chart document.
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();
63 * Disposes Chart document.
66 protected void cleanup( TestParameters tParam
, PrintWriter log
) {
67 if( xChartDoc
!=null ) {
68 log
.println( " closing xChartDoc" );
69 util
.DesktopTools
.closeDoc(xChartDoc
);
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
84 protected TestEnvironment
createTestEnvironment(TestParameters Param
, PrintWriter log
) {
85 XPropertySet oObj
= null;
86 XShape oDiagram
= null;
89 log
.println( "getting Diagram" );
90 oDiagram
= xChartDoc
.getDiagram();
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
);
101 } // finish method getTestEnvironment
104 } // finish class ChartGrid