merge the formfield patch from ooo-build
[ooovba.git] / qadevOOo / tests / java / mod / _forms / ODateModel.java
blobfe7be31e8d0048eb1ff2b6738771c6d5e15a6af9
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ODateModel.java,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 package mod._forms;
32 import com.sun.star.beans.NamedValue;
33 import java.io.PrintWriter;
35 import lib.TestEnvironment;
36 import lib.TestParameters;
37 import util.DBTools;
41 /**
42 * Test for object which is represented by service
43 * <code>com.sun.star.form.component.DateField</code>. <p>
44 * Object implements the following interfaces :
45 * <ul>
46 * <li> <code>com::sun::star::io::XPersistObject</code></li>
47 * <li> <code>com::sun::star::awt::UnoControlDateFieldModel</code></li>
48 * <li> <code>com::sun::star::form::XReset</code></li>
49 * <li> <code>com::sun::star::form::XBoundComponent</code></li>
50 * <li> <code>com::sun::star::form::FormComponent</code></li>
51 * <li> <code>com::sun::star::form::component::DateField</code></li>
52 * <li> <code>com::sun::star::beans::XFastPropertySet</code></li>
53 * <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
54 * <li> <code>com::sun::star::form::XUpdateBroadcaster</code></li>
55 * <li> <code>com::sun::star::form::DataAwareControlModel</code></li>
56 * <li> <code>com::sun::star::beans::XPropertyState</code></li>
57 * <li> <code>com::sun::star::form::FormControlModel</code></li>
58 * <li> <code>com::sun::star::container::XNamed</code></li>
59 * <li> <code>com::sun::star::lang::XComponent</code></li>
60 * <li> <code>com::sun::star::lang::XEventListener</code></li>
61 * <li> <code>com::sun::star::beans::XPropertyAccess</code></li>
62 * <li> <code>com::sun::star::beans::XPropertyContainer</code></li>
63 * <li> <code>com::sun::star::beans::XPropertySet</code></li>
64 * <li> <code>com::sun::star::form::XLoadListener</code></li>
65 * <li> <code>com::sun::star::container::XChild</code></li>
66 * </ul>
67 * The following files used by this test :
68 * <ul>
69 * <li><b> TestDB </b> (directory) : directory with test database </li>
70 * <li><b> TestDB/TestDB.dbf </b> : table file. See
71 * {@link util.DBTools DBTools} class for more information.</li>
72 * </ul> <p>
73 * This object test <b> is NOT </b> designed to be run in several
74 * threads concurently.
75 * @see com.sun.star.io.XPersistObject
76 * @see com.sun.star.awt.UnoControlDateFieldModel
77 * @see com.sun.star.form.XReset
78 * @see com.sun.star.form.XBoundComponent
79 * @see com.sun.star.form.FormComponent
80 * @see com.sun.star.form.component.DateField
81 * @see com.sun.star.beans.XFastPropertySet
82 * @see com.sun.star.beans.XMultiPropertySet
83 * @see com.sun.star.form.XUpdateBroadcaster
84 * @see com.sun.star.form.DataAwareControlModel
85 * @see com.sun.star.beans.XPropertyState
86 * @see com.sun.star.form.FormControlModel
87 * @see com.sun.star.container.XNamed
88 * @see com.sun.star.lang.XComponent
89 * @see com.sun.star.lang.XEventListener
90 * @see com.sun.star.beans.XPropertyAccess
91 * @see com.sun.star.beans.XPropertyContainer
92 * @see com.sun.star.beans.XPropertySet
93 * @see com.sun.star.form.XLoadListener
94 * @see com.sun.star.container.XChild
95 * @see ifc.io._XPersistObject
96 * @see ifc.awt._UnoControlDateFieldModel
97 * @see ifc.form._XReset
98 * @see ifc.form._XBoundComponent
99 * @see ifc.form._FormComponent
100 * @see ifc.form.component._DateField
101 * @see ifc.beans._XFastPropertySet
102 * @see ifc.beans._XMultiPropertySet
103 * @see ifc.form._XUpdateBroadcaster
104 * @see ifc.form._DataAwareControlModel
105 * @see ifc.beans._XPropertyState
106 * @see ifc.form._FormControlModel
107 * @see ifc.container._XNamed
108 * @see ifc.lang._XComponent
109 * @see ifc.lang._XEventListener
110 * @see ifc.beans._XPropertySet
111 * @see ifc.form._XLoadListener
112 * @see ifc.container._XChild
114 public class ODateModel extends GenericModelTest {
117 * Set some member variable of the super class <CODE>GenericModelTest</CODE>:
118 * <pre>
119 * super.m_ChangePropertyName = "Date";
120 * super.m_kindOfControl="DateField";
121 * super.m_ObjectName = "stardiv.one.form.component.DateField";
123 * NamedValue DataField = new NamedValue();
124 * DataField.Name = "DataField";
125 * DataField.Value = DBTools.TST_DATE_F;
126 * super.m_propertiesToSet.add(DataField);
128 * NamedValue Date = new NamedValue();
129 * Date.Name = "Date";
130 * Date.Value = new Integer(DBTools.TST_DATE);
131 * super.m_propertiesToSet.add(Date);
132 * super.m_LCShape_Type = "FixedText";
133 * </pre>
134 * Then <CODE>super.initialize()</CODE> was called.
135 * @param tParam the test parameter
136 * @param log the log writer
138 protected void initialize(TestParameters tParam, PrintWriter log) {
140 super.initialize(tParam, log);
142 super.m_ChangePropertyName = "Date";
144 super.m_kindOfControl="DateField";
146 super.m_ObjectName = "stardiv.one.form.component.DateField";
148 NamedValue DataField = new NamedValue();
149 DataField.Name = "DataField";
150 DataField.Value = DBTools.TST_DATE_F;
151 super.m_propertiesToSet.add(DataField);
153 NamedValue Date = new NamedValue();
154 Date.Name = "Date";
155 Date.Value = new Integer(DBTools.TST_DATE);
156 super.m_propertiesToSet.add(Date);
158 super.m_LCShape_Type = "FixedText";
162 * calls <CODE>cleanup()</CODE> from it's super class
163 * @param tParam the test parameter
164 * @param log the log writer
166 protected void cleanup(TestParameters tParam, PrintWriter log) {
167 super.cleanup(tParam, log);
172 * calls <CODE>createTestEnvironment()</CODE> from it's super class
173 * @param Param the test parameter
174 * @param log the log writer
175 * @return lib.TestEnvironment
177 protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
178 PrintWriter log) {
179 return super.createTestEnvironment(Param, log);
181 } // finish class ODateModel