public void TestCoverage() {
{
// new EthiopicCalendar(TimeZone)
EthiopicCalendar cal = new EthiopicCalendar(TimeZone.getDefault());
if(cal == null){
errln("could not create EthiopicCalendar with TimeZone");
}
}
{
// new EthiopicCalendar(ULocale)
EthiopicCalendar cal = new EthiopicCalendar(ULocale.getDefault());
if(cal == null){
errln("could not create EthiopicCalendar with ULocale");
}
}
{
// new EthiopicCalendar(Locale)
EthiopicCalendar cal = new EthiopicCalendar(Locale.getDefault());
if(cal == null){
errln("could not create EthiopicCalendar with Locale");
}
}
{
// new EthiopicCalendar(TimeZone, Locale)
EthiopicCalendar cal = new EthiopicCalendar(TimeZone.getDefault(), Locale.getDefault());
if(cal == null){
errln("could not create EthiopicCalendar with TimeZone,Locale");
}
}
{
// new EthiopicCalendar(TimeZone, ULocale)
EthiopicCalendar cal = new EthiopicCalendar(TimeZone.getDefault(), ULocale.getDefault());
if(cal == null){
errln("could not create EthiopicCalendar with TimeZone,ULocale");
}
}
{
// new EthiopicCalendar(Date)
EthiopicCalendar cal = new EthiopicCalendar(new Date());
if(cal == null){
errln("could not create EthiopicCalendar with Date");
}
}
{
// new EthiopicCalendar(int year, int month, int date)
EthiopicCalendar cal = new EthiopicCalendar(1997, EthiopicCalendar.MESKEREM, 1);
if(cal == null){
errln("could not create EthiopicCalendar with year,month,date");
}
}
{
// new EthiopicCalendar(int year, int month, int date, int hour, int minute, int second)
EthiopicCalendar cal = new EthiopicCalendar(1997, EthiopicCalendar.MESKEREM, 1, 1, 1, 1);
if(cal == null){
errln("could not create EthiopicCalendar with year,month,date,hour,minute,second");
}
}
{
// setCivil/isCivil
// operations on non-civil calendar
EthiopicCalendar cal = newAmeteAlemEraCalendar();
cal.setAmeteAlemEra(false);
if (cal.isAmeteAlemEra()) {
errln("EthiopicCalendar calendar is old system");
}
Date now = new Date();
cal.setTime(now);
Date then = cal.getTime();
if (!now.equals(then)) {
errln("get/set time failed with non-civil EthiopicCalendar calendar");
}
logln(then.toString());
cal.add(Calendar.MONTH, 1);
cal.add(Calendar.DAY_OF_MONTH, 1);
cal.add(Calendar.YEAR, 1);
logln(cal.getTime().toString());
}
{
// data
EthiopicCalendar cal = new EthiopicCalendar(1997, EthiopicCalendar.MESKEREM, 1);
Date time = cal.getTime();
String[] calendarLocales = {
"am_ET", "gez_ET", "ti_ET"
};
String[] formatLocales = {
"en", "am", "gez", "ti"
};
for (int i = 0; i < calendarLocales.length; ++i) {
String calLocName = calendarLocales[i];
Locale calLocale = LocaleUtility.getLocaleFromName(calLocName);
cal = new EthiopicCalendar(calLocale);
for (int j = 0; j < formatLocales.length; ++j) {
String locName = formatLocales[j];
Locale formatLocale = LocaleUtility.getLocaleFromName(locName);
DateFormat format = DateFormat.getDateTimeInstance(cal, DateFormat.FULL, DateFormat.FULL, formatLocale);