Branch libreoffice-5-0-4
[LibreOffice.git] / qadevOOo / tests / java / mod / _forms / ODateModel.java
blobe7df4366bb754b0325637ec9371eb75c93b8ee3b
1 /*
2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 package mod._forms;
20 import com.sun.star.beans.NamedValue;
21 import java.io.PrintWriter;
23 import lib.TestEnvironment;
24 import lib.TestParameters;
25 import util.DBTools;
29 /**
30 * Test for object which is represented by service
31 * <code>com.sun.star.form.component.DateField</code>. <p>
32 * Object implements the following interfaces :
33 * <ul>
34 * <li> <code>com::sun::star::io::XPersistObject</code></li>
35 * <li> <code>com::sun::star::awt::UnoControlDateFieldModel</code></li>
36 * <li> <code>com::sun::star::form::XReset</code></li>
37 * <li> <code>com::sun::star::form::XBoundComponent</code></li>
38 * <li> <code>com::sun::star::form::FormComponent</code></li>
39 * <li> <code>com::sun::star::form::component::DateField</code></li>
40 * <li> <code>com::sun::star::beans::XFastPropertySet</code></li>
41 * <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
42 * <li> <code>com::sun::star::form::XUpdateBroadcaster</code></li>
43 * <li> <code>com::sun::star::form::DataAwareControlModel</code></li>
44 * <li> <code>com::sun::star::beans::XPropertyState</code></li>
45 * <li> <code>com::sun::star::form::FormControlModel</code></li>
46 * <li> <code>com::sun::star::container::XNamed</code></li>
47 * <li> <code>com::sun::star::lang::XComponent</code></li>
48 * <li> <code>com::sun::star::lang::XEventListener</code></li>
49 * <li> <code>com::sun::star::beans::XPropertyAccess</code></li>
50 * <li> <code>com::sun::star::beans::XPropertyContainer</code></li>
51 * <li> <code>com::sun::star::beans::XPropertySet</code></li>
52 * <li> <code>com::sun::star::form::XLoadListener</code></li>
53 * <li> <code>com::sun::star::container::XChild</code></li>
54 * </ul>
55 * The following files used by this test :
56 * <ul>
57 * <li><b> TestDB </b> (directory) : directory with test database </li>
58 * <li><b> TestDB/TestDB.dbf </b> : table file. See
59 * {@link util.DBTools DBTools} class for more information.</li>
60 * </ul> <p>
61 * This object test <b> is NOT </b> designed to be run in several
62 * threads concurently.
63 * @see com.sun.star.io.XPersistObject
64 * @see com.sun.star.awt.UnoControlDateFieldModel
65 * @see com.sun.star.form.XReset
66 * @see com.sun.star.form.XBoundComponent
67 * @see com.sun.star.form.FormComponent
68 * @see com.sun.star.form.component.DateField
69 * @see com.sun.star.beans.XFastPropertySet
70 * @see com.sun.star.beans.XMultiPropertySet
71 * @see com.sun.star.form.XUpdateBroadcaster
72 * @see com.sun.star.form.DataAwareControlModel
73 * @see com.sun.star.beans.XPropertyState
74 * @see com.sun.star.form
75 * @see com.sun.star.container.XNamed
76 * @see com.sun.star.lang.XComponent
77 * @see com.sun.star.lang.XEventListener
78 * @see com.sun.star.beans.XPropertyAccess
79 * @see com.sun.star.beans.XPropertyContainer
80 * @see com.sun.star.beans.XPropertySet
81 * @see com.sun.star.form.XLoadListener
82 * @see com.sun.star.container.XChild
83 * @see ifc.io._XPersistObject
84 * @see ifc.awt._UnoControlDateFieldModel
85 * @see ifc.form._XReset
86 * @see ifc.form._XBoundComponent
87 * @see ifc.form._FormComponent
88 * @see ifc.form.component._DateField
89 * @see ifc.beans._XFastPropertySet
90 * @see ifc.beans._XMultiPropertySet
91 * @see ifc.form._XUpdateBroadcaster
92 * @see ifc.form._DataAwareControlModel
93 * @see ifc.beans._XPropertyState
94 * @see ifc.form._FormControlModel
95 * @see ifc.container._XNamed
96 * @see ifc.lang._XComponent
97 * @see ifc.lang._XEventListener
98 * @see ifc.beans._XPropertySet
99 * @see ifc.form._XLoadListener
100 * @see ifc.container._XChild
102 public class ODateModel extends GenericModelTest {
105 * Set some member variable of the super class <CODE>GenericModelTest</CODE>:
106 * <pre>
107 * super.m_ChangePropertyName = "Date";
108 * super.m_kindOfControl="DateField";
109 * super.m_ObjectName = "stardiv.one.form.component.DateField";
111 * NamedValue DataField = new NamedValue();
112 * DataField.Name = "DataField";
113 * DataField.Value = DBTools.TST_DATE_F;
114 * super.m_propertiesToSet.add(DataField);
116 * NamedValue Date = new NamedValue();
117 * Date.Name = "Date";
118 * Date.Value = Integer.valueOf(DBTools.TST_DATE);
119 * super.m_propertiesToSet.add(Date);
120 * super.m_LCShape_Type = "FixedText";
121 * </pre>
122 * Then <CODE>super.initialize()</CODE> was called.
123 * @param tParam the test parameter
124 * @param log the log writer
126 @Override
127 protected void initialize(TestParameters tParam, PrintWriter log) {
129 super.initialize(tParam, log);
131 super.m_ChangePropertyName = "Date";
133 super.m_kindOfControl="DateField";
135 super.m_ObjectName = "stardiv.one.form.component.DateField";
137 NamedValue DataField = new NamedValue();
138 DataField.Name = "DataField";
139 DataField.Value = DBTools.TST_DATE_F;
140 super.m_propertiesToSet.add(DataField);
142 NamedValue Date = new NamedValue();
143 Date.Name = "Date";
144 Date.Value = new com.sun.star.util.Date();
145 super.m_propertiesToSet.add(Date);
147 super.m_LCShape_Type = "FixedText";
153 * calls <CODE>createTestEnvironment()</CODE> from it's super class
154 * @param Param the test parameter
155 * @param log the log writer
156 * @return lib.TestEnvironment
158 @Override
159 protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
160 PrintWriter log) {
161 return super.createTestEnvironment(Param, log);
163 } // finish class ODateModel