public void TestCoverage() {
{
// new IndianCalendar(TimeZone)
IndianCalendar cal = new IndianCalendar(TimeZone.getDefault());
if(cal == null){
errln("could not create IndianCalendar with TimeZone");
}
}
{
// new IndianCalendar(ULocale)
IndianCalendar cal = new IndianCalendar(ULocale.getDefault());
if(cal == null){
errln("could not create IndianCalendar with ULocale");
}
}
{
// new IndianCalendar(Locale)
IndianCalendar cal = new IndianCalendar(Locale.getDefault());
if(cal == null){
errln("could not create IndianCalendar with Locale");
}
}
{
// new IndianCalendar(TimeZone, Locale)
IndianCalendar cal = new IndianCalendar(TimeZone.getDefault(),Locale.getDefault());
if(cal == null){
errln("could not create IndianCalendar with TimeZone, Locale");
}
}
{
// new IndianCalendar(TimeZone, ULocale)
IndianCalendar cal = new IndianCalendar(TimeZone.getDefault(),ULocale.getDefault());
if(cal == null){
errln("could not create IndianCalendar with TimeZone, ULocale");
}
}
{
// new IndianCalendar(Date)
IndianCalendar cal = new IndianCalendar(new Date());
if(cal == null){
errln("could not create IndianCalendar with Date");
}
}
{
// new IndianCalendar(int year, int month, int date)
IndianCalendar cal = new IndianCalendar(1917, IndianCalendar.CHAITRA, 1);
if(cal == null){
errln("could not create IndianCalendar with year,month,date");
}
}
{
// new IndianCalendar(int year, int month, int date, int hour, int minute, int second)
IndianCalendar cal = new IndianCalendar(1917, IndianCalendar.CHAITRA, 1, 1, 1, 1);
if(cal == null){
errln("could not create IndianCalendar with year,month,date,hour,minute,second");
}
}
{
// data
String[] calendarLocales = {
"bn_IN", "gu_IN", "hi_IN", "kn_IN", "ml_IN", "or_IN", "pa_IN", "ta_IN", "te_IN"
};
String[] formatLocales = {
"en", "fr", "bn", "gu", "hi", "kn", "ml", "or", "pa", "ta", "te"
};
for (int i = 0; i < calendarLocales.length; ++i) {
String calLocName = calendarLocales[i];
Locale calLocale = LocaleUtility.getLocaleFromName(calLocName);
IndianCalendar cal = new IndianCalendar(calLocale);
cal.set(-1039, 9, 21);
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);