• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1//#* © 2016 and later: Unicode, Inc. and others.
2//#* License & terms of use: http://www.unicode.org/copyright.html#License
3//#
4//#*******************************************************************************
5//#* Copyright (C) 1997-2015, International Business Machines Corporation and    *
6//#* others. All Rights Reserved.                                                *
7//#*******************************************************************************
8//#* This is the ant build file for ICU4J.  See readme.html for more information.
9//#*
10// policies needed to run tests
11grant
12{
13    // temporary for debugging
14    // permission java.lang.RuntimePermission "getProtectionDomain";
15
16    permission java.lang.RuntimePermission "accessDeclaredMembers";
17
18    // needed for Locale.setDefault, only used in tests and demos
19    permission java.util.PropertyPermission "user.language", "write";
20
21    // for charsets
22    permission java.lang.RuntimePermission "charsetProvider", "read";
23
24    // IBM 1.6 on Windows does not allow to use reflection to access
25    // getDSTSavings in TimeZone implementation class in sun.util.clanedar.
26    permission java.lang.RuntimePermission "accessClassInPackage.sun.util.calendar";
27
28    // for testing lenient decimal/group separator parsing
29    permission java.util.PropertyPermission "com.ibm.icu.text.DecimalFormat.SkipExtendedSeparatorParsing", "write";
30
31    // for setting the default time zone by the test framework
32    permission java.util.PropertyPermission "user.timezone", "write";
33
34    // for creating a fallback class loader
35    permission java.lang.RuntimePermission "createClassLoader";
36};
37
38// there must be a way for code in one jar file to call code in another jar
39// file and give the called code permission to read the calling code's
40// jar.  they're in different protection domains despite being on the
41// same classpath and being loaded by the same class loader, so the class
42// loader doesn't disambiguate which protection domain we're using. it's
43// not easy to figure out the security docs, sigh.
44//
45// this is so ICUData (in icu4j.jar), called from test code (in core/charset tests jar)
46// can read test resource files (in core/charset tests jar)
47//
48grant codebase "file:${user.dir}/icu4j.jar"
49{
50    permission java.io.FilePermission "${/}${user.dir}${/}icu4jtests.jar", "read";
51    permission java.io.FilePermission "${/}${user.dir}${/}icu4j-charset.jar", "read";
52
53    permission java.util.PropertyPermission "com.ibm.icu.util.TimeZone.DefaultTimeZoneType", "read";
54    permission java.util.PropertyPermission "com.ibm.icu.text.DecimalFormat.SkipExtendedSeparatorParsing", "read";
55};
56
57grant codebase "file:${user.dir}/icu4jtests.jar"
58{
59    permission java.io.FilePermission "${/}${user.dir}${/}icu4j.jar", "read";
60};