提交 517f1c9b 编写于 作者: K ksrini

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

Reviewed-by: alanb, chegar
上级 d2201a4c
/* /*
* 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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
* @compile -XDignore.symbol.file DefaultLocaleTest.java TestHelper.java * @compile -XDignore.symbol.file DefaultLocaleTest.java TestHelper.java
* @run main DefaultLocaleTestRun * @run main DefaultLocaleTestRun
*/ */
import java.io.File;
public class DefaultLocaleTestRun { public class DefaultLocaleTestRun {
public static void main(String... args) { public static void main(String... args) {
...@@ -43,11 +42,13 @@ public class DefaultLocaleTestRun { ...@@ -43,11 +42,13 @@ public class DefaultLocaleTestRun {
return; return;
} }
TestHelper.TestResult tr = null; TestHelper.TestResult tr = null;
tr = TestHelper.doExec(TestHelper.javaCmd, "DefaultLocaleTest", "-w", tr = TestHelper.doExec(TestHelper.javaCmd,
"x.out"); "-cp", TestHelper.TEST_CLASSES_DIR.getAbsolutePath(),
"DefaultLocaleTest", "-w", "x.out");
System.out.println(tr.testOutput); System.out.println(tr.testOutput);
tr = TestHelper.doExec(TestHelper.javawCmd, "DefaultLocaleTest", "-r", tr = TestHelper.doExec(TestHelper.javawCmd,
"x.out"); "-cp", TestHelper.TEST_CLASSES_DIR.getAbsolutePath(),
"DefaultLocaleTest", "-r", "x.out");
System.out.println(tr.testOutput); System.out.println(tr.testOutput);
if (!tr.isOK()) { if (!tr.isOK()) {
throw new RuntimeException("Test failed"); throw new RuntimeException("Test failed");
......
...@@ -47,6 +47,10 @@ import static java.nio.file.StandardCopyOption.*; ...@@ -47,6 +47,10 @@ import static java.nio.file.StandardCopyOption.*;
*/ */
public enum TestHelper { public enum TestHelper {
INSTANCE; 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 String JAVAHOME = System.getProperty("java.home");
static final boolean isSDK = JAVAHOME.endsWith("jre"); static final boolean isSDK = JAVAHOME.endsWith("jre");
static final String javaCmd; static final String javaCmd;
...@@ -76,6 +80,18 @@ public enum TestHelper { ...@@ -76,6 +80,18 @@ public enum TestHelper {
static int testExitValue = 0; static int testExitValue = 0;
static { 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) { if (is64Bit && is32Bit) {
throw new RuntimeException("arch model cannot be both 32 and 64 bit"); throw new RuntimeException("arch model cannot be both 32 and 64 bit");
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册