merge the formfield patch from ooo-build
[ooovba.git] / qadevOOo / tests / java / ifc / text / _CellRange.java
blobb083aadc6a27c62c2399cb86c8ed8719f3a2ea8d
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: _CellRange.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.text;
33 import lib.MultiPropertyTest;
35 /**
36 * Testing <code>com.sun.star.text.CellRange</code>
37 * service properties :
38 * <ul>
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:
51 * <ul>
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>
56 * </ul> <p>
57 * Properties testing is automated by <code>lib.MultiPropertyTest</code>.
58 * @see com.sun.star.text.CellProperties
60 public class _CellRange extends MultiPropertyTest {
62 /**
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) )
72 return val2;
73 else
74 return val1;
76 });
79 /**
80 * This property could be changed only when graphic
81 * URL is set.
83 public void _BackGraphicFilter() {
84 executeMethod("BackGraphicURL");
85 testProperty("BackGraphicFilter");
88 /**
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
96 ("space-metal.jpg")))
97 return util.utils.getFullTestURL("crazy-blue.jpg");
98 else
99 return util.utils.getFullTestURL("space-metal.jpg");