summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Carlstrom <bdc@google.com>2011-10-14 17:41:32 -0700
committerBrian Carlstrom <bdc@google.com>2011-10-14 17:41:32 -0700
commit513ac78ca8aaeb61fa06928ca10aeff34a7b4683 (patch)
tree2c1fa1de96e207469d07f5b02672370b7950c590
parentba6dde5853945ab18f713d8f818506bd501e2ab2 (diff)
downloadlibcore-513ac78ca8aaeb61fa06928ca10aeff34a7b4683.zip
libcore-513ac78ca8aaeb61fa06928ca10aeff34a7b4683.tar.gz
libcore-513ac78ca8aaeb61fa06928ca10aeff34a7b4683.tar.bz2
Set ANDROID_DATA for DalvikExecTest
Also increase timeout to allow for dexopt of BOOTCLASSPATH Bug: 5310023 Change-Id: Icaa81a3bb3cea10c610e6ad671a001f6dbfeda17
-rw-r--r--luni/src/test/java/libcore/java/util/jar/DalvikExecTest.java7
-rw-r--r--support/src/test/java/tests/support/Support_Exec.java6
2 files changed, 9 insertions, 4 deletions
diff --git a/luni/src/test/java/libcore/java/util/jar/DalvikExecTest.java b/luni/src/test/java/libcore/java/util/jar/DalvikExecTest.java
index 08ec096..021cd3f 100644
--- a/luni/src/test/java/libcore/java/util/jar/DalvikExecTest.java
+++ b/luni/src/test/java/libcore/java/util/jar/DalvikExecTest.java
@@ -45,7 +45,6 @@ public class DalvikExecTest extends TestCase {
builder.command().add("dalvikvm"); // for host mode, assume dalvikvm is on the path
}
- builder.command().add("-Djava.io.tmpdir=/tmp/mc");
builder.command().add("-Duser.language=en");
builder.command().add("-Duser.region=US");
builder.command().add("-Xbootclasspath:" + System.getProperty("java.boot.class.path"));
@@ -57,6 +56,12 @@ public class DalvikExecTest extends TestCase {
builder.command().add(arg1);
}
+ // Create a writable dalvik-cache under ANDROID_DATA.
+ // The default dalvik-cache is only writable by the system user (and root).
+ String tmp = System.getProperty("java.io.tmpdir");
+ builder.environment().put("ANDROID_DATA", tmp);
+ new File(tmp, "dalvik-cache").mkdir();
+
return execAndGetOutput(builder);
}
diff --git a/support/src/test/java/tests/support/Support_Exec.java b/support/src/test/java/tests/support/Support_Exec.java
index 124dcdc..0502b9c 100644
--- a/support/src/test/java/tests/support/Support_Exec.java
+++ b/support/src/test/java/tests/support/Support_Exec.java
@@ -77,7 +77,7 @@ public class Support_Exec extends TestCase {
* standard err, and returns. If the stream emits anything to standard err,
* an AssertionFailedError will be thrown.
*
- * <p>This method assumes the target process will complete within ten
+ * <p>This method assumes the target process will complete within thirty
* seconds. If it does not, an AssertionFailedError will be thrown.
*/
public static String execAndGetOutput(ProcessBuilder builder) throws IOException {
@@ -92,8 +92,8 @@ public class Support_Exec extends TestCase {
Throwable failure;
String out = "";
try {
- out = outFuture.get(10, TimeUnit.SECONDS);
- String err = errFuture.get(10, TimeUnit.SECONDS);
+ out = outFuture.get(30, TimeUnit.SECONDS);
+ String err = errFuture.get(30, TimeUnit.SECONDS);
failure = err.length() > 0
? new AssertionFailedError("Unexpected err stream data:\n" + err)
: null;