/**************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*************************************************************/
package ifc.drawing;
import lib.MultiMethodTest;
import com.sun.star.awt.Point;
import com.sun.star.awt.Size;
import com.sun.star.drawing.XShape;
/**
* Testing com.sun.star.drawing.XShape
* interface methods :
*
getPosition()
setPosition()
getSize()
setSize()
* This test needs the following object relations : *
'NoPos'
optional
* (of type Object
):
* if this relation exists then position setting is
* not supported by the object.* Test is NOT multithread compilant.
* @see com.sun.star.drawing.XShape */ public class _XShape extends MultiMethodTest { public XShape oObj = null; //oObj filled by MultiMethodTest Size sOld = new Size(); Point pOld = new Point(); Size sNew = new Size(); Point pNew = new Point(); /** * Gets the size and stores it.
* Has OK status if the method successfully returns * and no exceptions were thrown.
*/ public void _getSize(){ boolean result = false; log.println("get the size"); sOld = (Size) oObj.getSize(); result = true; tRes.tested("getSize()", result); } /** * Gets the current position and stores it if the object * supports position setting.
* Has OK status if the method successfully returns * and no exceptions were thrown or object doesn't * support position setting.
*/ public void _getPosition(){ boolean result = false; String obj = (String) tEnv.getObjRelation("NoPos"); if (obj != null) { log.println("Can't be used with "+obj); result = true; tRes.tested("getPosition()", result); return; } log.println("get the position"); pOld = (Point) oObj.getPosition(); result = true; tRes.tested("getPosition()", result); } /** * Sets a new size different from the size get before.
* Has OK status if the size returned by getSize()
* is equal to the size which was set.
* The following method tests are to be completed successfully before : *
getSize()
: to set the original size changed.* Has OK status if get position is equal to set position or * if the position setting isn't supported.
* The following method tests are to be completed successfully before : *
getPosition()
: to change old position.