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: _AreaShapeDescriptor.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
;
35 public class _AreaShapeDescriptor
extends MultiPropertyTest
{
37 protected boolean compare(Object ob1
, Object ob2
) {
39 return super.compare(ob1
, ob2
);
43 protected PropertyTester URLTester
= new PropertyTester() {
44 protected Object
getNewValue(String propName
, Object oldValue
)
45 throws java
.lang
.IllegalArgumentException
{
46 if (oldValue
.equals(util
.utils
.getFullTestURL("space-metal.jpg")))
47 return util
.utils
.getFullTestURL("crazy-blue.jpg"); else
48 return util
.utils
.getFullTestURL("space-metal.jpg");
52 protected PropertyTester StringTester
= new PropertyTester() {
53 protected Object
getNewValue(String propName
, Object oldValue
)
54 throws java
.lang
.IllegalArgumentException
{
55 if (oldValue
.equals(str1
))
61 public void _FillBitmapURL() {
62 log
.println("Testing with custom Property tester") ;
63 testProperty("FillBitmapURL", URLTester
) ;
66 public String str1
= "";
67 public String str2
= "";
69 public void _FillGradientName() {
70 log
.println("Testing with custom Property tester") ;
73 testProperty("FillGradientName", StringTester
) ;
76 public void _FillBitmapName() {
77 log
.println("Testing with custom Property tester") ;
80 testProperty("FillBitmapName", StringTester
) ;
83 public void _FillTransparenceGradientName() {
84 log
.println("Testing with custom Property tester") ;
87 testProperty("FillTransparenceGradientName", StringTester
) ;
90 public void _FillHatchName() {
91 log
.println("Testing with custom Property tester") ;
92 str1
= "Black 0 degrees";
93 str2
= "Black 45 degrees";
94 testProperty("FillHatchName", StringTester
) ;
97 public void _FillBitmapMode() {
98 log
.println("Testing with custom Property tester") ;
100 Object getting
= oObj
.getPropertyValue("FillBitmapMode");
101 if (! (getting
instanceof com
.sun
.star
.drawing
.BitmapMode
)) {
102 log
.println("getting the property 'FillBitmapMode'");
103 log
.println("return "+ oObj
.getClass().getName());
104 log
.println("Expected was 'com.sun.star.drawing.BitmapMode'");
105 tRes
.tested("FillBitmapMode",false);
106 } else testProperty("FillBitmapMode");
108 catch (Exception ex
) {
109 log
.println("Exception while checking 'FillBitmapMode'");
110 ex
.printStackTrace(log
);
111 tRes
.tested("FillBitmapMode",false);