merge the formfield patch from ooo-build
[ooovba.git] / qadevOOo / tests / java / mod / _sch / ChartTitle.java
blobd368cbae4f913bc6216257562cf1ddc2899daea4
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ChartTitle.java,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 package mod._sch;
33 import java.io.PrintWriter;
35 import lib.StatusException;
36 import lib.TestCase;
37 import lib.TestEnvironment;
38 import lib.TestParameters;
39 import util.SOfficeFactory;
41 import com.sun.star.chart.XChartDocument;
42 import com.sun.star.drawing.XShape;
43 import com.sun.star.lang.XMultiServiceFactory;
45 /**
46 * Test for object which is represented by service
47 * <code>com.sun.star.chart.ChartTitle</code>. <p>
48 * Object implements the following interfaces :
49 * <ul>
50 * <li> <code>com::sun::star::lang::XComponent</code></li>
51 * <li> <code>com::sun::star::chart::ChartTitle</code></li>
52 * <li> <code>com::sun::star::drawing::XShape</code></li>
53 * <li> <code>com::sun::star::drawing::XShapeDescriptor</code></li>
54 * <li> <code>com::sun::star::style::CharacterProperties</code></li>
55 * <li> <code>com::sun::star::beans::XPropertySet</code></li>
56 * <li> <code>com::sun::star::drawing::Shape</code></li>
57 * </ul>
58 * @see com.sun.star.lang.XComponent
59 * @see com.sun.star.chart.ChartTitle
60 * @see com.sun.star.drawing.XShape
61 * @see com.sun.star.drawing.XShapeDescriptor
62 * @see com.sun.star.style.CharacterProperties
63 * @see com.sun.star.beans.XPropertySet
64 * @see com.sun.star.drawing.Shape
65 * @see ifc.lang._XComponent
66 * @see ifc.chart._ChartTitle
67 * @see ifc.drawing._XShape
68 * @see ifc.drawing._XShapeDescriptor
69 * @see ifc.style._CharacterProperties
70 * @see ifc.beans._XPropertySet
71 * @see ifc.drawing._Shape
73 public class ChartTitle extends TestCase {
74 XChartDocument xChartDoc = null;
76 /**
77 * Creates Chart document.
79 protected void initialize( TestParameters tParam, PrintWriter log ) {
80 // get a soffice factory object
81 SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
83 try {
84 log.println( "creating a chartdocument" );
85 xChartDoc = SOF.createChartDoc(null);;
86 } catch (com.sun.star.uno.Exception e) {
87 // Some exception occures.FAILED
88 e.printStackTrace( log );
89 throw new StatusException( "Couldn't create document", e );
93 /**
94 * Disposes Chart document.
96 protected void cleanup( TestParameters tParam, PrintWriter log ) {
97 log.println( " closing xChartDoc " );
98 util.DesktopTools.closeDoc(xChartDoc);
102 * Creating a Testenvironment for the interfaces to be tested.
103 * Retrieves the shape of the main title of the chart document.
104 * The retrieved shape is the instance of the service
105 * <code>com.sun.star.chart.ChartTitle</code>.
107 protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
109 // get the Title
110 log.println( "getting Title" );
111 XShape oObj = (XShape) xChartDoc.getTitle();
113 log.println( "creating a new environment for chartdocument object" );
114 TestEnvironment tEnv = new TestEnvironment( oObj );
115 tEnv.addObjRelation("NoSetSize","sch.ChartTitle");
116 return tEnv;
117 } // finish method getTestEnvironment
119 } // finish class ChXChartObject_Title