001: /*
002: * @(#)JUnitTestSuiteEUTest.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.junit.v1;
028:
029: //import net.sourceforge.groboutils.testing.junitlog.v1.*;
030: import junit.framework.Test;
031: import junit.framework.TestCase;
032: import junit.framework.TestSuite;
033:
034: import java.io.IOException;
035: import java.lang.reflect.Method;
036:
037: /**
038: * Tests the functionality of the JUnit TestSuite class for conformance to
039: * expected behaviors.
040: *
041: * @author Matt Albrecht <a href="mailto:groboclown@users.sourceforge.net">groboclown@users.sourceforge.net</a>
042: * @since March 1, 2002
043: * @version $Date: 2003/02/10 22:52:21 $
044: */
045: public class JUnitTestSuiteEUTest extends TestCase {
046: //-------------------------------------------------------------------------
047: // Standard JUnit Class-specific declarations
048:
049: private static final Class THIS_CLASS = JUnitTestSuiteEUTest.class;
050:
051: // private static final IJUnitDocumentor LOG = (new JUnitLog(THIS_CLASS)).getDocumentor();
052:
053: public JUnitTestSuiteEUTest(String name) {
054: super (name);
055: }
056:
057: //-------------------------------------------------------------------------
058: // Tests
059:
060: public void testConstructor1() {
061: try {
062: new TestSuite((Class) null);
063: fail("Did not throw NullPointerException.");
064: } catch (NullPointerException e) {
065: // test exception
066: }
067: }
068:
069: public void testGetTestAt1() {
070: TestSuite ts = new TestSuite();
071:
072: try {
073: ts.testAt(0);
074: fail("Did not throw ArrayIndexOutOfBoundsException.");
075: } catch (ArrayIndexOutOfBoundsException e) {
076: // test exception
077: }
078: }
079:
080: public void testSetName1() {
081: TestSuite ts = new TestSuite();
082:
083: ts.setName(null);
084: }
085:
086: //-------------------------------------------------------------------------
087: // Standard JUnit declarations
088:
089: public static Test suite() {
090: TestSuite suite = new TestSuite(THIS_CLASS);
091:
092: return suite;
093: }
094:
095: public static void main(String[] args) {
096: String[] name = { THIS_CLASS.getName() };
097:
098: // junit.textui.TestRunner.main( name );
099: // junit.swingui.TestRunner.main( name );
100:
101: junit.textui.TestRunner.main(name);
102: }
103:
104: /**
105: *
106: * @exception Exception thrown under any exceptional condition.
107: */
108: protected void setUp() throws Exception {
109: super .setUp();
110:
111: // set ourself up
112: }
113:
114: /**
115: *
116: * @exception Exception thrown under any exceptional condition.
117: */
118: protected void tearDown() throws Exception {
119: // tear ourself down
120:
121: super.tearDown();
122: }
123: }
|