bump product version to 5.0.4.1
[LibreOffice.git] / qadevOOo / tests / java / mod / _sch / ChXChartData.java
blob7985996a06702a51c1c5d9d039e5a68720f8bc96
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;
31 /**
32 * Test for object which is represented by service
33 * <code>com.sun.star.chart.ChartData</code>. <p>
34 * Object implements the following interfaces :
35 * <ul>
36 * <li> <code>com::sun::star::chart::XChartData</code></li>
37 * </ul>
38 * @see com.sun.star.chart.ChartData
39 * @see com.sun.star.chart.XChartData
40 * @see ifc.chart._XChartData
42 public class ChXChartData extends TestCase {
43 XChartDocument xChartDoc = null;
45 /**
46 * Creates Chart document.
48 @Override
49 protected void initialize( TestParameters tParam, PrintWriter log ) {
50 // get a soffice factory object
51 SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF());
53 try {
54 log.println( "creating a chartdocument" );
55 xChartDoc = SOF.createChartDoc();
56 } catch (com.sun.star.uno.Exception e) {
57 // Some exception occurs.FAILED
58 e.printStackTrace( log );
59 throw new StatusException( "Couldn't create document", e );
63 /**
64 * Disposes Chart document.
66 @Override
67 protected void cleanup( TestParameters tParam, PrintWriter log ) {
68 if( xChartDoc!=null ) {
69 log.println( " closing xChartDoc" );
70 util.DesktopTools.closeDoc(xChartDoc);
71 xChartDoc = null;
75 /**
76 * Creating a Testenvironment for the interfaces to be tested.
77 * Retrieves the data source of the chart. This data source is the instance
78 * of the service <code>com.sun.star.chart.ChartData</code>.
79 * @see com.sun.star.chart.ChartData
81 @Override
82 protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
84 // get the Data
85 log.println( "getting Data" );
86 XChartData oObj = xChartDoc.getData();
88 log.println( "creating a new environment for chartdocument object" );
89 TestEnvironment tEnv = new TestEnvironment( oObj );
91 return tEnv;
92 } // finish method getTestEnvironment
94 } // finish class ChXChartData