View Javadoc
1 package org.apache.commons.betwixt.scarab; 2 3 /* 4 * ==================================================================== 5 * 6 * The Apache Software License, Version 1.1 7 * 8 * Copyright (c) 1999-2002 The Apache Software Foundation. All rights 9 * reserved. 10 * 11 * Redistribution and use in source and binary forms, with or without 12 * modification, are permitted provided that the following conditions 13 * are met: 14 * 15 * 1. Redistributions of source code must retain the above copyright 16 * notice, this list of conditions and the following disclaimer. 17 * 18 * 2. Redistributions in binary form must reproduce the above copyright 19 * notice, this list of conditions and the following disclaimer in 20 * the documentation and/or other materials provided with the 21 * distribution. 22 * 23 * 3. The end-user documentation included with the redistribution, if 24 * any, must include the following acknowlegement: 25 * "This product includes software developed by the 26 * Apache Software Foundation (http://www.apache.org/)." 27 * Alternately, this acknowlegement may appear in the software itself, 28 * if and wherever such third-party acknowlegements normally appear. 29 * 30 * 4. The names "The Jakarta Project", "Commons", and "Apache Software 31 * Foundation" must not be used to endorse or promote products derived 32 * from this software without prior written permission. For written 33 * permission, please contact apache@apache.org. 34 * 35 * 5. Products derived from this software may not be called "Apache" 36 * nor may "Apache" appear in their names without prior written 37 * permission of the Apache Group. 38 * 39 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 40 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 41 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 42 * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR 43 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 44 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 45 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 46 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 47 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 48 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 49 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 50 * SUCH DAMAGE. 51 * ==================================================================== 52 * 53 * This software consists of voluntary contributions made by many 54 * individuals on behalf of the Apache Software Foundation. For more 55 * information on the Apache Software Foundation, please see 56 * <http://www.apache.org/>;. 57 * 58 */ 59 60 import java.io.Serializable; 61 import java.util.ArrayList; 62 import java.util.List; 63 64 import junit.framework.AssertionFailedError; 65 66 import org.apache.commons.logging.Log; 67 import org.apache.commons.logging.LogFactory; 68 69 /*** 70 * <p><code>ScarabSettings</code> is a sample bean for use by the test cases.</p> 71 * 72 * @author <a href="mailto:jason@zenplex.com">Jason van Zyl</a> 73 * @version $Id: ScarabSettings.java,v 1.4 2002/06/05 10:30:50 jstrachan Exp $ 74 */ 75 public class ScarabSettings implements Serializable 76 { 77 78 /*** 79 * Logger 80 */ 81 private final static Log log = LogFactory.getLog(ScarabSettings.class); 82 83 private List globalAttributes; 84 85 private List modules; 86 87 private List globalIssueTypes; 88 89 /*** 90 * Constructor for the ScarabSettings object 91 */ 92 public ScarabSettings() 93 { 94 globalAttributes = new ArrayList(); 95 modules = new ArrayList(); 96 globalIssueTypes = new ArrayList(); 97 } 98 99 public List getGlobalAttributes() 100 { 101 return globalAttributes; 102 } 103 104 public void addGlobalAttribute(GlobalAttribute globalAttribute) 105 { 106 // adds an assertion that the name must be populated first 107 // as an extra test case 108 if (globalAttribute.getName() == null) 109 { 110 throw new AssertionFailedError("Cannot add a new GlobalAttribute that has no name: " + globalAttribute); 111 } 112 globalAttributes.add(globalAttribute); 113 } 114 115 public List getGlobalIssueTypes() 116 { 117 return globalIssueTypes; 118 } 119 120 public void addGlobalIssueType(GlobalIssueType globalIssueType) 121 { 122 globalIssueTypes.add(globalIssueType); 123 } 124 125 public List getModules() 126 { 127 return modules; 128 } 129 130 public void addModule(Module module) 131 { 132 modules.add(module); 133 } 134 }

This page was automatically generated by Maven