summaryrefslogtreecommitdiffstats
path: root/security/src
diff options
context:
space:
mode:
authorJesse Wilson <jessewilson@google.com>2009-10-09 17:41:52 -0700
committerJesse Wilson <jessewilson@google.com>2009-10-09 18:20:55 -0700
commit1f4eba15dc9e4086ce7e2a4fc7cac83fe6bbc03d (patch)
treef14192205ab0ea48f163b8e09df7189b26f28db4 /security/src
parent2fae89deffca19e4026887cd205904b6cc56526f (diff)
downloadlibcore-1f4eba15dc9e4086ce7e2a4fc7cac83fe6bbc03d.zip
libcore-1f4eba15dc9e4086ce7e2a4fc7cac83fe6bbc03d.tar.gz
libcore-1f4eba15dc9e4086ce7e2a4fc7cac83fe6bbc03d.tar.bz2
Rewrite Support_Exec to support timeouts on waiting processes.
Also rewriting SupportExec to use ProcessBuilder rather than Runtime.exec(). Changed callers to use the ProcessBuilder directly rather than calling-through chained methods.
Diffstat (limited to 'security/src')
-rw-r--r--security/src/test/java/tests/api/java/security/PermissionCollectionTest.java21
1 files changed, 10 insertions, 11 deletions
diff --git a/security/src/test/java/tests/api/java/security/PermissionCollectionTest.java b/security/src/test/java/tests/api/java/security/PermissionCollectionTest.java
index f36f119..35e3749 100644
--- a/security/src/test/java/tests/api/java/security/PermissionCollectionTest.java
+++ b/security/src/test/java/tests/api/java/security/PermissionCollectionTest.java
@@ -28,6 +28,8 @@ import java.security.SecurityPermission;
import java.util.StringTokenizer;
import tests.support.Support_Exec;
+import static tests.support.Support_Exec.javaProcessBuilder;
+import static tests.support.Support_Exec.execAndGetOutput;
import tests.support.Support_GetLocal;
import tests.support.resource.Support_Resources;
import dalvik.annotation.KnownFailure;
@@ -168,17 +170,14 @@ public class PermissionCollectionTest extends junit.framework.TestCase {
}
}
- String classPath = new File(classURL.getFile()).getPath();
-
- // Execute Support_PermissionCollection in another VM
- String[] classPathArray = new String[2];
- classPathArray[0] = classPath;
- classPathArray[1] = jarFile.getPath();
- String[] args = { "-Djava.security.policy=" + policyFile.toURL(),
- "tests.support.Support_PermissionCollection",
- signedBKS.toExternalForm() };
-
- String result = Support_Exec.execJava(args, classPathArray, true);
+ ProcessBuilder builder = javaProcessBuilder();
+ builder.command().add("-cp");
+ builder.command().add(Support_Exec.createPath(
+ new File(classURL.getFile()).getPath(), jarFile.getPath()));
+ builder.command().add("-Djava.security.policy=" + policyFile.toURL());
+ builder.command().add("tests.support.Support_PermissionCollection");
+ builder.command().add(signedBKS.toExternalForm());
+ String result = execAndGetOutput(builder);
StringTokenizer resultTokenizer = new StringTokenizer(result, ",");