summaryrefslogtreecommitdiffstats
path: root/security/src
diff options
context:
space:
mode:
authorUrs Grob <ursg@google.com>2009-04-29 17:01:24 +0200
committerUrs Grob <ursg@google.com>2009-05-28 16:06:03 +0200
commit728d33e7431ed0a19c3fe2f3caad92a9343c7f81 (patch)
treead9be9721e38f85edd0ff232b02b3883ce039b4a /security/src
parent45d1e076abf3d4e83bee1d27dd62147824f2a791 (diff)
downloadlibcore-728d33e7431ed0a19c3fe2f3caad92a9343c7f81.zip
libcore-728d33e7431ed0a19c3fe2f3caad92a9343c7f81.tar.gz
libcore-728d33e7431ed0a19c3fe2f3caad92a9343c7f81.tar.bz2
Reactivating tests disabled because of ClassLoader loop
Since ClassLoader.isAncestorOf has been fixed these tests now succeed. So they can be reactivated. BUG=1732214
Diffstat (limited to 'security/src')
-rw-r--r--security/src/test/java/tests/security/permissions/JavaLangClassLoaderTest.java12
-rw-r--r--security/src/test/java/tests/security/permissions/JavaLangThreadTest.java2
2 files changed, 8 insertions, 6 deletions
diff --git a/security/src/test/java/tests/security/permissions/JavaLangClassLoaderTest.java b/security/src/test/java/tests/security/permissions/JavaLangClassLoaderTest.java
index 66302ed..c33bb1b 100644
--- a/security/src/test/java/tests/security/permissions/JavaLangClassLoaderTest.java
+++ b/security/src/test/java/tests/security/permissions/JavaLangClassLoaderTest.java
@@ -17,7 +17,6 @@
package tests.security.permissions;
import dalvik.annotation.AndroidOnly;
-import dalvik.annotation.BrokenTest;
import dalvik.annotation.TestTargets;
import dalvik.annotation.TestLevel;
import dalvik.annotation.TestTargetNew;
@@ -120,7 +119,6 @@ public class JavaLangClassLoaderTest extends TestCase {
)
})
@AndroidOnly("uses DexFile")
- @BrokenTest("Endless loop in ClassLoader. Actually a known failure.")
public void test_getSystemClassLoader () throws IOException,
IllegalAccessException, InstantiationException {
class TestSecurityManager extends SecurityManager {
@@ -142,6 +140,10 @@ public class JavaLangClassLoaderTest extends TestCase {
File tempFile = Support_Resources.createTempFile(".jar");
tempFile.delete();
+ tempFile.deleteOnExit();
+ File tempCache = Support_Resources.createTempFile(".dex");
+ tempCache.delete();
+ tempCache.deleteOnExit();
/*
* The testdex.jar contains the following two classes:
@@ -167,8 +169,10 @@ public class JavaLangClassLoaderTest extends TestCase {
InputStream is = Support_Resources.getResourceStream("testdex.jar");
Support_Resources.copyLocalFileto(tempFile, is);
- DexFile dexfile = new DexFile(tempFile);
- ClassLoader pcl = Support_ClassLoader.getInstance(new URL(""),
+ DexFile dexfile = DexFile.loadDex(tempFile.getAbsolutePath(),
+ tempCache.getAbsolutePath(), 0);
+ ClassLoader pcl = Support_ClassLoader.getInstance(
+ new URL(Support_Resources.getResourceURL("testdex.jar")),
ClassLoader.getSystemClassLoader());
Class<?> testClass = dexfile.loadClass(
diff --git a/security/src/test/java/tests/security/permissions/JavaLangThreadTest.java b/security/src/test/java/tests/security/permissions/JavaLangThreadTest.java
index 0e5b43c..e71cec0 100644
--- a/security/src/test/java/tests/security/permissions/JavaLangThreadTest.java
+++ b/security/src/test/java/tests/security/permissions/JavaLangThreadTest.java
@@ -143,8 +143,6 @@ public class JavaLangThreadTest extends TestCase {
args = {}
)
@AndroidOnly("RI impl differs from RI spec, Android impl does not.")
- @BrokenTest("Suffers from endless loop in getClassLoader(), actually a"
- + "@KnownFailure, but we don't want to hang the test harness")
public void test_getContextClassLoader() {
class TestSecurityManager extends SecurityManager {
boolean called;