001: /*
002: * @(#)IChannelLoggerFactoryUTestI.java
003: *
004: * Copyright (C) 2002-2003 Matt Albrecht
005: * groboclown@users.sourceforge.net
006: * http://groboutils.sourceforge.net
007: *
008: * This program is free software; you can redistribute it and/or
009: * modify it under the terms of the GNU Lesser General Public License
010: * as published by the Free Software Foundation; either version 2
011: * of the License, or (at your option) any later version.
012: *
013: * This program is distributed in the hope that it will be useful,
014: * but WITHOUT ANY WARRANTY; without even the implied warranty of
015: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
016: * GNU Lesser General Public License for more details.
017: *
018: * You should have received a copy of the GNU Lesser General Public License
019: * along with this program; if not, write to the Free Software
020: * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
021: */
022:
023: package net.sourceforge.groboutils.codecoverage.v2;
024:
025: import java.util.Properties;
026:
027: import net.sourceforge.groboutils.autodoc.v1.AutoDoc;
028: import net.sourceforge.groboutils.junit.v1.AssertConstructor;
029: import net.sourceforge.groboutils.junit.v1.iftc.ImplFactory;
030: import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestCase;
031: import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite;
032:
033: /**
034: * Tests the IChannelLoggerFactory interface.
035: *
036: * @author Matt Albrecht <a href="mailto:groboclown@users.sourceforge.net">groboclown@users.sourceforge.net</a>
037: * @version $Date: 2004/04/15 05:48:27 $
038: * @since December 28, 2002
039: */
040: public class IChannelLoggerFactoryUTestI extends InterfaceTestCase {
041: //-------------------------------------------------------------------------
042: // Standard JUnit Class-specific declarations
043:
044: private static final Class THIS_CLASS = IChannelLoggerFactoryUTestI.class;
045: private static final AutoDoc DOC = new AutoDoc(THIS_CLASS);
046:
047: public IChannelLoggerFactoryUTestI(String name, ImplFactory f) {
048: super (name, IChannelLoggerFactory.class, f);
049: }
050:
051: public IChannelLoggerFactory createIChannelLoggerFactory() {
052: return (IChannelLoggerFactory) createImplObject();
053: }
054:
055: //-------------------------------------------------------------------------
056: // Tests
057:
058: // the factory MUST have a default constructor!
059: public void testConstructor1() {
060: IChannelLoggerFactory clf = createIChannelLoggerFactory();
061: AssertConstructor.assertHasDefaultConstructor(
062: "All instances of IChannelLoggerFactory must have a default "
063: + "constructor.", clf);
064: }
065:
066: public void testCreateChannelLogger1() {
067: IChannelLoggerFactory clf = createIChannelLoggerFactory();
068: IChannelLogger cl = clf.createChannelLogger("",
069: new Properties(), (short) 0);
070: assertNotNull("Returned null logger.", cl);
071: }
072:
073: public void testCreateChannelLogger2() {
074: IChannelLoggerFactory clf = createIChannelLoggerFactory();
075: IChannelLogger cl = clf.createChannelLogger("",
076: new Properties(), Short.MIN_VALUE);
077: assertNotNull("Returned null logger.", cl);
078: }
079:
080: public void testCreateChannelLogger3() {
081: IChannelLoggerFactory clf = createIChannelLoggerFactory();
082: IChannelLogger cl = clf.createChannelLogger("",
083: new Properties(), Short.MAX_VALUE);
084: assertNotNull("Returned null logger.", cl);
085: }
086:
087: //-------------------------------------------------------------------------
088: // Standard JUnit declarations
089:
090: public static InterfaceTestSuite suite() {
091: InterfaceTestSuite suite = new InterfaceTestSuite(THIS_CLASS);
092:
093: return suite;
094: }
095:
096: public static void main(String[] args) {
097: String[] name = { THIS_CLASS.getName() };
098:
099: // junit.textui.TestRunner.main( name );
100: // junit.swingui.TestRunner.main( name );
101:
102: junit.textui.TestRunner.main(name);
103: }
104:
105: /**
106: *
107: * @exception Exception thrown under any exceptional condition.
108: */
109: protected void setUp() throws Exception {
110: super .setUp();
111:
112: // set ourself up
113: }
114:
115: /**
116: *
117: * @exception Exception thrown under any exceptional condition.
118: */
119: protected void tearDown() throws Exception {
120: // tear ourself down
121:
122: super.tearDown();
123: }
124: }
|