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.sheet; 25 26 import lib.MultiPropertyTest; 27 import util.ValueChanger; 28 29 /** 30 * Testing <code>com.sun.star.sheet.SheetLink</code> 31 * service properties : 32 * <ul> 33 * <li><code> Url</code></li> 34 * <li><code> Filter</code></li> 35 * <li><code> FilterOptions</code></li> 36 * </ul> <p> 37 * Properties testing is automated by <code>lib.MultiPropertyTest</code>. 38 * @see com.sun.star.sheet.SheetLink 39 */ 40 public class _SheetLink extends MultiPropertyTest { 41 42 /** 43 *This class is destined to custom test of property <code>Url</code>. 44 */ 45 protected PropertyTester UrlTester = new PropertyTester() { 46 protected Object getNewValue(String propName, Object oldValue) { 47 String newValue = (String) ValueChanger.changePValue(oldValue); 48 if ( !newValue.startsWith("file://") ) { 49 newValue = "file://" + newValue; 50 } 51 52 return newValue; 53 } 54 }; 55 56 /** 57 * Test property <code>Url</code> using custom <code>PropertyTest</code>. 58 */ _Url()59 public void _Url() { 60 testProperty("Url", UrlTester); 61 } 62 63 /** 64 *This class is destined to custom test of property <code>Filter</code>. 65 */ 66 protected PropertyTester FilterTester = new PropertyTester() { 67 protected Object getNewValue(String propName, Object oldValue) { 68 return "StarCalc 4.0"; 69 } 70 }; 71 72 /** 73 * Test property <code>Filter</code> using custom <code>PropertyTest</code>. 74 */ _Filter()75 public void _Filter() { 76 testProperty("Filter", FilterTester); 77 } 78 } 79 80 81