use of java.util.TimeZone in project robovm by robovm.
the class TimeZoneTest method testHasSameRules.
// http://code.google.com/p/android/issues/detail?id=11918
public void testHasSameRules() throws Exception {
TimeZone denver = TimeZone.getTimeZone("America/Denver");
TimeZone phoenix = TimeZone.getTimeZone("America/Phoenix");
assertFalse(denver.hasSameRules(phoenix));
}
use of java.util.TimeZone in project robovm by robovm.
the class TimeZoneTest method testCustomTimeZoneDisplayNames.
// http://b/3049014
public void testCustomTimeZoneDisplayNames() {
TimeZone tz0001 = new SimpleTimeZone(60000, "ONE MINUTE");
TimeZone tz0130 = new SimpleTimeZone(5400000, "ONE HOUR, THIRTY");
TimeZone tzMinus0130 = new SimpleTimeZone(-5400000, "NEG ONE HOUR, THIRTY");
assertEquals("GMT+00:01", tz0001.getDisplayName(false, TimeZone.SHORT, Locale.US));
assertEquals("GMT+01:30", tz0130.getDisplayName(false, TimeZone.SHORT, Locale.US));
assertEquals("GMT-01:30", tzMinus0130.getDisplayName(false, TimeZone.SHORT, Locale.US));
}
use of java.util.TimeZone in project robovm by robovm.
the class TimeZoneTest method testAllDisplayNames.
public void testAllDisplayNames() throws Exception {
for (Locale locale : Locale.getAvailableLocales()) {
for (String id : TimeZone.getAvailableIDs()) {
TimeZone tz = TimeZone.getTimeZone(id);
assertNotNull(tz.getDisplayName(false, TimeZone.LONG, locale));
}
}
}
use of java.util.TimeZone in project robovm by robovm.
the class OldTimeZoneTest method test_getDisplayNameZI.
public void test_getDisplayNameZI() {
Locale.setDefault(Locale.US);
TimeZone tz = TimeZone.getTimeZone("America/Los_Angeles");
assertEquals("PST", tz.getDisplayName(false, 0));
assertEquals("Pacific Daylight Time", tz.getDisplayName(true, 1));
assertEquals("Pacific Standard Time", tz.getDisplayName(false, 1));
}
use of java.util.TimeZone in project robovm by robovm.
the class OldTimeZoneTest method test_getDisplayNameLjava_util_Locale.
public void test_getDisplayNameLjava_util_Locale() {
TimeZone tz = TimeZone.getTimeZone("America/Los_Angeles");
assertEquals("Pacific Standard Time", tz.getDisplayName(new Locale("US")));
assertEquals("heure normale du Pacifique", tz.getDisplayName(Locale.FRANCE));
}
Aggregations