jdk/test/java/util/PluggableLocale/DateFormatSymbolsProviderTest.java
changeset 13583 dc0017b1a452
parent 5506 202f599c92aa
child 14172 fad44417edf8
--- a/jdk/test/java/util/PluggableLocale/DateFormatSymbolsProviderTest.java	Tue Aug 21 13:42:08 2012 +0100
+++ b/jdk/test/java/util/PluggableLocale/DateFormatSymbolsProviderTest.java	Tue Aug 21 11:00:30 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
 
 import java.text.*;
 import java.util.*;
-import sun.util.*;
+import sun.util.locale.provider.*;
 import sun.util.resources.*;
 
 public class DateFormatSymbolsProviderTest extends ProviderTest {
@@ -34,7 +34,8 @@
     com.foo.DateFormatSymbolsProviderImpl dfsp = new com.foo.DateFormatSymbolsProviderImpl();
     List<Locale> availloc = Arrays.asList(DateFormatSymbols.getAvailableLocales());
     List<Locale> providerloc = Arrays.asList(dfsp.getAvailableLocales());
-    List<Locale> jreloc = Arrays.asList(LocaleData.getAvailableLocales());
+    List<Locale> jreloc = Arrays.asList(LocaleProviderAdapter.forJRE().getAvailableLocales());
+    List<Locale> jreimplloc = Arrays.asList(LocaleProviderAdapter.forJRE().getDateFormatSymbolsProvider().getAvailableLocales());
 
     public static void main(String[] s) {
         new DateFormatSymbolsProviderTest();
@@ -47,7 +48,8 @@
 
     void availableLocalesTest() {
         Set<Locale> localesFromAPI = new HashSet<Locale>(availloc);
-        Set<Locale> localesExpected = new HashSet<Locale>(jreloc);
+        Set<Locale> localesExpected = new HashSet<Locale>(jreimplloc);
+        localesExpected.remove(Locale.ROOT);
         localesExpected.addAll(providerloc);
         if (localesFromAPI.equals(localesExpected)) {
             System.out.println("availableLocalesTest passed.");
@@ -60,8 +62,8 @@
 
         for (Locale target: availloc) {
             // pure JRE implementation
-            ResourceBundle rb = LocaleData.getDateFormatData(target);
-            boolean jreSupportsLocale = jreloc.contains(target);
+            ResourceBundle rb = LocaleProviderAdapter.forJRE().getLocaleData().getDateFormatData(target);
+            boolean jreSupportsLocale = jreimplloc.contains(target);
 
             // JRE string arrays
             String[][] jres = new String[6][];