KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > struts > mock > MockFormBean


1 /*
2  * $Id: MockFormBean.java 54929 2004-10-16 16:38:42Z germuska $
3  *
4  * Copyright 1999-2004 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19
20 package org.apache.struts.mock;
21
22
23 import java.util.HashMap JavaDoc;
24 import java.util.Map JavaDoc;
25 import org.apache.struts.action.ActionForm;
26
27
28 /**
29  * <p>General purpose form bean for unit tests.</p>
30  *
31  * @version $Rev: 54929 $ $Date: 2004-10-16 17:38:42 +0100 (Sat, 16 Oct 2004) $
32  */

33
34 public class MockFormBean extends ActionForm {
35
36
37     public MockFormBean() {
38         this(null);
39     }
40
41
42     public MockFormBean(String JavaDoc stringProperty) {
43         this.stringProperty = stringProperty;
44     }
45
46
47     protected boolean booleanProperty = false;
48
49     public boolean getBooleanProperty() {
50         return (this.booleanProperty);
51     }
52
53     public void setBooleanProperty(boolean booleanProperty) {
54         this.booleanProperty = booleanProperty;
55     }
56
57
58     public Map JavaDoc getMapProperty() {
59         HashMap JavaDoc map = new HashMap JavaDoc();
60         map.put("foo1", "bar1");
61         map.put("foo2", "bar2");
62         return (map);
63     }
64
65
66     protected String JavaDoc stringProperty = null;
67
68     public String JavaDoc getStringProperty() {
69         return (this.stringProperty);
70     }
71
72     public void setStringProperty(String JavaDoc stringProperty) {
73         this.stringProperty = stringProperty;
74     }
75
76
77 }
78
Popular Tags