1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 package ifc.drawing;
29 
30 import lib.MultiPropertyTest;
31 
32 public class _AreaShapeDescriptor extends MultiPropertyTest {
33 
34     protected boolean compare(Object ob1, Object ob2) {
35 
36         return super.compare(ob1, ob2);
37 
38     }
39 
40     protected PropertyTester URLTester = new PropertyTester() {
41         protected Object getNewValue(String propName, Object oldValue)
42                 throws java.lang.IllegalArgumentException {
43             if (oldValue.equals(util.utils.getFullTestURL("space-metal.jpg")))
44                 return util.utils.getFullTestURL("crazy-blue.jpg"); else
45                 return util.utils.getFullTestURL("space-metal.jpg");
46         }
47     } ;
48 
49     protected PropertyTester StringTester = new PropertyTester() {
50         protected Object getNewValue(String propName, Object oldValue)
51                 throws java.lang.IllegalArgumentException {
52             if (oldValue.equals(str1))
53                 return str2; else
54                 return str1;
55         }
56     } ;
57 
58     public void _FillBitmapURL() {
59         log.println("Testing with custom Property tester") ;
60         testProperty("FillBitmapURL", URLTester) ;
61     }
62 
63     public String str1 = "";
64     public String str2 = "";
65 
66     public void _FillGradientName() {
67         log.println("Testing with custom Property tester") ;
68         str1 = "Gradient 1";
69         str2 = "Gradient 3";
70         testProperty("FillGradientName", StringTester) ;
71     }
72 
73     public void _FillBitmapName() {
74         log.println("Testing with custom Property tester") ;
75         str1 = "Sky";
76         str2 = "Blank";
77         testProperty("FillBitmapName", StringTester) ;
78     }
79 
80     public void _FillTransparenceGradientName() {
81         log.println("Testing with custom Property tester") ;
82         str1 = "Standard 1";
83         str2 = "Standard 2";
84         testProperty("FillTransparenceGradientName", StringTester) ;
85     }
86 
87     public void _FillHatchName() {
88         log.println("Testing with custom Property tester") ;
89         str1 = "Black 0 degrees";
90         str2 = "Black 45 degrees";
91         testProperty("FillHatchName", StringTester) ;
92     }
93 
94     public void _FillBitmapMode() {
95         log.println("Testing with custom Property tester") ;
96         try {
97             Object getting = oObj.getPropertyValue("FillBitmapMode");
98             if (! (getting instanceof com.sun.star.drawing.BitmapMode)) {
99                 log.println("getting the property 'FillBitmapMode'");
100                 log.println("return "+ oObj.getClass().getName());
101                 log.println("Expected was 'com.sun.star.drawing.BitmapMode'");
102                 tRes.tested("FillBitmapMode",false);
103             } else testProperty("FillBitmapMode");
104         }
105         catch (Exception ex) {
106             log.println("Exception while checking 'FillBitmapMode'");
107             ex.printStackTrace(log);
108             tRes.tested("FillBitmapMode",false);
109         }
110 
111     }
112 
113 }
114 
115 
116