8060026: Update jdk/test/tools/launcher tests to eliminate dependency on sun.tools.jar.Main
Reviewed-by: alanb, ksrini, psandoz
This commit is contained in:
parent
64bb4a891c
commit
13f3dfa073
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2008, 2014, 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
|
||||||
@ -50,6 +50,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Arrays;
|
||||||
import javax.tools.JavaCompiler;
|
import javax.tools.JavaCompiler;
|
||||||
import javax.tools.ToolProvider;
|
import javax.tools.ToolProvider;
|
||||||
|
|
||||||
@ -333,15 +334,10 @@ public class TestHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void createJar(String... args) {
|
static void createJar(String... args) {
|
||||||
sun.tools.jar.Main jarTool =
|
List<String> cmdList = new ArrayList<>();
|
||||||
new sun.tools.jar.Main(System.out, System.err, "JarCreator");
|
cmdList.add(jarCmd);
|
||||||
if (!jarTool.run(args)) {
|
cmdList.addAll(Arrays.asList(args));
|
||||||
String message = "jar creation failed with command:";
|
doExec(cmdList.toArray(new String[cmdList.size()]));
|
||||||
for (String x : args) {
|
|
||||||
message = message.concat(" " + x);
|
|
||||||
}
|
|
||||||
throw new RuntimeException(message);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void copyStream(InputStream in, OutputStream out) throws IOException {
|
static void copyStream(InputStream in, OutputStream out) throws IOException {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user