test/java/util/ResourceBundle/ResourceBundleTest.java
Print this page
rev 8630 : imported patch 8027930
@@ -20,11 +20,11 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
@test
- @bug 4049325 4073127 4083270 4106034 4108126
+ @bug 4049325 4073127 4083270 4106034 4108126 8027930
@summary test Resource Bundle
@build TestResource TestResource_de TestResource_fr TestResource_fr_CH
@build TestResource_it FakeTestResource
@run main ResourceBundleTest
*/
@@ -61,10 +61,11 @@
*
*/
import java.text.*;
import java.util.*;
+import static java.util.ResourceBundle.Control;
import java.io.*;
public class ResourceBundleTest extends RBTestFmwk {
public static void main(String[] args) throws Exception {
new ResourceBundleTest().run(args);
@@ -132,11 +133,12 @@
public void TestListResourceBundle() {
// load up the resource and check to make sure we got the right class
// (we don't define be_BY or be, so we fall back on the root default)
ResourceBundle bundle = ResourceBundle.getBundle("TestResource",
- new Locale("be", "BY"));
+ new Locale("be", "BY"),
+ Control.getNoFallbackControl(Control.FORMAT_DEFAULT));
if (!bundle.getClass().getName().equals("TestResource"))
errln("Expected TestResource, got " + bundle.getClass().getName());
doListResourceBundleTest(bundle);
}
@@ -266,11 +268,12 @@
errln("Actual locale for TestResource_fr_BE should have been fr, got " + locale);
// try to find TestResource_iw_IL, which doesn't exist. Should get root locale
// as its locale
test = ResourceBundle.getBundle("TestResource",
- new Locale("iw", "IL", ""));
+ new Locale("iw", "IL", ""),
+ Control.getNoFallbackControl(Control.FORMAT_DEFAULT));
locale = test.getLocale();
if (!(locale.getLanguage().equals("")) || !(locale.getCountry().equals("")))
errln("Actual locale for TestResource_iw_IL should have been the root locale, got "
+ locale);
}