8182404: remove jdk.testlibrary.JDKToolFinder and JDKToolLauncher

Reviewed-by: amenkov, jcbeyler, alanb
This commit is contained in:
Igor Ignatyev 2018-09-10 14:23:37 -07:00
parent 7445ebf02b
commit 2702b5c299
45 changed files with 58 additions and 315 deletions

View File

@ -40,7 +40,6 @@ import jdk.test.lib.apps.LingeredApp;
import jdk.test.lib.apps.LingeredAppWithDeadlock; import jdk.test.lib.apps.LingeredAppWithDeadlock;
import jdk.test.lib.Utils; import jdk.test.lib.Utils;
import jdk.test.lib.Platform;
import jdk.test.lib.JDKToolLauncher; import jdk.test.lib.JDKToolLauncher;
import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.ProcessTools;

View File

@ -24,7 +24,6 @@
/* /*
* @test * @test
* @bug 6760902 * @bug 6760902
* @library /lib/testlibrary
* @library /test/lib * @library /test/lib
* @build jdk.test.lib.process.ProcessTools * @build jdk.test.lib.process.ProcessTools
* @run testng GetResource * @run testng GetResource
@ -45,7 +44,7 @@ import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
import jdk.testlibrary.JDKToolFinder; import jdk.test.lib.JDKToolFinder;
import static jdk.test.lib.process.ProcessTools.*; import static jdk.test.lib.process.ProcessTools.*;
import org.testng.annotations.BeforeTest; import org.testng.annotations.BeforeTest;

View File

@ -32,7 +32,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.stream.Stream; import java.util.stream.Stream;
import jdk.testlibrary.JDKToolFinder; import jdk.test.lib.JDKToolFinder;
import jdk.test.lib.compiler.CompilerUtils; import jdk.test.lib.compiler.CompilerUtils;
import static jdk.test.lib.process.ProcessTools.executeCommand; import static jdk.test.lib.process.ProcessTools.executeCommand;

View File

@ -32,8 +32,8 @@
* patched system module, or Xbootclasspath * patched system module, or Xbootclasspath
* This test does not require existence of java.logging module, * This test does not require existence of java.logging module,
* but require jdk.compiler module * but require jdk.compiler module
* @library /lib/testlibrary /test/lib * @library /test/lib
* @build Base jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.* * @build Base jdk.test.lib.compiler.CompilerUtils
* @run main/othervm JDKLoggerForImageTest * @run main/othervm JDKLoggerForImageTest
*/ */

View File

@ -32,8 +32,8 @@
* 2. clients are in named/unnamed module, * 2. clients are in named/unnamed module,
* patched system module, or Xbootclasspath * patched system module, or Xbootclasspath
* This test DOES require existence of java.logging module * This test DOES require existence of java.logging module
* @library /lib/testlibrary /test/lib * @library /test/lib
* @build Base jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.* * @build Base jdk.test.lib.compiler.CompilerUtils
* @run main/othervm JDKLoggerForJDKTest * @run main/othervm JDKLoggerForJDKTest
*/ */

View File

@ -32,8 +32,8 @@
* patched system module, or Xbootclasspath * patched system module, or Xbootclasspath
* This test does not require existence of java.logging module, * This test does not require existence of java.logging module,
* but require jdk.compiler module * but require jdk.compiler module
* @library /lib/testlibrary /test/lib * @library /test/lib
* @build Base jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.* * @build Base jdk.test.lib.compiler.CompilerUtils
* @run main/othervm LoggerInImageTest * @run main/othervm LoggerInImageTest
*/ */

View File

@ -34,8 +34,8 @@ import java.io.File;
* patched system module, or Xbootclasspath * patched system module, or Xbootclasspath
* This test does not require existence of java.logging module, * This test does not require existence of java.logging module,
* but require jdk.compiler module * but require jdk.compiler module
* @library /lib/testlibrary /test/lib * @library /test/lib
* @build Base jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.* * @build Base jdk.test.lib.compiler.CompilerUtils
* @run main/othervm NamedLoggerForImageTest * @run main/othervm NamedLoggerForImageTest
*/ */

View File

@ -34,8 +34,8 @@ import java.io.File;
* patched system module, or Xbootclasspath * patched system module, or Xbootclasspath
* This test does not require existence of java.logging module, * This test does not require existence of java.logging module,
* but require jdk.compiler module * but require jdk.compiler module
* @library /lib/testlibrary /test/lib * @library /test/lib
* @build Base jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.* * @build Base jdk.test.lib.compiler.CompilerUtils
* @run main/othervm NamedLoggerForJDKTest * @run main/othervm NamedLoggerForJDKTest
*/ */

View File

@ -34,8 +34,8 @@ import java.io.File;
* patched system module, or Xbootclasspath * patched system module, or Xbootclasspath
* This test does not require existence of java.logging module, * This test does not require existence of java.logging module,
* but require jdk.compiler module * but require jdk.compiler module
* @library /lib/testlibrary /test/lib * @library /test/lib
* @build Base jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.* * @build Base jdk.test.lib.compiler.CompilerUtils
* @run main/othervm UnnamedLoggerForImageTest * @run main/othervm UnnamedLoggerForImageTest
*/ */

View File

@ -34,8 +34,8 @@ import java.io.File;
* patched system module, or Xbootclasspath * patched system module, or Xbootclasspath
* This test does not require existence of java.logging module, * This test does not require existence of java.logging module,
* but require jdk.compiler module * but require jdk.compiler module
* @library /lib/testlibrary /test/lib * @library /test/lib
* @build Base jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.* * @build Base jdk.test.lib.compiler.CompilerUtils
* @run main/othervm UnnamedLoggerForJDKTest * @run main/othervm UnnamedLoggerForJDKTest
*/ */

View File

@ -45,8 +45,8 @@ import java.util.*;
import java.util.concurrent.Phaser; import java.util.concurrent.Phaser;
import javax.management.*; import javax.management.*;
import javax.management.openmbean.CompositeData; import javax.management.openmbean.CompositeData;
import jdk.test.lib.JDKToolFinder;
import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.ProcessTools;
import jdk.testlibrary.JDKToolFinder;
import jdk.testlibrary.Utils; import jdk.testlibrary.Utils;
import sun.hotspot.code.Compiler; import sun.hotspot.code.Compiler;

View File

@ -28,10 +28,10 @@
import java.util.List; import java.util.List;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import jdk.test.lib.JDKToolFinder;
import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.ProcessTools;
import jdk.testlibrary.Utils; import jdk.testlibrary.Utils;
import jdk.testlibrary.JDKToolFinder;
public class RunUtil { public class RunUtil {

View File

@ -26,6 +26,7 @@
* @bug 8072466 * @bug 8072466
* @summary Deadlock when initializing MulticastSocket and DatagramSocket * @summary Deadlock when initializing MulticastSocket and DatagramSocket
* @library /lib/testlibrary * @library /lib/testlibrary
* @library /test/lib
* @build jdk.testlibrary.* * @build jdk.testlibrary.*
* @run main/othervm MultiDead * @run main/othervm MultiDead
*/ */
@ -36,7 +37,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
import static java.util.concurrent.TimeUnit.MILLISECONDS; import static java.util.concurrent.TimeUnit.MILLISECONDS;
import jdk.testlibrary.JDKToolLauncher; import jdk.test.lib.JDKToolLauncher;
import jdk.testlibrary.Utils; import jdk.testlibrary.Utils;
public class MultiDead { public class MultiDead {

View File

@ -46,7 +46,7 @@ import javax.tools.StandardJavaFileManager;
import javax.tools.StandardLocation; import javax.tools.StandardLocation;
import javax.tools.ToolProvider; import javax.tools.ToolProvider;
import jdk.test.lib.util.FileUtils; import jdk.test.lib.util.FileUtils;
import jdk.testlibrary.JDKToolFinder; import jdk.test.lib.JDKToolFinder;
import static java.lang.String.format; import static java.lang.String.format;
import static java.util.Arrays.asList; import static java.util.Arrays.asList;
@ -55,10 +55,10 @@ import static java.util.Arrays.asList;
* @bug 8064924 * @bug 8064924
* @modules jdk.compiler * @modules jdk.compiler
* @summary Basic test for URLStreamHandlerProvider * @summary Basic test for URLStreamHandlerProvider
* @library /lib/testlibrary /test/lib * @library /test/lib
* @build jdk.test.lib.Platform * @build jdk.test.lib.Platform
* jdk.test.lib.util.FileUtils * jdk.test.lib.util.FileUtils
* jdk.testlibrary.JDKToolFinder * jdk.test.lib.JDKToolFinder
* @compile Basic.java Child.java * @compile Basic.java Child.java
* @run main Basic * @run main Basic
*/ */

View File

@ -40,7 +40,7 @@ import java.util.Arrays;
* @summary Test for feature 'support stronger entry protection'. An entry is * @summary Test for feature 'support stronger entry protection'. An entry is
* stored to keystore with different PasswordProtection objects which are * stored to keystore with different PasswordProtection objects which are
* specified by different PBE algorithms (use -Dseed=X to set PRNG seed) * specified by different PBE algorithms (use -Dseed=X to set PRNG seed)
* @library /test/lib /lib/testlibrary ../ * @library /test/lib ../
* @key randomness * @key randomness
* @build jdk.test.lib.RandomFactory * @build jdk.test.lib.RandomFactory
* @run main EntryProtectionTest * @run main EntryProtectionTest

View File

@ -36,7 +36,7 @@ import java.util.List;
* @bug 8048830 * @bug 8048830
* @summary Test for PKCS12 keystore list , export commands. Refer README for * @summary Test for PKCS12 keystore list , export commands. Refer README for
* keystore files information * keystore files information
* @library /lib/testlibrary ../ * @library ../
* @library /test/lib * @library /test/lib
* @run main KeytoolReaderP12Test * @run main KeytoolReaderP12Test
*/ */

View File

@ -31,7 +31,7 @@ import static java.lang.System.out;
* @test * @test
* @bug 8048830 * @bug 8048830
* @summary Tests for creating pkcs12 keystore with various algorithms * @summary Tests for creating pkcs12 keystore with various algorithms
* @library /lib/testlibrary ../ * @library ../
* @library /test/lib * @library /test/lib
* @run main KeytoolWriteP12Test * @run main KeytoolWriteP12Test
*/ */

View File

@ -39,7 +39,7 @@ import static java.lang.System.out;
* @test * @test
* @bug 8048830 * @bug 8048830
* @summary Entry's attribute set should be empty * @summary Entry's attribute set should be empty
* @library /lib/testlibrary ../ * @library ../
* @library /test/lib * @library /test/lib
* @run main MetadataEmptyTest * @run main MetadataEmptyTest
*/ */

View File

@ -43,7 +43,7 @@ import java.util.HashSet;
* @test * @test
* @bug 8048830 * @bug 8048830
* @summary Test store metadata attributes to PKCS12 keystore. * @summary Test store metadata attributes to PKCS12 keystore.
* @library /lib/testlibrary ../ * @library ../
* @library /test/lib * @library /test/lib
* @run main MetadataStoreLoadTest * @run main MetadataStoreLoadTest
*/ */

View File

@ -42,7 +42,7 @@ import static java.lang.System.out;
* @summary Test imports certificate from file to PKCS12 keystore store it as * @summary Test imports certificate from file to PKCS12 keystore store it as
* trusted certificate Check import errors (must be not errors) & check keystore * trusted certificate Check import errors (must be not errors) & check keystore
* content after import * content after import
* @library /lib/testlibrary ../ * @library ../
* @library /test/lib * @library /test/lib
* @run main StoreTrustedCertAPITest * @run main StoreTrustedCertAPITest
*/ */

View File

@ -38,7 +38,7 @@ import static java.lang.System.out;
* @bug 8048830 * @bug 8048830
* @summary Tests keytool command imports certificate , list keystore, print * @summary Tests keytool command imports certificate , list keystore, print
* certificate and import password help. * certificate and import password help.
* @library /lib/testlibrary ../ * @library ../
* @library /test/lib * @library /test/lib
* @run main StoreTrustedCertKeytool * @run main StoreTrustedCertKeytool
*/ */

View File

@ -34,7 +34,7 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.ProcessTools;
import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.OutputAnalyzer;
import jdk.testlibrary.JDKToolFinder; import jdk.test.lib.JDKToolFinder;
import static java.lang.System.out; import static java.lang.System.out;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -59,8 +59,8 @@ import javax.management.openmbean.SimpleType;
import javax.management.openmbean.TabularDataSupport; import javax.management.openmbean.TabularDataSupport;
import javax.management.openmbean.TabularType; import javax.management.openmbean.TabularType;
import jdk.test.lib.JDKToolFinder;
import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.ProcessTools;
import jdk.testlibrary.JDKToolFinder;
public class MXBeanWeirdParamTest { public class MXBeanWeirdParamTest {

View File

@ -65,8 +65,8 @@ import javax.management.remote.JMXServiceURL;
import javax.management.Attribute ; import javax.management.Attribute ;
import javax.management.ObjectName ; import javax.management.ObjectName ;
import jdk.test.lib.JDKToolFinder;
import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.ProcessTools;
import jdk.testlibrary.JDKToolFinder;
public class AuthorizationTest { public class AuthorizationTest {

View File

@ -81,8 +81,8 @@ import javax.rmi.ssl.SslRMIServerSocketFactory;
import java.security.Security; import java.security.Security;
import jdk.test.lib.JDKToolFinder;
import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.ProcessTools;
import jdk.testlibrary.JDKToolFinder;
public class SecurityTest { public class SecurityTest {

View File

@ -1,115 +0,0 @@
/*
* Copyright (c) 2013, 2016, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.testlibrary;
import java.io.FileNotFoundException;
import java.nio.file.Path;
import java.nio.file.Paths;
/**
* @deprecated This class is deprecated. Use the one from
* {@code <root>/test/lib/jdk/test/lib}
*/
@Deprecated
public final class JDKToolFinder {
private JDKToolFinder() {
}
/**
* Returns the full path to an executable in jdk/bin based on System
* property {@code test.jdk} or {@code compile.jdk} (both are set by the jtreg test suite)
*
* @return Full path to an executable in jdk/bin
*/
public static String getJDKTool(String tool) {
// First try to find the executable in test.jdk
try {
return getTool(tool, "test.jdk");
} catch (FileNotFoundException e) {
}
// Now see if it's available in compile.jdk
try {
return getTool(tool, "compile.jdk");
} catch (FileNotFoundException e) {
throw new RuntimeException("Failed to find " + tool +
", looked in test.jdk (" + System.getProperty("test.jdk") +
") and compile.jdk (" + System.getProperty("compile.jdk") + ")");
}
}
/**
* Returns the full path to an executable in jdk/bin based on System
* property {@code compile.jdk}
*
* @return Full path to an executable in jdk/bin
*/
public static String getCompileJDKTool(String tool) {
try {
return getTool(tool, "compile.jdk");
} catch (FileNotFoundException e) {
throw new RuntimeException(e);
}
}
/**
* Returns the full path to an executable in jdk/bin based on System
* property {@code test.jdk}
*
* @return Full path to an executable in jdk/bin
*/
public static String getTestJDKTool(String tool) {
try {
return getTool(tool, "test.jdk");
} catch (FileNotFoundException e) {
throw new RuntimeException(e);
}
}
private static String getTool(String tool, String property) throws FileNotFoundException {
String jdkPath = System.getProperty(property);
if (jdkPath == null) {
throw new RuntimeException(
"System property '" + property + "' not set. This property is normally set by jtreg. "
+ "When running test separately, set this property using '-D" + property + "=/path/to/jdk'.");
}
Path toolName = Paths.get("bin", tool + (isWindows() ? ".exe" : ""));
Path jdkTool = Paths.get(jdkPath, toolName.toString());
if (!jdkTool.toFile().exists()) {
throw new FileNotFoundException("Could not find file " + jdkTool.toAbsolutePath());
}
return jdkTool.toAbsolutePath().toString();
}
private static boolean isWindows() {
return System.getProperty("os.name").toLowerCase().startsWith("win");
}
}

View File

@ -1,134 +0,0 @@
/*
* Copyright (c) 2013, 2016, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.testlibrary;
import java.util.ArrayList;
import java.util.List;
/**
* A utility for constructing command lines for starting JDK tool processes.
*
* The JDKToolLauncher can in particular be combined with a
* java.lang.ProcessBuilder to easily run a JDK tool. For example, the following
* code run {@code jmap -heap} against a process with GC logging turned on for
* the {@code jmap} process:
*
* <pre>
* {@code
* JDKToolLauncher jmap = JDKToolLauncher.create("jmap")
* .addVMArg("-Xlog:gc*=debug")
* .addToolArg("-heap")
* .addToolArg(pid);
* ProcessBuilder pb = new ProcessBuilder(jmap.getCommand());
* Process p = pb.start();
* }
* </pre>
* @deprecated This class is deprecated. Use the one from
* {@code <root>/test/lib/jdk/test/lib}
*/
@Deprecated
public class JDKToolLauncher {
private final String executable;
private final List<String> vmArgs = new ArrayList<String>();
private final List<String> toolArgs = new ArrayList<String>();
private JDKToolLauncher(String tool, boolean useCompilerJDK) {
if (useCompilerJDK) {
executable = JDKToolFinder.getJDKTool(tool);
} else {
executable = JDKToolFinder.getTestJDKTool(tool);
}
}
/**
* Creates a new JDKToolLauncher for the specified tool. Using tools path
* from the compiler JDK.
*
* @param tool
* The name of the tool
* @return A new JDKToolLauncher
*/
public static JDKToolLauncher create(String tool) {
return new JDKToolLauncher(tool, true);
}
/**
* Creates a new JDKToolLauncher for the specified tool in the Tested JDK.
*
* @param tool
* The name of the tool
*
* @return A new JDKToolLauncher
*/
public static JDKToolLauncher createUsingTestJDK(String tool) {
return new JDKToolLauncher(tool, false);
}
/**
* Adds an argument to the JVM running the tool.
*
* The JVM arguments are passed to the underlying JVM running the tool.
* Arguments will automatically be prepended with "-J".
*
* Any platform specific arguments required for running the tool are
* automatically added.
*
*
* @param arg
* The argument to VM running the tool
* @return The JDKToolLauncher instance
*/
public JDKToolLauncher addVMArg(String arg) {
vmArgs.add(arg);
return this;
}
/**
* Adds an argument to the tool.
*
* @param arg
* The argument to the tool
* @return The JDKToolLauncher instance
*/
public JDKToolLauncher addToolArg(String arg) {
toolArgs.add(arg);
return this;
}
/**
* Returns the command that can be used for running the tool.
*
* @return An array whose elements are the arguments of the command.
*/
public String[] getCommand() {
List<String> command = new ArrayList<String>();
command.add(executable);
// Add -J in front of all vmArgs
for (String arg : vmArgs) {
command.add("-J" + arg);
}
command.addAll(toolArgs);
return command.toArray(new String[command.size()]);
}
}

View File

@ -33,7 +33,7 @@ import java.util.stream.Collectors;
import jdk.internal.agent.Agent; import jdk.internal.agent.Agent;
import jdk.internal.agent.AgentConfigurationError; import jdk.internal.agent.AgentConfigurationError;
import jdk.testlibrary.JDKToolLauncher; import jdk.test.lib.JDKToolLauncher;
import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.ProcessTools;
/** /**

View File

@ -21,7 +21,7 @@
* questions. * questions.
*/ */
import jdk.testlibrary.JDKToolLauncher; import jdk.test.lib.JDKToolLauncher;
import jdk.test.lib.util.JarUtils; import jdk.test.lib.util.JarUtils;
import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.ProcessTools;

View File

@ -25,7 +25,7 @@ import java.util.Arrays;
import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.ProcessTools;
import jdk.testlibrary.JDKToolLauncher; import jdk.test.lib.JDKToolLauncher;
/** /**
* Helper class for starting jcmd process. * Helper class for starting jcmd process.

View File

@ -44,7 +44,7 @@ import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.ProcessTools;
import jdk.test.lib.apps.LingeredApp; import jdk.test.lib.apps.LingeredApp;
import jdk.test.lib.Platform; import jdk.test.lib.Platform;
import jdk.testlibrary.JDKToolLauncher; import jdk.test.lib.JDKToolLauncher;
import jdk.testlibrary.Utils; import jdk.testlibrary.Utils;
public class BasicLauncherTest { public class BasicLauncherTest {

View File

@ -39,12 +39,12 @@ import java.io.File;
import java.util.List; import java.util.List;
import java.util.Arrays; import java.util.Arrays;
import jdk.test.lib.Platform;
import jdk.test.lib.JDKToolLauncher;
import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.ProcessTools;
import jdk.test.lib.apps.LingeredApp; import jdk.test.lib.apps.LingeredApp;
import jdk.test.lib.Platform;
import jdk.test.lib.hprof.parser.HprofReader; import jdk.test.lib.hprof.parser.HprofReader;
import jdk.testlibrary.JDKToolLauncher;
public class HeapDumpTest { public class HeapDumpTest {

View File

@ -33,7 +33,7 @@ import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import jdk.test.lib.apps.LingeredApp; import jdk.test.lib.apps.LingeredApp;
import jdk.testlibrary.JDKToolLauncher; import jdk.test.lib.JDKToolLauncher;
import jdk.testlibrary.Utils; import jdk.testlibrary.Utils;
public class TmtoolTestScenario { public class TmtoolTestScenario {

View File

@ -23,16 +23,14 @@
import java.util.Arrays; import java.util.Arrays;
import jdk.test.lib.JDKToolLauncher;
import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.ProcessTools;
import jdk.testlibrary.JDKToolLauncher;
/* /*
* @test * @test
* @summary Unit test for jinfo utility * @summary Unit test for jinfo utility
* @library /lib/testlibrary
* @library /test/lib * @library /test/lib
* @build jdk.testlibrary.*
* @run main BasicJInfoTest * @run main BasicJInfoTest
*/ */
public class BasicJInfoTest { public class BasicJInfoTest {

View File

@ -27,10 +27,10 @@ import static jdk.testlibrary.Asserts.fail;
import java.io.File; import java.io.File;
import java.util.Arrays; import java.util.Arrays;
import jdk.test.lib.JDKToolLauncher;
import jdk.test.lib.hprof.HprofParser; import jdk.test.lib.hprof.HprofParser;
import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.ProcessTools;
import jdk.testlibrary.JDKToolLauncher;
/* /*
* @test * @test

View File

@ -35,10 +35,10 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import jdk.test.lib.JDKToolLauncher;
import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.ProcessTools;
import jdk.testlibrary.Asserts; import jdk.testlibrary.Asserts;
import jdk.testlibrary.JDKToolLauncher;
import jdk.testlibrary.Utils; import jdk.testlibrary.Utils;
/** /**

View File

@ -25,14 +25,12 @@ import java.util.Arrays;
import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.ProcessTools;
import jdk.testlibrary.JDKToolLauncher; import jdk.test.lib.JDKToolLauncher;
/* /*
* @test * @test
* @summary Unit test for jstack utility * @summary Unit test for jstack utility
* @library /lib/testlibrary
* @library /test/lib * @library /test/lib
* @build jdk.testlibrary.*
* @run main BasicJStackTest * @run main BasicJStackTest
*/ */
public class BasicJStackTest { public class BasicJStackTest {

View File

@ -32,7 +32,7 @@ import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.ProcessTools;
import jdk.testlibrary.Utils; import jdk.testlibrary.Utils;
import jdk.testlibrary.JDKToolLauncher; import jdk.test.lib.JDKToolLauncher;
/** /**
* @test * @test

View File

@ -24,18 +24,17 @@
/** /**
* @test * @test
* @bug 8035668 * @bug 8035668
* @library /lib/testlibrary
* @library /test/lib * @library /test/lib
* @summary Test checks case when target application finishes execution and jstat didn't complete work. * @summary Test checks case when target application finishes execution and jstat didn't complete work.
jstat is started with interval = 100 (jstat -compiler 100) and monitored application finishes jstat is started with interval = 100 (jstat -compiler 100) and monitored application finishes
after 500ms. This shouldn't cause crash or hang in target application or in jstat. after 500ms. This shouldn't cause crash or hang in target application or in jstat.
* @modules java.management * @modules java.management
* @build jdk.testlibrary.* JStatInterval * @build JStatInterval
* @run main JStatInterval * @run main JStatInterval
*/ */
import jdk.test.lib.JDKToolLauncher;
import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.ProcessTools;
import jdk.testlibrary.JDKToolLauncher;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;

View File

@ -22,7 +22,7 @@
# #
# @test # @test
# @bug 6959965 # @bug 6959965
# @run shell jstatClassloadOutput1.sh # @run shell jstatClassloadOutput1.sh
# @summary Test that output of 'jstat -classload 0' has expected line counts # @summary Test that output of 'jstat -classload 0' has expected line counts

View File

@ -30,8 +30,8 @@ import java.util.Arrays;
import jdk.test.lib.thread.ProcessThread; import jdk.test.lib.thread.ProcessThread;
import static jdk.testlibrary.Asserts.*; import static jdk.testlibrary.Asserts.*;
import jdk.testlibrary.JDKToolLauncher;
import jdk.testlibrary.Utils; import jdk.testlibrary.Utils;
import jdk.test.lib.JDKToolLauncher;
import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.ProcessTools;

View File

@ -21,17 +21,15 @@
* questions. * questions.
*/ */
import jdk.testlibrary.JDKToolLauncher; import jdk.test.lib.JDKToolLauncher;
import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.ProcessTools;
/* /*
* @test * @test
* @bug 4990825 * @bug 4990825
* @library /lib/testlibrary
* @library /test/lib * @library /test/lib
* @modules java.management * @modules java.management
* @build jdk.testlibrary.*
* @run main TestJstatdUsage * @run main TestJstatdUsage
*/ */
public class TestJstatdUsage { public class TestJstatdUsage {

View File

@ -36,7 +36,7 @@ import java.util.jar.JarOutputStream;
import java.util.stream.Stream; import java.util.stream.Stream;
import jdk.test.lib.util.FileUtils; import jdk.test.lib.util.FileUtils;
import jdk.testlibrary.JDKToolFinder; import jdk.test.lib.JDKToolFinder;
import org.testng.annotations.BeforeTest; import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@ -52,7 +52,7 @@ import static org.testng.Assert.assertTrue;
* @library /lib/testlibrary /test/lib * @library /lib/testlibrary /test/lib
* @build jdk.test.lib.Platform * @build jdk.test.lib.Platform
* jdk.test.lib.util.FileUtils * jdk.test.lib.util.FileUtils
* jdk.testlibrary.JDKToolFinder * jdk.test.lib.JDKToolFinder
* @run testng CLICompatibility * @run testng CLICompatibility
* @summary Basic test for compatibility of CLI options * @summary Basic test for compatibility of CLI options
*/ */

View File

@ -36,7 +36,7 @@ import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
import jdk.test.lib.util.FileUtils; import jdk.test.lib.util.FileUtils;
import jdk.testlibrary.JDKToolFinder; import jdk.test.lib.JDKToolFinder;
import org.testng.annotations.BeforeTest; import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider; import org.testng.annotations.DataProvider;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@ -47,12 +47,12 @@ import static java.lang.System.out;
/* /*
* @test * @test
* @bug 8167328 8171830 8165640 8174248 8176772 8196748 8191533 * @bug 8167328 8171830 8165640 8174248 8176772 8196748 8191533
* @library /lib/testlibrary /test/lib * @library /test/lib
* @modules jdk.compiler * @modules jdk.compiler
* jdk.jartool * jdk.jartool
* @build jdk.test.lib.Platform * @build jdk.test.lib.Platform
* jdk.test.lib.util.FileUtils * jdk.test.lib.util.FileUtils
* jdk.testlibrary.JDKToolFinder * jdk.test.lib.JDKToolFinder
* @compile Basic.java * @compile Basic.java
* @run testng Basic * @run testng Basic
* @summary Tests for plain Modular jars & Multi-Release Modular jars * @summary Tests for plain Modular jars & Multi-Release Modular jars

View File

@ -25,7 +25,7 @@
* @test * @test
* @bug 8157068 8177844 * @bug 8157068 8177844
* @summary Patch java.base and user module with ModuleHashes attribute * @summary Patch java.base and user module with ModuleHashes attribute
* @library /lib/testlibrary /test/lib * @library /test/lib
* @modules jdk.compiler * @modules jdk.compiler
* @build jdk.test.lib.compiler.CompilerUtils * @build jdk.test.lib.compiler.CompilerUtils
* jdk.test.lib.util.FileUtils * jdk.test.lib.util.FileUtils
@ -43,7 +43,7 @@ import java.util.stream.Stream;
import jdk.test.lib.compiler.CompilerUtils; import jdk.test.lib.compiler.CompilerUtils;
import jdk.test.lib.util.FileUtils; import jdk.test.lib.util.FileUtils;
import jdk.testlibrary.JDKToolFinder; import jdk.test.lib.JDKToolFinder;
import org.testng.annotations.BeforeTest; import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test; import org.testng.annotations.Test;