01: package org.apache.commons.betwixt.scarab;
02:
03: /*
04: * Licensed to the Apache Software Foundation (ASF) under one or more
05: * contributor license agreements. See the NOTICE file distributed with
06: * this work for additional information regarding copyright ownership.
07: * The ASF licenses this file to You under the Apache License, Version 2.0
08: * (the "License"); you may not use this file except in compliance with
09: * the License. You may obtain a copy of the License at
10: *
11: * http://www.apache.org/licenses/LICENSE-2.0
12: *
13: * Unless required by applicable law or agreed to in writing, software
14: * distributed under the License is distributed on an "AS IS" BASIS,
15: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16: * See the License for the specific language governing permissions and
17: * limitations under the License.
18: */
19:
20: import java.io.Serializable;
21: import java.util.ArrayList;
22: import java.util.List;
23:
24: import junit.framework.AssertionFailedError;
25:
26: import org.apache.commons.logging.Log;
27: import org.apache.commons.logging.LogFactory;
28:
29: /**
30: * <p><code>ScarabSettings</code> is a sample bean for use by the test cases.</p>
31: *
32: * @author <a href="mailto:jason@zenplex.com">Jason van Zyl</a>
33: * @version $Id: ScarabSettings.java 438373 2006-08-30 05:17:21Z bayard $
34: */
35: public class ScarabSettings implements Serializable {
36:
37: /**
38: * Logger
39: */
40: private final static Log log = LogFactory
41: .getLog(ScarabSettings.class);
42:
43: private List globalAttributes;
44:
45: private List modules;
46:
47: private List globalIssueTypes;
48:
49: /**
50: * Constructor for the ScarabSettings object
51: */
52: public ScarabSettings() {
53: globalAttributes = new ArrayList();
54: modules = new ArrayList();
55: globalIssueTypes = new ArrayList();
56: }
57:
58: public List getGlobalAttributes() {
59: return globalAttributes;
60: }
61:
62: public void addGlobalAttribute(GlobalAttribute globalAttribute) {
63: // adds an assertion that the name must be populated first
64: // as an extra test case
65: if (globalAttribute.getName() == null) {
66: throw new AssertionFailedError(
67: "Cannot add a new GlobalAttribute that has no name: "
68: + globalAttribute);
69: }
70: globalAttributes.add(globalAttribute);
71: }
72:
73: public List getGlobalIssueTypes() {
74: return globalIssueTypes;
75: }
76:
77: public void addGlobalIssueType(GlobalIssueType globalIssueType) {
78: globalIssueTypes.add(globalIssueType);
79: }
80:
81: public List getModules() {
82: return modules;
83: }
84:
85: public void addModule(Module module) {
86: modules.add(module);
87: }
88: }
|