public class

MainTest

extends TestCase
java.lang.Object
   ↳ TestCase
     ↳ org.joda.time.chrono.gj.MainTest

Class Overview

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.

Summary

Constants
int GREGORIAN_MODE
int JULIAN_MODE
Public Constructors
MainTest(int iterations, int mode, long seed)
Public Methods
static void main(String[] args)
Arguments: iterations [mode [seed]]
void testChronology()
Main junit test
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int GREGORIAN_MODE

Constant Value: 0 (0x00000000)

public static final int JULIAN_MODE

Constant Value: 1 (0x00000001)

Public Constructors

public MainTest (int iterations, int mode, long seed)

Parameters
iterations number of test iterations to perform
mode GREGORIAN_MODE or JULIAN_MODE,0=Gregorian, 1=Julian
seed seed for random number generator

Public Methods

public static void main (String[] args)

Arguments: iterations [mode [seed]]

Throws
Exception

public void testChronology ()

Main junit test