001: /********************************************************************************
002: * CruiseControl, a Continuous Integration Toolkit
003: * Copyright (c) 2001, ThoughtWorks, Inc.
004: * 200 E. Randolph, 25th Floor
005: * Chicago, IL 60601 USA
006: * All rights reserved.
007: *
008: * Redistribution and use in source and binary forms, with or without
009: * modification, are permitted provided that the following conditions
010: * are met:
011: *
012: * + Redistributions of source code must retain the above copyright
013: * notice, this list of conditions and the following disclaimer.
014: *
015: * + Redistributions in binary form must reproduce the above
016: * copyright notice, this list of conditions and the following
017: * disclaimer in the documentation and/or other materials provided
018: * with the distribution.
019: *
020: * + Neither the name of ThoughtWorks, Inc., CruiseControl, nor the
021: * names of its contributors may be used to endorse or promote
022: * products derived from this software without specific prior
023: * written permission.
024: *
025: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
026: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
027: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
028: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
029: * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
030: * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
031: * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
032: * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
033: * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
034: * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
035: * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
036: ********************************************************************************/package net.sourceforge.cruisecontrol.publishers;
037:
038: import net.sourceforge.cruisecontrol.Publisher;
039: import net.sourceforge.cruisecontrol.CruiseControlException;
040: import net.sourceforge.cruisecontrol.publishers.email.EmailMapping;
041:
042: import org.jdom.Element;
043:
044: public class MockPublisher implements Publisher {
045:
046: private int someInt;
047: private String someString;
048: private MockPublisherChild mpc;
049: private boolean someBoolean;
050: private EmailMapping mapping;
051:
052: public void setSomeBoolean(boolean someBoolean) {
053: this .someBoolean = someBoolean;
054: }
055:
056: public boolean getSomeBoolean() {
057: return someBoolean;
058: }
059:
060: public void setSomeString(String someString) {
061: this .someString = someString;
062: }
063:
064: public void setSomeInt(int someInt) {
065: this .someInt = someInt;
066: }
067:
068: public int getSomeInt() {
069: return someInt;
070: }
071:
072: public String getSomeString() {
073: return someString;
074: }
075:
076: public Object createMockPluginChild() {
077: mpc = new MockPublisherChild();
078: return mpc;
079: }
080:
081: public MockPublisherChild getMockPluginChild() {
082: return mpc;
083: }
084:
085: public void publish(Element cruisecontrolLog)
086: throws CruiseControlException {
087: }
088:
089: public void validate() throws CruiseControlException {
090: }
091:
092: public void add(EmailMapping emapping) {
093: mapping = emapping;
094: }
095:
096: public EmailMapping getEmailMapping() {
097: return mapping;
098: }
099:
100: public class MockPublisherChild {
101: private int myInt;
102: private String myString;
103:
104: public void setSomeString(String someString) {
105: this .myString = someString;
106: }
107:
108: public void setSomeInt(int someInt) {
109: this .myInt = someInt;
110: }
111:
112: public int getSomeInt() {
113: return myInt;
114: }
115:
116: public String getSomeString() {
117: return myString;
118: }
119: }
120: }
|