1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
30 import lib
.MultiMethodTest
;
32 import com
.sun
.star
.awt
.Rectangle
;
33 import com
.sun
.star
.table
.CellRangeAddress
;
34 import com
.sun
.star
.table
.XTableCharts
;
37 * Testing <code>com.sun.star.table.XTableCharts</code>
40 * <li><code> addNewByName()</code></li>
41 * <li><code> removeByName()</code></li>
43 * This test needs the following object relations :
45 * <li> <code>'ADDR'</code>
46 * (of type <code>com.sun.star.table.CellRangeAddress[]</code>):
47 * data source ranges for chart creating. </li>
48 * <li> <code>'RECT'</code>
49 * (of type <code>com.sun.star.awt.Rectangle</code>):
50 * the position of chart </li>
52 * Test is <b> NOT </b> multithread compilant. <p>
53 * @see com.sun.star.table.XTableCharts
55 public class _XTableCharts
extends MultiMethodTest
{
57 public XTableCharts oObj
= null;
60 * Adds a new chart into table with specified name . <p>
61 * Has <b> OK </b> status if <code>hasByName()</code> returns
62 * <code>true</code>. <p>
64 public void _addNewByName() {
66 CellRangeAddress
[] the_Range
= (CellRangeAddress
[])
67 tEnv
.getObjRelation("ADDR");
68 Rectangle the_rect
= (Rectangle
) tEnv
.getObjRelation("RECT");
69 oObj
.addNewByName("XTableCharts",the_rect
,the_Range
,true,true);
70 tRes
.tested("addNewByName()", oObj
.hasByName("XTableCharts") );
75 * Removes the chart added before. <p>
76 * Has <b> OK </b> status if <code>hasByName()</code> returns
77 * <code>false</code>. <p>
78 * The following method tests are to be completed successfully before :
80 * <li> <code> addNewByName() </code> : chart mst be added first </li>
83 public void _removeByName() {
84 requiredMethod("addNewByName()") ;
86 oObj
.removeByName("XTableCharts");
87 tRes
.tested("removeByName()", !oObj
.hasByName("XTableCharts") );
91 } // finish class _XTableCharts