ICU-2118 improve coverage; comment out dead code

X-SVN-Rev: 10707
This commit is contained in:
Alan Liu 2002-12-18 00:44:39 +00:00
parent aeb529cc69
commit 17e69412cb
2 changed files with 40 additions and 18 deletions

View File

@ -4,8 +4,8 @@
* others. All Rights Reserved.
*******************************************************************************
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/dev/test/calendar/IBMCalendarTest.java,v $
* $Date: 2002/08/07 03:10:18 $
* $Revision: 1.11 $
* $Date: 2002/12/18 00:44:39 $
* $Revision: 1.12 $
*******************************************************************************
*/
package com.ibm.icu.dev.test.calendar;
@ -16,11 +16,7 @@ import java.util.Locale;
import com.ibm.icu.impl.LocaleUtility;
import com.ibm.icu.text.DateFormat;
import com.ibm.icu.text.SimpleDateFormat;
import com.ibm.icu.util.BuddhistCalendar;
import com.ibm.icu.util.Calendar;
import com.ibm.icu.util.GregorianCalendar;
import com.ibm.icu.util.JapaneseCalendar;
import com.ibm.icu.util.TimeZone;
import com.ibm.icu.util.*;
/**
* @test
@ -330,4 +326,30 @@ public class IBMCalendarTest extends CalendarTest {
Locale loc = new Locale("ms", "MY"); // Malay (Malaysia)
Calendar cal = Calendar.getInstance(loc);
}
/**
* Miscellaneous tests to increase coverage.
*/
public void TestCoverage() {
// BuddhistCalendar
BuddhistCalendar bcal = new BuddhistCalendar();
int i = bcal.getMinimum(Calendar.ERA);
bcal.add(Calendar.YEAR, 1);
bcal.add(Calendar.MONTH, 1);
Date d = bcal.getTime();
// CalendarAstronomer
// (This class should probably be made package-private.)
CalendarAstronomer astro = new CalendarAstronomer();
String s = astro.local(0);
// ChineseCalendar
ChineseCalendar ccal = new ChineseCalendar(TimeZone.getDefault(),
Locale.getDefault());
ccal.add(Calendar.MONTH, 1);
ccal.add(Calendar.YEAR, 1);
ccal.roll(Calendar.MONTH, 1);
ccal.roll(Calendar.YEAR, 1);
d = ccal.getTime();
}
}

View File

@ -5,8 +5,8 @@
*******************************************************************************
*
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/util/Attic/CalendarAstronomer.java,v $
* $Date: 2002/12/05 01:25:10 $
* $Revision: 1.10 $
* $Date: 2002/12/18 00:44:36 $
* $Revision: 1.11 $
*
*****************************************************************************************
*/
@ -1083,17 +1083,17 @@ public class CalendarAstronomer {
moonPosition = null;
}
private static void out(String s) {
System.out.println(s);
}
//private static void out(String s) {
// System.out.println(s);
//}
private static String deg(double rad) {
return Double.toString(rad * RAD_DEG);
}
//private static String deg(double rad) {
// return Double.toString(rad * RAD_DEG);
//}
private static String hours(long ms) {
return Double.toString((double)ms / HOUR_MS) + " hours";
}
//private static String hours(long ms) {
// return Double.toString((double)ms / HOUR_MS) + " hours";
//}
/**
* @stable ICU 2.0