ICU-4259 - make securecheck tests pass

X-SVN-Rev: 16886
This commit is contained in:
Doug Felt 2004-11-20 04:50:15 +00:00
parent e1cb125860
commit 9ca03f1fd2
2 changed files with 21 additions and 5 deletions

View File

@ -293,9 +293,11 @@
<target name ="testData" depends="init">
<copy file="${src.dir}/com/ibm/icu/dev/data/rbbi/english.dict"
todir="${build.dir}/com/ibm/icu/dev/data/rbbi"/>
todir="${build.dir}/com/ibm/icu/dev/data/rbbi"/>
<copy file="${src.dir}/com/ibm/icu/dev/test/rbbi/rbbitst.txt"
todir="${build.dir}/com/ibm/icu/dev/test/rbbi"/>
todir="${build.dir}/com/ibm/icu/dev/test/rbbi"/>
<copy file="${src.dir}/com/ibm/icu/dev/data/riwords.txt"
todir="${build.dir}/com/ibm/icu/dev/data"/>
<javac includes="com/ibm/icu/dev/data/*.java"
excludes="**/CVS/**/*"
srcdir="${src.dir}"
@ -306,6 +308,10 @@
<fileset dir="${src.dir}/com/ibm/icu/dev/data"
includes="*.spp"/>
</copy>
<copy todir="${build.dir}/com/ibm/icu/dev/data/unicode">
<fileset dir="${src.dir}/com/ibm/icu/dev/data/unicode"
includes="*.txt"/>
</copy>
<copy file="${src.dir}/com/ibm/icu/dev/test/format/NumberFormatTestCases.txt"
todir="${build.dir}/com/ibm/icu/dev/test/format"/>
<unjar src="${src.dir}/com/ibm/icu/dev/data/testdata.jar" dest="${build.dir}"/>
@ -477,12 +483,14 @@
<target name="secureCheck" depends="testJar" description="run secure (applet-like) icu4j test suite">
<java classname="com.ibm.icu.dev.test.TestAll" fork="yes">
<!-- (use for debugging, LOTS of output) jvmarg value="-Djava.security.debug=access" -->
<!-- jvmarg value="-verbose"/ -->
<!-- (use for debugging, LOTS of output) <jvmarg value="-Djava.security.debug=access:trace"/ -->
<jvmarg value="-Djava.security.manager"/>
<jvmarg value="-Djava.security.policy=${src.dir}/com/ibm/icu/dev/test/security.policy"/>
<arg value="-w"/>
<classpath>
<pathelement location="clover.jar"/>
<pathelement location="${jar.file}"/>
<pathelement location="${testjar.file}"/>
</classpath>
</java>

View File

@ -39,6 +39,10 @@ public final class ICUResourceBundleTest extends TestFmwk {
//URL url = loader.getResource("LocaleElements_en.class");
//File file = new File(url.getPath());
URL url = (URL)en.nextElement();
if (url == null) {
warnln("could not load resource data");
return;
}
File file = new File(url.getPath());
File[] files = file.listFiles();
if(files!=null){
@ -48,9 +52,13 @@ public final class ICUResourceBundleTest extends TestFmwk {
}
}
}catch(SecurityException ex) {
warnln("could not load resource data");
warnln("could not load resource data: " + ex);
}catch(NullPointerException ex) {
// thrown by ibm 1.4.2 windows jvm security manager
warnln("could not load resource data: " + ex);
}catch(Exception ex){
errln("Unexpected exception: "+ ex.getMessage());
ex.printStackTrace();
errln("Unexpected exception: "+ ex);
}
}
public void TestResourceBundleWrapper(){