diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2007-06-04 12:35:06 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2007-06-04 12:35:06 +0000 |
commit | 8b01f37cd979e6ee7b28a9d82b98ea427215589c (patch) | |
tree | ff19ffa99e5f9caf52f0b9b0c796f97c081b21df /qadevOOo | |
parent | ade2b4e5ad8c6f181ac71dc02d76cfc8f0467078 (diff) |
INTEGRATION: CWS qadev29 (1.4.36); FILE MERGED
2007/03/07 19:48:17 cn 1.4.36.1: #i75120# implement object relations for XPropertyAccess and XPropertyContainer. Rebuild the test and use the GenericModelTest
Diffstat (limited to 'qadevOOo')
-rw-r--r-- | qadevOOo/tests/java/mod/_forms/OFixedTextModel.java | 110 |
1 files changed, 41 insertions, 69 deletions
diff --git a/qadevOOo/tests/java/mod/_forms/OFixedTextModel.java b/qadevOOo/tests/java/mod/_forms/OFixedTextModel.java index 4d04f536f3ec..2f730a473e3d 100644 --- a/qadevOOo/tests/java/mod/_forms/OFixedTextModel.java +++ b/qadevOOo/tests/java/mod/_forms/OFixedTextModel.java @@ -4,9 +4,9 @@ * * $RCSfile: OFixedTextModel.java,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: rt $ $Date: 2005-09-09 02:10:24 $ + * last change: $Author: ihi $ $Date: 2007-06-04 13:35:06 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -62,6 +62,8 @@ import com.sun.star.util.XCloseable; * <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> @@ -76,6 +78,8 @@ import com.sun.star.util.XCloseable; * @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 @@ -95,83 +99,51 @@ import com.sun.star.util.XCloseable; * @see ifc.awt._UnoControlFixedTextModel * @see ifc.lang._XComponent */ -public class OFixedTextModel extends TestCase { - XComponent xDrawDoc; - /** - * Creates Draw document where controls are placed. - */ - 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); - } - } +public class OFixedTextModel extends GenericModelTest { /** - * Disposes Draw document. - */ - 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"); - } - } - - /** - * Creating a Testenvironment for the interfaces to be tested. - * Creates FixedText in the Form. <p> - * Object relations created : - * <ul> - * <li> <code>'OBJNAME'</code> for - * {@link ifc.io._XPersistObject} : name of service which is - * represented by this object. </li> - * </ul> - */ - protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, - PrintWriter log) { - XInterface oObj = null; - + * Set some member variable of the super class <CODE>GenericModelTest</CODE>: + * <pre> + * super.m_kindOfControl="CommandButton"; + * super.m_ObjectName = "com.sun.star.form.component.CommandButton"; + * super.m_LCShape_Type = "CommandButton"; + * </pre> + * Then <CODE>super.initialize()</CODE> was called. + * @param tParam the test parameter + * @param log the log writer + */ - // creation of testobject here - // first we write what we are intend to do to log file - log.println("creating a test environment"); - - //get TextModel - String objName = "FixedText"; + protected void initialize(TestParameters tParam, PrintWriter log) { - XControlShape aShape = FormTools.createControlShape(xDrawDoc, 3000, - 4500, 15000, 10000, - objName); + super.initialize(tParam, log); - DrawTools.getDrawPage(xDrawDoc, 0).add((XShape) aShape); - oObj = aShape.getControl(); + super.m_kindOfControl="FixedText"; - log.println("creating a new environment for drawpage object"); + super.m_ObjectName = "stardiv.one.form.component.FixedText"; - TestEnvironment tEnv = new TestEnvironment(oObj); + super.m_LCShape_Type = "FixedText"; - tEnv.addObjRelation("OBJNAME", "stardiv.one.form.component." + - objName); + } + /** + * 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) { + super.cleanup(tParam, log); + } - //adding ObjRelation for XPersistObject - tEnv.addObjRelation("PSEUDOPERSISTENT", new Boolean(true)); + /** + * 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) { + return super.createTestEnvironment(Param, log); + } - return tEnv; - } // finish method getTestEnvironment } // finish class OFixedTextModel |