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 import lib.Status;
28 
29 /**
30 * Testing <code>com.sun.star.drawing.RotationDescriptor</code>
31 * service properties :
32 * <ul>
33 *  <li><code> RotateAngle</code></li>
34 *  <li><code> ShearAngle</code></li>
35 * </ul> <p>
36 * Properties testing is automated by <code>lib.MultiPropertyTest</code>.
37 * @see com.sun.star.drawing.RotationDescriptor
38 */
39 public class _RotationDescriptor extends MultiPropertyTest {
40 
41     /**
42      * Custom tester which increases value by 200
43      */
44     protected PropertyTester drawMeasureTester = new PropertyTester() {
45         protected Object getNewValue(String propName, Object oldValue) {
46             int val = ((Integer)oldValue).intValue() ;
47             return new Integer(val + 200) ;
48         }
49     } ;
50 
51     /**
52      * !!! DEPRECATED !!!
53      */
_RotationPointX()54     public void _RotationPointX() {
55         log.println("Testing with custom Property tester") ;
56         testProperty("RotationPointX", drawMeasureTester) ;
57     }
58 
59     /**
60      * !!! DEPRECATED !!!
61      */
_RotationPointY()62     public void _RotationPointY() {
63         log.println("Testing with custom Property tester") ;
64         testProperty("RotationPointY", drawMeasureTester) ;
65     }
66 
67     /**
68      * Tests the property with custom tester
69      */
_ShearAngle()70     public void _ShearAngle() {
71 
72         Object noShear = tEnv.getObjRelation("NoShear");
73 
74         if (noShear != null) {
75             log.println("This shape type doesn't support shear, see #85556#");
76             tRes.tested("ShearAngle",Status.skipped(true));
77             return;
78         }
79 
80         try {
81             oObj.setPropertyValue("RotateAngle",new Short((short) 0));
82         } catch (Exception e) {
83         }
84         log.println("Testing with custom Property tester") ;
85         testProperty("ShearAngle", drawMeasureTester) ;
86     }
87 
88     /**
89      * Tests the property with custom tester
90      */
_RotateAngle()91     public void _RotateAngle() {
92         log.println("Testing with custom Property tester") ;
93         testProperty("RotateAngle", drawMeasureTester) ;
94     }
95 
96 }  // finish class _RotationDescriptor
97 
98 
99