001 /*
002 Copyright (c) 1996-2012, Damon Hart-Davis
003 All rights reserved.
004
005 Redistribution and use in source and binary forms, with or without
006 modification, are permitted provided that the following conditions are
007 met:
008
009 * Redistributions of source code must retain the above copyright
010 notice, this list of conditions and the following disclaimer.
011
012 * Redistributions in binary form must reproduce the above copyright
013 notice, this list of conditions and the following disclaimer in the
014 documentation and/or other materials provided with the
015 distribution.
016
017 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
018 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
019 TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
020 PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
021 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
022 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
023 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
024 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
025 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
026 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
027 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
028 */
029 /*
030 * Created by IntelliJ IDEA.
031 * User: Administrator
032 * Date: 28-Dec-02
033 * Time: 22:24:51
034 * To change template for new class use
035 * Code Style | Class Templates options (Tools | IDE Options).
036 */
037 package org.hd.d.pg2k.test.dev;
038
039 import junit.framework.TestCase;
040
041 /**Tiny test that can be used to ensure that JUnit mechanism is behaving.
042 * This is useful as a preliminary in use from command-line, IDE, etc.
043 */
044 public final class TinyTest extends TestCase
045 {
046 public TinyTest(final String name)
047 {
048 super(name);
049 }
050
051 /**Simplest possible test. */
052 public void testTruth()
053 {
054 assertTrue(true);
055 }
056
057 /**Only becomes true if setUp() does its thang. */
058 private boolean flag;
059
060 /**Test that setup/cleanup works. */
061 public void testSetup()
062 {
063 assertTrue(flag);
064 }
065
066 /**Make sure that the streams are set up. */
067 public void testOut()
068 {
069 assertNotNull(Main.getOut());
070 assertNotNull(Main.getErr());
071 }
072
073 /**Do any setup needed for the tests. */
074 @Override
075 protected void setUp()
076 {
077 flag = true;
078 }
079
080 /**Do any clearup needed after the tests. */
081 @Override
082 protected void tearDown()
083 {
084 // cleanup code
085 flag = false;
086 }
087 }