diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-19 23:08:36 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-19 23:08:36 -0700 |
commit | eeb220adf9eea613d6cd97a131b0a9ef49e31a5b (patch) | |
tree | 9a6d52c8acb14e96a6efca3ec7eeb38b6e6f85fc /security | |
parent | 7387da1059039afc7d8fd3e48e4d0712fff5dfaf (diff) | |
download | libcore-eeb220adf9eea613d6cd97a131b0a9ef49e31a5b.zip libcore-eeb220adf9eea613d6cd97a131b0a9ef49e31a5b.tar.gz libcore-eeb220adf9eea613d6cd97a131b0a9ef49e31a5b.tar.bz2 |
auto import from //branches/cupcake_rel/...@141571
Diffstat (limited to 'security')
-rw-r--r-- | security/src/test/java/tests/security/permissions/JavaLangThreadTest.java | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/security/src/test/java/tests/security/permissions/JavaLangThreadTest.java b/security/src/test/java/tests/security/permissions/JavaLangThreadTest.java index 2c9af67..ddcf7ca 100644 --- a/security/src/test/java/tests/security/permissions/JavaLangThreadTest.java +++ b/security/src/test/java/tests/security/permissions/JavaLangThreadTest.java @@ -16,15 +16,16 @@ package tests.security.permissions; -import dalvik.annotation.AndroidOnly; -import dalvik.annotation.TestTargets; -import dalvik.annotation.TestLevel; -import dalvik.annotation.TestTargetNew; -import dalvik.annotation.TestTargetClass; +import java.net.MalformedURLException; +import java.net.URL; +import java.security.Permission; import junit.framework.TestCase; - -import java.security.Permission; +import tests.support.Support_ClassLoader; +import dalvik.annotation.AndroidOnly; +import dalvik.annotation.TestTargetClass; +import dalvik.annotation.TestTargetNew; +import dalvik.annotation.TestLevel; /* * This class tests the security permissions which are documented in @@ -167,13 +168,21 @@ public class JavaLangThreadTest extends TestCase { assertNotNull("test assumption: caller's class loader must not be null", this.getClass().getClassLoader()); + + URL url; + + try { + url = new URL("file:"); + } catch (MalformedURLException ex) { + throw new RuntimeException(ex); + } t1.setContextClassLoader(null); t2.setContextClassLoader(this.getClass().getClassLoader()); t3.setContextClassLoader(this.getClass().getClassLoader().getParent()); t4.setContextClassLoader( - new dalvik.system.PathClassLoader("", - this.getClass().getClassLoader())); + Support_ClassLoader.getInstance(url, + getClass().getClassLoader())); t5.setContextClassLoader( new ClassLoader(this.getClass().getClassLoader()) {}); |