merge the formfield patch from ooo-build
[ooovba.git] / qadevOOo / tests / java / mod / _sch / ChXChartData.java
blob4f10837bfaefe3bc7e0ef6e92798b0492fafabf9
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: ChXChartData.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;
32 import java.io.PrintWriter;
34 import lib.StatusException;
35 import lib.TestCase;
36 import lib.TestEnvironment;
37 import lib.TestParameters;
38 import util.SOfficeFactory;
40 import com.sun.star.chart.XChartData;
41 import com.sun.star.chart.XChartDocument;
42 import com.sun.star.lang.XMultiServiceFactory;
44 /**
45 * Test for object which is represented by service
46 * <code>com.sun.star.chart.ChartData</code>. <p>
47 * Object implements the following interfaces :
48 * <ul>
49 * <li> <code>com::sun::star::chart::XChartData</code></li>
50 * </ul>
51 * @see com.sun.star.chart.ChartData
52 * @see com.sun.star.chart.XChartData
53 * @see ifc.chart._XChartData
55 public class ChXChartData extends TestCase {
56 XChartDocument xChartDoc = null;
58 /**
59 * Creates Chart document.
61 protected void initialize( TestParameters tParam, PrintWriter log ) {
62 // get a soffice factory object
63 SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
65 try {
66 log.println( "creating a chartdocument" );
67 xChartDoc = SOF.createChartDoc(null);;
68 } catch (com.sun.star.uno.Exception e) {
69 // Some exception occures.FAILED
70 e.printStackTrace( log );
71 throw new StatusException( "Couldn't create document", e );
75 /**
76 * Disposes Chart document.
78 protected void cleanup( TestParameters tParam, PrintWriter log ) {
79 log.println( " closing xChartDoc " );
80 util.DesktopTools.closeDoc(xChartDoc);
83 /**
84 * Creating a Testenvironment for the interfaces to be tested.
85 * Retrieves the data source of the chart. This data source is the instance
86 * of the service <code>com.sun.star.chart.ChartData</code>.
87 * @see com.sun.star.chart.ChartData
89 protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
91 // get the Data
92 log.println( "getting Data" );
93 XChartData oObj = (XChartData) xChartDoc.getData();
95 log.println( "creating a new environment for chartdocument object" );
96 TestEnvironment tEnv = new TestEnvironment( oObj );
98 return tEnv;
99 } // finish method getTestEnvironment
101 } // finish class ChXChartData