1 /* |
1 /* |
2 * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
18 * |
18 * |
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
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 |
20 * or visit www.oracle.com if you need additional information or have any |
21 * questions. |
21 * questions. |
22 */ |
22 */ |
|
23 |
23 /* |
24 /* |
24 * |
25 * @test |
|
26 * @bug 4052440 7003643 8062588 8210406 |
|
27 * @summary NumberFormatProvider tests |
|
28 * @library providersrc/foobarutils |
|
29 * providersrc/fooprovider |
|
30 * @modules java.base/sun.util.locale.provider |
|
31 * @build com.foobar.Utils |
|
32 * com.foo.* |
|
33 * @run main/othervm -Djava.locale.providers=JRE,SPI NumberFormatProviderTest |
25 */ |
34 */ |
26 |
35 |
27 import java.text.*; |
36 import java.text.DecimalFormat; |
28 import java.util.*; |
37 import java.text.DecimalFormatSymbols; |
29 import sun.util.locale.provider.*; |
38 import java.text.MessageFormat; |
30 import sun.util.resources.*; |
39 import java.text.NumberFormat; |
|
40 import java.util.Arrays; |
|
41 import java.util.Currency; |
|
42 import java.util.HashSet; |
|
43 import java.util.List; |
|
44 import java.util.Locale; |
|
45 import java.util.Set; |
31 |
46 |
32 import com.foo.FooNumberFormat; |
47 import com.foo.FooNumberFormat; |
|
48 import com.foo.NumberFormatProviderImpl; |
|
49 |
|
50 import sun.util.locale.provider.LocaleProviderAdapter; |
33 |
51 |
34 public class NumberFormatProviderTest extends ProviderTest { |
52 public class NumberFormatProviderTest extends ProviderTest { |
35 |
53 |
36 com.foo.NumberFormatProviderImpl nfp = new com.foo.NumberFormatProviderImpl(); |
54 NumberFormatProviderImpl nfp = new NumberFormatProviderImpl(); |
37 List<Locale> availloc = Arrays.asList(NumberFormat.getAvailableLocales()); |
55 List<Locale> availloc = Arrays.asList(NumberFormat.getAvailableLocales()); |
38 List<Locale> providerloc = Arrays.asList(nfp.getAvailableLocales()); |
56 List<Locale> providerloc = Arrays.asList(nfp.getAvailableLocales()); |
39 List<Locale> jreloc = Arrays.asList(LocaleProviderAdapter.forJRE().getAvailableLocales()); |
57 List<Locale> jreloc = Arrays.asList(LocaleProviderAdapter.forJRE().getAvailableLocales()); |
40 List<Locale> jreimplloc = Arrays.asList(LocaleProviderAdapter.forJRE().getNumberFormatProvider().getAvailableLocales()); |
58 List<Locale> jreimplloc = Arrays.asList(LocaleProviderAdapter.forJRE().getNumberFormatProvider().getAvailableLocales()); |
41 |
59 |