--- a/jdk/test/java/util/PluggableLocale/DateFormatProviderTest.java Wed Nov 07 16:07:54 2012 -0500
+++ b/jdk/test/java/util/PluggableLocale/DateFormatProviderTest.java Wed Nov 07 15:08:28 2012 -0800
@@ -34,6 +34,7 @@
com.foo.DateFormatProviderImpl dfp = new com.foo.DateFormatProviderImpl();
List<Locale> availloc = Arrays.asList(DateFormat.getAvailableLocales());
List<Locale> providerloc = Arrays.asList(dfp.getAvailableLocales());
+ List<Locale> jreloc = Arrays.asList(LocaleProviderAdapter.forJRE().getAvailableLocales());
List<Locale> jreimplloc = Arrays.asList(LocaleProviderAdapter.forJRE().getDateFormatProvider().getAvailableLocales());
public static void main(String[] s) {
@@ -41,11 +42,23 @@
}
DateFormatProviderTest() {
+ availableLocalesTest();
objectValidityTest();
extendedVariantTest();
messageFormatTest();
}
+ void availableLocalesTest() {
+ Set<Locale> localesFromAPI = new HashSet<>(availloc);
+ Set<Locale> localesExpected = new HashSet<>(jreloc);
+ localesExpected.addAll(providerloc);
+ if (localesFromAPI.equals(localesExpected)) {
+ System.out.println("availableLocalesTest passed.");
+ } else {
+ throw new RuntimeException("availableLocalesTest failed");
+ }
+ }
+
void objectValidityTest() {
for (Locale target: availloc) {