Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/jdk/java/util/PluggableLocale/PermissionTest.java
41149 views
1
/*
2
* Copyright (c) 2015, 2018, 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
*
9
* This code is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12
* version 2 for more details (a copy is included in the LICENSE file that
13
* accompanied this code).
14
*
15
* You should have received a copy of the GNU General Public License version
16
* 2 along with this work; if not, write to the Free Software Foundation,
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
/*
25
* @test
26
* @bug 8075545 8210406
27
* @summary Check whether RuntimePermission("localeServiceProvider") is
28
* handled correctly.
29
* @library providersrc/foobarutils
30
* providersrc/barprovider
31
* providersrc/fooprovider
32
* @build com.foobar.Utils
33
* com.bar.*
34
* com.foo.*
35
* @run main/othervm PermissionTest
36
* @run main/othervm/fail/java.security.policy=dummy.policy
37
* -Djava.security.manager
38
* -Djava.locale.providers=JRE,SPI
39
* PermissionTest
40
* @run main/othervm/java.security.policy=localeServiceProvider.policy
41
* -Djava.security.manager
42
* -Djava.locale.providers=JRE,SPI
43
* PermissionTest
44
*/
45
46
import com.bar.CalendarDataProviderImpl;
47
import com.bar.CalendarNameProviderImpl;
48
import com.bar.CurrencyNameProviderImpl;
49
import com.bar.CurrencyNameProviderImpl2;
50
import com.bar.GenericTimeZoneNameProviderImpl;
51
import com.bar.LocaleNameProviderImpl;
52
import com.bar.TimeZoneNameProviderImpl;
53
import com.foo.BreakIteratorProviderImpl;
54
import com.foo.CollatorProviderImpl;
55
import com.foo.DateFormatProviderImpl;
56
import com.foo.DateFormatSymbolsProviderImpl;
57
import com.foo.DecimalFormatSymbolsProviderImpl;
58
import com.foo.NumberFormatProviderImpl;
59
60
public class PermissionTest{
61
62
// Make sure provider impls can be instantiated under a security manager.ZZ
63
BreakIteratorProviderImpl breakIP = new BreakIteratorProviderImpl();
64
CollatorProviderImpl collatorP = new CollatorProviderImpl();
65
DateFormatProviderImpl dateFP = new DateFormatProviderImpl();
66
DateFormatSymbolsProviderImpl dateFSP = new DateFormatSymbolsProviderImpl();
67
DecimalFormatSymbolsProviderImpl decimalFSP = new DecimalFormatSymbolsProviderImpl();
68
NumberFormatProviderImpl numberFP = new NumberFormatProviderImpl();
69
CurrencyNameProviderImpl currencyNP = new CurrencyNameProviderImpl();
70
CurrencyNameProviderImpl2 currencyNP2 = new CurrencyNameProviderImpl2();
71
LocaleNameProviderImpl localeNP = new LocaleNameProviderImpl();
72
TimeZoneNameProviderImpl tzNP = new TimeZoneNameProviderImpl();
73
GenericTimeZoneNameProviderImpl tzGenNP = new GenericTimeZoneNameProviderImpl();
74
CalendarDataProviderImpl calDataP = new CalendarDataProviderImpl();
75
CalendarNameProviderImpl calNameP = new CalendarNameProviderImpl();
76
77
public static void main(String[] s) {
78
new PermissionTest();
79
}
80
}
81
82