7132270: tools/launcher/DefaultLocaleTestRun.java failing (win)

Reviewed-by: alanb, chegar
This commit is contained in:
Kumar Srinivasan 2012-01-24 09:58:44 -08:00
parent 4953b8bfa5
commit d0df777779
2 changed files with 23 additions and 6 deletions

View File

@ -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 @@ public class DefaultLocaleTestRun {
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");

View File

@ -47,6 +47,10 @@ import static java.nio.file.StandardCopyOption.*;
*/
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 @@ public enum TestHelper {
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");
}