1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 package ifc.drawing; 25 26 import lib.MultiPropertyTest; 27 28 public class _AreaShapeDescriptor extends MultiPropertyTest { 29 compare(Object ob1, Object ob2)30 protected boolean compare(Object ob1, Object ob2) { 31 32 return super.compare(ob1, ob2); 33 34 } 35 36 protected PropertyTester URLTester = new PropertyTester() { 37 protected Object getNewValue(String propName, Object oldValue) 38 throws java.lang.IllegalArgumentException { 39 if (oldValue.equals(util.utils.getFullTestURL("space-metal.jpg"))) 40 return util.utils.getFullTestURL("crazy-blue.jpg"); else 41 return util.utils.getFullTestURL("space-metal.jpg"); 42 } 43 } ; 44 45 protected PropertyTester StringTester = new PropertyTester() { 46 protected Object getNewValue(String propName, Object oldValue) 47 throws java.lang.IllegalArgumentException { 48 if (oldValue.equals(str1)) 49 return str2; else 50 return str1; 51 } 52 } ; 53 _FillBitmapURL()54 public void _FillBitmapURL() { 55 log.println("Testing with custom Property tester") ; 56 testProperty("FillBitmapURL", URLTester) ; 57 } 58 59 public String str1 = ""; 60 public String str2 = ""; 61 _FillGradientName()62 public void _FillGradientName() { 63 log.println("Testing with custom Property tester") ; 64 str1 = "Gradient 1"; 65 str2 = "Gradient 3"; 66 testProperty("FillGradientName", StringTester) ; 67 } 68 _FillBitmapName()69 public void _FillBitmapName() { 70 log.println("Testing with custom Property tester") ; 71 str1 = "Sky"; 72 str2 = "Blank"; 73 testProperty("FillBitmapName", StringTester) ; 74 } 75 _FillTransparenceGradientName()76 public void _FillTransparenceGradientName() { 77 log.println("Testing with custom Property tester") ; 78 str1 = "Standard 1"; 79 str2 = "Standard 2"; 80 testProperty("FillTransparenceGradientName", StringTester) ; 81 } 82 _FillHatchName()83 public void _FillHatchName() { 84 log.println("Testing with custom Property tester") ; 85 str1 = "Black 0 degrees"; 86 str2 = "Black 45 degrees"; 87 testProperty("FillHatchName", StringTester) ; 88 } 89 _FillBitmapMode()90 public void _FillBitmapMode() { 91 log.println("Testing with custom Property tester") ; 92 try { 93 Object getting = oObj.getPropertyValue("FillBitmapMode"); 94 if (! (getting instanceof com.sun.star.drawing.BitmapMode)) { 95 log.println("getting the property 'FillBitmapMode'"); 96 log.println("return "+ oObj.getClass().getName()); 97 log.println("Expected was 'com.sun.star.drawing.BitmapMode'"); 98 tRes.tested("FillBitmapMode",false); 99 } else testProperty("FillBitmapMode"); 100 } 101 catch (Exception ex) { 102 log.println("Exception while checking 'FillBitmapMode'"); 103 ex.printStackTrace(log); 104 tRes.tested("FillBitmapMode",false); 105 } 106 107 } 108 109 } 110 111 112