ResourceBundleTest.java (2362:00cd9dc3c2b5) | ResourceBundleTest.java (8756:fb7abd509bd2) |
---|---|
1/* 2 * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * --- 8 unchanged lines hidden (view full) --- 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23/* 24 @test | 1/* 2 * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * --- 8 unchanged lines hidden (view full) --- 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23/* 24 @test |
25 @bug 4049325 4073127 4083270 4106034 4108126 | 25 @bug 4049325 4073127 4083270 4106034 4108126 8027930 |
26 @summary test Resource Bundle 27 @build TestResource TestResource_de TestResource_fr TestResource_fr_CH 28 @build TestResource_it FakeTestResource 29 @run main ResourceBundleTest 30*/ 31/* 32 * 33 * --- 24 unchanged lines hidden (view full) --- 58 * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR 59 * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR 60 * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. 61 * 62 */ 63 64import java.text.*; 65import java.util.*; | 26 @summary test Resource Bundle 27 @build TestResource TestResource_de TestResource_fr TestResource_fr_CH 28 @build TestResource_it FakeTestResource 29 @run main ResourceBundleTest 30*/ 31/* 32 * 33 * --- 24 unchanged lines hidden (view full) --- 58 * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR 59 * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR 60 * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. 61 * 62 */ 63 64import java.text.*; 65import java.util.*; |
66import java.util.ResourceBundle.Control; |
|
66import java.io.*; 67 68public class ResourceBundleTest extends RBTestFmwk { 69 public static void main(String[] args) throws Exception { 70 new ResourceBundleTest().run(args); 71 } 72 73 public ResourceBundleTest() { --- 55 unchanged lines hidden (view full) --- 129 130 Locale.setDefault(saveDefault); 131 } 132 133 public void TestListResourceBundle() { 134 // load up the resource and check to make sure we got the right class 135 // (we don't define be_BY or be, so we fall back on the root default) 136 ResourceBundle bundle = ResourceBundle.getBundle("TestResource", | 67import java.io.*; 68 69public class ResourceBundleTest extends RBTestFmwk { 70 public static void main(String[] args) throws Exception { 71 new ResourceBundleTest().run(args); 72 } 73 74 public ResourceBundleTest() { --- 55 unchanged lines hidden (view full) --- 130 131 Locale.setDefault(saveDefault); 132 } 133 134 public void TestListResourceBundle() { 135 // load up the resource and check to make sure we got the right class 136 // (we don't define be_BY or be, so we fall back on the root default) 137 ResourceBundle bundle = ResourceBundle.getBundle("TestResource", |
137 new Locale("be", "BY")); | 138 new Locale("be", "BY"), 139 Control.getNoFallbackControl(Control.FORMAT_DEFAULT)); |
138 if (!bundle.getClass().getName().equals("TestResource")) 139 errln("Expected TestResource, got " + bundle.getClass().getName()); 140 141 doListResourceBundleTest(bundle); 142 } 143 144 /** 145 * @bug 4073127 --- 117 unchanged lines hidden (view full) --- 263 new Locale("fr", "BE", "")); 264 locale = test.getLocale(); 265 if (!(locale.getLanguage().equals("fr")) || !(locale.getCountry().equals(""))) 266 errln("Actual locale for TestResource_fr_BE should have been fr, got " + locale); 267 268 // try to find TestResource_iw_IL, which doesn't exist. Should get root locale 269 // as its locale 270 test = ResourceBundle.getBundle("TestResource", | 140 if (!bundle.getClass().getName().equals("TestResource")) 141 errln("Expected TestResource, got " + bundle.getClass().getName()); 142 143 doListResourceBundleTest(bundle); 144 } 145 146 /** 147 * @bug 4073127 --- 117 unchanged lines hidden (view full) --- 265 new Locale("fr", "BE", "")); 266 locale = test.getLocale(); 267 if (!(locale.getLanguage().equals("fr")) || !(locale.getCountry().equals(""))) 268 errln("Actual locale for TestResource_fr_BE should have been fr, got " + locale); 269 270 // try to find TestResource_iw_IL, which doesn't exist. Should get root locale 271 // as its locale 272 test = ResourceBundle.getBundle("TestResource", |
271 new Locale("iw", "IL", "")); | 273 new Locale("iw", "IL", ""), 274 Control.getNoFallbackControl(Control.FORMAT_DEFAULT)); |
272 locale = test.getLocale(); 273 if (!(locale.getLanguage().equals("")) || !(locale.getCountry().equals(""))) 274 errln("Actual locale for TestResource_iw_IL should have been the root locale, got " 275 + locale); 276 } 277 278 /* 279 * @bug 4083270 --- 114 unchanged lines hidden --- | 275 locale = test.getLocale(); 276 if (!(locale.getLanguage().equals("")) || !(locale.getCountry().equals(""))) 277 errln("Actual locale for TestResource_iw_IL should have been the root locale, got " 278 + locale); 279 } 280 281 /* 282 * @bug 4083270 --- 114 unchanged lines hidden --- |