8058569: Update java/lang/invoke/lambda tests to eliminate dependency on sun.tools.jar.Main
Reviewed-by: dholmes, alanb
This commit is contained in:
parent
6d148f368d
commit
6f7645f43c
@ -37,8 +37,6 @@ import java.util.Map;
|
||||
* support infrastructure to invoke a java class from the command line
|
||||
*/
|
||||
class LUtils {
|
||||
static final sun.tools.jar.Main jarTool =
|
||||
new sun.tools.jar.Main(System.out, System.err, "jar-tool");
|
||||
static final com.sun.tools.javac.Main javac =
|
||||
new com.sun.tools.javac.Main();
|
||||
static final File cwd = new File(".").getAbsoluteFile();
|
||||
@ -49,6 +47,10 @@ class LUtils {
|
||||
static final File JAVA_BIN_FILE = new File(JAVAHOME, "bin");
|
||||
static final File JAVA_CMD = new File(JAVA_BIN_FILE,
|
||||
isWindows ? "java.exe" : "java");
|
||||
static final File JAR_BIN_FILE =
|
||||
new File(new File(JAVAHOME).getParentFile(), "bin");
|
||||
static final File JAR_CMD = new File(JAR_BIN_FILE,
|
||||
isWindows ? "jar.exe" : "jar");
|
||||
|
||||
protected LUtils() {
|
||||
}
|
||||
|
@ -67,12 +67,17 @@ public class LambdaAccessControlDoPrivilegedTest extends LUtils {
|
||||
compile(javacArgs);
|
||||
File jarFile = new File("foo.jar");
|
||||
String[] jargs = {"cvf", jarFile.getName(), doprivClass.getName()};
|
||||
jarTool.run(jargs);
|
||||
TestResult tr = doExec(JAR_CMD.getAbsolutePath(),
|
||||
"cvf", jarFile.getName(),
|
||||
doprivClass.getName());
|
||||
if (tr.exitValue != 0){
|
||||
throw new RuntimeException(tr.toString());
|
||||
}
|
||||
doprivJava.delete();
|
||||
doprivClass.delete();
|
||||
TestResult tr = doExec(JAVA_CMD.getAbsolutePath(),
|
||||
"-Xbootclasspath/p:foo.jar",
|
||||
"-cp", ".", "Bar");
|
||||
tr = doExec(JAVA_CMD.getAbsolutePath(),
|
||||
"-Xbootclasspath/p:foo.jar",
|
||||
"-cp", ".", "Bar");
|
||||
tr.assertZero("testDoPrivileged fails");
|
||||
barJava.delete();
|
||||
barClass.delete();
|
||||
|
Loading…
Reference in New Issue
Block a user