| java.lang.Object com.ibm.icu.dev.test.AbstractTestLog com.ibm.icu.dev.test.TestFmwk com.ibm.icu.dev.test.calendar.CalendarTest
All known Subclasses: com.ibm.icu.dev.test.calendar.ChineseTest, com.ibm.icu.dev.test.calendar.EthiopicTest, com.ibm.icu.dev.test.calendar.IslamicTest, com.ibm.icu.dev.test.calendar.CopticTest, com.ibm.icu.dev.test.calendar.HebrewTest, com.ibm.icu.dev.test.calendar.JapaneseTest, com.ibm.icu.dev.test.calendar.IBMCalendarTest,
CalendarTest | public class CalendarTest extends TestFmwk (Code) | | A base class for classes that test individual Calendar subclasses.
Defines various useful utility methods and constants
|
Field Summary | |
final public static boolean | ADD | final public static int | DATE | final static double | DAY_MS | final public static int | DOW | final public static int | DOWM | final public static int | DOY | final public static int | ERA | final public static int | FRI | final public static int | HOUR | final static long | JULIAN_EPOCH | final public static int | MINUTE | final public static int | MON | final public static int | MONTH | final public static boolean | ROLL | final public static int | SAT | final public static int | SECOND | final public static int | SUN | final public static int | THU | final public static int | TUE | final public static SimpleTimeZone | UTC | final public static int | WED | final public static int | WOM | final public static int | WOY | final public static int | YEAR |
Method Summary | |
protected void | doLimitsTest(Calendar cal, int[] fieldsToTest, Date startDate, int testDuration) Test the functions getXxxMinimum() and getXxxMaximum() by marching a
test calendar 'cal' through 'numberOfDays' sequential days starting
with 'startDate'. | public void | doRollAdd(boolean roll, Calendar cal, int[][] tests) Process test cases for add and roll methods. | public void | doTestCases(TestCase[] cases, Calendar cal) Iterates through a list of calendar TestCase objects and
makes sure that the time-to-fields and fields-to-time calculations work
correnctly for the values in each test case. | final public static String | fieldName(int f) | static double | getJulianDay(Calendar cal) | public static String | ymdToString(int year, int month, int day) Convert year,month,day values to the form "year/month/day". | public static String | ymdToString(Calendar cal) Convert year,month,day values to the form "year/month/day". |
ADD | final public static boolean ADD(Code) | | |
DATE | final public static int DATE(Code) | | |
DAY_MS | final static double DAY_MS(Code) | | |
DOW | final public static int DOW(Code) | | |
DOWM | final public static int DOWM(Code) | | |
DOY | final public static int DOY(Code) | | |
ERA | final public static int ERA(Code) | | |
FRI | final public static int FRI(Code) | | |
HOUR | final public static int HOUR(Code) | | |
JULIAN_EPOCH | final static long JULIAN_EPOCH(Code) | | |
MINUTE | final public static int MINUTE(Code) | | |
MON | final public static int MON(Code) | | |
MONTH | final public static int MONTH(Code) | | |
ROLL | final public static boolean ROLL(Code) | | |
SAT | final public static int SAT(Code) | | |
SECOND | final public static int SECOND(Code) | | |
SUN | final public static int SUN(Code) | | |
THU | final public static int THU(Code) | | |
TUE | final public static int TUE(Code) | | |
WED | final public static int WED(Code) | | |
WOM | final public static int WOM(Code) | | |
WOY | final public static int WOY(Code) | | |
YEAR | final public static int YEAR(Code) | | |
doLimitsTest | protected void doLimitsTest(Calendar cal, int[] fieldsToTest, Date startDate, int testDuration)(Code) | | Test the functions getXxxMinimum() and getXxxMaximum() by marching a
test calendar 'cal' through 'numberOfDays' sequential days starting
with 'startDate'. For each date, read a field value along with its
reported actual minimum and actual maximum. These values are
checked against one another as well as against getMinimum(),
getGreatestMinimum(), getLeastMaximum(), and getMaximum(). We
expect to see:
1. minimum <= actualMinimum <= greatestMinimum <=
leastMaximum <= actualMaximum <= maximum
2. actualMinimum <= value <= actualMaximum
Note: In addition to outright failures, this test reports some
results as warnings. These are not generally of concern, but they
should be evaluated by a human. To see these, run this test in
verbose mode.
Parameters: cal - the calendar to be tested Parameters: fieldsToTest - an array of field values to be tested, e.g., newint[] { Calendar.MONTH, Calendar.DAY_OF_MONTH }. It only makessense to test the day fields; the time fields are not tested by thismethod. If null, then test all standard fields. Parameters: startDate - the first date to test Parameters: testDuration - if positive, the number of days to be tested.If negative, the number of seconds to run the test. |
doRollAdd | public void doRollAdd(boolean roll, Calendar cal, int[][] tests)(Code) | | Process test cases for add and roll methods.
Each test case is an array of integers, as follows:
- 0: input year
- 1: month (zero-based)
- 2: day
- 3: field to roll or add to
- 4: amount to roll or add
- 5: result year
- 6: month (zero-based)
- 7: day
For example:
// input add by output
// year month day field amount year month day
{ 5759, HESHVAN, 2, MONTH, 1, 5759, KISLEV, 2 },
Parameters: roll - true or ROLL to test the roll method;false or ADD to test the add |
doTestCases | public void doTestCases(TestCase[] cases, Calendar cal)(Code) | | Iterates through a list of calendar TestCase objects and
makes sure that the time-to-fields and fields-to-time calculations work
correnctly for the values in each test case.
|
ymdToString | public static String ymdToString(int year, int month, int day)(Code) | | Convert year,month,day values to the form "year/month/day".
On input the month value is zero-based, but in the result string it is one-based.
|
ymdToString | public static String ymdToString(Calendar cal)(Code) | | Convert year,month,day values to the form "year/month/day".
|
Fields inherited from com.ibm.icu.dev.test.TestFmwk | protected TestParams params(Code)(Java Doc)
|
Methods inherited from com.ibm.icu.dev.test.TestFmwk | protected boolean assertEquals(String message, boolean expected, boolean actual)(Code)(Java Doc) protected boolean assertEquals(String message, long expected, long actual)(Code)(Java Doc) protected boolean assertEquals(String message, float expected, float actual, double error)(Code)(Java Doc) protected boolean assertEquals(String message, double expected, double actual, double error)(Code)(Java Doc) protected boolean assertEquals(String message, Object expected, Object actual)(Code)(Java Doc) protected boolean assertFalse(String message, boolean condition)(Code)(Java Doc) protected boolean assertNotEquals(String message, Object expected, Object actual)(Code)(Java Doc) protected boolean assertNotNull(String message, Object actual)(Code)(Java Doc) protected boolean assertNotSame(String message, Object expected, Object actual)(Code)(Java Doc) protected boolean assertNull(String message, Object actual)(Code)(Java Doc) protected boolean assertSame(String message, Object expected, Object actual)(Code)(Java Doc) protected boolean assertTrue(String message, boolean condition)(Code)(Java Doc) protected int checkArray(String msg, String array, String expected)(Code)(Java Doc) protected int checkArray(String msg, Locale array, String expected)(Code)(Java Doc) protected int checkArray(String msg, ULocale array, String expected)(Code)(Java Doc) protected Random createRandom()(Code)(Java Doc) protected void fail(String message)(Code)(Java Doc) protected static synchronized java.util.Date getDate(int year, int month, int dom)(Code)(Java Doc) protected String getDescription()(Code)(Java Doc) protected int getErrorCount()(Code)(Java Doc) public PrintWriter getErrorLogPrintWriter()(Code)(Java Doc) public int getInclusion()(Code)(Java Doc) public PrintWriter getLogPrintWriter()(Code)(Java Doc) protected String getMethodDescription(String name)(Code)(Java Doc) protected TestFmwk getSubtest(String prefix) throws TestFmwkException(Code)(Java Doc) protected Target getTargets(String targetName)(Code)(Java Doc) public String getTranslitTestFilter()(Code)(Java Doc) protected void handleException(Throwable e)(Code)(Java Doc) public static String hex(char[] s)(Code)(Java Doc) public static String hex(byte[] s)(Code)(Java Doc) public static String hex(char ch)(Code)(Java Doc) public static String hex(int ch)(Code)(Java Doc) public static String hex(String s)(Code)(Java Doc) public static String hex(StringBuffer s)(Code)(Java Doc) protected void init() throws Exception(Code)(Java Doc) public boolean isDateAtLeast(int year, int month, int day)(Code)(Java Doc) public boolean isMemTracking()(Code)(Java Doc) public boolean isModularBuild()(Code)(Java Doc) public boolean isQuick()(Code)(Java Doc) public boolean isTiming()(Code)(Java Doc) public boolean isVerbose()(Code)(Java Doc) public void msg(String message, int level, boolean incCount, boolean newln)(Code)(Java Doc) public boolean noData()(Code)(Java Doc) public static String prettify(String s)(Code)(Java Doc) public static String prettify(StringBuffer s)(Code)(Java Doc) public Target resolveTarget(TestParams params)(Code)(Java Doc) public Target resolveTarget(TestParams params, String targetPath)(Code)(Java Doc) public void run(String[] args)(Code)(Java Doc) public int run(String[] args, PrintWriter log)(Code)(Java Doc) public int runTests(TestParams params, String[] tests)(Code)(Java Doc) protected TimeZone safeGetTimeZone(String id)(Code)(Java Doc) public void usage()(Code)(Java Doc) public static void usage(PrintWriter pw, String className)(Code)(Java Doc) protected boolean validate()(Code)(Java Doc) protected boolean validateMethod(String name)(Code)(Java Doc)
|
Fields inherited from com.ibm.icu.dev.test.AbstractTestLog | public static boolean dontSkipForVersion(Code)(Java Doc)
|
|
|