merge the formfield patch from ooo-build
[ooovba.git] / qadevOOo / tests / java / mod / _forms / ORadioButtonModel.java
blob85fd6e7c8433cd32e904cc928d40f8c9501eafa3
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: ORadioButtonModel.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 com.sun.star.beans.PropertyValue;
34 import java.io.PrintWriter;
36 import lib.TestEnvironment;
37 import lib.TestParameters;
38 import util.DBTools;
42 /**
43 * Test for object which is represented by service
44 * <code>com.sun.star.form.component.RadioButton</code>. <p>
46 * Object implements the following interfaces :
47 * <ul>
48 * <li> <code>com::sun::star::io::XPersistObject</code></li>
49 * <li> <code>com::sun::star::form::component::RadioButton</code></li>
50 * <li> <code>com::sun::star::form::XReset</code></li>
51 * <li> <code>com::sun::star::form::XBoundComponent</code></li>
52 * <li> <code>com::sun::star::form::FormComponent</code></li>
53 * <li> <code>com::sun::star::beans::XFastPropertySet</code></li>
54 * <li> <code>com::sun::star::beans::XMultiPropertySet</code></li>
55 * <li> <code>com::sun::star::form::XUpdateBroadcaster</code></li>
56 * <li> <code>com::sun::star::form::DataAwareControlModel</code></li>
57 * <li> <code>com::sun::star::awt::UnoControlRadioButtonModel</code></li>
58 * <li> <code>com::sun::star::beans::XPropertyState</code></li>
59 * <li> <code>com::sun::star::form::FormControlModel</code></li>
60 * <li> <code>com::sun::star::container::XNamed</code></li>
61 * <li> <code>com::sun::star::lang::XComponent</code></li>
62 * <li> <code>com::sun::star::lang::XEventListener</code></li>
63 * <li> <code>com::sun::star::beans::XPropertyAccess</code></li>
64 * <li> <code>com::sun::star::beans::XPropertyContainer</code></li>
65 * <li> <code>com::sun::star::beans::XPropertySet</code></li>
66 * <li> <code>com::sun::star::form::XLoadListener</code></li>
67 * <li> <code>com::sun::star::container::XChild</code></li>
68 * </ul> <p>
69 * This object test <b> is NOT </b> designed to be run in several
70 * threads concurently.
71 * @see com.sun.star.io.XPersistObject
72 * @see com.sun.star.form.component.RadioButton
73 * @see com.sun.star.form.XReset
74 * @see com.sun.star.form.XBoundComponent
75 * @see com.sun.star.form.FormComponent
76 * @see com.sun.star.beans.XFastPropertySet
77 * @see com.sun.star.beans.XMultiPropertySet
78 * @see com.sun.star.form.XUpdateBroadcaster
79 * @see com.sun.star.form.DataAwareControlModel
80 * @see com.sun.star.awt.UnoControlRadioButtonModel
81 * @see com.sun.star.beans.XPropertyState
82 * @see com.sun.star.form.FormControlModel
83 * @see com.sun.star.container.XNamed
84 * @see com.sun.star.lang.XComponent
85 * @see com.sun.star.lang.XEventListener
86 * @see com.sun.star.beans.XPropertyAccess
87 * @see com.sun.star.beans.XPropertyContainer
88 * @see com.sun.star.beans.XPropertySet
89 * @see com.sun.star.form.XLoadListener
90 * @see com.sun.star.container.XChild
91 * @see ifc.io._XPersistObject
92 * @see ifc.form.component._RadioButton
93 * @see ifc.form._XReset
94 * @see ifc.form._XBoundComponent
95 * @see ifc.form._FormComponent
96 * @see ifc.beans._XFastPropertySet
97 * @see ifc.beans._XMultiPropertySet
98 * @see ifc.form._XUpdateBroadcaster
99 * @see ifc.form._DataAwareControlModel
100 * @see ifc.awt._UnoControlRadioButtonModel
101 * @see ifc.beans._XPropertyState
102 * @see ifc.form._FormControlModel
103 * @see ifc.container._XNamed
104 * @see ifc.lang._XComponent
105 * @see ifc.lang._XEventListener
106 * @see ifc.beans._XPropertySet
107 * @see ifc.form._XLoadListener
108 * @see ifc.container._XChild
110 public class ORadioButtonModel extends GenericModelTest {
113 * Set some member variable of the super class <CODE>GenericModelTest</CODE>:
114 * <pre>
115 * super.m_ChangePropertyName</CODE> = "State";
116 * super.m_kindOfControl</CODE>="RadioButton";
117 * super.m_ObjectName</CODE> = "RadioButton";
118 * NamedValue myProp = new NamedValue();
119 * myProp.Name = "DataField";
120 * myProp.Value = DBTools.TST_STRING_F;
121 * super.m_propertiesToSet.add(myProp);
122 * super.m_LCShape_Type = "GroupBox";
123 * </pre>
124 * Then <CODE>super.initialize()</CODE> was called.
125 * @param tParam the test parameter
126 * @param log the log writer
129 protected void initialize(TestParameters tParam, PrintWriter log) {
131 super.initialize(tParam, log);
132 super.m_ChangePropertyName = "State";
134 super.m_kindOfControl="RadioButton";
136 super.m_ObjectName = "stardiv.one.form.component.RadioButton";
138 NamedValue myProp = new NamedValue();
139 myProp.Name = "DataField";
140 myProp.Value = DBTools.TST_STRING_F;
141 super.m_propertiesToSet.add(myProp);
143 super.m_LCShape_Type = "GroupBox";
147 * calls <CODE>cleanup()</CODE> from it's super class
148 * @param tParam the test parameter
149 * @param log the log writer
151 protected void cleanup(TestParameters tParam, PrintWriter log) {
152 super.cleanup(tParam, log);
157 * calls <CODE>createTestEnvironment()</CODE> from it's super class
158 * @param Param the test parameter
159 * @param log the log writer
160 * @return lib.TestEnvironment
162 protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
163 PrintWriter log) {
164 TestEnvironment tEnv = super.createTestEnvironment(Param, log);
165 tEnv.addObjRelation("DataAwareControlModel.NewFieldName",
166 DBTools.TST_INT_F);
167 PropertyValue prop = new PropertyValue();
168 prop.Name = "HelpText";
169 prop.Value = "new Help Text since XPropertyAccess";
170 tEnv.addObjRelation("XPropertyAccess.propertyToChange", prop);
171 tEnv.addObjRelation("XPropertyContainer.propertyNotRemovable", "HelpText");
173 return tEnv;
176 } // finish class ORadioButtonModel