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
;
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
;
35 * Test for object which is represented by service
36 * <code>com.sun.star.chart.ChartArea</code>. <p>
37 * Object implements the following interfaces :
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>
43 * The following files used by this test :
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>
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;
61 * Creates Chart document.
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
);
74 * Disposes Chart document.
77 protected void cleanup( TestParameters tParam
, PrintWriter log
) {
78 if( xChartDoc
!=null ) {
79 log
.println( " closing xChartDoc" );
80 util
.DesktopTools
.closeDoc(xChartDoc
);
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
93 protected TestEnvironment
createTestEnvironment(TestParameters Param
, PrintWriter log
) {
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
);
103 } // finish method getTestEnvironment
105 } // finish class ChartArea