7132270: tools/launcher/DefaultLocaleTestRun.java failing (win)
Reviewed-by: alanb, chegar
--- a/jdk/test/tools/launcher/DefaultLocaleTestRun.java Tue Jan 17 16:20:52 2012 +0100
+++ b/jdk/test/tools/launcher/DefaultLocaleTestRun.java Tue Jan 24 09:58:44 2012 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -34,7 +34,6 @@
* @compile -XDignore.symbol.file DefaultLocaleTest.java TestHelper.java
* @run main DefaultLocaleTestRun
*/
-import java.io.File;
public class DefaultLocaleTestRun {
public static void main(String... args) {
@@ -43,11 +42,13 @@
return;
}
TestHelper.TestResult tr = null;
- tr = TestHelper.doExec(TestHelper.javaCmd, "DefaultLocaleTest", "-w",
- "x.out");
+ tr = TestHelper.doExec(TestHelper.javaCmd,
+ "-cp", TestHelper.TEST_CLASSES_DIR.getAbsolutePath(),
+ "DefaultLocaleTest", "-w", "x.out");
System.out.println(tr.testOutput);
- tr = TestHelper.doExec(TestHelper.javawCmd, "DefaultLocaleTest", "-r",
- "x.out");
+ tr = TestHelper.doExec(TestHelper.javawCmd,
+ "-cp", TestHelper.TEST_CLASSES_DIR.getAbsolutePath(),
+ "DefaultLocaleTest", "-r", "x.out");
System.out.println(tr.testOutput);
if (!tr.isOK()) {
throw new RuntimeException("Test failed");
--- a/jdk/test/tools/launcher/TestHelper.java Tue Jan 17 16:20:52 2012 +0100
+++ b/jdk/test/tools/launcher/TestHelper.java Tue Jan 24 09:58:44 2012 -0800
@@ -47,6 +47,10 @@
*/
public enum TestHelper {
INSTANCE;
+ // commonly used jtreg constants
+ static final File TEST_CLASSES_DIR;
+ static final File TEST_SOURCES_DIR;
+
static final String JAVAHOME = System.getProperty("java.home");
static final boolean isSDK = JAVAHOME.endsWith("jre");
static final String javaCmd;
@@ -76,6 +80,18 @@
static int testExitValue = 0;
static {
+ String tmp = System.getProperty("test.classes", null);
+ if (tmp == null) {
+ throw new Error("property test.classes not defined ??");
+ }
+ TEST_CLASSES_DIR = new File(tmp).getAbsoluteFile();
+
+ tmp = System.getProperty("test.src", null);
+ if (tmp == null) {
+ throw new Error("property test.src not defined ??");
+ }
+ TEST_SOURCES_DIR = new File(tmp).getAbsoluteFile();
+
if (is64Bit && is32Bit) {
throw new RuntimeException("arch model cannot be both 32 and 64 bit");
}