INTEGRATION: CWS qadev29 (1.4.36); FILE MERGED
2007/03/14 11:51:22 cn 1.4.36.2: #i75120# rebuild test case: usageof GenericModelTest 2007/03/07 19:51:22 cn 1.4.36.1: #i75120# update comments for new interfaces XPropertyAccess and XPropertyContainer. Test not ready yet.
This commit is contained in:
parent
0e1e99c88d
commit
7b79d52d91
1 changed files with 84 additions and 108 deletions
|
@ -4,9 +4,9 @@
|
|||
*
|
||||
* $RCSfile: OGroupBoxModel.java,v $
|
||||
*
|
||||
* $Revision: 1.4 $
|
||||
* $Revision: 1.5 $
|
||||
*
|
||||
* last change: $Author: rt $ $Date: 2005-09-09 02:11:54 $
|
||||
* last change: $Author: ihi $ $Date: 2007-06-04 13:35:45 $
|
||||
*
|
||||
* The Contents of this file are made available subject to
|
||||
* the terms of GNU Lesser General Public License Version 2.1.
|
||||
|
@ -34,6 +34,7 @@
|
|||
************************************************************************/
|
||||
package mod._forms;
|
||||
|
||||
import com.sun.star.beans.NamedValue;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
import lib.StatusException;
|
||||
|
@ -49,125 +50,100 @@ import com.sun.star.lang.XMultiServiceFactory;
|
|||
import com.sun.star.uno.UnoRuntime;
|
||||
import com.sun.star.uno.XInterface;
|
||||
import com.sun.star.util.XCloseable;
|
||||
import util.DBTools;
|
||||
|
||||
|
||||
/**
|
||||
* Test for object which is represented by service
|
||||
* <code>com.sun.star.form.component.GroupBox</code>. <p>
|
||||
* Object implements the following interfaces :
|
||||
* <ul>
|
||||
* <li> <code>com::sun::star::awt::UnoControlGroupBoxModel</code></li>
|
||||
* <li> <code>com::sun::star::io::XPersistObject</code></li>
|
||||
* <li> <code>com::sun::star::container::XChild</code></li>
|
||||
* <li> <code>com::sun::star::form::FormControlModel</code></li>
|
||||
* <li> <code>com::sun::star::form::FormComponent</code></li>
|
||||
* <li> <code>com::sun::star::beans::XPropertySet</code></li>
|
||||
* <li> <code>com::sun::star::beans::XFastPropertySet</code></li>
|
||||
* <li> <code>com::sun::star::beans::XPropertyState</code></li>
|
||||
* <li> <code>com::sun::star::container::XNamed</code></li>
|
||||
* <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
|
||||
* <li> <code>com::sun::star::lang::XComponent</code></li>
|
||||
* </ul>
|
||||
* This object test <b> is NOT </b> designed to be run in several
|
||||
* threads concurently.
|
||||
* @see com.sun.star.awt.UnoControlGroupBoxModel
|
||||
* @see com.sun.star.io.XPersistObject
|
||||
* @see com.sun.star.container.XChild
|
||||
* @see com.sun.star.form.FormControlModel
|
||||
* @see com.sun.star.form.FormComponent
|
||||
* @see com.sun.star.beans.XPropertySet
|
||||
* @see com.sun.star.beans.XFastPropertySet
|
||||
* @see com.sun.star.beans.XPropertyState
|
||||
* @see com.sun.star.container.XNamed
|
||||
* @see com.sun.star.beans.XMultiPropertySet
|
||||
* @see com.sun.star.lang.XComponent
|
||||
* @see ifc.awt._UnoControlGroupBoxModel
|
||||
* @see ifc.io._XPersistObject
|
||||
* @see ifc.container._XChild
|
||||
* @see ifc.form._FormControlModel
|
||||
* @see ifc.form._FormComponent
|
||||
* @see ifc.beans._XPropertySet
|
||||
* @see ifc.beans._XFastPropertySet
|
||||
* @see ifc.beans._XPropertyState
|
||||
* @see ifc.container._XNamed
|
||||
* @see ifc.beans._XMultiPropertySet
|
||||
* @see ifc.lang._XComponent
|
||||
*/
|
||||
public class OGroupBoxModel extends TestCase {
|
||||
XComponent xDrawDoc = null;
|
||||
* Test for object which is represented by service
|
||||
* <code>com.sun.star.form.component.GroupBox</code>. <p>
|
||||
* Object implements the following interfaces :
|
||||
* <ul>
|
||||
* <li> <code>com::sun::star::awt::UnoControlGroupBoxModel</code></li>
|
||||
* <li> <code>com::sun::star::io::XPersistObject</code></li>
|
||||
* <li> <code>com::sun::star::container::XChild</code></li>
|
||||
* <li> <code>com::sun::star::form::FormControlModel</code></li>
|
||||
* <li> <code>com::sun::star::form::FormComponent</code></li>
|
||||
* <li> <code>com::sun::star::beans::XPropertyAccess</code></li>
|
||||
* <li> <code>com::sun::star::beans::XPropertyContainer</code></li>
|
||||
* <li> <code>com::sun::star::beans::XPropertySet</code></li>
|
||||
* <li> <code>com::sun::star::beans::XFastPropertySet</code></li>
|
||||
* <li> <code>com::sun::star::beans::XPropertyState</code></li>
|
||||
* <li> <code>com::sun::star::container::XNamed</code></li>
|
||||
* <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
|
||||
* <li> <code>com::sun::star::lang::XComponent</code></li>
|
||||
* </ul>
|
||||
* This object test <b> is NOT </b> designed to be run in several
|
||||
* threads concurently.
|
||||
* @see com.sun.star.awt.UnoControlGroupBoxModel
|
||||
* @see com.sun.star.io.XPersistObject
|
||||
* @see com.sun.star.container.XChild
|
||||
* @see com.sun.star.form.FormControlModel
|
||||
* @see com.sun.star.form.FormComponent
|
||||
* @see com.sun.star.beans.XPropertyAccess
|
||||
* @see com.sun.star.beans.XPropertyContainer
|
||||
* @see com.sun.star.beans.XPropertySet
|
||||
* @see com.sun.star.beans.XFastPropertySet
|
||||
* @see com.sun.star.beans.XPropertyState
|
||||
* @see com.sun.star.container.XNamed
|
||||
* @see com.sun.star.beans.XMultiPropertySet
|
||||
* @see com.sun.star.lang.XComponent
|
||||
* @see ifc.awt._UnoControlGroupBoxModel
|
||||
* @see ifc.io._XPersistObject
|
||||
* @see ifc.container._XChild
|
||||
* @see ifc.form._FormControlModel
|
||||
* @see ifc.form._FormComponent
|
||||
* @see ifc.beans._XPropertySet
|
||||
* @see ifc.beans._XFastPropertySet
|
||||
* @see ifc.beans._XPropertyState
|
||||
* @see ifc.container._XNamed
|
||||
* @see ifc.beans._XMultiPropertySet
|
||||
* @see ifc.lang._XComponent
|
||||
*/
|
||||
public class OGroupBoxModel extends GenericModelTest {
|
||||
|
||||
/**
|
||||
* Creates Drawing document.
|
||||
*/
|
||||
* Set some member variable of the super class <CODE>GenericModelTest</CODE>:
|
||||
* <pre>
|
||||
* <super.m_ChangePropertyName</CODE> = "Text";
|
||||
* super.m_kindOfControl</CODE>="GroupBox";
|
||||
* super.m_ObjectName</CODE> = "GroupBox";
|
||||
* </pre>
|
||||
* Then <CODE>super.initialize()</CODE> was called.
|
||||
* @param tParam the test parameter
|
||||
* @param log the log writer
|
||||
*/
|
||||
|
||||
protected void initialize(TestParameters tParam, PrintWriter log) {
|
||||
SOfficeFactory SOF = SOfficeFactory.getFactory(((XMultiServiceFactory) tParam.getMSF()));
|
||||
|
||||
try {
|
||||
log.println("creating a draw document");
|
||||
xDrawDoc = SOF.createDrawDoc(null);
|
||||
} catch (com.sun.star.uno.Exception e) {
|
||||
// Some exception occures.FAILED
|
||||
e.printStackTrace(log);
|
||||
throw new StatusException("Couldn't create document", e);
|
||||
}
|
||||
super.initialize(tParam, log);
|
||||
|
||||
super.m_kindOfControl="GroupBox";
|
||||
|
||||
super.m_ObjectName = "stardiv.one.form.component.GroupBox";
|
||||
|
||||
super.m_LCShape_Type = "FixedText";
|
||||
|
||||
super.m_ChangePropertyName = "Text";
|
||||
}
|
||||
|
||||
/**
|
||||
* Disposes drawing document.
|
||||
*/
|
||||
* calls <CODE>cleanup()</CODE> from it's super class
|
||||
* @param tParam the test parameter
|
||||
* @param log the log writer
|
||||
*/
|
||||
protected void cleanup(TestParameters tParam, PrintWriter log) {
|
||||
log.println(" disposing xDrawDoc ");
|
||||
|
||||
try {
|
||||
XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
|
||||
XCloseable.class, xDrawDoc);
|
||||
closer.close(true);
|
||||
} catch (com.sun.star.util.CloseVetoException e) {
|
||||
log.println("couldn't close document");
|
||||
} catch (com.sun.star.lang.DisposedException e) {
|
||||
log.println("couldn't close document");
|
||||
}
|
||||
super.cleanup(tParam, log);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* <code>GroupBox</code> component created and added to the draw
|
||||
* page.
|
||||
* Object relations created :
|
||||
* <ul>
|
||||
* <li> <code>'OBJNAME'</code> for
|
||||
* {@link ifc.io._XPersistObject} : name of service which is
|
||||
* represented by this object. </li>
|
||||
* </ul>
|
||||
*/
|
||||
* calls <CODE>createTestEnvironment()</CODE> from it's super class
|
||||
* @param Param the test parameter
|
||||
* @param log the log writer
|
||||
* @return lib.TestEnvironment
|
||||
*/
|
||||
protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
|
||||
PrintWriter log) {
|
||||
XInterface oObj = null;
|
||||
PrintWriter log) {
|
||||
return super.createTestEnvironment(Param, log);
|
||||
}
|
||||
|
||||
|
||||
// creation of testobject here
|
||||
// first we write what we are intend to do to log file
|
||||
log.println("creating a test environment");
|
||||
|
||||
//get GroupBoxModel
|
||||
String objName = "GroupBox";
|
||||
|
||||
XControlShape shape = FormTools.insertControlShape(xDrawDoc, 5000,
|
||||
7000, 2000, 2000,
|
||||
objName);
|
||||
oObj = shape.getControl();
|
||||
|
||||
log.println("creating a new environment for drawpage object");
|
||||
|
||||
TestEnvironment tEnv = new TestEnvironment(oObj);
|
||||
|
||||
log.println("adding DrawDocument as obj relation to environment");
|
||||
tEnv.addObjRelation("OBJNAME", "stardiv.one.form.component." +
|
||||
objName);
|
||||
|
||||
|
||||
//adding ObjRelation for XPersistObject
|
||||
tEnv.addObjRelation("PSEUDOPERSISTENT", new Boolean(true));
|
||||
|
||||
return tEnv;
|
||||
} // finish method getTestEnvironment
|
||||
} // finish class OGroupBoxModel
|
||||
|
|
Loading…
Reference in a new issue