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: _CellRange.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 ************************************************************************/
33 import lib
.MultiPropertyTest
;
36 * Testing <code>com.sun.star.text.CellRange</code>
37 * service properties :
39 * <li><code> BackColor</code></li>
40 * <li><code> BackGraphicURL</code></li>
41 * <li><code> BackGraphicFilter</code></li>
42 * <li><code> BackGraphicLocation</code></li>
43 * <li><code> BackTransparent</code></li>
44 * <li><code> ChartColumnAsLabel</code></li>
45 * <li><code> ChartRowAsLabel</code></li>
46 * <li><code> NumberFormat</code></li>
47 * <li><code> TopMargin</code></li>
48 * <li><code> BottomMargin</code></li>
50 * The following predefined files needed to complete the test:
52 * <li> <code> crazy-blue.jpg </code> : jpeg image used to test
53 * BackGraphicURL()</li>
54 * <li> <code> space-metal.jpg </code> : jpeg image used to test
55 * BackGraphicURL()</li>
57 * Properties testing is automated by <code>lib.MultiPropertyTest</code>.
58 * @see com.sun.star.text.CellProperties
60 public class _CellRange
extends MultiPropertyTest
{
63 * Redefined method returns value, that differs from property value.
65 public void _BackColor() {
66 final Short val1
= new Short( (short) 4 );
67 final Short val2
= new Short( (short) 6 );
68 log
.println("Testing with custom Property tester") ;
69 testProperty("BackColor", new PropertyTester() {
70 protected Object
getNewValue(String propName
, Object oldValue
) {
71 if ( oldValue
.equals(val1
) )
80 * This property could be changed only when graphic
83 public void _BackGraphicFilter() {
84 executeMethod("BackGraphicURL");
85 testProperty("BackGraphicFilter");
89 * Redefined method returns value, that differs from property value.
91 public void _BackGraphicURL() {
92 log
.println("Testing with custom Property tester") ;
93 testProperty("BackGraphicURL", new PropertyTester() {
94 protected Object
getNewValue(String propName
, Object oldValue
) {
95 if (oldValue
.equals(util
.utils
.getFullTestURL
97 return util
.utils
.getFullTestURL("crazy-blue.jpg");
99 return util
.utils
.getFullTestURL("space-metal.jpg");