001: /*
002: * @(#)IAutoDocSetUTestI.java
003: *
004: * Copyright (C) 2002-2003 Matt Albrecht
005: * groboclown@users.sourceforge.net
006: * http://groboutils.sourceforge.net
007: *
008: * Permission is hereby granted, free of charge, to any person obtaining a
009: * copy of this software and associated documentation files (the "Software"),
010: * to deal in the Software without restriction, including without limitation
011: * the rights to use, copy, modify, merge, publish, distribute, sublicense,
012: * and/or sell copies of the Software, and to permit persons to whom the
013: * Software is furnished to do so, subject to the following conditions:
014: *
015: * The above copyright notice and this permission notice shall be included in
016: * all copies or substantial portions of the Software.
017: *
018: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
019: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
020: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
021: * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
022: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
023: * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
024: * DEALINGS IN THE SOFTWARE.
025: */
026:
027: package net.sourceforge.groboutils.autodoc.v1.defimpl;
028:
029: //import net.sourceforge.groboutils.testing.junitlog.v1.*;
030: import org.easymock.EasyMock;
031: import org.easymock.MockControl;
032: import net.sourceforge.groboutils.junit.v1.iftc.*;
033: import junit.framework.Test;
034: import junit.framework.TestCase;
035: import junit.framework.TestSuite;
036:
037: import java.util.Enumeration;
038: import java.util.NoSuchElementException;
039:
040: /**
041: * Tests the AutoDocIT interface.
042: *
043: * @author Matt Albrecht <a href="mailto:groboclown@users.sourceforge.net">groboclown@users.sourceforge.net</a>
044: * @since March 27, 2002
045: * @version $Date: 2003/05/30 00:06:04 $
046: */
047: public class IAutoDocSetUTestI extends InterfaceTestCase {
048: //-------------------------------------------------------------------------
049: // Standard JUnit Class-specific declarations
050:
051: private static final Class THIS_CLASS = IAutoDocSetUTestI.class;
052:
053: // private static final IJUnitDocumentor LOG = (new JUnitLog(THIS_CLASS)).getDocumentor();
054:
055: public IAutoDocSetUTestI(String name, ImplFactory f) {
056: super (name, IAutoDocSet.class, f);
057: }
058:
059: public IAutoDocSet createIAutoDocSet() {
060: return (IAutoDocSet) createImplObject();
061: }
062:
063: //-------------------------------------------------------------------------
064: // Tests
065:
066: public void testGetSetContents1()
067: {
068: IAutoDocSet ads = createIAutoDocSet();
069: Enumeration enum = ads.getSetContents();
070: assertNotNull(
071: "Returned null enum.",
072: enum );
073:
074: while (enum.hasMoreElements())
075: {
076: Object o = enum.nextElement();
077: assertNotNull( "Enum element is null.", o );
078: }
079:
080: try
081: {
082: enum.nextElement();
083: fail( "Did not throw NoMoreElementsException." );
084: }
085: catch (NoSuchElementException ex)
086: {
087: // test exception
088: }
089: }
090:
091: //-------------------------------------------------------------------------
092: // Standard JUnit declarations
093:
094: public static InterfaceTestSuite suite() {
095: InterfaceTestSuite suite = new InterfaceTestSuite(THIS_CLASS);
096:
097: return suite;
098: }
099:
100: public static void main(String[] args) {
101: String[] name = { THIS_CLASS.getName() };
102:
103: // junit.textui.TestRunner.main( name );
104: // junit.swingui.TestRunner.main( name );
105:
106: junit.textui.TestRunner.main(name);
107: }
108:
109: /**
110: *
111: * @exception Exception thrown under any exceptional condition.
112: */
113: protected void setUp() throws Exception {
114: super .setUp();
115:
116: // set ourself up
117: }
118:
119: /**
120: *
121: * @exception Exception thrown under any exceptional condition.
122: */
123: protected void tearDown() throws Exception {
124: // tear ourself down
125:
126: super.tearDown();
127: }
128: }
|