junit.com.mcdermottroe.exemplar
Class ExemplarTestCase<T>

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by junit.com.mcdermottroe.exemplar.ExemplarTestCase<T>
Type Parameters:
T - The type of class being tested.
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
AbstractClassTestCase, EnumClassTestCase, InterfaceTestCase, NormalClassTestCase, SingletonClassTestCase, UtilityClassTestCase

public abstract class ExemplarTestCase<T>
extends junit.framework.TestCase

A root class for all tests in Exemplar.

Since:
0.1

Field Summary
protected static String DELIBERATE_PASS
          This is the message to use when an always-pass assert is used.
protected  Class<?> testedClass
          The Class of the class which is being tested by the runtime type of this ExemplarTestCase object.
protected static File TMP
          A File for the temp directory.
 
Constructor Summary
ExemplarTestCase()
           
 
Method Summary
protected  Class<?> getTestedClass()
          Calculate the class to be tested.
 void setUp()
          Set up the JUnit test.
 void testAllMethodsBeingTested()
          Test that all of the methods in the tested class have at least some testing methods for them.
 void testCorrectPackage()
          When this method is inherited by every test it will make sure that all of the tested classes are in the same package as Constants which is in the root package.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DELIBERATE_PASS

protected static final String DELIBERATE_PASS
This is the message to use when an always-pass assert is used.

See Also:
Constant Field Values

TMP

protected static final File TMP
A File for the temp directory.


testedClass

protected Class<?> testedClass
The Class of the class which is being tested by the runtime type of this ExemplarTestCase object.

Constructor Detail

ExemplarTestCase

public ExemplarTestCase()
Method Detail

setUp

public void setUp()
           throws Exception
Set up the JUnit test.

Overrides:
setUp in class junit.framework.TestCase
Throws:
Exception - if TestCase.setUp() throws one.
See Also:
testedClass, TestCase.setUp()

getTestedClass

protected Class<?> getTestedClass()
Calculate the class to be tested. The default version of this method should be sufficient for almost all cases.

Returns:
The Class of the class to test.

testCorrectPackage

public void testCorrectPackage()
When this method is inherited by every test it will make sure that all of the tested classes are in the same package as Constants which is in the root package.

See Also:
Constants

testAllMethodsBeingTested

public void testAllMethodsBeingTested()
Test that all of the methods in the tested class have at least some testing methods for them.