|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object junit.framework.Assert junit.framework.TestCase org.joda.time.chrono.gj.MainTest
public class MainTest
Tests either the Julian or Gregorian chronology from org.joda.time.chrono.gj against the implementations in this package. It tests all the date fields against their principal methods.
Randomly generated values are fed into the DateTimeField methods and the results are compared between the two chronologies. If any result doesn't match, an error report is generated and the program exits. Each time this test program is run, the pseudo random number generator is seeded with the same value. This ensures consistent results between test runs.
The main method accepts three optional arguments: iterations, mode, seed. By default, iterations is set to 1,000,000. The test will take several minutes to run, depending on the computer's performance. Every 5 seconds a progress message is printed.
The mode can be either 'g' for proleptic gregorian (the default) or 'j' for proleptic julian. To override the default random number generator seed, pass in a third argument which accepts a long signed integer.
Field Summary | |
---|---|
static int |
GREGORIAN_MODE
|
static int |
JULIAN_MODE
|
Constructor Summary | |
---|---|
MainTest(int iterations,
int mode,
long seed)
|
Method Summary | |
---|---|
static void |
main(String[] args)
Arguments: iterations [mode [seed]] |
void |
testChronology()
Main junit test |
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, 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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int GREGORIAN_MODE
public static final int JULIAN_MODE
Constructor Detail |
---|
public MainTest(int iterations, int mode, long seed)
iterations
- number of test iterations to performmode
- GREGORIAN_MODE or JULIAN_MODE,0=Gregorian, 1=Julianseed
- seed for random number generatorMethod Detail |
---|
public static void main(String[] args) throws Exception
Exception
public void testChronology()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |