| java.lang.Object com.ibm.icu.dev.test.calendar.TestCase
All known Subclasses: com.ibm.icu.dev.test.calendar.ChineseTestCase,
TestCase | public class TestCase (Code) | | A pseudo Calendar that is useful for testing
new calendars. A TestCase object is used to hold the
field and millisecond values that the calendar should have at one
particular instant in time. The applyFields and applyTime
methods are used to apply these settings to the calendar object being
tested, and the equals and fieldsEqual methods are used to ensure
that the calendar has ended up in the right state.
|
Constructor Summary | |
public | TestCase(double julian, int era, int year, int month, int day, int dayOfWeek, int hour, int min, int sec) Initialize a TestCase object using a julian day number and
the corresponding fields for the calendar being tested. | public | TestCase(int gregYear, int gregMonth, int gregDay, int era, int year, int month, int day, int dayOfWeek, int hour, int min, int sec) Initialize a TestCase object using a Gregorian year/month/day and
the corresponding fields for the calendar being tested. | protected | TestCase() For subclasses. |
Method Summary | |
public void | applyFields(Calendar c) Apply this test case's field values to another calendar
by calling its set method for each field. | public void | applyTime(Calendar c) Apply this test case's time in milliseconds to another calendar
by calling its setTime method. | public static String | dowToString(int dow) | public boolean | equals(Object obj) Determine whether time in milliseconds of this calendar
is the same as that of the other calendar. | public boolean | fieldsEqual(Calendar c, TestLog log) Determine whether the fields of this calendar
are the same as that of the other calendar. | protected int | get(int field) | public Date | getTime() | protected boolean | isSet(int field) | protected void | set(int field, int value) | protected void | setTime(Date d) | public String | toString() Return a String representation of this test case's time. |
JULIAN_EPOCH | final protected static long JULIAN_EPOCH(Code) | | |
ONE_DAY | final protected static long ONE_DAY(Code) | | |
ONE_HOUR | final protected static int ONE_HOUR(Code) | | |
ONE_MINUTE | final protected static int ONE_MINUTE(Code) | | |
ONE_SECOND | final protected static int ONE_SECOND(Code) | | |
fields | protected int[] fields(Code) | | |
isSet | protected boolean[] isSet(Code) | | |
TestCase | public TestCase(double julian, int era, int year, int month, int day, int dayOfWeek, int hour, int min, int sec)(Code) | | Initialize a TestCase object using a julian day number and
the corresponding fields for the calendar being tested.
Parameters: era - The ERA field of tested calendar on the given julian day Parameters: year - The YEAR field of tested calendar on the given julian day Parameters: month - The MONTH (1-based) field of tested calendar on the given julian day Parameters: day - The DAY_OF_MONTH field of tested calendar on the given julian day Parameters: dayOfWeek - The DAY_OF_WEEK field of tested calendar on the given julian day Parameters: hour - The HOUR field of tested calendar on the given julian day Parameters: min - The MINUTE field of tested calendar on the given julian day Parameters: sec - The SECOND field of tested calendar on the given julian day |
TestCase | public TestCase(int gregYear, int gregMonth, int gregDay, int era, int year, int month, int day, int dayOfWeek, int hour, int min, int sec)(Code) | | Initialize a TestCase object using a Gregorian year/month/day and
the corresponding fields for the calendar being tested.
Parameters: gregYear - The Gregorian year of the date to be tested Parameters: gregMonth - The Gregorian month of the date to be tested Parameters: gregDay - The Gregorian day of the month of the date to be tested Parameters: era - The ERA field of tested calendar on the given gregorian date Parameters: year - The YEAR field of tested calendar on the given gregorian date Parameters: month - The MONTH (0-based) field of tested calendar on the given gregorian date Parameters: day - The DAY_OF_MONTH field of tested calendar on the given gregorian date Parameters: dayOfWeek - The DAY_OF_WEEK field of tested calendar on the given gregorian date Parameters: hour - The HOUR field of tested calendar on the given gregorian date Parameters: min - The MINUTE field of tested calendar on the given gregorian date Parameters: sec - The SECOND field of tested calendar on the given gregorian date |
TestCase | protected TestCase()(Code) | | For subclasses.
|
applyFields | public void applyFields(Calendar c)(Code) | | Apply this test case's field values to another calendar
by calling its set method for each field. This is useful in combination
with the equal method.
See Also: com.ibm.icu.util.Calendar.equals |
applyTime | public void applyTime(Calendar c)(Code) | | Apply this test case's time in milliseconds to another calendar
by calling its setTime method. This is useful in combination
with fieldsEqual
See Also: TestCase.fieldsEqual |
equals | public boolean equals(Object obj)(Code) | | Determine whether time in milliseconds of this calendar
is the same as that of the other calendar. This method is useful
for determining whether the other calendar's computeTime method
works properly. For example:
Calendar testCalendar = ...
TestCase case = ...
case.applyFields(testCalendar);
if (!case.equals(testCalendar)) {
// Error!
}
See Also: TestCase.applyFields |
fieldsEqual | public boolean fieldsEqual(Calendar c, TestLog log)(Code) | | Determine whether the fields of this calendar
are the same as that of the other calendar. This method is useful
for determining whether the other calendar's computeFields method
works properly. For example:
Calendar testCalendar = ...
TestCase case = ...
case.applyTime(testCalendar);
if (!case.fieldsEqual(testCalendar)) {
// Error!
}
See Also: TestCase.applyTime |
get | protected int get(int field)(Code) | | |
isSet | protected boolean isSet(int field)(Code) | | |
set | protected void set(int field, int value)(Code) | | |
toString | public String toString()(Code) | | Return a String representation of this test case's time.
|
|
|