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
.chart
.XChartDocument
;
29 import com
.sun
.star
.drawing
.XShape
;
32 * Test for object which is represented by service
33 * <code>com.sun.star.chart.ChartTitle</code>. <p>
34 * Object implements the following interfaces :
36 * <li> <code>com::sun::star::lang::XComponent</code></li>
37 * <li> <code>com::sun::star::chart::ChartTitle</code></li>
38 * <li> <code>com::sun::star::drawing::XShape</code></li>
39 * <li> <code>com::sun::star::drawing::XShapeDescriptor</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::drawing::Shape</code></li>
44 * @see com.sun.star.lang.XComponent
45 * @see com.sun.star.chart.ChartTitle
46 * @see com.sun.star.drawing.XShape
47 * @see com.sun.star.drawing.XShapeDescriptor
48 * @see com.sun.star.style.CharacterProperties
49 * @see com.sun.star.beans.XPropertySet
50 * @see com.sun.star.drawing.Shape
51 * @see ifc.lang._XComponent
52 * @see ifc.chart._ChartTitle
53 * @see ifc.drawing._XShape
54 * @see ifc.drawing._XShapeDescriptor
55 * @see ifc.style._CharacterProperties
56 * @see ifc.beans._XPropertySet
57 * @see ifc.drawing._Shape
59 public class ChartTitle
extends TestCase
{
60 XChartDocument xChartDoc
= null;
63 * Creates Chart document.
66 protected void initialize( TestParameters tParam
, PrintWriter log
) throws Exception
{
67 // get a soffice factory object
68 SOfficeFactory SOF
= SOfficeFactory
.getFactory( tParam
.getMSF());
69 log
.println( "creating a chartdocument" );
70 xChartDoc
= SOF
.createChartDoc();
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 * Retrieves the shape of the main title of the chart document.
88 * The retrieved shape is the instance of the service
89 * <code>com.sun.star.chart.ChartTitle</code>.
92 protected TestEnvironment
createTestEnvironment(TestParameters Param
, PrintWriter log
) {
95 log
.println( "getting Title" );
96 XShape oObj
= xChartDoc
.getTitle();
98 log
.println( "creating a new environment for chartdocument object" );
99 TestEnvironment tEnv
= new TestEnvironment( oObj
);
100 tEnv
.addObjRelation("NoSetSize","sch.ChartTitle");
102 } // finish method getTestEnvironment
104 } // finish class ChXChartObject_Title