KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > groboutils > codecoverage > v2 > IChannelLoggerFactoryUTestI


1 /*
2  * @(#)IChannelLoggerFactoryUTestI.java
3  *
4  * Copyright (C) 2002-2003 Matt Albrecht
5  * groboclown@users.sourceforge.net
6  * http://groboutils.sourceforge.net
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21  */

22
23 package net.sourceforge.groboutils.codecoverage.v2;
24
25 import java.util.Properties JavaDoc;
26
27 import net.sourceforge.groboutils.autodoc.v1.AutoDoc;
28 import net.sourceforge.groboutils.junit.v1.AssertConstructor;
29 import net.sourceforge.groboutils.junit.v1.iftc.ImplFactory;
30 import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestCase;
31 import net.sourceforge.groboutils.junit.v1.iftc.InterfaceTestSuite;
32
33
34 /**
35  * Tests the IChannelLoggerFactory interface.
36  *
37  * @author Matt Albrecht <a HREF="mailto:groboclown@users.sourceforge.net">groboclown@users.sourceforge.net</a>
38  * @version $Date: 2004/04/15 05:48:27 $
39  * @since December 28, 2002
40  */

41 public class IChannelLoggerFactoryUTestI extends InterfaceTestCase
42 {
43     //-------------------------------------------------------------------------
44
// Standard JUnit Class-specific declarations
45

46     private static final Class JavaDoc THIS_CLASS = IChannelLoggerFactoryUTestI.class;
47     private static final AutoDoc DOC = new AutoDoc( THIS_CLASS );
48     
49     public IChannelLoggerFactoryUTestI( String JavaDoc name, ImplFactory f )
50     {
51         super( name, IChannelLoggerFactory.class, f );
52     }
53
54     
55     public IChannelLoggerFactory createIChannelLoggerFactory()
56     {
57         return (IChannelLoggerFactory)createImplObject();
58     }
59
60
61     //-------------------------------------------------------------------------
62
// Tests
63

64     
65     // the factory MUST have a default constructor!
66
public void testConstructor1()
67     {
68         IChannelLoggerFactory clf = createIChannelLoggerFactory();
69         AssertConstructor.assertHasDefaultConstructor(
70             "All instances of IChannelLoggerFactory must have a default "+
71             "constructor.", clf );
72     }
73     
74     
75     public void testCreateChannelLogger1()
76     {
77         IChannelLoggerFactory clf = createIChannelLoggerFactory();
78         IChannelLogger cl = clf.createChannelLogger(
79             "", new Properties JavaDoc(), (short)0 );
80         assertNotNull(
81             "Returned null logger.",
82             cl );
83     }
84     
85     
86     public void testCreateChannelLogger2()
87     {
88         IChannelLoggerFactory clf = createIChannelLoggerFactory();
89         IChannelLogger cl = clf.createChannelLogger(
90             "", new Properties JavaDoc(), Short.MIN_VALUE );
91         assertNotNull(
92             "Returned null logger.",
93             cl );
94     }
95     
96     
97     public void testCreateChannelLogger3()
98     {
99         IChannelLoggerFactory clf = createIChannelLoggerFactory();
100         IChannelLogger cl = clf.createChannelLogger(
101             "", new Properties JavaDoc(), Short.MAX_VALUE );
102         assertNotNull(
103             "Returned null logger.",
104             cl );
105     }
106     
107     
108     //-------------------------------------------------------------------------
109
// Standard JUnit declarations
110

111     
112     public static InterfaceTestSuite suite()
113     {
114         InterfaceTestSuite suite = new InterfaceTestSuite( THIS_CLASS );
115         
116         return suite;
117     }
118     
119     public static void main( String JavaDoc[] args )
120     {
121         String JavaDoc[] name = { THIS_CLASS.getName() };
122         
123         // junit.textui.TestRunner.main( name );
124
// junit.swingui.TestRunner.main( name );
125

126         junit.textui.TestRunner.main( name );
127     }
128     
129     
130     /**
131      *
132      * @exception Exception thrown under any exceptional condition.
133      */

134     protected void setUp() throws Exception JavaDoc
135     {
136         super.setUp();
137         
138         // set ourself up
139
}
140     
141     
142     /**
143      *
144      * @exception Exception thrown under any exceptional condition.
145      */

146     protected void tearDown() throws Exception JavaDoc
147     {
148         // tear ourself down
149

150         
151         super.tearDown();
152     }
153 }
154
155
Popular Tags