bump product version to 4.2.0.1
[LibreOffice.git] / qadevOOo / tests / java / mod / _sch / ChXChartDataArray.java
blob17135967bd38e3ce283c64600b4cc2f6d430be39
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;
20 import java.io.PrintWriter;
22 import lib.StatusException;
23 import lib.TestCase;
24 import lib.TestEnvironment;
25 import lib.TestParameters;
26 import util.SOfficeFactory;
28 import com.sun.star.chart.XChartData;
29 import com.sun.star.chart.XChartDocument;
30 import com.sun.star.lang.XMultiServiceFactory;
32 /**
33 * Test for object which is represented by service
34 * <code>com.sun.star.chart.ChartDataArray</code>. <p>
35 * Object implements the following interfaces :
36 * <ul>
37 * <li> <code>com::sun::star::chart::XChartData</code></li>
38 * <li> <code>com::sun::star::chart::XChartDataArray</code></li>
39 * </ul>
40 * @see com.sun.star.chart.ChartDataArray
41 * @see com.sun.star.chart.XChartData
42 * @see com.sun.star.chart.XChartDataArray
43 * @see ifc.chart._XChartData
44 * @see ifc.chart._XChartDataArray
46 public class ChXChartDataArray extends TestCase {
47 XChartDocument xChartDoc = null;
49 /**
50 * Creates Chart document.
52 protected void initialize( TestParameters tParam, PrintWriter log ) {
53 // get a soffice factory object
54 SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF());
56 try {
57 log.println( "creating a chartdocument" );
58 xChartDoc = SOF.createChartDoc(null);
59 } catch (com.sun.star.uno.Exception e) {
60 // Some exception occurs.FAILED
61 e.printStackTrace( log );
62 throw new StatusException( "Couldn't create document", e );
66 /**
67 * Disposes Chart document.
69 protected void cleanup( TestParameters tParam, PrintWriter log ) {
70 if( xChartDoc!=null ) {
71 log.println( " closing xChartDoc" );
72 util.DesktopTools.closeDoc(xChartDoc);
73 xChartDoc = null;
77 /**
78 * Creating a Testenvironment for the interfaces to be tested.
79 * Retrieves the data source of the chart. This data source is the instance
80 * of the service <code>com.sun.star.chart.ChartDataArray</code>.
81 * <code>com.sun.star.chart.ChartDataArray</code>.
82 * @see com.sun.star.chart.ChartDataArray
84 protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
86 // get the Data
87 log.println( "getting Data" );
88 XChartData oObj = xChartDoc.getData();
90 log.println( "creating a new environment for chartdocument object" );
91 TestEnvironment tEnv = new TestEnvironment( oObj );
93 return tEnv;
94 } // finish method getTestEnvironment
96 } // finish class ChXChartDataArray