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 .
21 import lib
.MultiMethodTest
;
23 import com
.sun
.star
.awt
.Rectangle
;
24 import com
.sun
.star
.table
.CellRangeAddress
;
25 import com
.sun
.star
.table
.XTableCharts
;
28 * Testing <code>com.sun.star.table.XTableCharts</code>
31 * <li><code> addNewByName()</code></li>
32 * <li><code> removeByName()</code></li>
34 * This test needs the following object relations :
36 * <li> <code>'ADDR'</code>
37 * (of type <code>com.sun.star.table.CellRangeAddress[]</code>):
38 * data source ranges for chart creating. </li>
39 * <li> <code>'RECT'</code>
40 * (of type <code>com.sun.star.awt.Rectangle</code>):
41 * the position of chart </li>
43 * Test is <b> NOT </b> multithread compliant. <p>
44 * @see com.sun.star.table.XTableCharts
46 public class _XTableCharts
extends MultiMethodTest
{
48 public XTableCharts oObj
= null;
51 * Adds a new chart into table with specified name . <p>
52 * Has <b> OK </b> status if <code>hasByName()</code> returns
53 * <code>true</code>. <p>
55 public void _addNewByName() {
57 CellRangeAddress
[] the_Range
= (CellRangeAddress
[])
58 tEnv
.getObjRelation("ADDR");
59 Rectangle the_rect
= (Rectangle
) tEnv
.getObjRelation("RECT");
60 oObj
.addNewByName("XTableCharts",the_rect
,the_Range
,true,true);
61 tRes
.tested("addNewByName()", oObj
.hasByName("XTableCharts") );
66 * Removes the chart added before. <p>
67 * Has <b> OK </b> status if <code>hasByName()</code> returns
68 * <code>false</code>. <p>
69 * The following method tests are to be completed successfully before :
71 * <li> <code> addNewByName() </code> : chart must be added first </li>
74 public void _removeByName() {
75 requiredMethod("addNewByName()") ;
77 oObj
.removeByName("XTableCharts");
78 tRes
.tested("removeByName()", !oObj
.hasByName("XTableCharts") );
82 } // finish class _XTableCharts