1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ChXChartDataArray.java,v $
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 ************************************************************************/
32 import java
.io
.PrintWriter
;
34 import lib
.StatusException
;
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
;
45 * Test for object which is represented by service
46 * <code>com.sun.star.chart.ChartDataArray</code>. <p>
47 * Object implements the following interfaces :
49 * <li> <code>com::sun::star::chart::XChartData</code></li>
50 * <li> <code>com::sun::star::chart::XChartDataArray</code></li>
52 * @see com.sun.star.chart.ChartDataArray
53 * @see com.sun.star.chart.XChartData
54 * @see com.sun.star.chart.XChartDataArray
55 * @see ifc.chart._XChartData
56 * @see ifc.chart._XChartDataArray
58 public class ChXChartDataArray
extends TestCase
{
59 XChartDocument xChartDoc
= null;
62 * Creates Chart document.
64 protected void initialize( TestParameters tParam
, PrintWriter log
) {
65 // get a soffice factory object
66 SOfficeFactory SOF
= SOfficeFactory
.getFactory( (XMultiServiceFactory
)tParam
.getMSF());
69 log
.println( "creating a chartdocument" );
70 xChartDoc
= SOF
.createChartDoc(null);;
71 } catch (com
.sun
.star
.uno
.Exception e
) {
72 // Some exception occures.FAILED
73 e
.printStackTrace( log
);
74 throw new StatusException( "Couldn't create document", e
);
79 * Disposes Chart document.
81 protected void cleanup( TestParameters tParam
, PrintWriter log
) {
82 log
.println( " closing xChartDoc " );
83 util
.DesktopTools
.closeDoc(xChartDoc
);
87 * Creating a Testenvironment for the interfaces to be tested.
88 * Retrieves the data source of the chart. This data source is the instance
89 * of the service <code>com.sun.star.chart.ChartDataArray</code>.
90 * <code>com.sun.star.chart.ChartDataArray</code>.
91 * @see com.sun.star.chart.ChartDataArray
93 protected synchronized TestEnvironment
createTestEnvironment(TestParameters Param
, PrintWriter log
) {
96 log
.println( "getting Data" );
97 XChartData oObj
= (XChartData
) xChartDoc
.getData();
99 log
.println( "creating a new environment for chartdocument object" );
100 TestEnvironment tEnv
= new TestEnvironment( oObj
);
103 } // finish method getTestEnvironment
105 } // finish class ChXChartDataArray