1 /* 2 * This file is part of the LibreOffice project. 3 * 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/. 7 * 8 * This file incorporates work covered by the following license notice: 9 * 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 . 17 */ 18 package mod._forms; 19 20 import com.sun.star.beans.NamedValue; 21 import com.sun.star.beans.PropertyValue; 22 import java.io.PrintWriter; 23 24 import lib.TestEnvironment; 25 import lib.TestParameters; 26 import util.DBTools; 27 28 29 30 /** 31 * Test for object which is represented by service 32 * <code>com.sun.star.form.component.RadioButton</code>. <p> 33 * 34 * Object implements the following interfaces : 35 * <ul> 36 * <li> <code>com::sun::star::io::XPersistObject</code></li> 37 * <li> <code>com::sun::star::form::component::RadioButton</code></li> 38 * <li> <code>com::sun::star::form::XReset</code></li> 39 * <li> <code>com::sun::star::form::XBoundComponent</code></li> 40 * <li> <code>com::sun::star::form::FormComponent</code></li> 41 * <li> <code>com::sun::star::beans::XFastPropertySet</code></li> 42 * <li> <code>com::sun::star::beans::XMultiPropertySet</code></li> 43 * <li> <code>com::sun::star::form::XUpdateBroadcaster</code></li> 44 * <li> <code>com::sun::star::form::DataAwareControlModel</code></li> 45 * <li> <code>com::sun::star::awt::UnoControlRadioButtonModel</code></li> 46 * <li> <code>com::sun::star::beans::XPropertyState</code></li> 47 * <li> <code>com::sun::star::form::FormControlModel</code></li> 48 * <li> <code>com::sun::star::container::XNamed</code></li> 49 * <li> <code>com::sun::star::lang::XComponent</code></li> 50 * <li> <code>com::sun::star::lang::XEventListener</code></li> 51 * <li> <code>com::sun::star::beans::XPropertyAccess</code></li> 52 * <li> <code>com::sun::star::beans::XPropertyContainer</code></li> 53 * <li> <code>com::sun::star::beans::XPropertySet</code></li> 54 * <li> <code>com::sun::star::form::XLoadListener</code></li> 55 * <li> <code>com::sun::star::container::XChild</code></li> 56 * </ul> <p> 57 * This object test <b> is NOT </b> designed to be run in several 58 * threads concurrently. 59 * @see com.sun.star.io.XPersistObject 60 * @see com.sun.star.form.component.RadioButton 61 * @see com.sun.star.form.XReset 62 * @see com.sun.star.form.XBoundComponent 63 * @see com.sun.star.form.FormComponent 64 * @see com.sun.star.beans.XFastPropertySet 65 * @see com.sun.star.beans.XMultiPropertySet 66 * @see com.sun.star.form.XUpdateBroadcaster 67 * @see com.sun.star.form.DataAwareControlModel 68 * @see com.sun.star.awt.UnoControlRadioButtonModel 69 * @see com.sun.star.beans.XPropertyState 70 * @see com.sun.star.form 71 * @see com.sun.star.container.XNamed 72 * @see com.sun.star.lang.XComponent 73 * @see com.sun.star.lang.XEventListener 74 * @see com.sun.star.beans.XPropertyAccess 75 * @see com.sun.star.beans.XPropertyContainer 76 * @see com.sun.star.beans.XPropertySet 77 * @see com.sun.star.form.XLoadListener 78 * @see com.sun.star.container.XChild 79 * @see ifc.io._XPersistObject 80 * @see ifc.form.component._RadioButton 81 * @see ifc.form._XReset 82 * @see ifc.form._XBoundComponent 83 * @see ifc.form._FormComponent 84 * @see ifc.beans._XFastPropertySet 85 * @see ifc.beans._XMultiPropertySet 86 * @see ifc.form._XUpdateBroadcaster 87 * @see ifc.form._DataAwareControlModel 88 * @see ifc.awt._UnoControlRadioButtonModel 89 * @see ifc.beans._XPropertyState 90 * @see ifc.form._FormControlModel 91 * @see ifc.container._XNamed 92 * @see ifc.lang._XComponent 93 * @see ifc.lang._XEventListener 94 * @see ifc.beans._XPropertySet 95 * @see ifc.form._XLoadListener 96 * @see ifc.container._XChild 97 */ 98 public class ORadioButtonModel extends GenericModelTest { 99 100 /** 101 * Set some member variable of the super class <CODE>GenericModelTest</CODE>: 102 * <pre> 103 * super.m_ChangePropertyName</CODE> = "State"; 104 * super.m_kindOfControl</CODE>="RadioButton"; 105 * super.m_ObjectName</CODE> = "RadioButton"; 106 * NamedValue myProp = new NamedValue(); 107 * myProp.Name = "DataField"; 108 * myProp.Value = DBTools.TST_STRING_F; 109 * super.m_propertiesToSet.add(myProp); 110 * super.m_LCShape_Type = "GroupBox"; 111 * </pre> 112 * Then <CODE>super.initialize()</CODE> was called. 113 * @param tParam the test parameter 114 * @param log the log writer 115 */ 116 117 @Override initialize(TestParameters tParam, PrintWriter log)118 protected void initialize(TestParameters tParam, PrintWriter log) throws Exception { 119 120 super.initialize(tParam, log); 121 super.m_ChangePropertyName = "State"; 122 123 super.m_kindOfControl="RadioButton"; 124 125 super.m_ObjectName = "stardiv.one.form.component.RadioButton"; 126 127 NamedValue myProp = new NamedValue(); 128 myProp.Name = "DataField"; 129 myProp.Value = DBTools.TST_STRING_F; 130 super.m_propertiesToSet.add(myProp); 131 132 super.m_LCShape_Type = "GroupBox"; 133 134 } 135 136 /** 137 * calls <CODE>createTestEnvironment()</CODE> from its super class 138 * @param Param the test parameter 139 * @param log the log writer 140 * @return lib.TestEnvironment 141 */ 142 @Override createTestEnvironment(TestParameters Param, PrintWriter log)143 protected TestEnvironment createTestEnvironment(TestParameters Param, 144 PrintWriter log) throws Exception { 145 TestEnvironment tEnv = super.createTestEnvironment(Param, log); 146 tEnv.addObjRelation("DataAwareControlModel.NewFieldName", 147 DBTools.TST_INT_F); 148 PropertyValue prop = new PropertyValue(); 149 prop.Name = "HelpText"; 150 prop.Value = "new Help Text since XPropertyAccess"; 151 tEnv.addObjRelation("XPropertyAccess.propertyToChange", prop); 152 tEnv.addObjRelation("XPropertyContainer.propertyNotRemovable", "HelpText"); 153 154 return tEnv; 155 } 156 157 } // finish class ORadioButtonModel 158