| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
  |
  +--junit.framework.Assert
        |
        +--junit.framework.TestCase
              |
              +--org.jutil.junit.JutilTest
This is an extension for the junit TestCase class.
 
 This class adds revision checking to junit tests. The revision of a library class
 is kept in a static string, which is automatically updated by CVS (or another revision
 control management system). Each testclass passes a Revision object
 to the constructor of this class, which represents the revision that is tested by that testclass.
 When the library class is changed, the revisions will differ, and a 
 RevisionError will be thrown. This way a developer knows
 that he must check whether or not the testclass must be adapted.
At this moment this class can only work with cvs revisions. Put the following code in the library class:
 public final static String CVS_REVISION ="$Revision: 1.9 $";
 CVS will now automatically adapt the CVS_REVISION field when the cvs revision
 is changed.
The test class either pass a Class to a constructor to indicated the tested class
 , or for Jutil.org testclasses, use the constructor which determines the testclass itself. For
 the Jutil.org testclasses, the following scheme is used:
org.jutiltest.X.TestY -> org.jutil.X.TA typical constructor of a testclass will look like this:
 super(nameForJunit, new CVSRevision("x.x.x"));
 Of course any Revision can be passed, but most people use CVS as
 source control mechanism.
| Class Specifications | 
| public invariant getTestedRevision().equals(getTestedClassRevision()); | 
| Field Summary | |
| static java.lang.String | CVS_REVISION | 
| Constructor Summary | |
| JutilTest(java.lang.String name,
          java.lang.Class testedClass,
          Revision testedRevision)Initialize a new JutilTest with the given name, tested class and tested revision. | |
| JutilTest(java.lang.String name,
          Revision testedRevision)Initialize a new JutilTest with the given name and tested revision. This is a convenience constructor for Jutil.org test classes. | |
| Method Summary | |
|  java.lang.Class | getTestedClass()Return the class that is tested by this test class. | 
|  Revision | getTestedClassRevision()Return the field representing the revision of the tested class. | 
|  Revision | getTestedRevision()Return the revision of the tested class that is tested by this class. | 
| Methods inherited from class junit.framework.TestCase | 
| countTestCases, createResult, getName, name, run, run, runBare, runTest, setName, setUp, tearDown, toString | 
| Methods inherited from class junit.framework.Assert | 
| assert, assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail | 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Field Detail | 
public static final java.lang.String CVS_REVISION
| Constructor Detail | 
public JutilTest(java.lang.String name,
                 Revision testedRevision)
Initialize a new JutilTest with the given name and tested revision.
This is a convenience constructor for Jutil.org test classes. The tested class will be set to the corresponding class in the library. This means, the class with package org.jutil.X when the package of this class is org.jutiltest.X and with the name X when the name of this testclass is TestX.
If you want to set the tested class yourself, use the other constructor.
name - The name of the method that has to be invoked by default.testedRevision - The revision of the tested class that is tested by this class.
public JutilTest(java.lang.String name,
                 java.lang.Class testedClass,
                 Revision testedRevision)
name - The name of the method that has to be invoked by default.testedClass - The class that is tested by this testclass.testedRevision - The revision of the tested class that is tested by this class.| Method Detail | 
public Revision getTestedRevision()
public Revision getTestedClassRevision()
public java.lang.Class getTestedClass()
| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||