KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > betwixt > scarab > ScarabSettings


1 package org.apache.commons.betwixt.scarab;
2
3 /*
4  * Copyright 2001-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 import java.io.Serializable JavaDoc;
20 import java.util.ArrayList JavaDoc;
21 import java.util.List JavaDoc;
22
23 import junit.framework.AssertionFailedError;
24
25 import org.apache.commons.logging.Log;
26 import org.apache.commons.logging.LogFactory;
27
28 /**
29  * <p><code>ScarabSettings</code> is a sample bean for use by the test cases.</p>
30  *
31  * @author <a HREF="mailto:jason@zenplex.com">Jason van Zyl</a>
32  * @version $Id: ScarabSettings.java,v 1.4 2002/06/05 10:30:50 jstrachan Exp $
33  */

34 public class ScarabSettings implements Serializable JavaDoc
35 {
36
37     /**
38      * Logger
39      */

40     private final static Log log = LogFactory.getLog(ScarabSettings.class);
41
42     private List JavaDoc globalAttributes;
43
44     private List JavaDoc modules;
45     
46     private List JavaDoc globalIssueTypes;
47     
48     /**
49      * Constructor for the ScarabSettings object
50      */

51     public ScarabSettings()
52     {
53         globalAttributes = new ArrayList JavaDoc();
54         modules = new ArrayList JavaDoc();
55         globalIssueTypes = new ArrayList JavaDoc();
56     }
57
58     public List JavaDoc getGlobalAttributes()
59     {
60         return globalAttributes;
61     }
62     
63     public void addGlobalAttribute(GlobalAttribute globalAttribute)
64     {
65         // adds an assertion that the name must be populated first
66
// as an extra test case
67
if (globalAttribute.getName() == null)
68         {
69             throw new AssertionFailedError("Cannot add a new GlobalAttribute that has no name: " + globalAttribute);
70         }
71         globalAttributes.add(globalAttribute);
72     }
73
74     public List JavaDoc getGlobalIssueTypes()
75     {
76         return globalIssueTypes;
77     }
78     
79     public void addGlobalIssueType(GlobalIssueType globalIssueType)
80     {
81         globalIssueTypes.add(globalIssueType);
82     }
83
84     public List JavaDoc getModules()
85     {
86         return modules;
87     }
88     
89     public void addModule(Module module)
90     {
91         modules.add(module);
92     }
93 }
94
Popular Tags