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
.XAxisYSupplier
;
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.ChartAxis</code>. <p>
37 * Object implements the following interfaces :
39 * <li> <code>com::sun::star::drawing::LineProperties</code></li>
40 * <li> <code>com::sun::star::style::CharacterProperties</code></li>
41 * <li> <code>com::sun::star::beans::XPropertySet</code></li>
42 * <li> <code>com::sun::star::chart::ChartAxis</code></li>
44 * @see com.sun.star.drawing.LineProperties
45 * @see com.sun.star.style.CharacterProperties
46 * @see com.sun.star.beans.XPropertySet
47 * @see com.sun.star.chart.ChartAxis
48 * @see ifc.drawing._LineProperties
49 * @see ifc.style._CharacterProperties
50 * @see ifc.beans._XPropertySet
51 * @see ifc.chart._ChartAxis
53 public class ChXChartAxis
extends TestCase
{
54 XChartDocument xChartDoc
= null;
57 * Creates Chart document.
60 protected void initialize( TestParameters tParam
, PrintWriter log
) throws Exception
{
61 // get a soffice factory object
62 SOfficeFactory SOF
= SOfficeFactory
.getFactory( tParam
.getMSF());
63 log
.println( "creating a chartdocument" );
64 xChartDoc
= SOF
.createChartDoc();
68 * Disposes Chart document.
71 protected void cleanup( TestParameters tParam
, PrintWriter log
) {
72 if( xChartDoc
!=null ) {
73 log
.println( " closing xChartDoc" );
74 util
.DesktopTools
.closeDoc(xChartDoc
);
80 * Creating a TestEnvironment for the interfaces to be tested.
81 * Retrieves the diagram of the chart document. Then obtains the properties
82 * of the y-axis of the diagram using the interface
83 * <code>XAxisYSupplier</code>. The obatined property is the instance
84 * of the service <code>com.sun.star.chart.ChartAxis</code>.
85 * @see com.sun.star.chart.XAxisYSupplier
86 * @see com.sun.star.chart.ChartAxis
89 protected TestEnvironment
createTestEnvironment(TestParameters Param
, PrintWriter log
) {
91 XPropertySet oObj
= null;
92 XShape oDiagram
= null;
94 // create testobject here
96 log
.println( "getting Diagram" );
97 oDiagram
= xChartDoc
.getDiagram();
100 log
.println( "getting ChartAxis" );
101 XAxisYSupplier oAxisSup
= UnoRuntime
.queryInterface(XAxisYSupplier
.class,oDiagram
);
102 oObj
= oAxisSup
.getYAxis();
104 log
.println( "creating a new environment for chartdocument object" );
105 TestEnvironment tEnv
= new TestEnvironment( oObj
);
108 } // finish method getTestEnvironment
112 } // finish class ChXChartAxis