Update ooo320-m1
[ooovba.git] / qadevOOo / tests / java / ifc / table / _XTableCharts.java
blob2bb64be993e6811b013fff3f2dcb02b69799bdc9
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: _XTableCharts.java,v $
10 * $Revision: 1.4 $
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 ifc.table;
33 import lib.MultiMethodTest;
35 import com.sun.star.awt.Rectangle;
36 import com.sun.star.table.CellRangeAddress;
37 import com.sun.star.table.XTableCharts;
39 /**
40 * Testing <code>com.sun.star.table.XTableCharts</code>
41 * interface methods :
42 * <ul>
43 * <li><code> addNewByName()</code></li>
44 * <li><code> removeByName()</code></li>
45 * </ul> <p>
46 * This test needs the following object relations :
47 * <ul>
48 * <li> <code>'ADDR'</code>
49 * (of type <code>com.sun.star.table.CellRangeAddress[]</code>):
50 * data source ranges for chart creating. </li>
51 * <li> <code>'RECT'</code>
52 * (of type <code>com.sun.star.awt.Rectangle</code>):
53 * the position of chart </li>
54 * <ul> <p>
55 * Test is <b> NOT </b> multithread compilant. <p>
56 * @see com.sun.star.table.XTableCharts
58 public class _XTableCharts extends MultiMethodTest {
60 public XTableCharts oObj = null;
62 /**
63 * Adds a new chart into table with specified name . <p>
64 * Has <b> OK </b> status if <code>hasByName()</code> returns
65 * <code>true</code>. <p>
67 public void _addNewByName() {
69 CellRangeAddress[] the_Range = (CellRangeAddress[])
70 tEnv.getObjRelation("ADDR");
71 Rectangle the_rect = (Rectangle) tEnv.getObjRelation("RECT");
72 oObj.addNewByName("XTableCharts",the_rect,the_Range,true,true);
73 tRes.tested("addNewByName()", oObj.hasByName("XTableCharts") );
75 } // addNewByName()
77 /**
78 * Removes the chart added before. <p>
79 * Has <b> OK </b> status if <code>hasByName()</code> returns
80 * <code>false</code>. <p>
81 * The following method tests are to be completed successfully before :
82 * <ul>
83 * <li> <code> addNewByName() </code> : chart mst be added first </li>
84 * </ul>
86 public void _removeByName() {
87 requiredMethod("addNewByName()") ;
89 oObj.removeByName("XTableCharts");
90 tRes.tested("removeByName()", !oObj.hasByName("XTableCharts") );
92 } // removeByName()
94 } // finish class _XTableCharts