/**************************************************************
*
* 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.awt;
import lib.MultiMethodTest;
import com.sun.star.awt.XControl;
import com.sun.star.awt.XControlContainer;
/**
* Testing com.sun.star.awt.XControlContainer
* interface methods:
*
setStatusText()
addControl()
removeControl()
getControl()
getControls()
* This test needs the following object relations : *
'CONTROL1'
(of type XControl
):
* used as a parameter to addControl(), getControl() and removeControl()'CONTROL2'
(of type XControl
):
* used as a parameter to addControl(), getControl() and removeControl()* Test is NOT multithread compilant.
* @see com.sun.star.awt.XControlContainer */ public class _XControlContainer extends MultiMethodTest { public XControlContainer oObj = null; /** * Test calls the method.
* Has OK status if the method successfully returns * and no exceptions were thrown. */ public void _setStatusText() { oObj.setStatusText("testing XControlContainer::setStatusText(String)"); tRes.tested("setStatusText()",true); } /** * Test calls the method twice - two controls gotten from object relations * 'CONTROL1' and 'CONTROL2' added to container.
* Has OK status if the method successfully returns * and no exceptions were thrown. */ public void _addControl() { oObj.addControl("CONTROL1", (XControl)tEnv.getObjRelation("CONTROL1")); oObj.addControl("CONTROL2", (XControl)tEnv.getObjRelation("CONTROL2")); tRes.tested("addControl()",true); } /** * Test calls the method with object relation 'CONTROL1' as a * parameter. Then control gotten from container is checked, and if returned * value is null then another control 'CONTROL2' is removed from container, * otherwise returned value of method test is 'false'.
* Has OK status if control is removed successfully.
* The following method tests are to be completed successfully before : *
addControl()
: adds control to a container getControl()
: gets control from container getControls()
: gets controls from container* Has OK status if value returned by the method is equal to * a corresponding object relation.
* The following method tests are to be completed successfully before : *
addControl()
: adds control to a container * Has OK status if returned array consists of at least two * elements.
* The following method tests are to be completed successfully before : *
addControl()
: adds control to a container