bump product version to 5.0.4.1
[LibreOffice.git] / qadevOOo / tests / java / mod / _sch / ChartTitle.java
blobf933ad5f3d3ba6fed90eeb73a6ecafad3d76b345
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.StatusException;
24 import lib.TestCase;
25 import lib.TestEnvironment;
26 import lib.TestParameters;
27 import util.SOfficeFactory;
29 import com.sun.star.chart.XChartDocument;
30 import com.sun.star.drawing.XShape;
32 /**
33 * Test for object which is represented by service
34 * <code>com.sun.star.chart.ChartTitle</code>. <p>
35 * Object implements the following interfaces :
36 * <ul>
37 * <li> <code>com::sun::star::lang::XComponent</code></li>
38 * <li> <code>com::sun::star::chart::ChartTitle</code></li>
39 * <li> <code>com::sun::star::drawing::XShape</code></li>
40 * <li> <code>com::sun::star::drawing::XShapeDescriptor</code></li>
41 * <li> <code>com::sun::star::style::CharacterProperties</code></li>
42 * <li> <code>com::sun::star::beans::XPropertySet</code></li>
43 * <li> <code>com::sun::star::drawing::Shape</code></li>
44 * </ul>
45 * @see com.sun.star.lang.XComponent
46 * @see com.sun.star.chart.ChartTitle
47 * @see com.sun.star.drawing.XShape
48 * @see com.sun.star.drawing.XShapeDescriptor
49 * @see com.sun.star.style.CharacterProperties
50 * @see com.sun.star.beans.XPropertySet
51 * @see com.sun.star.drawing.Shape
52 * @see ifc.lang._XComponent
53 * @see ifc.chart._ChartTitle
54 * @see ifc.drawing._XShape
55 * @see ifc.drawing._XShapeDescriptor
56 * @see ifc.style._CharacterProperties
57 * @see ifc.beans._XPropertySet
58 * @see ifc.drawing._Shape
60 public class ChartTitle extends TestCase {
61 XChartDocument xChartDoc = null;
63 /**
64 * Creates Chart document.
66 @Override
67 protected void initialize( TestParameters tParam, PrintWriter log ) {
68 // get a soffice factory object
69 SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF());
71 try {
72 log.println( "creating a chartdocument" );
73 xChartDoc = SOF.createChartDoc();
74 } catch (com.sun.star.uno.Exception e) {
75 // Some exception occurs.FAILED
76 e.printStackTrace( log );
77 throw new StatusException( "Couldn't create document", e );
81 /**
82 * Disposes Chart document.
84 @Override
85 protected void cleanup( TestParameters tParam, PrintWriter log ) {
86 if( xChartDoc!=null ) {
87 log.println( " closing xChartDoc" );
88 util.DesktopTools.closeDoc(xChartDoc);
89 xChartDoc = null;
93 /**
94 * Creating a Testenvironment for the interfaces to be tested.
95 * Retrieves the shape of the main title of the chart document.
96 * The retrieved shape is the instance of the service
97 * <code>com.sun.star.chart.ChartTitle</code>.
99 @Override
100 protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
102 // get the Title
103 log.println( "getting Title" );
104 XShape oObj = xChartDoc.getTitle();
106 log.println( "creating a new environment for chartdocument object" );
107 TestEnvironment tEnv = new TestEnvironment( oObj );
108 tEnv.addObjRelation("NoSetSize","sch.ChartTitle");
109 return tEnv;
110 } // finish method getTestEnvironment
112 } // finish class ChXChartObject_Title