8067013: Rename the com.oracle.java.testlibary package
Reviewed-by: dholmes, gtriantafill, sla
Contributed-by: alexander.kulyakhtin@oracle.com
--- a/hotspot/test/compiler/arguments/BMICommandLineOptionTestBase.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/arguments/BMICommandLineOptionTestBase.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -21,7 +21,7 @@
* questions.
*/
-import com.oracle.java.testlibrary.cli.*;
+import jdk.test.lib.cli.*;
/**
* Base class for all X86 bit manipulation related command line options.
--- a/hotspot/test/compiler/arguments/BMISupportedCPUTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/arguments/BMISupportedCPUTest.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -21,8 +21,8 @@
* questions.
*/
-import com.oracle.java.testlibrary.*;
-import com.oracle.java.testlibrary.cli.*;
+import jdk.test.lib.*;
+import jdk.test.lib.cli.*;
/**
* Test on bit manipulation related command line options,
--- a/hotspot/test/compiler/arguments/BMIUnsupportedCPUTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/arguments/BMIUnsupportedCPUTest.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -21,8 +21,8 @@
* questions.
*/
-import com.oracle.java.testlibrary.*;
-import com.oracle.java.testlibrary.cli.*;
+import jdk.test.lib.*;
+import jdk.test.lib.cli.*;
/**
* Test on bit manipulation related command line options,
--- a/hotspot/test/compiler/arguments/CheckCompileThresholdScaling.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/arguments/CheckCompileThresholdScaling.java Mon May 04 16:30:07 2015 +0200
@@ -21,7 +21,7 @@
* questions.
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
/*
* @test CheckCompileThresholdScaling
--- a/hotspot/test/compiler/arguments/TestUseBMI1InstructionsOnSupportedCPU.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/arguments/TestUseBMI1InstructionsOnSupportedCPU.java Mon May 04 16:30:07 2015 +0200
@@ -38,7 +38,7 @@
*/
import sun.hotspot.cpuinfo.CPUInfo;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class TestUseBMI1InstructionsOnSupportedCPU
extends BMISupportedCPUTest {
--- a/hotspot/test/compiler/arguments/TestUseBMI1InstructionsOnUnsupportedCPU.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/arguments/TestUseBMI1InstructionsOnUnsupportedCPU.java Mon May 04 16:30:07 2015 +0200
@@ -38,8 +38,8 @@
*/
import sun.hotspot.cpuinfo.CPUInfo;
-import com.oracle.java.testlibrary.*;
-import com.oracle.java.testlibrary.cli.*;
+import jdk.test.lib.*;
+import jdk.test.lib.cli.*;
public class TestUseBMI1InstructionsOnUnsupportedCPU
extends BMIUnsupportedCPUTest {
--- a/hotspot/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnSupportedCPU.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnSupportedCPU.java Mon May 04 16:30:07 2015 +0200
@@ -39,7 +39,7 @@
*/
import sun.hotspot.cpuinfo.CPUInfo;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class TestUseCountLeadingZerosInstructionOnSupportedCPU
extends BMISupportedCPUTest {
--- a/hotspot/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnUnsupportedCPU.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/arguments/TestUseCountLeadingZerosInstructionOnUnsupportedCPU.java Mon May 04 16:30:07 2015 +0200
@@ -39,7 +39,7 @@
*/
import sun.hotspot.cpuinfo.CPUInfo;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class TestUseCountLeadingZerosInstructionOnUnsupportedCPU
extends BMIUnsupportedCPUTest {
--- a/hotspot/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnSupportedCPU.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnSupportedCPU.java Mon May 04 16:30:07 2015 +0200
@@ -39,8 +39,8 @@
*/
import sun.hotspot.cpuinfo.CPUInfo;
-import com.oracle.java.testlibrary.*;
-import com.oracle.java.testlibrary.cli.*;
+import jdk.test.lib.*;
+import jdk.test.lib.cli.*;
public class TestUseCountTrailingZerosInstructionOnSupportedCPU
extends BMISupportedCPUTest {
--- a/hotspot/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnUnsupportedCPU.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/arguments/TestUseCountTrailingZerosInstructionOnUnsupportedCPU.java Mon May 04 16:30:07 2015 +0200
@@ -39,8 +39,8 @@
*/
import sun.hotspot.cpuinfo.CPUInfo;
-import com.oracle.java.testlibrary.*;
-import com.oracle.java.testlibrary.cli.*;
+import jdk.test.lib.*;
+import jdk.test.lib.cli.*;
public class TestUseCountTrailingZerosInstructionOnUnsupportedCPU
extends BMIUnsupportedCPUTest {
--- a/hotspot/test/compiler/arraycopy/TestArrayCopyNoInitDeopt.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/arraycopy/TestArrayCopyNoInitDeopt.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* java.management
* @build TestArrayCopyNoInitDeopt
* @run main ClassFileInstaller sun.hotspot.WhiteBox
- * @run main ClassFileInstaller com.oracle.java.testlibrary.Platform
+ * @run main ClassFileInstaller jdk.test.lib.Platform
* @run main/othervm -Xmixed -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:TypeProfileLevel=020
* TestArrayCopyNoInitDeopt
@@ -40,7 +40,7 @@
import sun.hotspot.WhiteBox;
import sun.hotspot.code.NMethod;
-import com.oracle.java.testlibrary.Platform;
+import jdk.test.lib.Platform;
import java.lang.reflect.*;
public class TestArrayCopyNoInitDeopt {
--- a/hotspot/test/compiler/c2/6589834/Test_ia32.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/c2/6589834/Test_ia32.java Mon May 04 16:30:07 2015 +0200
@@ -31,7 +31,7 @@
* java.compiler
* java.management
* jdk.jvmstat/sun.jvmstat.monitor
- * @build ClassFileInstaller sun.hotspot.WhiteBox com.oracle.java.testlibrary.*
+ * @build ClassFileInstaller sun.hotspot.WhiteBox jdk.test.lib.*
* Test_ia32 InlinedArrayCloneTestCase
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
@@ -44,7 +44,7 @@
import java.lang.reflect.Method;
-import com.oracle.java.testlibrary.Asserts;
+import jdk.test.lib.Asserts;
import sun.hotspot.WhiteBox;
public class Test_ia32 {
--- a/hotspot/test/compiler/c2/6857159/Test6857159.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/c2/6857159/Test6857159.java Mon May 04 16:30:07 2015 +0200
@@ -31,7 +31,7 @@
* java.management
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class Test6857159 {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/compiler/c2/7068051/Test7068051.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/c2/7068051/Test7068051.java Mon May 04 16:30:07 2015 +0200
@@ -33,8 +33,8 @@
* @run main/othervm -showversion -Xbatch Test7068051
*/
-import com.oracle.java.testlibrary.JDKToolLauncher;
-import com.oracle.java.testlibrary.OutputAnalyzer;
+import jdk.test.lib.JDKToolLauncher;
+import jdk.test.lib.OutputAnalyzer;
import java.io.IOException;
import java.io.InputStream;
--- a/hotspot/test/compiler/c2/7177917/Test7177917.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/c2/7177917/Test7177917.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, 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
@@ -26,7 +26,7 @@
* Micro-benchmark for Math.pow() and Math.exp()
*/
-import com.oracle.java.testlibrary.Utils;
+import jdk.test.lib.Utils;
import java.util.Random;
public class Test7177917 {
--- a/hotspot/test/compiler/c2/8005956/PolynomialRoot.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/c2/8005956/PolynomialRoot.java Mon May 04 16:30:07 2015 +0200
@@ -19,7 +19,7 @@
* @run main/timeout=300 PolynomialRoot
*/
-import com.oracle.java.testlibrary.Utils;
+import jdk.test.lib.Utils;
import java.util.Arrays;
import java.util.Random;
--- a/hotspot/test/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java Mon May 04 16:30:07 2015 +0200
@@ -31,7 +31,7 @@
* @modules java.base/sun.misc
* java.management
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class CheckReservedInitialCodeCacheSizeArgOrder {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/compiler/codecache/CheckSegmentedCodeCache.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codecache/CheckSegmentedCodeCache.java Mon May 04 16:30:07 2015 +0200
@@ -21,7 +21,7 @@
* questions.
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.hotspot.WhiteBox;
/*
--- a/hotspot/test/compiler/codecache/CheckUpperLimit.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codecache/CheckUpperLimit.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* @modules java.base/sun.misc
* java.management
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class CheckUpperLimit {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/compiler/codecache/OverflowCodeCacheTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codecache/OverflowCodeCacheTest.java Mon May 04 16:30:07 2015 +0200
@@ -29,7 +29,7 @@
import sun.hotspot.WhiteBox;
import sun.hotspot.code.BlobType;
import sun.hotspot.code.CodeBlob;
-import com.oracle.java.testlibrary.Asserts;
+import jdk.test.lib.Asserts;
/*
* @test OverflowCodeCacheTest
--- a/hotspot/test/compiler/codecache/cli/TestSegmentedCodeCacheOption.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codecache/cli/TestSegmentedCodeCacheOption.java Mon May 04 16:30:07 2015 +0200
@@ -20,9 +20,9 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
-import com.oracle.java.testlibrary.ExitCode;
-import com.oracle.java.testlibrary.Platform;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+import jdk.test.lib.ExitCode;
+import jdk.test.lib.Platform;
+import jdk.test.lib.cli.CommandLineOptionTest;
import common.CodeCacheOptions;
import sun.hotspot.code.BlobType;
@@ -35,7 +35,7 @@
* java.compiler
* java.management
* jdk.jvmstat/sun.jvmstat.monitor
- * @build TestSegmentedCodeCacheOption com.oracle.java.testlibrary.*
+ * @build TestSegmentedCodeCacheOption jdk.test.lib.*
* @run main TestSegmentedCodeCacheOption
*/
public class TestSegmentedCodeCacheOption {
--- a/hotspot/test/compiler/codecache/cli/codeheapsize/CodeCacheFreeSpaceRunner.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codecache/cli/codeheapsize/CodeCacheFreeSpaceRunner.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -22,9 +22,9 @@
*/
package codeheapsize;
-import com.oracle.java.testlibrary.ExitCode;
-import com.oracle.java.testlibrary.Platform;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+import jdk.test.lib.ExitCode;
+import jdk.test.lib.Platform;
+import jdk.test.lib.cli.CommandLineOptionTest;
import common.CodeCacheCLITestCase;
import common.CodeCacheOptions;
import sun.hotspot.code.BlobType;
--- a/hotspot/test/compiler/codecache/cli/codeheapsize/GenericCodeHeapSizeRunner.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codecache/cli/codeheapsize/GenericCodeHeapSizeRunner.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -22,7 +22,7 @@
*/
package codeheapsize;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.CommandLineOptionTest;
import common.CodeCacheCLITestCase;
import common.CodeCacheOptions;
import sun.hotspot.code.BlobType;
--- a/hotspot/test/compiler/codecache/cli/codeheapsize/JVMStartupRunner.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codecache/cli/codeheapsize/JVMStartupRunner.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -24,9 +24,9 @@
import common.CodeCacheCLITestCase;
import common.CodeCacheOptions;
-import com.oracle.java.testlibrary.ExitCode;
-import com.oracle.java.testlibrary.Utils;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+import jdk.test.lib.ExitCode;
+import jdk.test.lib.Utils;
+import jdk.test.lib.cli.CommandLineOptionTest;
import sun.hotspot.code.BlobType;
import java.util.Random;
--- a/hotspot/test/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java Mon May 04 16:30:07 2015 +0200
@@ -22,7 +22,7 @@
*/
package codeheapsize;
-import com.oracle.java.testlibrary.Platform;
+import jdk.test.lib.Platform;
import common.CodeCacheCLITestBase;
import common.CodeCacheCLITestCase;
import sun.hotspot.code.BlobType;
@@ -36,7 +36,7 @@
* java.compiler
* java.management
* jdk.jvmstat/sun.jvmstat.monitor
- * @build TestCodeHeapSizeOptions com.oracle.java.testlibrary.* codeheapsize.*
+ * @build TestCodeHeapSizeOptions jdk.test.lib.* codeheapsize.*
* common.*
* @run main/timeout=240 codeheapsize.TestCodeHeapSizeOptions
*/
--- a/hotspot/test/compiler/codecache/cli/common/CodeCacheCLITestCase.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codecache/cli/common/CodeCacheCLITestCase.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -22,8 +22,8 @@
*/
package common;
-import com.oracle.java.testlibrary.Platform;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+import jdk.test.lib.Platform;
+import jdk.test.lib.cli.CommandLineOptionTest;
import sun.hotspot.code.BlobType;
import java.util.Collections;
--- a/hotspot/test/compiler/codecache/cli/common/CodeCacheOptions.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codecache/cli/common/CodeCacheOptions.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -22,7 +22,7 @@
*/
package common;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.CommandLineOptionTest;
import sun.hotspot.code.BlobType;
import java.util.ArrayList;
--- a/hotspot/test/compiler/codecache/cli/printcodecache/PrintCodeCacheRunner.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codecache/cli/printcodecache/PrintCodeCacheRunner.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -22,8 +22,8 @@
*/
package printcodecache;
-import com.oracle.java.testlibrary.ExitCode;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+import jdk.test.lib.ExitCode;
+import jdk.test.lib.cli.CommandLineOptionTest;
import common.CodeCacheCLITestCase;
import common.CodeCacheInfoFormatter;
import common.CodeCacheOptions;
--- a/hotspot/test/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java Mon May 04 16:30:07 2015 +0200
@@ -35,7 +35,7 @@
* java.compiler
* java.management
* jdk.jvmstat/sun.jvmstat.monitor
- * @build TestPrintCodeCacheOption com.oracle.java.testlibrary.*
+ * @build TestPrintCodeCacheOption jdk.test.lib.*
* printcodecache.* common.*
* @run main/timeout=240 printcodecache.TestPrintCodeCacheOption
*/
--- a/hotspot/test/compiler/codecache/dtrace/SegmentedCodeCacheDtraceTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codecache/dtrace/SegmentedCodeCacheDtraceTest.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -21,12 +21,12 @@
* questions.
*/
-import com.oracle.java.testlibrary.Asserts;
-import com.oracle.java.testlibrary.JDKToolFinder;
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.Utils;
-import com.oracle.java.testlibrary.dtrace.DtraceResultsAnalyzer;
-import com.oracle.java.testlibrary.dtrace.DtraceRunner;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.JDKToolFinder;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.Utils;
+import jdk.test.lib.dtrace.DtraceResultsAnalyzer;
+import jdk.test.lib.dtrace.DtraceRunner;
import java.io.IOException;
import java.lang.reflect.Executable;
import java.nio.file.Files;
@@ -115,7 +115,7 @@
public static void main(String args[]) {
int iterations
- = Integer.getInteger("com.oracle.java.testlibrary.iterations", 1);
+ = Integer.getInteger("jdk.test.lib.iterations", 1);
if (!DtraceRunner.dtraceAvailable()) {
System.out.println("INFO: There is no dtrace avaiable. Skipping.");
return;
--- a/hotspot/test/compiler/codecache/dtrace/SegmentedCodeCacheDtraceTestWorker.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codecache/dtrace/SegmentedCodeCacheDtraceTestWorker.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -21,7 +21,7 @@
* questions.
*/
-import com.oracle.java.testlibrary.Utils;
+import jdk.test.lib.Utils;
import java.lang.reflect.Executable;
import java.util.ArrayList;
import java.util.Arrays;
--- a/hotspot/test/compiler/codecache/jmx/BeanTypeTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codecache/jmx/BeanTypeTest.java Mon May 04 16:30:07 2015 +0200
@@ -21,7 +21,7 @@
* questions.
*/
-import com.oracle.java.testlibrary.Asserts;
+import jdk.test.lib.Asserts;
import java.lang.management.MemoryType;
import sun.hotspot.code.BlobType;
--- a/hotspot/test/compiler/codecache/jmx/CodeCacheUtils.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codecache/jmx/CodeCacheUtils.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -21,7 +21,7 @@
* questions.
*/
-import com.oracle.java.testlibrary.Utils;
+import jdk.test.lib.Utils;
import java.lang.management.MemoryPoolMXBean;
import javax.management.Notification;
import sun.hotspot.WhiteBox;
--- a/hotspot/test/compiler/codecache/jmx/CodeHeapBeanPresenceTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codecache/jmx/CodeHeapBeanPresenceTest.java Mon May 04 16:30:07 2015 +0200
@@ -21,7 +21,7 @@
* questions.
*/
-import com.oracle.java.testlibrary.Asserts;
+import jdk.test.lib.Asserts;
import java.util.EnumSet;
import sun.hotspot.code.BlobType;
--- a/hotspot/test/compiler/codecache/jmx/GetUsageTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codecache/jmx/GetUsageTest.java Mon May 04 16:30:07 2015 +0200
@@ -21,7 +21,7 @@
* questions.
*/
-import com.oracle.java.testlibrary.Asserts;
+import jdk.test.lib.Asserts;
import java.lang.management.MemoryPoolMXBean;
import java.util.HashMap;
import java.util.Map;
--- a/hotspot/test/compiler/codecache/jmx/InitialAndMaxUsageTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codecache/jmx/InitialAndMaxUsageTest.java Mon May 04 16:30:07 2015 +0200
@@ -21,7 +21,7 @@
* questions.
*/
-import com.oracle.java.testlibrary.Asserts;
+import jdk.test.lib.Asserts;
import java.lang.management.MemoryPoolMXBean;
import java.util.ArrayList;
import java.util.List;
--- a/hotspot/test/compiler/codecache/jmx/ManagerNamesTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codecache/jmx/ManagerNamesTest.java Mon May 04 16:30:07 2015 +0200
@@ -21,7 +21,7 @@
* questions.
*/
-import com.oracle.java.testlibrary.Asserts;
+import jdk.test.lib.Asserts;
import java.lang.management.MemoryPoolMXBean;
import sun.hotspot.code.BlobType;
--- a/hotspot/test/compiler/codecache/jmx/MemoryPoolsPresenceTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codecache/jmx/MemoryPoolsPresenceTest.java Mon May 04 16:30:07 2015 +0200
@@ -21,7 +21,7 @@
* questions.
*/
-import com.oracle.java.testlibrary.Asserts;
+import jdk.test.lib.Asserts;
import java.lang.management.ManagementFactory;
import java.lang.management.MemoryManagerMXBean;
import java.util.HashMap;
--- a/hotspot/test/compiler/codecache/jmx/PeakUsageTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codecache/jmx/PeakUsageTest.java Mon May 04 16:30:07 2015 +0200
@@ -21,7 +21,7 @@
* questions.
*/
-import com.oracle.java.testlibrary.Asserts;
+import jdk.test.lib.Asserts;
import java.lang.management.MemoryPoolMXBean;
import sun.hotspot.code.BlobType;
--- a/hotspot/test/compiler/codecache/jmx/PoolsIndependenceTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codecache/jmx/PoolsIndependenceTest.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -21,8 +21,8 @@
* questions.
*/
-import com.oracle.java.testlibrary.Asserts;
-import com.oracle.java.testlibrary.Utils;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.Utils;
import java.lang.management.ManagementFactory;
import java.lang.management.MemoryNotificationInfo;
import java.lang.management.MemoryPoolMXBean;
--- a/hotspot/test/compiler/codecache/jmx/ThresholdNotificationsTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codecache/jmx/ThresholdNotificationsTest.java Mon May 04 16:30:07 2015 +0200
@@ -21,8 +21,8 @@
* questions.
*/
-import com.oracle.java.testlibrary.Asserts;
-import com.oracle.java.testlibrary.Utils;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.Utils;
import java.lang.management.ManagementFactory;
import java.lang.management.MemoryNotificationInfo;
import java.lang.management.MemoryPoolMXBean;
@@ -83,7 +83,7 @@
protected void runTest() {
int iterationsCount =
- Integer.getInteger("com.oracle.java.testlibrary.iterations", 1);
+ Integer.getInteger("jdk.test.lib.iterations", 1);
MemoryPoolMXBean bean = btype.getMemoryPool();
((NotificationEmitter) ManagementFactory.getMemoryMXBean()).
addNotificationListener(this, null, null);
--- a/hotspot/test/compiler/codecache/jmx/UsageThresholdExceededSeveralTimesTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codecache/jmx/UsageThresholdExceededSeveralTimesTest.java Mon May 04 16:30:07 2015 +0200
@@ -32,7 +32,7 @@
* @run main/othervm -Xbootclasspath/a:. -XX:-UseCodeCacheFlushing
* -XX:-MethodFlushing -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:+SegmentedCodeCache -XX:CompileCommand=compileonly,null::*
- * -Dcom.oracle.java.testlibrary.iterations=10 UsageThresholdExceededTest
+ * -Djdk.test.lib.iterations=10 UsageThresholdExceededTest
* @summary verifying that getUsageThresholdCount() returns correct value
* after threshold has been hit several times
*/
--- a/hotspot/test/compiler/codecache/jmx/UsageThresholdExceededTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codecache/jmx/UsageThresholdExceededTest.java Mon May 04 16:30:07 2015 +0200
@@ -21,7 +21,7 @@
* questions.
*/
-import com.oracle.java.testlibrary.Asserts;
+import jdk.test.lib.Asserts;
import java.lang.management.MemoryPoolMXBean;
import sun.hotspot.code.BlobType;
@@ -52,7 +52,7 @@
public static void main(String[] args) {
int iterationsCount =
- Integer.getInteger("com.oracle.java.testlibrary.iterations", 1);
+ Integer.getInteger("jdk.test.lib.iterations", 1);
for (BlobType btype : BlobType.getAvailable()) {
if (CodeCacheUtils.isCodeHeapPredictable(btype)) {
new UsageThresholdExceededTest(btype, iterationsCount)
--- a/hotspot/test/compiler/codecache/jmx/UsageThresholdIncreasedTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codecache/jmx/UsageThresholdIncreasedTest.java Mon May 04 16:30:07 2015 +0200
@@ -21,7 +21,7 @@
* questions.
*/
-import com.oracle.java.testlibrary.Asserts;
+import jdk.test.lib.Asserts;
import java.lang.management.MemoryPoolMXBean;
import sun.hotspot.code.BlobType;
--- a/hotspot/test/compiler/codecache/jmx/UsageThresholdNotExceededTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codecache/jmx/UsageThresholdNotExceededTest.java Mon May 04 16:30:07 2015 +0200
@@ -21,7 +21,7 @@
* questions.
*/
-import com.oracle.java.testlibrary.Asserts;
+import jdk.test.lib.Asserts;
import java.lang.management.MemoryPoolMXBean;
import sun.hotspot.code.BlobType;
--- a/hotspot/test/compiler/codecache/stress/CodeCacheStressRunner.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codecache/stress/CodeCacheStressRunner.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -22,8 +22,8 @@
*
*/
-import com.oracle.java.testlibrary.TimeLimitedRunner;
-import com.oracle.java.testlibrary.Utils;
+import jdk.test.lib.TimeLimitedRunner;
+import jdk.test.lib.Utils;
public class CodeCacheStressRunner {
private final Runnable action;
--- a/hotspot/test/compiler/codecache/stress/Helper.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codecache/stress/Helper.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -28,10 +28,10 @@
import java.util.concurrent.Callable;
import java.util.Random;
-import com.oracle.java.testlibrary.Asserts;
-import com.oracle.java.testlibrary.ByteCodeLoader;
-import com.oracle.java.testlibrary.InfiniteLoop;
-import com.oracle.java.testlibrary.Utils;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.ByteCodeLoader;
+import jdk.test.lib.InfiniteLoop;
+import jdk.test.lib.Utils;
import sun.hotspot.WhiteBox;
public final class Helper {
--- a/hotspot/test/compiler/codecache/stress/OverloadCompileQueueTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codecache/stress/OverloadCompileQueueTest.java Mon May 04 16:30:07 2015 +0200
@@ -25,7 +25,7 @@
import java.lang.reflect.Method;
import java.util.stream.IntStream;
-import com.oracle.java.testlibrary.Platform;
+import jdk.test.lib.Platform;
/*
* @test OverloadCompileQueueTest
--- a/hotspot/test/compiler/codegen/6896617/Test6896617.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codegen/6896617/Test6896617.java Mon May 04 16:30:07 2015 +0200
@@ -33,7 +33,7 @@
*
*/
-import com.oracle.java.testlibrary.Utils;
+import jdk.test.lib.Utils;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.Charset;
--- a/hotspot/test/compiler/codegen/7100757/Test7100757.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codegen/7100757/Test7100757.java Mon May 04 16:30:07 2015 +0200
@@ -32,7 +32,7 @@
* @run main/timeout=300 Test7100757
*/
-import com.oracle.java.testlibrary.Utils;
+import jdk.test.lib.Utils;
import java.util.BitSet;
import java.util.Random;
--- a/hotspot/test/compiler/codegen/7184394/TestAESBase.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/codegen/7184394/TestAESBase.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, 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
@@ -26,7 +26,7 @@
* @author Tom Deneau
*/
-import com.oracle.java.testlibrary.Utils;
+import jdk.test.lib.Utils;
import java.security.AlgorithmParameters;
import java.util.Random;
import javax.crypto.Cipher;
--- a/hotspot/test/compiler/cpuflags/RestoreMXCSR.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/cpuflags/RestoreMXCSR.java Mon May 04 16:30:07 2015 +0200
@@ -29,7 +29,7 @@
* @modules java.base/sun.misc
* java.management
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class RestoreMXCSR {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/compiler/debug/VerifyAdapterSharing.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/debug/VerifyAdapterSharing.java Mon May 04 16:30:07 2015 +0200
@@ -29,7 +29,7 @@
* @modules java.base/sun.misc
* java.management
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class VerifyAdapterSharing {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/compiler/dependencies/MonomorphicObjectCall/TestMonomorphicObjectCall.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/dependencies/MonomorphicObjectCall/TestMonomorphicObjectCall.java Mon May 04 16:30:07 2015 +0200
@@ -25,7 +25,7 @@
import java.util.ArrayList;
import java.util.Collections;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
/*
* @test
--- a/hotspot/test/compiler/eliminateAutobox/UnsignedLoads.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/eliminateAutobox/UnsignedLoads.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -30,7 +30,7 @@
* -XX:CompileOnly=::valueOf,::byteValue,::shortValue,::testUnsignedByte,::testUnsignedShort
* UnsignedLoads
*/
-import static com.oracle.java.testlibrary.Asserts.assertEQ;
+import static jdk.test.lib.Asserts.assertEQ;
public class UnsignedLoads {
public static int testUnsignedByte() {
--- a/hotspot/test/compiler/intrinsics/bmi/BMITestRunner.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/intrinsics/bmi/BMITestRunner.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -22,10 +22,10 @@
*
*/
-import com.oracle.java.testlibrary.Asserts;
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.ProcessTools;
-import com.oracle.java.testlibrary.Utils;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
+import jdk.test.lib.Utils;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
--- a/hotspot/test/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -22,9 +22,9 @@
*
*/
-import com.oracle.java.testlibrary.Asserts;
-import com.oracle.java.testlibrary.Platform;
-import com.oracle.java.testlibrary.Utils;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.Platform;
+import jdk.test.lib.Utils;
import sun.hotspot.code.NMethod;
import sun.hotspot.cpuinfo.CPUInfo;
--- a/hotspot/test/compiler/intrinsics/classcast/NullCheckDroppingsTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/intrinsics/classcast/NullCheckDroppingsTest.java Mon May 04 16:30:07 2015 +0200
@@ -25,13 +25,14 @@
* @test NullCheckDroppingsTest
* @bug 8054492
* @summary "Casting can result in redundant null checks in generated code"
- * @library /testlibrary /../../test/lib /testlibrary/com/oracle/java/testlibrary
+ * @library /testlibrary /../../test/lib
* @modules java.base/sun.misc
* java.management
+ * @build ClassFileInstaller sun.hotspot.WhiteBox jdk.test.lib.*
* @build NullCheckDroppingsTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main ClassFileInstaller com.oracle.java.testlibrary.Platform
+ * @run main ClassFileInstaller jdk.test.lib.Platform
* @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -Xmixed -XX:-BackgroundCompilation -XX:-TieredCompilation -XX:CompileThreshold=1000
* -XX:CompileCommand=exclude,NullCheckDroppingsTest::runTest NullCheckDroppingsTest
@@ -39,7 +40,7 @@
import sun.hotspot.WhiteBox;
import sun.hotspot.code.NMethod;
-import com.oracle.java.testlibrary.Platform;
+import jdk.test.lib.Platform;
import java.lang.reflect.Method;
import java.lang.invoke.MethodHandle;
--- a/hotspot/test/compiler/intrinsics/clone/TestObjectClone.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/intrinsics/clone/TestObjectClone.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -29,7 +29,7 @@
* @library /testlibrary
* @run main/othervm -XX:-TieredCompilation -Xbatch -XX:CompileOnly=TestObjectClone::f TestObjectClone
*/
-import com.oracle.java.testlibrary.Asserts;
+import jdk.test.lib.Asserts;
public class TestObjectClone implements Cloneable {
static class A extends TestObjectClone {}
--- a/hotspot/test/compiler/intrinsics/mathexact/AddExactIRepeatTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/intrinsics/mathexact/AddExactIRepeatTest.java Mon May 04 16:30:07 2015 +0200
@@ -33,7 +33,7 @@
*
*/
-import com.oracle.java.testlibrary.Utils;
+import jdk.test.lib.Utils;
import java.util.Random;
public class AddExactIRepeatTest {
--- a/hotspot/test/compiler/intrinsics/mathexact/MulExactIRepeatTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/intrinsics/mathexact/MulExactIRepeatTest.java Mon May 04 16:30:07 2015 +0200
@@ -33,7 +33,7 @@
*
*/
-import com.oracle.java.testlibrary.Utils;
+import jdk.test.lib.Utils;
import java.util.Random;
public class MulExactIRepeatTest {
--- a/hotspot/test/compiler/intrinsics/mathexact/SubExactIRepeatTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/intrinsics/mathexact/SubExactIRepeatTest.java Mon May 04 16:30:07 2015 +0200
@@ -33,7 +33,7 @@
*
*/
-import com.oracle.java.testlibrary.Utils;
+import jdk.test.lib.Utils;
import java.util.Random;
public class SubExactIRepeatTest {
--- a/hotspot/test/compiler/intrinsics/mathexact/Verify.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/intrinsics/mathexact/Verify.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, 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
@@ -21,7 +21,7 @@
* questions.
*/
-import com.oracle.java.testlibrary.Utils;
+import jdk.test.lib.Utils;
import java.util.Random;
/**
--- a/hotspot/test/compiler/intrinsics/mathexact/sanity/IntrinsicBase.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/IntrinsicBase.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, 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
@@ -21,7 +21,7 @@
* questions.
*/
-import com.oracle.java.testlibrary.Platform;
+import jdk.test.lib.Platform;
import intrinsics.Verifier;
import java.io.FileOutputStream;
--- a/hotspot/test/compiler/intrinsics/sha/cli/SHAOptionsBase.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/intrinsics/sha/cli/SHAOptionsBase.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -21,8 +21,8 @@
* questions.
*/
-import com.oracle.java.testlibrary.Platform;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+import jdk.test.lib.Platform;
+import jdk.test.lib.cli.CommandLineOptionTest;
import sha.predicate.IntrinsicPredicates;
import java.util.function.BooleanSupplier;
--- a/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -21,11 +21,11 @@
* questions.
*/
-import com.oracle.java.testlibrary.ExitCode;
-import com.oracle.java.testlibrary.Platform;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
-import com.oracle.java.testlibrary.cli.predicate.NotPredicate;
-import com.oracle.java.testlibrary.cli.predicate.OrPredicate;
+import jdk.test.lib.ExitCode;
+import jdk.test.lib.Platform;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.NotPredicate;
+import jdk.test.lib.cli.predicate.OrPredicate;
/**
* Generic test case for SHA-related options targeted to non-x86 and
--- a/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForSupportedSparcCPU.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForSupportedSparcCPU.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -21,10 +21,10 @@
* questions.
*/
-import com.oracle.java.testlibrary.ExitCode;
-import com.oracle.java.testlibrary.Platform;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import jdk.test.lib.ExitCode;
+import jdk.test.lib.Platform;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
/**
* Generic test case for SHA-related options targeted to SPARC CPUs which
--- a/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedSparcCPU.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedSparcCPU.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -21,11 +21,11 @@
* questions.
*/
-import com.oracle.java.testlibrary.ExitCode;
-import com.oracle.java.testlibrary.Platform;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
-import com.oracle.java.testlibrary.cli.predicate.NotPredicate;
+import jdk.test.lib.ExitCode;
+import jdk.test.lib.Platform;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
+import jdk.test.lib.cli.predicate.NotPredicate;
/**
* Generic test case for SHA-related options targeted to SPARC CPUs which don't
--- a/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedX86CPU.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForUnsupportedX86CPU.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -21,10 +21,10 @@
* questions.
*/
-import com.oracle.java.testlibrary.ExitCode;
-import com.oracle.java.testlibrary.Platform;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
-import com.oracle.java.testlibrary.cli.predicate.OrPredicate;
+import jdk.test.lib.ExitCode;
+import jdk.test.lib.Platform;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.OrPredicate;
/**
* Generic test case for SHA-related options targeted to X86 CPUs that don't
--- a/hotspot/test/compiler/intrinsics/sha/cli/testcases/UseSHAIntrinsicsSpecificTestCaseForUnsupportedSparcCPU.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/intrinsics/sha/cli/testcases/UseSHAIntrinsicsSpecificTestCaseForUnsupportedSparcCPU.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -21,11 +21,11 @@
* questions.
*/
-import com.oracle.java.testlibrary.ExitCode;
-import com.oracle.java.testlibrary.Platform;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
-import com.oracle.java.testlibrary.cli.predicate.NotPredicate;
+import jdk.test.lib.ExitCode;
+import jdk.test.lib.Platform;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
+import jdk.test.lib.cli.predicate.NotPredicate;
import sha.predicate.IntrinsicPredicates;
/**
--- a/hotspot/test/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForSupportedSparcCPU.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForSupportedSparcCPU.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -21,11 +21,11 @@
* questions.
*/
-import com.oracle.java.testlibrary.Asserts;
-import com.oracle.java.testlibrary.ExitCode;
-import com.oracle.java.testlibrary.Platform;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.ExitCode;
+import jdk.test.lib.Platform;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
import sha.predicate.IntrinsicPredicates;
/**
--- a/hotspot/test/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForUnsupportedSparcCPU.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForUnsupportedSparcCPU.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -21,12 +21,12 @@
* questions.
*/
-import com.oracle.java.testlibrary.Asserts;
-import com.oracle.java.testlibrary.ExitCode;
-import com.oracle.java.testlibrary.Platform;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
-import com.oracle.java.testlibrary.cli.predicate.NotPredicate;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.ExitCode;
+import jdk.test.lib.Platform;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
+import jdk.test.lib.cli.predicate.NotPredicate;
import sha.predicate.IntrinsicPredicates;
/**
--- a/hotspot/test/compiler/intrinsics/unsafe/HeapByteBufferTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/intrinsics/unsafe/HeapByteBufferTest.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
//
-// Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
// Copyright (c) 2015, Red Hat Inc. All rights reserved.
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
//
@@ -23,7 +23,7 @@
//
//
-import com.oracle.java.testlibrary.Utils;
+import jdk.test.lib.Utils;
import static java.lang.Math.abs;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
--- a/hotspot/test/compiler/jsr292/ConcurrentClassLoadingTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/jsr292/ConcurrentClassLoadingTest.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* java.management
* @run main/othervm ConcurrentClassLoadingTest
*/
-import com.oracle.java.testlibrary.Utils;
+import jdk.test.lib.Utils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
--- a/hotspot/test/compiler/jsr292/MHInlineTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/jsr292/MHInlineTest.java Mon May 04 16:30:07 2015 +0200
@@ -29,8 +29,8 @@
* @run main/othervm MHInlineTest
*/
import java.lang.invoke.*;
-import com.oracle.java.testlibrary.*;
-import static com.oracle.java.testlibrary.Asserts.*;
+import jdk.test.lib.*;
+import static jdk.test.lib.Asserts.*;
public class MHInlineTest {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/compiler/oracle/CheckCompileCommandOption.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/oracle/CheckCompileCommandOption.java Mon May 04 16:30:07 2015 +0200
@@ -24,7 +24,7 @@
import java.io.PrintWriter;
import java.io.File;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
/*
* @test CheckCompileCommandOption
--- a/hotspot/test/compiler/oracle/GetMethodOptionTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/oracle/GetMethodOptionTest.java Mon May 04 16:30:07 2015 +0200
@@ -24,14 +24,14 @@
import java.lang.reflect.Executable;
import java.util.function.BiFunction;
-import com.oracle.java.testlibrary.Asserts;
+import jdk.test.lib.Asserts;
import sun.hotspot.WhiteBox;
/*
* @test
* @bug 8074980
* @library /testlibrary /../../test/lib
- * @build sun.hotspot.WhiteBox com.oracle.java.testlibrary.Asserts GetMethodOptionTest
+ * @build sun.hotspot.WhiteBox jdk.test.lib.Asserts GetMethodOptionTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
--- a/hotspot/test/compiler/oracle/TestCompileCommand.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/oracle/TestCompileCommand.java Mon May 04 16:30:07 2015 +0200
@@ -24,7 +24,7 @@
import java.io.PrintWriter;
import java.io.File;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
/*
* @test TestCompileCommand
--- a/hotspot/test/compiler/profiling/spectrapredefineclass/Launcher.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/profiling/spectrapredefineclass/Launcher.java Mon May 04 16:30:07 2015 +0200
@@ -21,7 +21,7 @@
* questions.
*/
import java.io.PrintWriter;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
/*
* @test
--- a/hotspot/test/compiler/profiling/spectrapredefineclass_classloaders/Launcher.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/profiling/spectrapredefineclass_classloaders/Launcher.java Mon May 04 16:30:07 2015 +0200
@@ -21,7 +21,7 @@
* questions.
*/
import java.io.PrintWriter;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
/*
* @test
--- a/hotspot/test/compiler/rangechecks/TestExplicitRangeChecks.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rangechecks/TestExplicitRangeChecks.java Mon May 04 16:30:07 2015 +0200
@@ -28,7 +28,7 @@
* @library /testlibrary /../../test/lib /compiler/whitebox
* @build TestExplicitRangeChecks
* @run main ClassFileInstaller sun.hotspot.WhiteBox
- * @run main ClassFileInstaller com.oracle.java.testlibrary.Platform
+ * @run main ClassFileInstaller jdk.test.lib.Platform
* @run main/othervm -ea -Xmixed -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:CompileCommand=compileonly,TestExplicitRangeChecks.test* TestExplicitRangeChecks
*
@@ -39,7 +39,7 @@
import java.util.*;
import sun.hotspot.WhiteBox;
import sun.hotspot.code.NMethod;
-import com.oracle.java.testlibrary.Platform;
+import jdk.test.lib.Platform;
import sun.misc.Unsafe;
public class TestExplicitRangeChecks {
--- a/hotspot/test/compiler/rangechecks/TestRangeCheckSmearing.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rangechecks/TestRangeCheckSmearing.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* java.management
* @build TestRangeCheckSmearing
* @run main ClassFileInstaller sun.hotspot.WhiteBox
- * @run main ClassFileInstaller com.oracle.java.testlibrary.Platform
+ * @run main ClassFileInstaller jdk.test.lib.Platform
* @run main/othervm -ea -Xmixed -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestRangeCheckSmearing
*
@@ -41,7 +41,7 @@
import java.util.*;
import sun.hotspot.WhiteBox;
import sun.hotspot.code.NMethod;
-import com.oracle.java.testlibrary.Platform;
+import jdk.test.lib.Platform;
public class TestRangeCheckSmearing {
private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
--- a/hotspot/test/compiler/rtm/cli/RTMGenericCommandLineOptionTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/cli/RTMGenericCommandLineOptionTest.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -22,8 +22,8 @@
*
*/
-import com.oracle.java.testlibrary.*;
-import com.oracle.java.testlibrary.cli.*;
+import jdk.test.lib.*;
+import jdk.test.lib.cli.*;
import java.util.function.BooleanSupplier;
--- a/hotspot/test/compiler/rtm/cli/RTMLockingAwareTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/cli/RTMLockingAwareTest.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -25,9 +25,9 @@
import java.util.List;
import java.util.LinkedList;
-import com.oracle.java.testlibrary.ExitCode;
-import com.oracle.java.testlibrary.cli.*;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import jdk.test.lib.ExitCode;
+import jdk.test.lib.cli.*;
+import jdk.test.lib.cli.predicate.AndPredicate;
import rtm.predicate.SupportedCPU;
import rtm.predicate.SupportedVM;
--- a/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsBase.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsBase.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -22,8 +22,8 @@
*
*/
-import com.oracle.java.testlibrary.*;
-import com.oracle.java.testlibrary.cli.*;
+import jdk.test.lib.*;
+import jdk.test.lib.cli.*;
import java.util.function.BooleanSupplier;
--- a/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig.java Mon May 04 16:30:07 2015 +0200
@@ -38,8 +38,8 @@
* TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig
*/
-import com.oracle.java.testlibrary.cli.*;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import jdk.test.lib.cli.*;
+import jdk.test.lib.cli.predicate.AndPredicate;
import rtm.predicate.SupportedCPU;
import rtm.predicate.SupportedVM;
--- a/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java Mon May 04 16:30:07 2015 +0200
@@ -38,8 +38,8 @@
* TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig
*/
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
-import com.oracle.java.testlibrary.cli.predicate.NotPredicate;
+import jdk.test.lib.cli.predicate.AndPredicate;
+import jdk.test.lib.cli.predicate.NotPredicate;
import rtm.predicate.SupportedCPU;
import rtm.predicate.SupportedVM;
--- a/hotspot/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java Mon May 04 16:30:07 2015 +0200
@@ -37,8 +37,8 @@
* -XX:+WhiteBoxAPI TestRTMAbortRatioOptionOnUnsupportedConfig
*/
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
-import com.oracle.java.testlibrary.cli.predicate.NotPredicate;
+import jdk.test.lib.cli.predicate.AndPredicate;
+import jdk.test.lib.cli.predicate.NotPredicate;
import rtm.predicate.SupportedCPU;
import rtm.predicate.SupportedVM;
--- a/hotspot/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java Mon May 04 16:30:07 2015 +0200
@@ -22,8 +22,8 @@
*
*/
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
-import com.oracle.java.testlibrary.cli.predicate.NotPredicate;
+import jdk.test.lib.cli.predicate.AndPredicate;
+import jdk.test.lib.cli.predicate.NotPredicate;
import rtm.predicate.SupportedCPU;
import rtm.predicate.SupportedVM;
--- a/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnSupportedConfig.java Mon May 04 16:30:07 2015 +0200
@@ -37,9 +37,9 @@
* -XX:+WhiteBoxAPI TestUseRTMDeoptOptionOnSupportedConfig
*/
-import com.oracle.java.testlibrary.ExitCode;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import jdk.test.lib.ExitCode;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
import rtm.predicate.SupportedCPU;
import rtm.predicate.SupportedVM;
--- a/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMDeoptOptionOnUnsupportedConfig.java Mon May 04 16:30:07 2015 +0200
@@ -37,10 +37,10 @@
* -XX:+WhiteBoxAPI TestUseRTMDeoptOptionOnUnsupportedConfig
*/
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.CommandLineOptionTest;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
-import com.oracle.java.testlibrary.cli.predicate.NotPredicate;
+import jdk.test.lib.cli.predicate.AndPredicate;
+import jdk.test.lib.cli.predicate.NotPredicate;
import rtm.predicate.SupportedCPU;
import rtm.predicate.SupportedVM;
--- a/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnSupportedConfig.java Mon May 04 16:30:07 2015 +0200
@@ -38,9 +38,9 @@
* TestUseRTMForStackLocksOptionOnSupportedConfig
*/
-import com.oracle.java.testlibrary.*;
-import com.oracle.java.testlibrary.cli.*;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import jdk.test.lib.*;
+import jdk.test.lib.cli.*;
+import jdk.test.lib.cli.predicate.AndPredicate;
import rtm.predicate.SupportedCPU;
import rtm.predicate.SupportedVM;
--- a/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnUnsupportedConfig.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMForStackLocksOptionOnUnsupportedConfig.java Mon May 04 16:30:07 2015 +0200
@@ -38,10 +38,10 @@
* TestUseRTMForStackLocksOptionOnUnsupportedConfig
*/
-import com.oracle.java.testlibrary.ExitCode;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
-import com.oracle.java.testlibrary.cli.predicate.NotPredicate;
+import jdk.test.lib.ExitCode;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
+import jdk.test.lib.cli.predicate.NotPredicate;
import rtm.predicate.SupportedCPU;
import rtm.predicate.SupportedVM;
--- a/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnSupportedConfig.java Mon May 04 16:30:07 2015 +0200
@@ -37,9 +37,9 @@
* -XX:+WhiteBoxAPI TestUseRTMLockingOptionOnSupportedConfig
*/
-import com.oracle.java.testlibrary.ExitCode;
-import com.oracle.java.testlibrary.cli.*;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import jdk.test.lib.ExitCode;
+import jdk.test.lib.cli.*;
+import jdk.test.lib.cli.predicate.AndPredicate;
import rtm.predicate.SupportedCPU;
import rtm.predicate.SupportedVM;
--- a/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedCPU.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedCPU.java Mon May 04 16:30:07 2015 +0200
@@ -37,10 +37,10 @@
* -XX:+WhiteBoxAPI TestUseRTMLockingOptionOnUnsupportedCPU
*/
-import com.oracle.java.testlibrary.*;
-import com.oracle.java.testlibrary.cli.*;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
-import com.oracle.java.testlibrary.cli.predicate.NotPredicate;
+import jdk.test.lib.*;
+import jdk.test.lib.cli.*;
+import jdk.test.lib.cli.predicate.AndPredicate;
+import jdk.test.lib.cli.predicate.NotPredicate;
import rtm.predicate.SupportedCPU;
import rtm.predicate.SupportedVM;
--- a/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java Mon May 04 16:30:07 2015 +0200
@@ -37,10 +37,10 @@
* -XX:+WhiteBoxAPI TestUseRTMLockingOptionOnUnsupportedVM
*/
-import com.oracle.java.testlibrary.ExitCode;
-import com.oracle.java.testlibrary.cli.*;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
-import com.oracle.java.testlibrary.cli.predicate.NotPredicate;
+import jdk.test.lib.ExitCode;
+import jdk.test.lib.cli.*;
+import jdk.test.lib.cli.predicate.AndPredicate;
+import jdk.test.lib.cli.predicate.NotPredicate;
import rtm.predicate.SupportedCPU;
import rtm.predicate.SupportedVM;
--- a/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/cli/TestUseRTMLockingOptionWithBiasedLocking.java Mon May 04 16:30:07 2015 +0200
@@ -37,9 +37,9 @@
* -XX:+WhiteBoxAPI TestUseRTMLockingOptionWithBiasedLocking
*/
-import com.oracle.java.testlibrary.*;
-import com.oracle.java.testlibrary.cli.*;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import jdk.test.lib.*;
+import jdk.test.lib.cli.*;
+import jdk.test.lib.cli.predicate.AndPredicate;
import rtm.predicate.SupportedCPU;
import rtm.predicate.SupportedVM;
--- a/hotspot/test/compiler/rtm/locking/TestRTMAbortRatio.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/locking/TestRTMAbortRatio.java Mon May 04 16:30:07 2015 +0200
@@ -38,9 +38,9 @@
*/
import java.util.List;
-import com.oracle.java.testlibrary.*;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import jdk.test.lib.*;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
import rtm.*;
import rtm.predicate.SupportedCPU;
import rtm.predicate.SupportedVM;
--- a/hotspot/test/compiler/rtm/locking/TestRTMAbortThreshold.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/locking/TestRTMAbortThreshold.java Mon May 04 16:30:07 2015 +0200
@@ -38,9 +38,9 @@
*/
import java.util.List;
-import com.oracle.java.testlibrary.*;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import jdk.test.lib.*;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
import rtm.*;
import rtm.predicate.SupportedCPU;
import rtm.predicate.SupportedVM;
--- a/hotspot/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/locking/TestRTMAfterNonRTMDeopt.java Mon May 04 16:30:07 2015 +0200
@@ -40,9 +40,9 @@
*/
import java.util.List;
-import com.oracle.java.testlibrary.*;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import jdk.test.lib.*;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
import rtm.*;
import rtm.predicate.SupportedCPU;
import rtm.predicate.SupportedVM;
--- a/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnHighAbortRatio.java Mon May 04 16:30:07 2015 +0200
@@ -38,9 +38,9 @@
*/
import java.util.List;
-import com.oracle.java.testlibrary.*;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import jdk.test.lib.*;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
import rtm.*;
import rtm.predicate.SupportedCPU;
import rtm.predicate.SupportedVM;
--- a/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/locking/TestRTMDeoptOnLowAbortRatio.java Mon May 04 16:30:07 2015 +0200
@@ -37,9 +37,9 @@
*/
import java.util.List;
-import com.oracle.java.testlibrary.*;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import jdk.test.lib.*;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
import rtm.*;
import rtm.predicate.SupportedCPU;
import rtm.predicate.SupportedVM;
--- a/hotspot/test/compiler/rtm/locking/TestRTMLockingCalculationDelay.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/locking/TestRTMLockingCalculationDelay.java Mon May 04 16:30:07 2015 +0200
@@ -37,9 +37,9 @@
* -XX:+WhiteBoxAPI TestRTMLockingCalculationDelay
*/
-import com.oracle.java.testlibrary.*;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import jdk.test.lib.*;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
import rtm.*;
import rtm.predicate.SupportedCPU;
import rtm.predicate.SupportedVM;
--- a/hotspot/test/compiler/rtm/locking/TestRTMLockingThreshold.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/locking/TestRTMLockingThreshold.java Mon May 04 16:30:07 2015 +0200
@@ -38,9 +38,9 @@
*/
import java.util.List;
-import com.oracle.java.testlibrary.*;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import jdk.test.lib.*;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
import rtm.*;
import rtm.predicate.SupportedCPU;
import rtm.predicate.SupportedVM;
--- a/hotspot/test/compiler/rtm/locking/TestRTMRetryCount.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/locking/TestRTMRetryCount.java Mon May 04 16:30:07 2015 +0200
@@ -38,9 +38,9 @@
import java.util.List;
-import com.oracle.java.testlibrary.*;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import jdk.test.lib.*;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
import rtm.*;
import rtm.predicate.SupportedCPU;
import rtm.predicate.SupportedVM;
--- a/hotspot/test/compiler/rtm/locking/TestRTMSpinLoopCount.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/locking/TestRTMSpinLoopCount.java Mon May 04 16:30:07 2015 +0200
@@ -38,9 +38,9 @@
*/
import java.util.List;
-import com.oracle.java.testlibrary.*;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import jdk.test.lib.*;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
import rtm.*;
import rtm.predicate.SupportedCPU;
import rtm.predicate.SupportedVM;
--- a/hotspot/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/locking/TestRTMTotalCountIncrRate.java Mon May 04 16:30:07 2015 +0200
@@ -40,9 +40,9 @@
import sun.misc.Unsafe;
import java.util.List;
-import com.oracle.java.testlibrary.*;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import jdk.test.lib.*;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
import rtm.*;
import rtm.predicate.SupportedCPU;
import rtm.predicate.SupportedVM;
--- a/hotspot/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/locking/TestUseRTMAfterLockInflation.java Mon May 04 16:30:07 2015 +0200
@@ -39,9 +39,9 @@
import java.util.List;
-import com.oracle.java.testlibrary.*;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import jdk.test.lib.*;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
import rtm.*;
import rtm.predicate.SupportedCPU;
import rtm.predicate.SupportedVM;
--- a/hotspot/test/compiler/rtm/locking/TestUseRTMDeopt.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/locking/TestUseRTMDeopt.java Mon May 04 16:30:07 2015 +0200
@@ -37,9 +37,9 @@
* -XX:+WhiteBoxAPI TestUseRTMDeopt
*/
-import com.oracle.java.testlibrary.*;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import jdk.test.lib.*;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
import rtm.*;
import rtm.predicate.SupportedCPU;
import rtm.predicate.SupportedVM;
--- a/hotspot/test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java Mon May 04 16:30:07 2015 +0200
@@ -38,9 +38,9 @@
import java.util.List;
-import com.oracle.java.testlibrary.*;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import jdk.test.lib.*;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
import rtm.*;
import rtm.predicate.SupportedCPU;
import rtm.predicate.SupportedVM;
--- a/hotspot/test/compiler/rtm/locking/TestUseRTMForStackLocks.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/locking/TestUseRTMForStackLocks.java Mon May 04 16:30:07 2015 +0200
@@ -38,9 +38,9 @@
import java.util.List;
-import com.oracle.java.testlibrary.*;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import jdk.test.lib.*;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
import rtm.*;
import rtm.predicate.SupportedCPU;
import rtm.predicate.SupportedVM;
--- a/hotspot/test/compiler/rtm/locking/TestUseRTMXendForLockBusy.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/locking/TestUseRTMXendForLockBusy.java Mon May 04 16:30:07 2015 +0200
@@ -39,9 +39,9 @@
import java.util.List;
-import com.oracle.java.testlibrary.*;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import jdk.test.lib.*;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
import rtm.*;
import rtm.predicate.SupportedCPU;
import rtm.predicate.SupportedVM;
--- a/hotspot/test/compiler/rtm/method_options/TestNoRTMLockElidingOption.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/method_options/TestNoRTMLockElidingOption.java Mon May 04 16:30:07 2015 +0200
@@ -38,9 +38,9 @@
*/
import java.util.List;
-import com.oracle.java.testlibrary.*;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import jdk.test.lib.*;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
import rtm.*;
import rtm.predicate.SupportedCPU;
import rtm.predicate.SupportedVM;
--- a/hotspot/test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java Mon May 04 16:30:07 2015 +0200
@@ -39,9 +39,9 @@
*/
import java.util.List;
-import com.oracle.java.testlibrary.*;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import jdk.test.lib.*;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
import rtm.*;
import rtm.predicate.SupportedCPU;
import rtm.predicate.SupportedVM;
--- a/hotspot/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/rtm/print/TestPrintPreciseRTMLockingStatistics.java Mon May 04 16:30:07 2015 +0200
@@ -41,9 +41,9 @@
import java.util.*;
-import com.oracle.java.testlibrary.*;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
+import jdk.test.lib.*;
+import jdk.test.lib.cli.CommandLineOptionTest;
+import jdk.test.lib.cli.predicate.AndPredicate;
import rtm.*;
import rtm.predicate.SupportedCPU;
import rtm.predicate.SupportedVM;
--- a/hotspot/test/compiler/startup/NumCompilerThreadsCheck.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/startup/NumCompilerThreadsCheck.java Mon May 04 16:30:07 2015 +0200
@@ -29,7 +29,7 @@
* @modules java.base/sun.misc
* java.management
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class NumCompilerThreadsCheck {
--- a/hotspot/test/compiler/startup/SmallCodeCacheStartup.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/startup/SmallCodeCacheStartup.java Mon May 04 16:30:07 2015 +0200
@@ -31,8 +31,8 @@
* @modules java.base/sun.misc
* java.management
*/
-import com.oracle.java.testlibrary.*;
-import static com.oracle.java.testlibrary.Asserts.assertTrue;
+import jdk.test.lib.*;
+import static jdk.test.lib.Asserts.assertTrue;
public class SmallCodeCacheStartup {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/compiler/startup/StartupOutput.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/startup/StartupOutput.java Mon May 04 16:30:07 2015 +0200
@@ -29,7 +29,7 @@
* @modules java.base/sun.misc
* java.management
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class StartupOutput {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/compiler/testlibrary/CompilerUtils.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/testlibrary/CompilerUtils.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -21,8 +21,8 @@
* questions.
*/
-import com.oracle.java.testlibrary.Asserts;
-import com.oracle.java.testlibrary.Platform;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.Platform;
import java.util.stream.IntStream;
import sun.hotspot.WhiteBox;
--- a/hotspot/test/compiler/testlibrary/rtm/AbortProvoker.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/testlibrary/rtm/AbortProvoker.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -28,7 +28,7 @@
import java.util.concurrent.BrokenBarrierException;
import java.util.concurrent.CyclicBarrier;
-import com.oracle.java.testlibrary.Asserts;
+import jdk.test.lib.Asserts;
import sun.hotspot.WhiteBox;
/**
--- a/hotspot/test/compiler/testlibrary/rtm/AbortType.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/testlibrary/rtm/AbortType.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -24,7 +24,7 @@
package rtm;
-import com.oracle.java.testlibrary.Asserts;
+import jdk.test.lib.Asserts;
import java.util.HashMap;
import java.util.Map;
--- a/hotspot/test/compiler/testlibrary/rtm/RTMTestBase.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/testlibrary/rtm/RTMTestBase.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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,10 +34,10 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.ProcessTools;
-import com.oracle.java.testlibrary.Utils;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
+import jdk.test.lib.Utils;
+import jdk.test.lib.cli.CommandLineOptionTest;
/**
* Auxiliary methods used for RTM testing.
--- a/hotspot/test/compiler/testlibrary/rtm/XAbortProvoker.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/testlibrary/rtm/XAbortProvoker.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -24,7 +24,7 @@
package rtm;
-import com.oracle.java.testlibrary.Utils;
+import jdk.test.lib.Utils;
import sun.misc.Unsafe;
/**
--- a/hotspot/test/compiler/testlibrary/rtm/predicate/SupportedVM.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/testlibrary/rtm/predicate/SupportedVM.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -24,7 +24,7 @@
package rtm.predicate;
-import com.oracle.java.testlibrary.Platform;
+import jdk.test.lib.Platform;
import java.util.function.BooleanSupplier;
--- a/hotspot/test/compiler/testlibrary/sha/predicate/IntrinsicPredicates.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/testlibrary/sha/predicate/IntrinsicPredicates.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -23,10 +23,10 @@
package sha.predicate;
-import com.oracle.java.testlibrary.Platform;
-import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
-import com.oracle.java.testlibrary.cli.predicate.CPUSpecificPredicate;
-import com.oracle.java.testlibrary.cli.predicate.OrPredicate;
+import jdk.test.lib.Platform;
+import jdk.test.lib.cli.predicate.AndPredicate;
+import jdk.test.lib.cli.predicate.CPUSpecificPredicate;
+import jdk.test.lib.cli.predicate.OrPredicate;
import sun.hotspot.WhiteBox;
import java.util.function.BooleanSupplier;
--- a/hotspot/test/compiler/testlibrary/uncommontrap/Verifier.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/testlibrary/uncommontrap/Verifier.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -33,7 +33,7 @@
import java.util.Properties;
import java.util.regex.Pattern;
-import com.oracle.java.testlibrary.Asserts;
+import jdk.test.lib.Asserts;
/**
* Utility tool aimed to verify presence or absence of specified uncommon trap
* in compilation log.
--- a/hotspot/test/compiler/tiered/TransitionsTestExecutor.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/tiered/TransitionsTestExecutor.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -21,8 +21,8 @@
* questions.
*/
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
--- a/hotspot/test/compiler/types/correctness/CorrectnessTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/types/correctness/CorrectnessTest.java Mon May 04 16:30:07 2015 +0200
@@ -54,8 +54,8 @@
* @summary Tests correctness of type usage with type profiling and speculations
*/
-import com.oracle.java.testlibrary.Asserts;
-import com.oracle.java.testlibrary.Platform;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.Platform;
import execution.Execution;
import execution.MethodHandleDelegate;
import execution.TypeConflict;
--- a/hotspot/test/compiler/types/correctness/OffTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/types/correctness/OffTest.java Mon May 04 16:30:07 2015 +0200
@@ -37,9 +37,9 @@
* @run main/timeout=1200 OffTest
*/
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.ProcessTools;
-import com.oracle.java.testlibrary.Utils;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
+import jdk.test.lib.Utils;
import java.util.Random;
import scenarios.ProfilingType;
--- a/hotspot/test/compiler/types/correctness/scenarios/ArrayScenario.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/types/correctness/scenarios/ArrayScenario.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -23,7 +23,7 @@
package scenarios;
-import com.oracle.java.testlibrary.Asserts;
+import jdk.test.lib.Asserts;
import hierarchies.TypeHierarchy;
import java.lang.reflect.Array;
--- a/hotspot/test/compiler/types/correctness/scenarios/CheckCast.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/types/correctness/scenarios/CheckCast.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -23,7 +23,7 @@
package scenarios;
-import com.oracle.java.testlibrary.Asserts;
+import jdk.test.lib.Asserts;
import hierarchies.TypeHierarchy;
import java.util.Objects;
--- a/hotspot/test/compiler/types/correctness/scenarios/ClassIdentity.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/types/correctness/scenarios/ClassIdentity.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -23,7 +23,7 @@
package scenarios;
-import com.oracle.java.testlibrary.Asserts;
+import jdk.test.lib.Asserts;
import hierarchies.TypeHierarchy;
/**
--- a/hotspot/test/compiler/types/correctness/scenarios/ClassInstanceOf.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/types/correctness/scenarios/ClassInstanceOf.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -23,7 +23,7 @@
package scenarios;
-import com.oracle.java.testlibrary.Asserts;
+import jdk.test.lib.Asserts;
import hierarchies.TypeHierarchy;
/**
--- a/hotspot/test/compiler/types/correctness/scenarios/ClassIsInstance.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/types/correctness/scenarios/ClassIsInstance.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -23,7 +23,7 @@
package scenarios;
-import com.oracle.java.testlibrary.Asserts;
+import jdk.test.lib.Asserts;
import hierarchies.TypeHierarchy;
/**
--- a/hotspot/test/compiler/types/correctness/scenarios/ReceiverAtInvokes.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/types/correctness/scenarios/ReceiverAtInvokes.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -23,7 +23,7 @@
package scenarios;
-import com.oracle.java.testlibrary.Asserts;
+import jdk.test.lib.Asserts;
import hierarchies.TypeHierarchy;
/**
--- a/hotspot/test/compiler/uncommontrap/TestUnstableIfTrap.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/uncommontrap/TestUnstableIfTrap.java Mon May 04 16:30:07 2015 +0200
@@ -26,8 +26,8 @@
import java.lang.reflect.Method;
import java.util.Properties;
-import com.oracle.java.testlibrary.ByteCodeLoader;
-import com.oracle.java.testlibrary.Platform;
+import jdk.test.lib.ByteCodeLoader;
+import jdk.test.lib.Platform;
import jdk.internal.org.objectweb.asm.ClassVisitor;
import jdk.internal.org.objectweb.asm.ClassWriter;
import jdk.internal.org.objectweb.asm.Label;
@@ -46,7 +46,7 @@
* java.compiler
* java.management
* jdk.jvmstat/sun.jvmstat.monitor
- * @build TestUnstableIfTrap com.oracle.java.testlibrary.* uncommontrap.Verifier
+ * @build TestUnstableIfTrap jdk.test.lib.* uncommontrap.Verifier
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/othervm -Xbatch -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
--- a/hotspot/test/compiler/unsafe/UnsafeRaw.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/unsafe/UnsafeRaw.java Mon May 04 16:30:07 2015 +0200
@@ -31,7 +31,7 @@
* @run main/othervm -Xbatch UnsafeRaw
*/
-import com.oracle.java.testlibrary.Utils;
+import jdk.test.lib.Utils;
import java.util.Random;
public class UnsafeRaw {
--- a/hotspot/test/compiler/whitebox/AllocationCodeBlobTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/whitebox/AllocationCodeBlobTest.java Mon May 04 16:30:07 2015 +0200
@@ -28,8 +28,8 @@
import sun.hotspot.WhiteBox;
import sun.hotspot.code.BlobType;
-import com.oracle.java.testlibrary.Asserts;
-import com.oracle.java.testlibrary.InfiniteLoop;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.InfiniteLoop;
/*
* @test AllocationCodeBlobTest
--- a/hotspot/test/compiler/whitebox/DeoptimizeFramesTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/whitebox/DeoptimizeFramesTest.java Mon May 04 16:30:07 2015 +0200
@@ -46,8 +46,8 @@
import java.util.concurrent.Phaser;
import sun.hotspot.code.NMethod;
-import com.oracle.java.testlibrary.Asserts;
-import com.oracle.java.testlibrary.InfiniteLoop;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.InfiniteLoop;
public class DeoptimizeFramesTest extends CompilerWhiteBoxTest {
private final boolean makeNotEntrant;
--- a/hotspot/test/compiler/whitebox/ForceNMethodSweepTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/whitebox/ForceNMethodSweepTest.java Mon May 04 16:30:07 2015 +0200
@@ -28,8 +28,8 @@
import sun.hotspot.WhiteBox;
import sun.hotspot.code.BlobType;
-import com.oracle.java.testlibrary.Asserts;
-import com.oracle.java.testlibrary.InfiniteLoop;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.InfiniteLoop;
/*
* @test
--- a/hotspot/test/compiler/whitebox/GetCodeHeapEntriesTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/whitebox/GetCodeHeapEntriesTest.java Mon May 04 16:30:07 2015 +0200
@@ -28,7 +28,7 @@
import sun.hotspot.WhiteBox;
import sun.hotspot.code.CodeBlob;
import sun.hotspot.code.BlobType;
-import com.oracle.java.testlibrary.Asserts;
+import jdk.test.lib.Asserts;
/*
* @test GetCodeHeapEntriesTest
--- a/hotspot/test/compiler/whitebox/GetNMethodTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/whitebox/GetNMethodTest.java Mon May 04 16:30:07 2015 +0200
@@ -24,7 +24,7 @@
import sun.hotspot.code.BlobType;
import sun.hotspot.code.NMethod;
-import com.oracle.java.testlibrary.Asserts;
+import jdk.test.lib.Asserts;
/*
* @test GetNMethodTest
--- a/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java Mon May 04 16:30:07 2015 +0200
@@ -24,19 +24,20 @@
/*
* @test IsMethodCompilableTest
* @bug 8007270 8006683 8007288 8022832
- * @library /testlibrary /../../test/lib /testlibrary/com/oracle/java/testlibrary
+ * @library /testlibrary /../../test/lib
* @modules java.base/sun.misc
* java.management
+ * @build jdk.test.lib.* sun.hotspot.WhiteBox
* @build IsMethodCompilableTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
- * @run main ClassFileInstaller com.oracle.java.testlibrary.Platform
+ * @run main ClassFileInstaller jdk.test.lib.Platform
* @run main/othervm/timeout=2400 -Xbootclasspath/a:. -Xmixed -XX:-TieredCompilation -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:PerMethodRecompilationCutoff=3 -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* IsMethodCompilableTest
* @summary testing of WB::isMethodCompilable()
* @author igor.ignatyev@oracle.com
*/
-import com.oracle.java.testlibrary.Platform;
+import jdk.test.lib.Platform;
public class IsMethodCompilableTest extends CompilerWhiteBoxTest {
/**
--- a/hotspot/test/compiler/whitebox/LockCompilationTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/compiler/whitebox/LockCompilationTest.java Mon May 04 16:30:07 2015 +0200
@@ -38,7 +38,7 @@
import java.util.concurrent.BrokenBarrierException;
import java.util.concurrent.CyclicBarrier;
-import com.oracle.java.testlibrary.Asserts;
+import jdk.test.lib.Asserts;
public class LockCompilationTest extends CompilerWhiteBoxTest {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/gc/6941923/Test6941923.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/6941923/Test6941923.java Mon May 04 16:30:07 2015 +0200
@@ -31,7 +31,7 @@
* @run main/othervm/timeout=600 Test6941923
*
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import java.io.File;
import java.io.FilenameFilter;
import java.util.ArrayList;
--- a/hotspot/test/gc/TestCardTablePageCommits.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/TestCardTablePageCommits.java Mon May 04 16:30:07 2015 +0200
@@ -21,10 +21,10 @@
* questions.
*/
-import com.oracle.java.testlibrary.JDKToolFinder;
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.ProcessTools;
-import com.oracle.java.testlibrary.Platform;
+import jdk.test.lib.JDKToolFinder;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
+import jdk.test.lib.Platform;
/*
* @test TestCardTablePageCommits
--- a/hotspot/test/gc/TestDisableExplicitGC.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/TestDisableExplicitGC.java Mon May 04 16:30:07 2015 +0200
@@ -32,7 +32,7 @@
*/
import java.lang.management.GarbageCollectorMXBean;
import java.util.List;
-import static com.oracle.java.testlibrary.Asserts.*;
+import static jdk.test.lib.Asserts.*;
public class TestDisableExplicitGC {
--- a/hotspot/test/gc/TestGCLogRotationViaJcmd.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/TestGCLogRotationViaJcmd.java Mon May 04 16:30:07 2015 +0200
@@ -31,7 +31,7 @@
* @run main/othervm -Xloggc:test.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=3 TestGCLogRotationViaJcmd
*
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import java.io.File;
import java.io.FilenameFilter;
--- a/hotspot/test/gc/TestObjectAlignment.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/TestObjectAlignment.java Mon May 04 16:30:07 2015 +0200
@@ -43,8 +43,8 @@
* @run main/othervm TestObjectAlignment -Xmx20M -XX:-ExplicitGCInvokesConcurrent -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=256
*/
-import com.oracle.java.testlibrary.ProcessTools;
-import com.oracle.java.testlibrary.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
public class TestObjectAlignment {
--- a/hotspot/test/gc/TestSmallHeap.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/TestSmallHeap.java Mon May 04 16:30:07 2015 +0200
@@ -57,10 +57,10 @@
* So, the expected heap size is page_size * 512.
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import com.sun.management.HotSpotDiagnosticMXBean;
import java.lang.management.ManagementFactory;
-import static com.oracle.java.testlibrary.Asserts.*;
+import static jdk.test.lib.Asserts.*;
import sun.hotspot.WhiteBox;
--- a/hotspot/test/gc/TestSoftReferencesBehaviorOnOOME.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/TestSoftReferencesBehaviorOnOOME.java Mon May 04 16:30:07 2015 +0200
@@ -34,7 +34,7 @@
* @run main/othervm -Xmx128m TestSoftReferencesBehaviorOnOOME 128k 256k
* @run main/othervm -Xmx128m TestSoftReferencesBehaviorOnOOME 2k 32k 10
*/
-import com.oracle.java.testlibrary.Utils;
+import jdk.test.lib.Utils;
import java.lang.ref.SoftReference;
import java.util.LinkedList;
import java.util.Random;
--- a/hotspot/test/gc/TestVerifyDuringStartup.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/TestVerifyDuringStartup.java Mon May 04 16:30:07 2015 +0200
@@ -30,9 +30,9 @@
* java.management
*/
-import com.oracle.java.testlibrary.JDKToolFinder;
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.ProcessTools;
+import jdk.test.lib.JDKToolFinder;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
import java.util.ArrayList;
import java.util.Collections;
--- a/hotspot/test/gc/TestVerifySilently.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/TestVerifySilently.java Mon May 04 16:30:07 2015 +0200
@@ -30,8 +30,8 @@
* java.management
*/
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
import java.util.ArrayList;
import java.util.Collections;
--- a/hotspot/test/gc/arguments/TestArrayAllocatorMallocLimit.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/arguments/TestArrayAllocatorMallocLimit.java Mon May 04 16:30:07 2015 +0200
@@ -33,9 +33,9 @@
* @run driver TestArrayAllocatorMallocLimit
*/
-import com.oracle.java.testlibrary.Asserts;
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.ProcessTools;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
import java.math.BigInteger;
public class TestArrayAllocatorMallocLimit {
--- a/hotspot/test/gc/arguments/TestCompressedClassFlags.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/arguments/TestCompressedClassFlags.java Mon May 04 16:30:07 2015 +0200
@@ -21,7 +21,7 @@
* questions.
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
/*
* @test
--- a/hotspot/test/gc/arguments/TestDynMaxHeapFreeRatio.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/arguments/TestDynMaxHeapFreeRatio.java Mon May 04 16:30:07 2015 +0200
@@ -21,10 +21,10 @@
* questions.
*/
-import static com.oracle.java.testlibrary.Asserts.assertEQ;
-import static com.oracle.java.testlibrary.Asserts.assertFalse;
-import static com.oracle.java.testlibrary.Asserts.assertTrue;
-import com.oracle.java.testlibrary.DynamicVMOption;
+import static jdk.test.lib.Asserts.assertEQ;
+import static jdk.test.lib.Asserts.assertFalse;
+import static jdk.test.lib.Asserts.assertTrue;
+import jdk.test.lib.DynamicVMOption;
/**
* @test TestDynMaxHeapFreeRatio
--- a/hotspot/test/gc/arguments/TestDynMinHeapFreeRatio.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/arguments/TestDynMinHeapFreeRatio.java Mon May 04 16:30:07 2015 +0200
@@ -34,10 +34,10 @@
* @run main/othervm -XX:MinHeapFreeRatio=51 -XX:MaxHeapFreeRatio=52 TestDynMinHeapFreeRatio
* @run main/othervm -XX:MinHeapFreeRatio=75 -XX:MaxHeapFreeRatio=100 TestDynMinHeapFreeRatio
*/
-import static com.oracle.java.testlibrary.Asserts.assertEQ;
-import static com.oracle.java.testlibrary.Asserts.assertFalse;
-import static com.oracle.java.testlibrary.Asserts.assertTrue;
-import com.oracle.java.testlibrary.DynamicVMOption;
+import static jdk.test.lib.Asserts.assertEQ;
+import static jdk.test.lib.Asserts.assertFalse;
+import static jdk.test.lib.Asserts.assertTrue;
+import jdk.test.lib.DynamicVMOption;
public class TestDynMinHeapFreeRatio {
--- a/hotspot/test/gc/arguments/TestG1ConcRefinementThreads.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/arguments/TestG1ConcRefinementThreads.java Mon May 04 16:30:07 2015 +0200
@@ -31,7 +31,7 @@
* java.management
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import java.util.*;
import java.util.regex.*;
--- a/hotspot/test/gc/arguments/TestG1PercentageOptions.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/arguments/TestG1PercentageOptions.java Mon May 04 16:30:07 2015 +0200
@@ -32,7 +32,7 @@
* @run driver TestG1PercentageOptions
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class TestG1PercentageOptions {
--- a/hotspot/test/gc/arguments/TestHeapFreeRatio.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/arguments/TestHeapFreeRatio.java Mon May 04 16:30:07 2015 +0200
@@ -32,7 +32,7 @@
* @run main/othervm TestHeapFreeRatio
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class TestHeapFreeRatio {
--- a/hotspot/test/gc/arguments/TestInitialTenuringThreshold.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/arguments/TestInitialTenuringThreshold.java Mon May 04 16:30:07 2015 +0200
@@ -33,7 +33,7 @@
* @author thomas.schatzl@oracle.com
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class TestInitialTenuringThreshold {
--- a/hotspot/test/gc/arguments/TestMaxHeapSizeTools.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/arguments/TestMaxHeapSizeTools.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 2013, 2015, 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
@@ -26,7 +26,7 @@
import java.util.ArrayList;
import java.util.Arrays;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.hotspot.WhiteBox;
class ErgoArgsPrinter {
--- a/hotspot/test/gc/arguments/TestMaxNewSize.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/arguments/TestMaxNewSize.java Mon May 04 16:30:07 2015 +0200
@@ -46,7 +46,7 @@
import java.util.ArrayList;
import java.util.Arrays;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class TestMaxNewSize {
--- a/hotspot/test/gc/arguments/TestObjectTenuringFlags.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/arguments/TestObjectTenuringFlags.java Mon May 04 16:30:07 2015 +0200
@@ -34,7 +34,7 @@
* @run main/othervm TestObjectTenuringFlags
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import java.util.*;
--- a/hotspot/test/gc/arguments/TestParallelGCThreads.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/arguments/TestParallelGCThreads.java Mon May 04 16:30:07 2015 +0200
@@ -32,7 +32,7 @@
* @run driver TestParallelGCThreads
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class TestParallelGCThreads {
--- a/hotspot/test/gc/arguments/TestSelectDefaultGC.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/arguments/TestSelectDefaultGC.java Mon May 04 16:30:07 2015 +0200
@@ -32,7 +32,7 @@
* @run driver TestSelectDefaultGC
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import java.util.regex.*;
public class TestSelectDefaultGC {
--- a/hotspot/test/gc/arguments/TestSurvivorAlignmentInBytesOption.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/arguments/TestSurvivorAlignmentInBytesOption.java Mon May 04 16:30:07 2015 +0200
@@ -21,8 +21,8 @@
* questions.
*/
-import com.oracle.java.testlibrary.ExitCode;
-import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
+import jdk.test.lib.ExitCode;
+import jdk.test.lib.cli.CommandLineOptionTest;
/**
* @test
--- a/hotspot/test/gc/arguments/TestUnrecognizedVMOptionsHandling.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/arguments/TestUnrecognizedVMOptionsHandling.java Mon May 04 16:30:07 2015 +0200
@@ -32,7 +32,7 @@
* @run main/othervm TestUnrecognizedVMOptionsHandling
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class TestUnrecognizedVMOptionsHandling {
--- a/hotspot/test/gc/arguments/TestUseCompressedOopsErgoTools.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/arguments/TestUseCompressedOopsErgoTools.java Mon May 04 16:30:07 2015 +0200
@@ -29,7 +29,7 @@
import java.util.ArrayList;
import java.util.Arrays;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import java.lang.management.ManagementFactory;
import sun.hotspot.WhiteBox;
--- a/hotspot/test/gc/arguments/TestUseNUMAInterleaving.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/arguments/TestUseNUMAInterleaving.java Mon May 04 16:30:07 2015 +0200
@@ -32,8 +32,8 @@
* java.management
* @run driver TestUseNUMAInterleaving
*/
-import com.oracle.java.testlibrary.ProcessTools;
-import com.oracle.java.testlibrary.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
public class TestUseNUMAInterleaving {
--- a/hotspot/test/gc/arguments/TestVerifyBeforeAndAfterGCFlags.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/arguments/TestVerifyBeforeAndAfterGCFlags.java Mon May 04 16:30:07 2015 +0200
@@ -36,9 +36,9 @@
import java.util.ArrayList;
import java.util.Collections;
-import com.oracle.java.testlibrary.Utils;
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.ProcessTools;
+import jdk.test.lib.Utils;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
public class TestVerifyBeforeAndAfterGCFlags {
--- a/hotspot/test/gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java Mon May 04 16:30:07 2015 +0200
@@ -35,8 +35,8 @@
* @summary Test that -XX:-CMSClassUnloadingEnabled will trigger a Full GC when more than MetaspaceSize metadata is allocated.
*/
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
import java.lang.management.GarbageCollectorMXBean;
import java.lang.management.ManagementFactory;
import java.util.ArrayList;
--- a/hotspot/test/gc/class_unloading/TestG1ClassUnloadingHWM.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/class_unloading/TestG1ClassUnloadingHWM.java Mon May 04 16:30:07 2015 +0200
@@ -35,8 +35,8 @@
* @summary Test that -XX:-ClassUnloadingWithConcurrentMark will trigger a Full GC when more than MetaspaceSize metadata is allocated.
*/
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
import java.util.ArrayList;
import java.util.Arrays;
import sun.hotspot.WhiteBox;
--- a/hotspot/test/gc/concurrentMarkSweep/GuardShrinkWarning.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/concurrentMarkSweep/GuardShrinkWarning.java Mon May 04 16:30:07 2015 +0200
@@ -34,7 +34,7 @@
* @author jon.masamitsu@oracle.com
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class GuardShrinkWarning {
public static void main(String args[]) throws Exception {
--- a/hotspot/test/gc/defnew/HeapChangeLogging.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/defnew/HeapChangeLogging.java Mon May 04 16:30:07 2015 +0200
@@ -35,7 +35,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class HeapChangeLogging {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/gc/ergonomics/TestDynamicNumberOfGCThreads.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/ergonomics/TestDynamicNumberOfGCThreads.java Mon May 04 16:30:07 2015 +0200
@@ -30,8 +30,8 @@
* @library /testlibrary
*/
-import com.oracle.java.testlibrary.ProcessTools;
-import com.oracle.java.testlibrary.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
public class TestDynamicNumberOfGCThreads {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/gc/g1/Test2GbHeap.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/g1/Test2GbHeap.java Mon May 04 16:30:07 2015 +0200
@@ -34,8 +34,8 @@
import java.util.ArrayList;
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
public class Test2GbHeap {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/gc/g1/TestEagerReclaimHumongousRegions.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/g1/TestEagerReclaimHumongousRegions.java Mon May 04 16:30:07 2015 +0200
@@ -36,9 +36,9 @@
import java.util.regex.Matcher;
import java.util.LinkedList;
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.ProcessTools;
-import com.oracle.java.testlibrary.Asserts;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
+import jdk.test.lib.Asserts;
class ReclaimRegionFast {
public static final int M = 1024*1024;
--- a/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java Mon May 04 16:30:07 2015 +0200
@@ -36,8 +36,8 @@
import java.util.LinkedList;
import java.util.Random;
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
// An object that has a few references to other instances to slow down marking.
class ObjectWithSomeRefs {
--- a/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsWithRefs.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsWithRefs.java Mon May 04 16:30:07 2015 +0200
@@ -39,9 +39,9 @@
import java.util.regex.Matcher;
import java.util.LinkedList;
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.ProcessTools;
-import static com.oracle.java.testlibrary.Asserts.*;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
+import static jdk.test.lib.Asserts.*;
class RefHolder {
Object ref;
--- a/hotspot/test/gc/g1/TestG1TraceEagerReclaimHumongousObjects.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/g1/TestG1TraceEagerReclaimHumongousObjects.java Mon May 04 16:30:07 2015 +0200
@@ -32,8 +32,8 @@
* java.management
*/
-import com.oracle.java.testlibrary.ProcessTools;
-import com.oracle.java.testlibrary.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
import java.util.LinkedList;
public class TestG1TraceEagerReclaimHumongousObjects {
--- a/hotspot/test/gc/g1/TestGCLogMessages.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/g1/TestGCLogMessages.java Mon May 04 16:30:07 2015 +0200
@@ -32,8 +32,8 @@
* java.management
*/
-import com.oracle.java.testlibrary.ProcessTools;
-import com.oracle.java.testlibrary.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
public class TestGCLogMessages {
--- a/hotspot/test/gc/g1/TestHumongousAllocInitialMark.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/g1/TestHumongousAllocInitialMark.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* java.management
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class TestHumongousAllocInitialMark {
// Heap sizes < 224 MB are increased to 224 MB if vm_page_size == 64K to
--- a/hotspot/test/gc/g1/TestHumongousCodeCacheRoots.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/g1/TestHumongousCodeCacheRoots.java Mon May 04 16:30:07 2015 +0200
@@ -36,7 +36,7 @@
* @run main TestHumongousCodeCacheRoots
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.hotspot.WhiteBox;
import java.util.ArrayList;
--- a/hotspot/test/gc/g1/TestHumongousShrinkHeap.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/g1/TestHumongousShrinkHeap.java Mon May 04 16:30:07 2015 +0200
@@ -39,7 +39,7 @@
import java.lang.management.MemoryUsage;
import java.util.ArrayList;
import java.util.List;
-import static com.oracle.java.testlibrary.Asserts.*;
+import static jdk.test.lib.Asserts.*;
public class TestHumongousShrinkHeap {
--- a/hotspot/test/gc/g1/TestLargePageUseForAuxMemory.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/g1/TestLargePageUseForAuxMemory.java Mon May 04 16:30:07 2015 +0200
@@ -23,19 +23,20 @@
/*
* @test TestLargePageUseForAuxMemory.java
+ * @summary Test that auxiliary data structures are allocated using large pages if available.
* @bug 8058354
- * @ignore 8079208
* @key gc
* @library /testlibrary /../../test/lib
* @requires (vm.gc=="G1" | vm.gc=="null")
+ * @build jdk.test.lib.* sun.hotspot.WhiteBox
* @build TestLargePageUseForAuxMemory
+ * @ignore 8079208
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
- * @summary Test that auxiliary data structures are allocated using large pages if available.
* @run main/othervm -Xbootclasspath/a:. -XX:+UseG1GC -XX:+WhiteBoxAPI -XX:+IgnoreUnrecognizedVMOptions -XX:+UseLargePages TestLargePageUseForAuxMemory
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.hotspot.WhiteBox;
public class TestLargePageUseForAuxMemory {
--- a/hotspot/test/gc/g1/TestPrintGCDetails.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/g1/TestPrintGCDetails.java Mon May 04 16:30:07 2015 +0200
@@ -32,8 +32,8 @@
* java.management
*/
-import com.oracle.java.testlibrary.ProcessTools;
-import com.oracle.java.testlibrary.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
public class TestPrintGCDetails {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/gc/g1/TestPrintRegionRememberedSetInfo.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/g1/TestPrintRegionRememberedSetInfo.java Mon May 04 16:30:07 2015 +0200
@@ -33,7 +33,7 @@
* @author thomas.schatzl@oracle.com
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import java.lang.Thread;
import java.util.ArrayList;
import java.util.Arrays;
--- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData.java Mon May 04 16:30:07 2015 +0200
@@ -21,11 +21,11 @@
* questions.
*/
-import com.oracle.java.testlibrary.Asserts;
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.Platform;
-import com.oracle.java.testlibrary.ProcessTools;
-import com.oracle.java.testlibrary.Utils;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.Platform;
+import jdk.test.lib.ProcessTools;
+import jdk.test.lib.Utils;
import java.io.IOException;
import java.lang.management.ManagementFactory;
import java.lang.management.MemoryUsage;
--- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData00.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData00.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* @library /testlibrary /../../test/lib
* @modules java.base/sun.misc
* java.management
- * @build com.oracle.java.testlibrary.* sun.hotspot.WhiteBox
+ * @build jdk.test.lib.* sun.hotspot.WhiteBox
* TestShrinkAuxiliaryData TestShrinkAuxiliaryData00
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData05.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData05.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* @library /testlibrary /../../test/lib
* @modules java.base/sun.misc
* java.management
- * @build com.oracle.java.testlibrary.* sun.hotspot.WhiteBox
+ * @build jdk.test.lib.* sun.hotspot.WhiteBox
* TestShrinkAuxiliaryData TestShrinkAuxiliaryData05
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData10.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData10.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* @library /testlibrary /../../test/lib
* @modules java.base/sun.misc
* java.management
- * @build com.oracle.java.testlibrary.* sun.hotspot.WhiteBox
+ * @build jdk.test.lib.* sun.hotspot.WhiteBox
* @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData10
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData15.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData15.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* @library /testlibrary /../../test/lib
* @modules java.base/sun.misc
* java.management
- * @build com.oracle.java.testlibrary.* sun.hotspot.WhiteBox
+ * @build jdk.test.lib.* sun.hotspot.WhiteBox
* @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData15
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData20.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData20.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* @library /testlibrary /../../test/lib
* @modules java.base/sun.misc
* java.management
- * @build com.oracle.java.testlibrary.* sun.hotspot.WhiteBox
+ * @build jdk.test.lib.* sun.hotspot.WhiteBox
* @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData20
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData25.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData25.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* @library /testlibrary /../../test/lib
* @modules java.base/sun.misc
* java.management
- * @build com.oracle.java.testlibrary.* sun.hotspot.WhiteBox
+ * @build jdk.test.lib.* sun.hotspot.WhiteBox
* @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData25
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData30.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData30.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* @library /testlibrary /../../test/lib
* @modules java.base/sun.misc
* java.management
- * @build com.oracle.java.testlibrary.* sun.hotspot.WhiteBox
+ * @build jdk.test.lib.* sun.hotspot.WhiteBox
* @build TestShrinkAuxiliaryData TestShrinkAuxiliaryData30
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
--- a/hotspot/test/gc/g1/TestShrinkDefragmentedHeap.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/g1/TestShrinkDefragmentedHeap.java Mon May 04 16:30:07 2015 +0200
@@ -39,9 +39,9 @@
import java.lang.management.MemoryUsage;
import java.util.ArrayList;
import java.util.List;
-import static com.oracle.java.testlibrary.Asserts.*;
-import com.oracle.java.testlibrary.ProcessTools;
-import com.oracle.java.testlibrary.OutputAnalyzer;
+import static jdk.test.lib.Asserts.*;
+import jdk.test.lib.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
import com.sun.management.HotSpotDiagnosticMXBean;
public class TestShrinkDefragmentedHeap {
--- a/hotspot/test/gc/g1/TestStringDeduplicationTools.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/g1/TestStringDeduplicationTools.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -29,7 +29,7 @@
import java.lang.reflect.*;
import java.security.*;
import java.util.*;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.misc.*;
class TestStringDeduplicationTools {
--- a/hotspot/test/gc/g1/TestStringSymbolTableStats.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/g1/TestStringSymbolTableStats.java Mon May 04 16:30:07 2015 +0200
@@ -31,8 +31,8 @@
* java.management
*/
-import com.oracle.java.testlibrary.ProcessTools;
-import com.oracle.java.testlibrary.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
public class TestStringSymbolTableStats {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/gc/g1/TestSummarizeRSetStatsPerRegion.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/g1/TestSummarizeRSetStatsPerRegion.java Mon May 04 16:30:07 2015 +0200
@@ -32,7 +32,7 @@
* @run main TestSummarizeRSetStatsPerRegion
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import java.lang.Thread;
import java.util.ArrayList;
import java.util.Arrays;
--- a/hotspot/test/gc/g1/TestSummarizeRSetStatsThreads.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/g1/TestSummarizeRSetStatsThreads.java Mon May 04 16:30:07 2015 +0200
@@ -35,8 +35,8 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import com.oracle.java.testlibrary.ProcessTools;
-import com.oracle.java.testlibrary.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
public class TestSummarizeRSetStatsThreads {
--- a/hotspot/test/gc/g1/TestSummarizeRSetStatsTools.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/g1/TestSummarizeRSetStatsTools.java Mon May 04 16:30:07 2015 +0200
@@ -28,7 +28,7 @@
import com.sun.management.HotSpotDiagnosticMXBean;
import com.sun.management.VMOption;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import java.lang.management.ManagementFactory;
import java.util.ArrayList;
import java.util.Arrays;
--- a/hotspot/test/gc/logging/TestGCId.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/logging/TestGCId.java Mon May 04 16:30:07 2015 +0200
@@ -31,8 +31,8 @@
* java.management
*/
-import com.oracle.java.testlibrary.ProcessTools;
-import com.oracle.java.testlibrary.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
public class TestGCId {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java Mon May 04 16:30:07 2015 +0200
@@ -31,7 +31,7 @@
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:CompressedClassSpaceSize=50m CompressedClassSpaceSizeInJmapHeap
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import java.nio.file.*;
import java.io.File;
import java.nio.charset.Charset;
--- a/hotspot/test/gc/metaspace/TestCapacityUntilGCWrapAround.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/metaspace/TestCapacityUntilGCWrapAround.java Mon May 04 16:30:07 2015 +0200
@@ -36,8 +36,8 @@
import sun.hotspot.WhiteBox;
-import com.oracle.java.testlibrary.Asserts;
-import com.oracle.java.testlibrary.Platform;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.Platform;
public class TestCapacityUntilGCWrapAround {
private static long MB = 1024 * 1024;
--- a/hotspot/test/gc/metaspace/TestMetaspaceMemoryPool.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/metaspace/TestMetaspaceMemoryPool.java Mon May 04 16:30:07 2015 +0200
@@ -23,8 +23,8 @@
import java.util.List;
import java.lang.management.*;
-import com.oracle.java.testlibrary.*;
-import static com.oracle.java.testlibrary.Asserts.*;
+import jdk.test.lib.*;
+import static jdk.test.lib.Asserts.*;
/* @test TestMetaspaceMemoryPool
* @bug 8000754
--- a/hotspot/test/gc/metaspace/TestMetaspacePerfCounters.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/metaspace/TestMetaspacePerfCounters.java Mon May 04 16:30:07 2015 +0200
@@ -24,8 +24,8 @@
import java.util.List;
import java.util.ArrayList;
-import com.oracle.java.testlibrary.*;
-import static com.oracle.java.testlibrary.Asserts.*;
+import jdk.test.lib.*;
+import static jdk.test.lib.Asserts.*;
/* @test TestMetaspacePerfCounters
* @bug 8014659
--- a/hotspot/test/gc/metaspace/TestMetaspaceSizeFlags.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/metaspace/TestMetaspaceSizeFlags.java Mon May 04 16:30:07 2015 +0200
@@ -21,9 +21,9 @@
* questions.
*/
-import com.oracle.java.testlibrary.Asserts;
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.ProcessTools;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
/*
* @test TestMetaspaceSizeFlags
--- a/hotspot/test/gc/metaspace/TestPerfCountersAndMemoryPools.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/metaspace/TestPerfCountersAndMemoryPools.java Mon May 04 16:30:07 2015 +0200
@@ -24,8 +24,8 @@
import java.util.List;
import java.lang.management.*;
-import com.oracle.java.testlibrary.*;
-import static com.oracle.java.testlibrary.Asserts.*;
+import jdk.test.lib.*;
+import static jdk.test.lib.Asserts.*;
/* @test TestPerfCountersAndMemoryPools
* @bug 8023476
--- a/hotspot/test/gc/parallelScavenge/AdaptiveGCBoundary.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/parallelScavenge/AdaptiveGCBoundary.java Mon May 04 16:30:07 2015 +0200
@@ -34,7 +34,7 @@
* @author jon.masamitsu@oracle.com
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class AdaptiveGCBoundary {
public static void main(String args[]) throws Exception {
--- a/hotspot/test/gc/parallelScavenge/TestDynShrinkHeap.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/parallelScavenge/TestDynShrinkHeap.java Mon May 04 16:30:07 2015 +0200
@@ -29,11 +29,11 @@
* @library /testlibrary
* @run main/othervm -XX:+UseAdaptiveSizePolicyWithSystemGC -XX:+UseParallelGC -XX:MinHeapFreeRatio=0 -XX:MaxHeapFreeRatio=100 -Xmx1g -verbose:gc TestDynShrinkHeap
*/
-import com.oracle.java.testlibrary.DynamicVMOption;
+import jdk.test.lib.DynamicVMOption;
import java.lang.management.ManagementFactory;
import java.lang.management.MemoryUsage;
import java.util.ArrayList;
-import static com.oracle.java.testlibrary.Asserts.assertLessThan;
+import static jdk.test.lib.Asserts.assertLessThan;
import com.sun.management.HotSpotDiagnosticMXBean;
public class TestDynShrinkHeap {
--- a/hotspot/test/gc/startup_warnings/TestCMS.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/startup_warnings/TestCMS.java Mon May 04 16:30:07 2015 +0200
@@ -31,8 +31,8 @@
* java.management
*/
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
public class TestCMS {
--- a/hotspot/test/gc/startup_warnings/TestDefNewCMS.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/startup_warnings/TestDefNewCMS.java Mon May 04 16:30:07 2015 +0200
@@ -31,8 +31,8 @@
* java.management
*/
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
public class TestDefNewCMS {
--- a/hotspot/test/gc/startup_warnings/TestDefaultMaxRAMFraction.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/startup_warnings/TestDefaultMaxRAMFraction.java Mon May 04 16:30:07 2015 +0200
@@ -31,8 +31,8 @@
* java.management
*/
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
public class TestDefaultMaxRAMFraction {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/gc/startup_warnings/TestG1.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/startup_warnings/TestG1.java Mon May 04 16:30:07 2015 +0200
@@ -31,8 +31,8 @@
* java.management
*/
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
public class TestG1 {
--- a/hotspot/test/gc/startup_warnings/TestNoParNew.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/startup_warnings/TestNoParNew.java Mon May 04 16:30:07 2015 +0200
@@ -31,8 +31,8 @@
* java.management
*/
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
public class TestNoParNew {
--- a/hotspot/test/gc/startup_warnings/TestParNewCMS.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/startup_warnings/TestParNewCMS.java Mon May 04 16:30:07 2015 +0200
@@ -31,8 +31,8 @@
* java.management
*/
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
public class TestParNewCMS {
--- a/hotspot/test/gc/startup_warnings/TestParNewSerialOld.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/startup_warnings/TestParNewSerialOld.java Mon May 04 16:30:07 2015 +0200
@@ -31,8 +31,8 @@
* java.management
*/
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
public class TestParNewSerialOld {
--- a/hotspot/test/gc/startup_warnings/TestParallelGC.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/startup_warnings/TestParallelGC.java Mon May 04 16:30:07 2015 +0200
@@ -31,8 +31,8 @@
* java.management
*/
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
public class TestParallelGC {
--- a/hotspot/test/gc/startup_warnings/TestParallelScavengeSerialOld.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/startup_warnings/TestParallelScavengeSerialOld.java Mon May 04 16:30:07 2015 +0200
@@ -31,8 +31,8 @@
* java.management
*/
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
public class TestParallelScavengeSerialOld {
--- a/hotspot/test/gc/startup_warnings/TestSerialGC.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/startup_warnings/TestSerialGC.java Mon May 04 16:30:07 2015 +0200
@@ -31,8 +31,8 @@
* java.management
*/
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
public class TestSerialGC {
--- a/hotspot/test/gc/survivorAlignment/SurvivorAlignmentTestMain.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/survivorAlignment/SurvivorAlignmentTestMain.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -28,7 +28,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import com.oracle.java.testlibrary.Asserts;
+import jdk.test.lib.Asserts;
import com.sun.management.ThreadMXBean;
import sun.hotspot.WhiteBox;
import sun.misc.Unsafe;
--- a/hotspot/test/gc/whitebox/TestConcMarkCycleWB.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/whitebox/TestConcMarkCycleWB.java Mon May 04 16:30:07 2015 +0200
@@ -30,14 +30,14 @@
* java.compiler
* java.management
* jdk.jvmstat/sun.jvmstat.monitor
- * @build ClassFileInstaller com.oracle.java.testlibrary.* sun.hotspot.WhiteBox TestConcMarkCycleWB
+ * @build ClassFileInstaller jdk.test.lib.* sun.hotspot.WhiteBox TestConcMarkCycleWB
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+UseG1GC TestConcMarkCycleWB
* @summary Verifies that ConcurrentMarking-related WB works properly
*/
-import static com.oracle.java.testlibrary.Asserts.assertFalse;
-import static com.oracle.java.testlibrary.Asserts.assertTrue;
+import static jdk.test.lib.Asserts.assertFalse;
+import static jdk.test.lib.Asserts.assertTrue;
import sun.hotspot.WhiteBox;
public class TestConcMarkCycleWB {
--- a/hotspot/test/gc/whitebox/TestWBGC.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/gc/whitebox/TestWBGC.java Mon May 04 16:30:07 2015 +0200
@@ -32,7 +32,7 @@
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* @run driver TestWBGC
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.hotspot.WhiteBox;
public class TestWBGC {
--- a/hotspot/test/runtime/BadObjectClass/BootstrapRedefine.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/BadObjectClass/BootstrapRedefine.java Mon May 04 16:30:07 2015 +0200
@@ -32,7 +32,7 @@
* @run main BootstrapRedefine
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class BootstrapRedefine {
--- a/hotspot/test/runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java Mon May 04 16:30:07 2015 +0200
@@ -31,7 +31,7 @@
* @run main CDSCompressedKPtrs
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class CDSCompressedKPtrs {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/runtime/CDSCompressedKPtrs/CDSCompressedKPtrsError.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/CDSCompressedKPtrs/CDSCompressedKPtrsError.java Mon May 04 16:30:07 2015 +0200
@@ -31,7 +31,7 @@
* @run main CDSCompressedKPtrsError
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class CDSCompressedKPtrsError {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/runtime/CDSCompressedKPtrs/XShareAuto.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/CDSCompressedKPtrs/XShareAuto.java Mon May 04 16:30:07 2015 +0200
@@ -31,7 +31,7 @@
* @run main XShareAuto
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class XShareAuto {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/runtime/ClassFile/JsrRewriting.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/ClassFile/JsrRewriting.java Mon May 04 16:30:07 2015 +0200
@@ -40,7 +40,7 @@
* @run main JsrRewriting
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import java.io.File;
public class JsrRewriting {
--- a/hotspot/test/runtime/ClassFile/OomWhileParsingRepeatedJsr.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/ClassFile/OomWhileParsingRepeatedJsr.java Mon May 04 16:30:07 2015 +0200
@@ -40,7 +40,7 @@
* @run main OomWhileParsingRepeatedJsr
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class OomWhileParsingRepeatedJsr {
--- a/hotspot/test/runtime/ClassFile/UnsupportedClassFileVersion.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/ClassFile/UnsupportedClassFileVersion.java Mon May 04 16:30:07 2015 +0200
@@ -36,7 +36,7 @@
import jdk.internal.org.objectweb.asm.ClassWriter;
import jdk.internal.org.objectweb.asm.MethodVisitor;
import jdk.internal.org.objectweb.asm.Opcodes;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class UnsupportedClassFileVersion implements Opcodes {
public static void main(String... args) throws Exception {
--- a/hotspot/test/runtime/CommandLine/BooleanFlagWithInvalidValue.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/CommandLine/BooleanFlagWithInvalidValue.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* java.management
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class BooleanFlagWithInvalidValue {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/runtime/CommandLine/CompilerConfigFileWarning.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/CommandLine/CompilerConfigFileWarning.java Mon May 04 16:30:07 2015 +0200
@@ -31,7 +31,7 @@
*/
import java.io.PrintWriter;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class CompilerConfigFileWarning {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/runtime/CommandLine/ConfigFileParsing.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/CommandLine/ConfigFileParsing.java Mon May 04 16:30:07 2015 +0200
@@ -31,7 +31,7 @@
*/
import java.io.PrintWriter;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class ConfigFileParsing {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/runtime/CommandLine/ConfigFileWarning.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/CommandLine/ConfigFileWarning.java Mon May 04 16:30:07 2015 +0200
@@ -31,7 +31,7 @@
*/
import java.io.PrintWriter;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class ConfigFileWarning {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/runtime/CommandLine/FlagWithInvalidValue.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/CommandLine/FlagWithInvalidValue.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* java.management
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class FlagWithInvalidValue {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/CommandLine/NonBooleanFlagWithInvalidBooleanPrefix.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* java.management
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class NonBooleanFlagWithInvalidBooleanPrefix {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/runtime/CommandLine/ObsoleteFlagErrorMessage.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/CommandLine/ObsoleteFlagErrorMessage.java Mon May 04 16:30:07 2015 +0200
@@ -28,7 +28,7 @@
* @library /testlibrary
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class ObsoleteFlagErrorMessage {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/runtime/CommandLine/TestHexArguments.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/CommandLine/TestHexArguments.java Mon May 04 16:30:07 2015 +0200
@@ -32,7 +32,7 @@
*/
import java.io.File;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class TestHexArguments {
public static void main(String args[]) throws Exception {
--- a/hotspot/test/runtime/CommandLine/TestNullTerminatedFlags.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/CommandLine/TestNullTerminatedFlags.java Mon May 04 16:30:07 2015 +0200
@@ -21,7 +21,7 @@
* questions.
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
/*
* @test TestNullTerminatedFlags
--- a/hotspot/test/runtime/CommandLine/TestVMOptions.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/CommandLine/TestVMOptions.java Mon May 04 16:30:07 2015 +0200
@@ -31,7 +31,7 @@
* @run main TestVMOptions
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import java.io.File;
public class TestVMOptions {
--- a/hotspot/test/runtime/CommandLine/TraceExceptionsTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/CommandLine/TraceExceptionsTest.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* java.management
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class TraceExceptionsTest {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/runtime/CommandLine/UnrecognizedVMOption.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/CommandLine/UnrecognizedVMOption.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* java.management
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class UnrecognizedVMOption {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/runtime/CommandLine/VMOptionWarning.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/CommandLine/VMOptionWarning.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* java.management
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class VMOptionWarning {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* java.management
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class CompressedClassPointers {
--- a/hotspot/test/runtime/CompressedOops/CompressedClassSpaceSize.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/CompressedOops/CompressedClassSpaceSize.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* java.management
* @run main CompressedClassSpaceSize
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class CompressedClassSpaceSize {
--- a/hotspot/test/runtime/CompressedOops/CompressedKlassPointerAndOops.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/CompressedOops/CompressedKlassPointerAndOops.java Mon May 04 16:30:07 2015 +0200
@@ -31,7 +31,7 @@
* java.management
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class CompressedKlassPointerAndOops {
--- a/hotspot/test/runtime/CompressedOops/ObjectAlignment.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/CompressedOops/ObjectAlignment.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* java.management
* @run main ObjectAlignment
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class ObjectAlignment {
--- a/hotspot/test/runtime/CompressedOops/UseCompressedOops.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/CompressedOops/UseCompressedOops.java Mon May 04 16:30:07 2015 +0200
@@ -32,7 +32,7 @@
*/
import java.util.ArrayList;
import java.util.Collections;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class UseCompressedOops {
--- a/hotspot/test/runtime/EnclosingMethodAttr/EnclMethodAttr.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/EnclosingMethodAttr/EnclMethodAttr.java Mon May 04 16:30:07 2015 +0200
@@ -32,7 +32,7 @@
*/
import java.io.File;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class EnclMethodAttr {
--- a/hotspot/test/runtime/ErrorHandling/ProblematicFrameTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/ErrorHandling/ProblematicFrameTest.java Mon May 04 16:30:07 2015 +0200
@@ -30,14 +30,14 @@
* java.compiler
* java.management
* jdk.jvmstat/sun.jvmstat.monitor
- * @build com.oracle.java.testlibrary.*
+ * @build jdk.test.lib.*
* @run driver ProblematicFrameTest
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.misc.Unsafe;
-import com.oracle.java.testlibrary.Utils;
+import jdk.test.lib.Utils;
public class ProblematicFrameTest {
private static class Crasher {
--- a/hotspot/test/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java Mon May 04 16:30:07 2015 +0200
@@ -27,9 +27,9 @@
import java.io.InputStreamReader;
import java.util.regex.Pattern;
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.Platform;
-import com.oracle.java.testlibrary.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.Platform;
+import jdk.test.lib.ProcessTools;
/*
* @test
--- a/hotspot/test/runtime/ErrorHandling/SecondaryErrorTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/ErrorHandling/SecondaryErrorTest.java Mon May 04 16:30:07 2015 +0200
@@ -38,9 +38,9 @@
import java.io.InputStreamReader;
import java.util.regex.Pattern;
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.Platform;
-import com.oracle.java.testlibrary.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.Platform;
+import jdk.test.lib.ProcessTools;
public class SecondaryErrorTest {
--- a/hotspot/test/runtime/LoadClass/LoadClassNegative.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/LoadClass/LoadClassNegative.java Mon May 04 16:30:07 2015 +0200
@@ -35,7 +35,7 @@
*/
import java.io.File;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class LoadClassNegative {
--- a/hotspot/test/runtime/LocalVariableTable/TestLVT.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/LocalVariableTable/TestLVT.java Mon May 04 16:30:07 2015 +0200
@@ -32,7 +32,7 @@
* @run main TestLVT
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import java.util.*;
public class TestLVT {
--- a/hotspot/test/runtime/NMT/AutoshutdownNMT.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/NMT/AutoshutdownNMT.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* java.management
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class AutoshutdownNMT {
--- a/hotspot/test/runtime/NMT/BaselineWithParameter.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/NMT/BaselineWithParameter.java Mon May 04 16:30:07 2015 +0200
@@ -32,7 +32,7 @@
* @run main/othervm -XX:NativeMemoryTracking=detail BaselineWithParameter
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class BaselineWithParameter {
--- a/hotspot/test/runtime/NMT/ChangeTrackingLevel.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/NMT/ChangeTrackingLevel.java Mon May 04 16:30:07 2015 +0200
@@ -33,7 +33,7 @@
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail ChangeTrackingLevel
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.hotspot.WhiteBox;
public class ChangeTrackingLevel {
--- a/hotspot/test/runtime/NMT/CommandLineDetail.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/NMT/CommandLineDetail.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* java.management
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class CommandLineDetail {
--- a/hotspot/test/runtime/NMT/CommandLineEmptyArgument.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/NMT/CommandLineEmptyArgument.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* java.management
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class CommandLineEmptyArgument {
--- a/hotspot/test/runtime/NMT/CommandLineInvalidArgument.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/NMT/CommandLineInvalidArgument.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* java.management
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class CommandLineInvalidArgument {
--- a/hotspot/test/runtime/NMT/CommandLineSummary.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/NMT/CommandLineSummary.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* java.management
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class CommandLineSummary {
--- a/hotspot/test/runtime/NMT/CommandLineTurnOffNMT.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/NMT/CommandLineTurnOffNMT.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* java.management
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class CommandLineTurnOffNMT {
--- a/hotspot/test/runtime/NMT/JcmdBaselineDetail.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/NMT/JcmdBaselineDetail.java Mon May 04 16:30:07 2015 +0200
@@ -31,7 +31,7 @@
* @run main/othervm -XX:NativeMemoryTracking=detail JcmdBaselineDetail
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class JcmdBaselineDetail {
--- a/hotspot/test/runtime/NMT/JcmdDetailDiff.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/NMT/JcmdDetailDiff.java Mon May 04 16:30:07 2015 +0200
@@ -33,7 +33,7 @@
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail JcmdDetailDiff
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.hotspot.WhiteBox;
--- a/hotspot/test/runtime/NMT/JcmdScale.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/NMT/JcmdScale.java Mon May 04 16:30:07 2015 +0200
@@ -31,7 +31,7 @@
* @run main/othervm -XX:NativeMemoryTracking=summary JcmdScale
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class JcmdScale {
--- a/hotspot/test/runtime/NMT/JcmdScaleDetail.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/NMT/JcmdScaleDetail.java Mon May 04 16:30:07 2015 +0200
@@ -31,7 +31,7 @@
* @run main/othervm -XX:NativeMemoryTracking=detail JcmdScaleDetail
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class JcmdScaleDetail {
--- a/hotspot/test/runtime/NMT/JcmdSummaryDiff.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/NMT/JcmdSummaryDiff.java Mon May 04 16:30:07 2015 +0200
@@ -33,7 +33,7 @@
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=summary JcmdSummaryDiff
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.hotspot.WhiteBox;
--- a/hotspot/test/runtime/NMT/JcmdWithNMTDisabled.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/NMT/JcmdWithNMTDisabled.java Mon May 04 16:30:07 2015 +0200
@@ -31,7 +31,7 @@
* @run main JcmdWithNMTDisabled 1
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class JcmdWithNMTDisabled {
static ProcessBuilder pb = new ProcessBuilder();
--- a/hotspot/test/runtime/NMT/MallocRoundingReportTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/NMT/MallocRoundingReportTest.java Mon May 04 16:30:07 2015 +0200
@@ -34,7 +34,7 @@
*
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.hotspot.WhiteBox;
--- a/hotspot/test/runtime/NMT/MallocSiteHashOverflow.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/NMT/MallocSiteHashOverflow.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -32,7 +32,7 @@
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail MallocSiteHashOverflow
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.hotspot.WhiteBox;
public class MallocSiteHashOverflow {
--- a/hotspot/test/runtime/NMT/MallocStressTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/NMT/MallocStressTest.java Mon May 04 16:30:07 2015 +0200
@@ -38,7 +38,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.hotspot.WhiteBox;
public class MallocStressTest {
--- a/hotspot/test/runtime/NMT/MallocTestType.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/NMT/MallocTestType.java Mon May 04 16:30:07 2015 +0200
@@ -34,7 +34,7 @@
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail MallocTestType
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.hotspot.WhiteBox;
public class MallocTestType {
--- a/hotspot/test/runtime/NMT/MallocTrackingVerify.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/NMT/MallocTrackingVerify.java Mon May 04 16:30:07 2015 +0200
@@ -38,7 +38,7 @@
import java.util.ArrayList;
import java.util.Random;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.hotspot.WhiteBox;
--- a/hotspot/test/runtime/NMT/NMTWithCDS.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/NMT/NMTWithCDS.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* java.management
* @run main NMTWithCDS
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class NMTWithCDS {
--- a/hotspot/test/runtime/NMT/PrintNMTStatistics.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/NMT/PrintNMTStatistics.java Mon May 04 16:30:07 2015 +0200
@@ -29,7 +29,7 @@
* @library /testlibrary
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class PrintNMTStatistics {
--- a/hotspot/test/runtime/NMT/PrintNMTStatisticsWithNMTDisabled.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/NMT/PrintNMTStatisticsWithNMTDisabled.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* java.management
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class PrintNMTStatisticsWithNMTDisabled {
--- a/hotspot/test/runtime/NMT/ReleaseNoCommit.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/NMT/ReleaseNoCommit.java Mon May 04 16:30:07 2015 +0200
@@ -33,9 +33,9 @@
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=summary ReleaseNoCommit
*/
-import com.oracle.java.testlibrary.JDKToolFinder;
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.ProcessTools;
+import jdk.test.lib.JDKToolFinder;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
import sun.hotspot.WhiteBox;
--- a/hotspot/test/runtime/NMT/ShutdownTwice.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/NMT/ShutdownTwice.java Mon May 04 16:30:07 2015 +0200
@@ -31,7 +31,7 @@
* @run main/othervm -XX:NativeMemoryTracking=detail ShutdownTwice
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class ShutdownTwice {
--- a/hotspot/test/runtime/NMT/SummaryAfterShutdown.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/NMT/SummaryAfterShutdown.java Mon May 04 16:30:07 2015 +0200
@@ -31,7 +31,7 @@
* @run main/othervm -XX:NativeMemoryTracking=detail SummaryAfterShutdown
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class SummaryAfterShutdown {
--- a/hotspot/test/runtime/NMT/SummarySanityCheck.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/NMT/SummarySanityCheck.java Mon May 04 16:30:07 2015 +0200
@@ -34,7 +34,7 @@
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:NativeMemoryTracking=summary -XX:+WhiteBoxAPI SummarySanityCheck
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
--- a/hotspot/test/runtime/NMT/ThreadedMallocTestType.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/NMT/ThreadedMallocTestType.java Mon May 04 16:30:07 2015 +0200
@@ -33,7 +33,7 @@
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail ThreadedMallocTestType
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.hotspot.WhiteBox;
public class ThreadedMallocTestType {
--- a/hotspot/test/runtime/NMT/ThreadedVirtualAllocTestType.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/NMT/ThreadedVirtualAllocTestType.java Mon May 04 16:30:07 2015 +0200
@@ -33,7 +33,7 @@
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail ThreadedVirtualAllocTestType
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.hotspot.WhiteBox;
public class ThreadedVirtualAllocTestType {
--- a/hotspot/test/runtime/NMT/VirtualAllocCommitUncommitRecommit.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/NMT/VirtualAllocCommitUncommitRecommit.java Mon May 04 16:30:07 2015 +0200
@@ -34,7 +34,7 @@
*
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.hotspot.WhiteBox;
--- a/hotspot/test/runtime/NMT/VirtualAllocTestType.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/NMT/VirtualAllocTestType.java Mon May 04 16:30:07 2015 +0200
@@ -34,7 +34,7 @@
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail VirtualAllocTestType
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.hotspot.WhiteBox;
public class VirtualAllocTestType {
--- a/hotspot/test/runtime/PerfMemDestroy/PerfMemDestroy.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/PerfMemDestroy/PerfMemDestroy.java Mon May 04 16:30:07 2015 +0200
@@ -33,7 +33,7 @@
import java.io.File;
import java.util.Map;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class PerfMemDestroy {
public static void main(String args[]) throws Throwable {
--- a/hotspot/test/runtime/RedefineObject/TestRedefineObject.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/RedefineObject/TestRedefineObject.java Mon May 04 16:30:07 2015 +0200
@@ -21,7 +21,7 @@
* questions.
*/
import java.io.PrintWriter;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
/*
* Test to redefine java/lang/Object and verify that it doesn't crash on vtable
--- a/hotspot/test/runtime/RedefineTests/RedefineAnnotations.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/RedefineTests/RedefineAnnotations.java Mon May 04 16:30:07 2015 +0200
@@ -32,7 +32,7 @@
* @run main/othervm -javaagent:redefineagent.jar RedefineAnnotations
*/
-import static com.oracle.java.testlibrary.Asserts.assertTrue;
+import static jdk.test.lib.Asserts.assertTrue;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.lang.NoSuchFieldException;
--- a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency1.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency1.java Mon May 04 16:30:07 2015 +0200
@@ -34,7 +34,7 @@
* @run main AssertSafepointCheckConsistency1
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.hotspot.WhiteBox;
--- a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency2.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency2.java Mon May 04 16:30:07 2015 +0200
@@ -34,7 +34,7 @@
* @run main AssertSafepointCheckConsistency2
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.hotspot.WhiteBox;
--- a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency3.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency3.java Mon May 04 16:30:07 2015 +0200
@@ -34,7 +34,7 @@
* @run main AssertSafepointCheckConsistency3
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.hotspot.WhiteBox;
--- a/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency4.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/Safepoint/AssertSafepointCheckConsistency4.java Mon May 04 16:30:07 2015 +0200
@@ -34,7 +34,7 @@
* @run main AssertSafepointCheckConsistency4
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.hotspot.WhiteBox;
--- a/hotspot/test/runtime/SharedArchiveFile/ArchiveDoesNotExist.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/SharedArchiveFile/ArchiveDoesNotExist.java Mon May 04 16:30:07 2015 +0200
@@ -33,7 +33,7 @@
* @run main ArchiveDoesNotExist
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import java.io.File;
public class ArchiveDoesNotExist {
--- a/hotspot/test/runtime/SharedArchiveFile/CdsDifferentObjectAlignment.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/SharedArchiveFile/CdsDifferentObjectAlignment.java Mon May 04 16:30:07 2015 +0200
@@ -34,7 +34,7 @@
* java.management
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class CdsDifferentObjectAlignment {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/runtime/SharedArchiveFile/CdsSameObjectAlignment.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/SharedArchiveFile/CdsSameObjectAlignment.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* java.management
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class CdsSameObjectAlignment {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/runtime/SharedArchiveFile/DefaultUseWithClient.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/SharedArchiveFile/DefaultUseWithClient.java Mon May 04 16:30:07 2015 +0200
@@ -31,7 +31,7 @@
* @bug 8032224
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import java.io.File;
public class DefaultUseWithClient {
--- a/hotspot/test/runtime/SharedArchiveFile/DumpSymbolAndStringTable.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/SharedArchiveFile/DumpSymbolAndStringTable.java Mon May 04 16:30:07 2015 +0200
@@ -31,7 +31,7 @@
* @run main/othervm -XX:+UnlockDiagnosticVMOptions DumpSymbolAndStringTable
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class DumpSymbolAndStringTable {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/runtime/SharedArchiveFile/LimitSharedSizes.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/SharedArchiveFile/LimitSharedSizes.java Mon May 04 16:30:07 2015 +0200
@@ -29,7 +29,7 @@
* @run main LimitSharedSizes
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class LimitSharedSizes {
static enum Region {
--- a/hotspot/test/runtime/SharedArchiveFile/MaxMetaspaceSize.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/SharedArchiveFile/MaxMetaspaceSize.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* java.management
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class MaxMetaspaceSize {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/runtime/SharedArchiveFile/PrintSharedArchiveAndExit.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/SharedArchiveFile/PrintSharedArchiveAndExit.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* java.management
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class PrintSharedArchiveAndExit {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/runtime/SharedArchiveFile/SharedArchiveFile.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/SharedArchiveFile/SharedArchiveFile.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* java.management
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class SharedArchiveFile {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/runtime/SharedArchiveFile/SharedBaseAddress.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/SharedArchiveFile/SharedBaseAddress.java Mon May 04 16:30:07 2015 +0200
@@ -31,7 +31,7 @@
* @run main SharedBaseAddress
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class SharedBaseAddress {
--- a/hotspot/test/runtime/SharedArchiveFile/SharedSymbolTableBucketSize.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/SharedArchiveFile/SharedSymbolTableBucketSize.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* java.management
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class SharedSymbolTableBucketSize {
public static void main(String[] args) throws Exception {
--- a/hotspot/test/runtime/SharedArchiveFile/SpaceUtilizationCheck.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/SharedArchiveFile/SpaceUtilizationCheck.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* @run main SpaceUtilizationCheck
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import java.util.regex.Pattern;
import java.util.regex.Matcher;
--- a/hotspot/test/runtime/Thread/Fibonacci.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/Thread/Fibonacci.java Mon May 04 16:30:07 2015 +0200
@@ -32,7 +32,7 @@
* @run main Fibonacci 15
*/
-import com.oracle.java.testlibrary.Asserts;
+import jdk.test.lib.Asserts;
public class Fibonacci extends Thread {
private int index;
--- a/hotspot/test/runtime/Thread/TestThreadDumpMonitorContention.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/Thread/TestThreadDumpMonitorContention.java Mon May 04 16:30:07 2015 +0200
@@ -43,7 +43,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class TestThreadDumpMonitorContention {
// jstack tends to be closely bound to the VM that we are running
--- a/hotspot/test/runtime/Thread/ThreadPriorities.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/Thread/ThreadPriorities.java Mon May 04 16:30:07 2015 +0200
@@ -38,8 +38,8 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import com.oracle.java.testlibrary.*;
-import static com.oracle.java.testlibrary.Asserts.*;
+import jdk.test.lib.*;
+import static jdk.test.lib.Asserts.*;
public class ThreadPriorities {
--- a/hotspot/test/runtime/Unsafe/AllocateInstance.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/Unsafe/AllocateInstance.java Mon May 04 16:30:07 2015 +0200
@@ -30,9 +30,9 @@
* @run main AllocateInstance
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.misc.Unsafe;
-import static com.oracle.java.testlibrary.Asserts.*;
+import static jdk.test.lib.Asserts.*;
public class AllocateInstance {
public static void main(String args[]) throws Exception {
--- a/hotspot/test/runtime/Unsafe/AllocateMemory.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/Unsafe/AllocateMemory.java Mon May 04 16:30:07 2015 +0200
@@ -30,9 +30,9 @@
* @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:MallocMaxTestWords=100m AllocateMemory
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.misc.Unsafe;
-import static com.oracle.java.testlibrary.Asserts.*;
+import static jdk.test.lib.Asserts.*;
public class AllocateMemory {
public static void main(String args[]) throws Exception {
--- a/hotspot/test/runtime/Unsafe/CopyMemory.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/Unsafe/CopyMemory.java Mon May 04 16:30:07 2015 +0200
@@ -30,9 +30,9 @@
* @run main CopyMemory
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.misc.Unsafe;
-import static com.oracle.java.testlibrary.Asserts.*;
+import static jdk.test.lib.Asserts.*;
public class CopyMemory {
final static int LENGTH = 8;
--- a/hotspot/test/runtime/Unsafe/DefineClass.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/Unsafe/DefineClass.java Mon May 04 16:30:07 2015 +0200
@@ -33,9 +33,9 @@
import java.security.ProtectionDomain;
import java.io.InputStream;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.misc.Unsafe;
-import static com.oracle.java.testlibrary.Asserts.*;
+import static jdk.test.lib.Asserts.*;
public class DefineClass {
public static void main(String args[]) throws Exception {
--- a/hotspot/test/runtime/Unsafe/FieldOffset.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/Unsafe/FieldOffset.java Mon May 04 16:30:07 2015 +0200
@@ -31,10 +31,10 @@
*/
import java.lang.reflect.Field;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.misc.Unsafe;
import java.lang.reflect.*;
-import static com.oracle.java.testlibrary.Asserts.*;
+import static jdk.test.lib.Asserts.*;
public class FieldOffset {
public static void main(String args[]) throws Exception {
--- a/hotspot/test/runtime/Unsafe/GetField.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/Unsafe/GetField.java Mon May 04 16:30:07 2015 +0200
@@ -30,10 +30,10 @@
* @run main GetField
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.misc.Unsafe;
import java.lang.reflect.*;
-import static com.oracle.java.testlibrary.Asserts.*;
+import static jdk.test.lib.Asserts.*;
public class GetField {
public static void main(String args[]) throws Exception {
--- a/hotspot/test/runtime/Unsafe/GetKlassPointerGetJavaMirror.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/Unsafe/GetKlassPointerGetJavaMirror.java Mon May 04 16:30:07 2015 +0200
@@ -25,12 +25,13 @@
* @bug 8022853
* @library /testlibrary
* @modules java.base/sun.misc
+ * @build jdk.test.lib.*
* @run main GetKlassPointerGetJavaMirror
*/
-import static com.oracle.java.testlibrary.Asserts.*;
+import static jdk.test.lib.Asserts.*;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.misc.Unsafe;
public class GetKlassPointerGetJavaMirror {
--- a/hotspot/test/runtime/Unsafe/GetPutAddress.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/Unsafe/GetPutAddress.java Mon May 04 16:30:07 2015 +0200
@@ -30,9 +30,9 @@
* @run main GetPutAddress
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.misc.Unsafe;
-import static com.oracle.java.testlibrary.Asserts.*;
+import static jdk.test.lib.Asserts.*;
public class GetPutAddress {
public static void main(String args[]) throws Exception {
--- a/hotspot/test/runtime/Unsafe/GetPutBoolean.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/Unsafe/GetPutBoolean.java Mon May 04 16:30:07 2015 +0200
@@ -31,9 +31,9 @@
*/
import java.lang.reflect.Field;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.misc.Unsafe;
-import static com.oracle.java.testlibrary.Asserts.*;
+import static jdk.test.lib.Asserts.*;
public class GetPutBoolean {
public static void main(String args[]) throws Exception {
--- a/hotspot/test/runtime/Unsafe/GetPutByte.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/Unsafe/GetPutByte.java Mon May 04 16:30:07 2015 +0200
@@ -31,9 +31,9 @@
*/
import java.lang.reflect.Field;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.misc.Unsafe;
-import static com.oracle.java.testlibrary.Asserts.*;
+import static jdk.test.lib.Asserts.*;
public class GetPutByte {
public static void main(String args[]) throws Exception {
--- a/hotspot/test/runtime/Unsafe/GetPutChar.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/Unsafe/GetPutChar.java Mon May 04 16:30:07 2015 +0200
@@ -31,9 +31,9 @@
*/
import java.lang.reflect.Field;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.misc.Unsafe;
-import static com.oracle.java.testlibrary.Asserts.*;
+import static jdk.test.lib.Asserts.*;
public class GetPutChar {
public static void main(String args[]) throws Exception {
--- a/hotspot/test/runtime/Unsafe/GetPutDouble.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/Unsafe/GetPutDouble.java Mon May 04 16:30:07 2015 +0200
@@ -31,9 +31,9 @@
*/
import java.lang.reflect.Field;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.misc.Unsafe;
-import static com.oracle.java.testlibrary.Asserts.*;
+import static jdk.test.lib.Asserts.*;
public class GetPutDouble {
public static void main(String args[]) throws Exception {
--- a/hotspot/test/runtime/Unsafe/GetPutFloat.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/Unsafe/GetPutFloat.java Mon May 04 16:30:07 2015 +0200
@@ -31,9 +31,9 @@
*/
import java.lang.reflect.Field;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.misc.Unsafe;
-import static com.oracle.java.testlibrary.Asserts.*;
+import static jdk.test.lib.Asserts.*;
public class GetPutFloat {
public static void main(String args[]) throws Exception {
--- a/hotspot/test/runtime/Unsafe/GetPutInt.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/Unsafe/GetPutInt.java Mon May 04 16:30:07 2015 +0200
@@ -30,9 +30,9 @@
*/
import java.lang.reflect.Field;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.misc.Unsafe;
-import static com.oracle.java.testlibrary.Asserts.*;
+import static jdk.test.lib.Asserts.*;
public class GetPutInt {
public static void main(String args[]) throws Exception {
--- a/hotspot/test/runtime/Unsafe/GetPutLong.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/Unsafe/GetPutLong.java Mon May 04 16:30:07 2015 +0200
@@ -31,9 +31,9 @@
*/
import java.lang.reflect.Field;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.misc.Unsafe;
-import static com.oracle.java.testlibrary.Asserts.*;
+import static jdk.test.lib.Asserts.*;
public class GetPutLong {
public static void main(String args[]) throws Exception {
--- a/hotspot/test/runtime/Unsafe/GetPutObject.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/Unsafe/GetPutObject.java Mon May 04 16:30:07 2015 +0200
@@ -31,9 +31,9 @@
*/
import java.lang.reflect.Field;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.misc.Unsafe;
-import static com.oracle.java.testlibrary.Asserts.*;
+import static jdk.test.lib.Asserts.*;
public class GetPutObject {
public static void main(String args[]) throws Exception {
--- a/hotspot/test/runtime/Unsafe/GetPutShort.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/Unsafe/GetPutShort.java Mon May 04 16:30:07 2015 +0200
@@ -31,9 +31,9 @@
*/
import java.lang.reflect.Field;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.misc.Unsafe;
-import static com.oracle.java.testlibrary.Asserts.*;
+import static jdk.test.lib.Asserts.*;
public class GetPutShort {
public static void main(String args[]) throws Exception {
--- a/hotspot/test/runtime/Unsafe/GetUncompressedObject.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/Unsafe/GetUncompressedObject.java Mon May 04 16:30:07 2015 +0200
@@ -25,12 +25,13 @@
* @bug 8022853
* @library /testlibrary
* @modules java.base/sun.misc
+ * @build jdk.test.lib.*
* @run main GetUncompressedObject
*/
-import static com.oracle.java.testlibrary.Asserts.*;
+import static jdk.test.lib.Asserts.*;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.misc.Unsafe;
public class GetUncompressedObject {
--- a/hotspot/test/runtime/Unsafe/GetUnsafe.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/Unsafe/GetUnsafe.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
*/
import sun.misc.Unsafe;
-import static com.oracle.java.testlibrary.Asserts.*;
+import static jdk.test.lib.Asserts.*;
public class GetUnsafe {
public static void main(String args[]) throws Exception {
--- a/hotspot/test/runtime/Unsafe/PageSize.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/Unsafe/PageSize.java Mon May 04 16:30:07 2015 +0200
@@ -31,9 +31,9 @@
*/
import java.lang.reflect.Field;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.misc.Unsafe;
-import static com.oracle.java.testlibrary.Asserts.*;
+import static jdk.test.lib.Asserts.*;
public class PageSize {
public static void main(String args[]) throws Exception {
--- a/hotspot/test/runtime/Unsafe/RangeCheck.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/Unsafe/RangeCheck.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* java.management
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.misc.Unsafe;
public class RangeCheck {
--- a/hotspot/test/runtime/Unsafe/Reallocate.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/Unsafe/Reallocate.java Mon May 04 16:30:07 2015 +0200
@@ -30,9 +30,9 @@
* @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:MallocMaxTestWords=100m Reallocate
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.misc.Unsafe;
-import static com.oracle.java.testlibrary.Asserts.*;
+import static jdk.test.lib.Asserts.*;
public class Reallocate {
public static void main(String args[]) throws Exception {
--- a/hotspot/test/runtime/Unsafe/SetMemory.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/Unsafe/SetMemory.java Mon May 04 16:30:07 2015 +0200
@@ -30,9 +30,9 @@
* @run main SetMemory
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.misc.Unsafe;
-import static com.oracle.java.testlibrary.Asserts.*;
+import static jdk.test.lib.Asserts.*;
public class SetMemory {
public static void main(String args[]) throws Exception {
--- a/hotspot/test/runtime/Unsafe/ThrowException.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/Unsafe/ThrowException.java Mon May 04 16:30:07 2015 +0200
@@ -30,9 +30,9 @@
* @run main ThrowException
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.misc.Unsafe;
-import static com.oracle.java.testlibrary.Asserts.*;
+import static jdk.test.lib.Asserts.*;
public class ThrowException {
public static void main(String args[]) throws Exception {
--- a/hotspot/test/runtime/XCheckJniJsig/XCheckJSig.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/XCheckJniJsig/XCheckJSig.java Mon May 04 16:30:07 2015 +0200
@@ -33,7 +33,7 @@
import java.io.File;
import java.util.Map;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class XCheckJSig {
public static void main(String args[]) throws Throwable {
--- a/hotspot/test/runtime/classFileParserBug/ClassFileParserBug.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/classFileParserBug/ClassFileParserBug.java Mon May 04 16:30:07 2015 +0200
@@ -32,7 +32,7 @@
*/
import java.io.File;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class ClassFileParserBug {
public static void main(String args[]) throws Throwable {
--- a/hotspot/test/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java Mon May 04 16:30:07 2015 +0200
@@ -33,7 +33,7 @@
*/
import java.io.File;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class TestEmptyBootstrapMethodsAttr {
--- a/hotspot/test/runtime/contended/Options.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/contended/Options.java Mon May 04 16:30:07 2015 +0200
@@ -21,7 +21,7 @@
* questions.
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
/*
* @test
--- a/hotspot/test/runtime/duplAttributes/DuplAttributesTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/duplAttributes/DuplAttributesTest.java Mon May 04 16:30:07 2015 +0200
@@ -32,7 +32,7 @@
*/
import java.io.File;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
public class DuplAttributesTest {
--- a/hotspot/test/runtime/memory/LargePages/TestLargePageSizeInBytes.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/memory/LargePages/TestLargePageSizeInBytes.java Mon May 04 16:30:07 2015 +0200
@@ -30,9 +30,9 @@
* @run driver TestLargePageSizeInBytes
*/
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.Platform;
-import com.oracle.java.testlibrary.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.Platform;
+import jdk.test.lib.ProcessTools;
public class TestLargePageSizeInBytes {
private static long M = 1024L * 1024L;
--- a/hotspot/test/runtime/memory/LargePages/TestLargePagesFlags.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/memory/LargePages/TestLargePagesFlags.java Mon May 04 16:30:07 2015 +0200
@@ -29,9 +29,9 @@
* @run main TestLargePagesFlags
*/
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.Platform;
-import com.oracle.java.testlibrary.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.Platform;
+import jdk.test.lib.ProcessTools;
import java.util.ArrayList;
public class TestLargePagesFlags {
--- a/hotspot/test/runtime/memory/ReadFromNoaccessArea.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/memory/ReadFromNoaccessArea.java Mon May 04 16:30:07 2015 +0200
@@ -33,7 +33,7 @@
* @run main ReadFromNoaccessArea
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.hotspot.WhiteBox;
public class ReadFromNoaccessArea {
--- a/hotspot/test/runtime/memory/ReadVMPageSize.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/memory/ReadVMPageSize.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -30,7 +30,7 @@
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI ReadVMPageSize
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.hotspot.WhiteBox;
public class ReadVMPageSize {
--- a/hotspot/test/runtime/memory/ReserveMemory.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/memory/ReserveMemory.java Mon May 04 16:30:07 2015 +0200
@@ -35,7 +35,7 @@
* @run main ReserveMemory
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.hotspot.WhiteBox;
--- a/hotspot/test/runtime/memory/RunUnitTestsConcurrently.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/memory/RunUnitTestsConcurrently.java Mon May 04 16:30:07 2015 +0200
@@ -33,7 +33,7 @@
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI RunUnitTestsConcurrently 30 15000
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.hotspot.WhiteBox;
public class RunUnitTestsConcurrently {
--- a/hotspot/test/runtime/verifier/OverriderMsg.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/verifier/OverriderMsg.java Mon May 04 16:30:07 2015 +0200
@@ -26,7 +26,7 @@
import jdk.internal.org.objectweb.asm.ClassWriter;
import jdk.internal.org.objectweb.asm.MethodVisitor;
import static jdk.internal.org.objectweb.asm.Opcodes.*;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
/*
* @test OverriderMsg
--- a/hotspot/test/runtime/verifier/TestANewArray.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/verifier/TestANewArray.java Mon May 04 16:30:07 2015 +0200
@@ -28,7 +28,7 @@
import jdk.internal.org.objectweb.asm.MethodVisitor;
import static jdk.internal.org.objectweb.asm.Opcodes.*;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
/*
* @test
--- a/hotspot/test/runtime/verifier/TestMultiANewArray.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/runtime/verifier/TestMultiANewArray.java Mon May 04 16:30:07 2015 +0200
@@ -26,7 +26,7 @@
import jdk.internal.org.objectweb.asm.ClassWriter;
import jdk.internal.org.objectweb.asm.MethodVisitor;
import static jdk.internal.org.objectweb.asm.Opcodes.*;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
/*
* @test TestMultiANewArray
--- a/hotspot/test/serviceability/attach/AttachSetGetFlag.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/serviceability/attach/AttachSetGetFlag.java Mon May 04 16:30:07 2015 +0200
@@ -31,7 +31,7 @@
* java.management
* jdk.attach/sun.tools.attach
* jdk.jvmstat/sun.jvmstat.monitor
- * @build com.oracle.java.testlibrary.* AttachSetGetFlag
+ * @build jdk.test.lib.* AttachSetGetFlag
* @run driver AttachSetGetFlag
*/
@@ -45,9 +45,9 @@
import sun.tools.attach.HotSpotVirtualMachine;
-import com.oracle.java.testlibrary.Asserts;
-import com.oracle.java.testlibrary.Platform;
-import com.oracle.java.testlibrary.ProcessTools;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.Platform;
+import jdk.test.lib.ProcessTools;
import com.sun.tools.attach.VirtualMachine;
public class AttachSetGetFlag {
--- a/hotspot/test/serviceability/attach/AttachWithStalePidFile.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/serviceability/attach/AttachWithStalePidFile.java Mon May 04 16:30:07 2015 +0200
@@ -27,11 +27,11 @@
* @key regression
* @summary Regression test for attach issue where stale pid files in /tmp lead to connection issues
* @library /testlibrary
- * @build com.oracle.java.testlibrary.* AttachWithStalePidFileTarget
+ * @build jdk.test.lib.* AttachWithStalePidFileTarget
* @run main AttachWithStalePidFile
*/
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import com.sun.tools.attach.VirtualMachine;
import sun.tools.attach.HotSpotVirtualMachine;
import java.lang.reflect.Field;
--- a/hotspot/test/serviceability/dcmd/compiler/CodeCacheTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/serviceability/dcmd/compiler/CodeCacheTest.java Mon May 04 16:30:07 2015 +0200
@@ -29,8 +29,8 @@
* java.compiler
* java.management
* jdk.jvmstat/sun.jvmstat.monitor
- * @build com.oracle.java.testlibrary.*
- * @build com.oracle.java.testlibrary.dcmd.*
+ * @build jdk.test.lib.*
+ * @build jdk.test.lib.dcmd.*
* @run testng/othervm -XX:+SegmentedCodeCache CodeCacheTest
* @run testng/othervm -XX:-SegmentedCodeCache CodeCacheTest
* @run testng/othervm -Xint -XX:+SegmentedCodeCache CodeCacheTest
@@ -40,9 +40,9 @@
import org.testng.annotations.Test;
import org.testng.Assert;
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.dcmd.CommandExecutor;
-import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.dcmd.CommandExecutor;
+import jdk.test.lib.dcmd.JMXExecutor;
import java.util.Iterator;
import java.util.regex.Matcher;
--- a/hotspot/test/serviceability/dcmd/compiler/CodelistTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/serviceability/dcmd/compiler/CodelistTest.java Mon May 04 16:30:07 2015 +0200
@@ -29,8 +29,8 @@
* java.compiler
* java.management
* jdk.jvmstat/sun.jvmstat.monitor
- * @build com.oracle.java.testlibrary.*
- * @build com.oracle.java.testlibrary.dcmd.*
+ * @build jdk.test.lib.*
+ * @build jdk.test.lib.dcmd.*
* @build MethodIdentifierParser
* @run testng CodelistTest
* @summary Test of diagnostic command Compiler.codelist
@@ -39,9 +39,9 @@
import org.testng.annotations.Test;
import org.testng.Assert;
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.dcmd.CommandExecutor;
-import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.dcmd.CommandExecutor;
+import jdk.test.lib.dcmd.JMXExecutor;
import java.lang.reflect.Method;
--- a/hotspot/test/serviceability/dcmd/compiler/CompilerQueueTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/serviceability/dcmd/compiler/CompilerQueueTest.java Mon May 04 16:30:07 2015 +0200
@@ -30,17 +30,17 @@
* java.management
* jdk.jvmstat/sun.jvmstat.monitor
* @ignore 8069160
- * @build com.oracle.java.testlibrary.*
- * @build com.oracle.java.testlibrary.dcmd.*
+ * @build jdk.test.lib.*
+ * @build jdk.test.lib.dcmd.*
* @run testng CompilerQueueTest
* @run testng/othervm -XX:-TieredCompilation CompilerQueueTest
* @run testng/othervm -Xint CompilerQueueTest
* @summary Test of diagnostic command Compiler.queue
*/
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.dcmd.CommandExecutor;
-import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.dcmd.CommandExecutor;
+import jdk.test.lib.dcmd.JMXExecutor;
import org.testng.annotations.Test;
import java.util.Iterator;
--- a/hotspot/test/serviceability/dcmd/framework/HelpTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/serviceability/dcmd/framework/HelpTest.java Mon May 04 16:30:07 2015 +0200
@@ -21,12 +21,12 @@
* questions.
*/
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.dcmd.CommandExecutor;
-import com.oracle.java.testlibrary.dcmd.PidJcmdExecutor;
-import com.oracle.java.testlibrary.dcmd.MainClassJcmdExecutor;
-import com.oracle.java.testlibrary.dcmd.FileJcmdExecutor;
-import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.dcmd.CommandExecutor;
+import jdk.test.lib.dcmd.PidJcmdExecutor;
+import jdk.test.lib.dcmd.MainClassJcmdExecutor;
+import jdk.test.lib.dcmd.FileJcmdExecutor;
+import jdk.test.lib.dcmd.JMXExecutor;
import org.testng.annotations.Test;
/*
@@ -38,8 +38,8 @@
* java.management
* jdk.jvmstat/sun.jvmstat.monitor
* @ignore 8072440
- * @build com.oracle.java.testlibrary.*
- * @build com.oracle.java.testlibrary.dcmd.*
+ * @build jdk.test.lib.*
+ * @build jdk.test.lib.dcmd.*
* @run testng/othervm -XX:+UsePerfData HelpTest
*/
public class HelpTest {
--- a/hotspot/test/serviceability/dcmd/framework/InvalidCommandTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/serviceability/dcmd/framework/InvalidCommandTest.java Mon May 04 16:30:07 2015 +0200
@@ -21,12 +21,12 @@
* questions.
*/
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.dcmd.CommandExecutor;
-import com.oracle.java.testlibrary.dcmd.PidJcmdExecutor;
-import com.oracle.java.testlibrary.dcmd.MainClassJcmdExecutor;
-import com.oracle.java.testlibrary.dcmd.FileJcmdExecutor;
-import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.dcmd.CommandExecutor;
+import jdk.test.lib.dcmd.PidJcmdExecutor;
+import jdk.test.lib.dcmd.MainClassJcmdExecutor;
+import jdk.test.lib.dcmd.FileJcmdExecutor;
+import jdk.test.lib.dcmd.JMXExecutor;
import org.testng.annotations.Test;
/*
@@ -38,8 +38,8 @@
* java.management
* jdk.jvmstat/sun.jvmstat.monitor
* @ignore 8072440
- * @build com.oracle.java.testlibrary.*
- * @build com.oracle.java.testlibrary.dcmd.*
+ * @build jdk.test.lib.*
+ * @build jdk.test.lib.dcmd.*
* @run testng/othervm -XX:+UsePerfData InvalidCommandTest
*/
public class InvalidCommandTest {
--- a/hotspot/test/serviceability/dcmd/framework/VMVersionTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/serviceability/dcmd/framework/VMVersionTest.java Mon May 04 16:30:07 2015 +0200
@@ -21,12 +21,12 @@
* questions.
*/
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.dcmd.CommandExecutor;
-import com.oracle.java.testlibrary.dcmd.PidJcmdExecutor;
-import com.oracle.java.testlibrary.dcmd.MainClassJcmdExecutor;
-import com.oracle.java.testlibrary.dcmd.FileJcmdExecutor;
-import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.dcmd.CommandExecutor;
+import jdk.test.lib.dcmd.PidJcmdExecutor;
+import jdk.test.lib.dcmd.MainClassJcmdExecutor;
+import jdk.test.lib.dcmd.FileJcmdExecutor;
+import jdk.test.lib.dcmd.JMXExecutor;
import org.testng.annotations.Test;
@@ -39,8 +39,8 @@
* java.management
* jdk.jvmstat/sun.jvmstat.monitor
* @ignore 8072440
- * @build com.oracle.java.testlibrary.*
- * @build com.oracle.java.testlibrary.dcmd.*
+ * @build jdk.test.lib.*
+ * @build jdk.test.lib.dcmd.*
* @run testng/othervm -XX:+UsePerfData VMVersionTest
*/
public class VMVersionTest {
--- a/hotspot/test/serviceability/dcmd/gc/ClassHistogramAllTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/serviceability/dcmd/gc/ClassHistogramAllTest.java Mon May 04 16:30:07 2015 +0200
@@ -29,8 +29,8 @@
* java.compiler
* java.management
* jdk.jvmstat/sun.jvmstat.monitor
- * @build com.oracle.java.testlibrary.*
- * @build com.oracle.java.testlibrary.dcmd.*
+ * @build jdk.test.lib.*
+ * @build jdk.test.lib.dcmd.*
* @build ClassHistogramTest
* @run testng ClassHistogramAllTest
*/
--- a/hotspot/test/serviceability/dcmd/gc/ClassHistogramTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/serviceability/dcmd/gc/ClassHistogramTest.java Mon May 04 16:30:07 2015 +0200
@@ -25,9 +25,9 @@
import java.util.regex.Pattern;
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.dcmd.CommandExecutor;
-import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.dcmd.CommandExecutor;
+import jdk.test.lib.dcmd.JMXExecutor;
/*
* @test
@@ -37,8 +37,8 @@
* java.compiler
* java.management
* jdk.jvmstat/sun.jvmstat.monitor
- * @build com.oracle.java.testlibrary.*
- * @build com.oracle.java.testlibrary.dcmd.*
+ * @build jdk.test.lib.*
+ * @build jdk.test.lib.dcmd.*
* @run testng ClassHistogramTest
*/
public class ClassHistogramTest {
--- a/hotspot/test/serviceability/dcmd/gc/HeapDumpAllTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/serviceability/dcmd/gc/HeapDumpAllTest.java Mon May 04 16:30:07 2015 +0200
@@ -30,8 +30,8 @@
* java.compiler
* java.management
* jdk.jvmstat/sun.jvmstat.monitor
- * @build com.oracle.java.testlibrary.*
- * @build com.oracle.java.testlibrary.dcmd.*
+ * @build jdk.test.lib.*
+ * @build jdk.test.lib.dcmd.*
* @build jdk.test.lib.hprof.*
* @build jdk.test.lib.hprof.module.*
* @build jdk.test.lib.hprof.parser.*
--- a/hotspot/test/serviceability/dcmd/gc/HeapDumpTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/serviceability/dcmd/gc/HeapDumpTest.java Mon May 04 16:30:07 2015 +0200
@@ -32,10 +32,10 @@
import jdk.test.lib.hprof.HprofParser;
import jdk.test.lib.hprof.model.Snapshot;
-import com.oracle.java.testlibrary.JDKToolFinder;
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.dcmd.CommandExecutor;
-import com.oracle.java.testlibrary.dcmd.PidJcmdExecutor;
+import jdk.test.lib.JDKToolFinder;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.dcmd.CommandExecutor;
+import jdk.test.lib.dcmd.PidJcmdExecutor;
/*
* @test
@@ -46,8 +46,8 @@
* java.compiler
* java.management
* jdk.jvmstat/sun.jvmstat.monitor
- * @build com.oracle.java.testlibrary.*
- * @build com.oracle.java.testlibrary.dcmd.*
+ * @build jdk.test.lib.*
+ * @build jdk.test.lib.dcmd.*
* @build jdk.test.lib.hprof.*
* @build jdk.test.lib.hprof.module.*
* @build jdk.test.lib.hprof.parser.*
--- a/hotspot/test/serviceability/dcmd/gc/RunFinalizationTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/serviceability/dcmd/gc/RunFinalizationTest.java Mon May 04 16:30:07 2015 +0200
@@ -28,8 +28,8 @@
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;
-import com.oracle.java.testlibrary.dcmd.CommandExecutor;
-import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+import jdk.test.lib.dcmd.CommandExecutor;
+import jdk.test.lib.dcmd.JMXExecutor;
/*
* @test
@@ -39,8 +39,8 @@
* java.compiler
* java.management
* jdk.jvmstat/sun.jvmstat.monitor
- * @build com.oracle.java.testlibrary.*
- * @build com.oracle.java.testlibrary.dcmd.*
+ * @build jdk.test.lib.*
+ * @build jdk.test.lib.dcmd.*
* @run testng RunFinalizationTest
*/
public class RunFinalizationTest {
--- a/hotspot/test/serviceability/dcmd/gc/RunGCTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/serviceability/dcmd/gc/RunGCTest.java Mon May 04 16:30:07 2015 +0200
@@ -29,9 +29,9 @@
import java.nio.file.Path;
import java.nio.file.Paths;
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.dcmd.CommandExecutor;
-import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.dcmd.CommandExecutor;
+import jdk.test.lib.dcmd.JMXExecutor;
/*
* @test
@@ -41,8 +41,8 @@
* java.compiler
* java.management
* jdk.jvmstat/sun.jvmstat.monitor
- * @build com.oracle.java.testlibrary.*
- * @build com.oracle.java.testlibrary.dcmd.*
+ * @build jdk.test.lib.*
+ * @build jdk.test.lib.dcmd.*
* @run testng/othervm -XX:+PrintGCDetails -Xloggc:RunGC.gclog -XX:-ExplicitGCInvokesConcurrent RunGCTest
*/
public class RunGCTest {
--- a/hotspot/test/serviceability/dcmd/jvmti/DataDumpDcmdTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/serviceability/dcmd/jvmti/DataDumpDcmdTest.java Mon May 04 16:30:07 2015 +0200
@@ -21,10 +21,10 @@
* questions.
*/
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.dcmd.CommandExecutor;
-import com.oracle.java.testlibrary.dcmd.JMXExecutor;
-import com.oracle.java.testlibrary.dcmd.PidJcmdExecutor;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.dcmd.CommandExecutor;
+import jdk.test.lib.dcmd.JMXExecutor;
+import jdk.test.lib.dcmd.PidJcmdExecutor;
import org.testng.annotations.Test;
/*
@@ -32,7 +32,7 @@
* @bug 8054890
* @summary Test of JVMTI.data_dump diagnostic command
* @library /testlibrary
- * @build com.oracle.java.testlibrary.*
+ * @build jdk.test.lib.*
* @run testng DataDumpDcmdTest
*/
@@ -57,4 +57,4 @@
public void cli() throws Throwable {
run(new PidJcmdExecutor());
}
-}
\ No newline at end of file
+}
--- a/hotspot/test/serviceability/dcmd/thread/PrintConcurrentLocksTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/serviceability/dcmd/thread/PrintConcurrentLocksTest.java Mon May 04 16:30:07 2015 +0200
@@ -29,8 +29,8 @@
* java.compiler
* java.management
* jdk.jvmstat/sun.jvmstat.monitor
- * @build com.oracle.java.testlibrary.*
- * @build com.oracle.java.testlibrary.dcmd.*
+ * @build jdk.test.lib.*
+ * @build jdk.test.lib.dcmd.*
* @build PrintTest
* @run testng PrintConcurrentLocksTest
*/
--- a/hotspot/test/serviceability/dcmd/thread/PrintTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/serviceability/dcmd/thread/PrintTest.java Mon May 04 16:30:07 2015 +0200
@@ -24,10 +24,10 @@
import org.testng.annotations.Test;
import org.testng.Assert;
-import com.oracle.java.testlibrary.OutputAnalyzer;
+import jdk.test.lib.OutputAnalyzer;
-import com.oracle.java.testlibrary.dcmd.CommandExecutor;
-import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+import jdk.test.lib.dcmd.CommandExecutor;
+import jdk.test.lib.dcmd.JMXExecutor;
import java.util.concurrent.BrokenBarrierException;
import java.util.concurrent.CyclicBarrier;
@@ -42,8 +42,8 @@
* java.compiler
* java.management
* jdk.jvmstat/sun.jvmstat.monitor
- * @build com.oracle.java.testlibrary.*
- * @build com.oracle.java.testlibrary.dcmd.*
+ * @build jdk.test.lib.*
+ * @build jdk.test.lib.dcmd.*
* @run testng PrintTest
*/
public class PrintTest {
@@ -149,8 +149,8 @@
* at java.lang.Object.wait(Object.java:502)
* at java.lang.UNIXProcess.waitFor(UNIXProcess.java:397)
* - locked <0x000000071a70ad98> (a java.lang.UNIXProcess)
- * at com.oracle.java.testlibrary.dcmd.JcmdExecutor.executeImpl(JcmdExecutor.java:32)
- * at com.oracle.java.testlibrary.dcmd.CommandExecutor.execute(CommandExecutor.java:24)
+ * at jdk.test.lib.dcmd.JcmdExecutor.executeImpl(JcmdExecutor.java:32)
+ * at jdk.test.lib.dcmd.CommandExecutor.execute(CommandExecutor.java:24)
* --> at Print.run(Print.java:74)
* at Print.file(Print.java:112)
* ...
--- a/hotspot/test/serviceability/dcmd/vm/ClassHierarchyTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/serviceability/dcmd/vm/ClassHierarchyTest.java Mon May 04 16:30:07 2015 +0200
@@ -29,17 +29,17 @@
* java.compiler
* java.management
* jdk.jvmstat/sun.jvmstat.monitor
- * @build com.oracle.java.testlibrary.*
- * @build com.oracle.java.testlibrary.dcmd.*
+ * @build jdk.test.lib.*
+ * @build jdk.test.lib.dcmd.*
* @run testng ClassHierarchyTest
*/
import org.testng.annotations.Test;
import org.testng.Assert;
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.dcmd.CommandExecutor;
-import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.dcmd.CommandExecutor;
+import jdk.test.lib.dcmd.JMXExecutor;
import java.io.File;
import java.io.FileInputStream;
--- a/hotspot/test/serviceability/dcmd/vm/ClassLoaderStatsTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/serviceability/dcmd/vm/ClassLoaderStatsTest.java Mon May 04 16:30:07 2015 +0200
@@ -29,17 +29,17 @@
* java.compiler
* java.management
* jdk.jvmstat/sun.jvmstat.monitor
- * @build com.oracle.java.testlibrary.*
- * @build com.oracle.java.testlibrary.dcmd.*
+ * @build jdk.test.lib.*
+ * @build jdk.test.lib.dcmd.*
* @run testng ClassLoaderStatsTest
*/
import org.testng.annotations.Test;
import org.testng.Assert;
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.dcmd.CommandExecutor;
-import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.dcmd.CommandExecutor;
+import jdk.test.lib.dcmd.JMXExecutor;
import java.io.File;
import java.io.FileInputStream;
--- a/hotspot/test/serviceability/dcmd/vm/CommandLineTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/serviceability/dcmd/vm/CommandLineTest.java Mon May 04 16:30:07 2015 +0200
@@ -21,11 +21,11 @@
* questions.
*/
-import com.oracle.java.testlibrary.OutputAnalyzer;
+import jdk.test.lib.OutputAnalyzer;
import org.testng.annotations.Test;
-import com.oracle.java.testlibrary.dcmd.CommandExecutor;
-import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+import jdk.test.lib.dcmd.CommandExecutor;
+import jdk.test.lib.dcmd.JMXExecutor;
/*
* @test
@@ -35,8 +35,8 @@
* java.compiler
* java.management
* jdk.jvmstat/sun.jvmstat.monitor
- * @build com.oracle.java.testlibrary.*
- * @build com.oracle.java.testlibrary.dcmd.*
+ * @build jdk.test.lib.*
+ * @build jdk.test.lib.dcmd.*
* @run testng/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+ThereShouldNotBeAnyVMOptionNamedLikeThis CommandLineTest
*/
public class CommandLineTest {
--- a/hotspot/test/serviceability/dcmd/vm/DynLibsTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/serviceability/dcmd/vm/DynLibsTest.java Mon May 04 16:30:07 2015 +0200
@@ -1,10 +1,10 @@
import org.testng.annotations.Test;
import org.testng.Assert;
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.Platform;
-import com.oracle.java.testlibrary.dcmd.CommandExecutor;
-import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.Platform;
+import jdk.test.lib.dcmd.CommandExecutor;
+import jdk.test.lib.dcmd.JMXExecutor;
/*
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
@@ -37,8 +37,8 @@
* java.compiler
* java.management
* jdk.jvmstat/sun.jvmstat.monitor
- * @build com.oracle.java.testlibrary.*
- * @build com.oracle.java.testlibrary.dcmd.*
+ * @build jdk.test.lib.*
+ * @build jdk.test.lib.dcmd.*
* @run testng DynLibsTest
*/
--- a/hotspot/test/serviceability/dcmd/vm/FlagsTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/serviceability/dcmd/vm/FlagsTest.java Mon May 04 16:30:07 2015 +0200
@@ -21,9 +21,9 @@
* questions.
*/
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.dcmd.CommandExecutor;
-import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.dcmd.CommandExecutor;
+import jdk.test.lib.dcmd.JMXExecutor;
import org.testng.annotations.Test;
/*
@@ -34,8 +34,8 @@
* java.compiler
* java.management
* jdk.jvmstat/sun.jvmstat.monitor
- * @build com.oracle.java.testlibrary.*
- * @build com.oracle.java.testlibrary.dcmd.*
+ * @build jdk.test.lib.*
+ * @build jdk.test.lib.dcmd.*
* @run testng/othervm -Xmx129m -XX:+PrintGC -XX:+UnlockDiagnosticVMOptions -XX:+IgnoreUnrecognizedVMOptions -XX:+ThereShouldNotBeAnyVMOptionNamedLikeThis_Right -XX:-TieredCompilation FlagsTest
*/
public class FlagsTest {
--- a/hotspot/test/serviceability/dcmd/vm/SetVMFlagTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/serviceability/dcmd/vm/SetVMFlagTest.java Mon May 04 16:30:07 2015 +0200
@@ -21,9 +21,9 @@
* questions.
*/
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.dcmd.CommandExecutor;
-import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.dcmd.CommandExecutor;
+import jdk.test.lib.dcmd.JMXExecutor;
import org.testng.annotations.Test;
import static org.testng.Assert.*;
@@ -32,8 +32,8 @@
* @bug 8054890
* @summary Test of VM.set_flag diagnostic command
* @library /testlibrary
- * @build com.oracle.java.testlibrary.*
- * @build com.oracle.java.testlibrary.dcmd.*
+ * @build jdk.test.lib.*
+ * @build jdk.test.lib.dcmd.*
* @run testng SetVMFlagTest
*/
@@ -139,4 +139,4 @@
private OutputAnalyzer getAllFlags(CommandExecutor executor) {
return executor.execute("VM.flags -all", true);
}
-}
\ No newline at end of file
+}
--- a/hotspot/test/serviceability/dcmd/vm/SystemPropertiesTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/serviceability/dcmd/vm/SystemPropertiesTest.java Mon May 04 16:30:07 2015 +0200
@@ -23,9 +23,9 @@
import org.testng.annotations.Test;
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.dcmd.CommandExecutor;
-import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.dcmd.CommandExecutor;
+import jdk.test.lib.dcmd.JMXExecutor;
/*
* @test
@@ -35,8 +35,8 @@
* java.compiler
* java.management
* jdk.jvmstat/sun.jvmstat.monitor
- * @build com.oracle.java.testlibrary.*
- * @build com.oracle.java.testlibrary.dcmd.*
+ * @build jdk.test.lib.*
+ * @build jdk.test.lib.dcmd.*
* @run testng SystemPropertiesTest
*/
public class SystemPropertiesTest {
--- a/hotspot/test/serviceability/dcmd/vm/UptimeTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/serviceability/dcmd/vm/UptimeTest.java Mon May 04 16:30:07 2015 +0200
@@ -24,9 +24,9 @@
import org.testng.annotations.Test;
import org.testng.Assert;
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.dcmd.CommandExecutor;
-import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.dcmd.CommandExecutor;
+import jdk.test.lib.dcmd.JMXExecutor;
import java.text.NumberFormat;
import java.text.ParseException;
@@ -39,8 +39,8 @@
* java.compiler
* java.management
* jdk.jvmstat/sun.jvmstat.monitor
- * @build com.oracle.java.testlibrary.*
- * @build com.oracle.java.testlibrary.dcmd.*
+ * @build jdk.test.lib.*
+ * @build jdk.test.lib.dcmd.*
* @run testng UptimeTest
*/
public class UptimeTest {
--- a/hotspot/test/serviceability/jvmti/GetObjectSizeOverflow.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/serviceability/jvmti/GetObjectSizeOverflow.java Mon May 04 16:30:07 2015 +0200
@@ -21,7 +21,7 @@
* questions.
*/
import java.io.PrintWriter;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
/*
* Test to verify GetObjectSize does not overflow on a 600M element int[]
@@ -34,7 +34,7 @@
* java.instrument
* java.management
* jdk.jvmstat/sun.jvmstat.monitor
- * @build ClassFileInstaller com.oracle.java.testlibrary.* GetObjectSizeOverflowAgent
+ * @build ClassFileInstaller jdk.test.lib.* GetObjectSizeOverflowAgent
* @run main ClassFileInstaller GetObjectSizeOverflowAgent
* @run main GetObjectSizeOverflow
*/
--- a/hotspot/test/serviceability/jvmti/TestLambdaFormRetransformation.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/serviceability/jvmti/TestLambdaFormRetransformation.java Mon May 04 16:30:07 2015 +0200
@@ -46,9 +46,9 @@
import java.security.ProtectionDomain;
import java.util.Arrays;
-import com.oracle.java.testlibrary.ExitCode;
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.ProcessTools;
+import jdk.test.lib.ExitCode;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
public class TestLambdaFormRetransformation {
private static String MANIFEST = String.format("Manifest-Version: 1.0\n" +
--- a/hotspot/test/serviceability/jvmti/TestRedefineWithUnresolvedClass.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/serviceability/jvmti/TestRedefineWithUnresolvedClass.java Mon May 04 16:30:07 2015 +0200
@@ -32,15 +32,15 @@
* java.management
* jdk.jartool/sun.tools.jar
* jdk.jvmstat/sun.jvmstat.monitor
- * @build com.oracle.java.testlibrary.* UnresolvedClassAgent
+ * @build jdk.test.lib.* UnresolvedClassAgent
* @run main TestRedefineWithUnresolvedClass
*/
import java.io.File;
import java.util.Arrays;
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
public class TestRedefineWithUnresolvedClass {
--- a/hotspot/test/serviceability/sa/jmap-hashcode/Test8028623.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/serviceability/sa/jmap-hashcode/Test8028623.java Mon May 04 16:30:07 2015 +0200
@@ -30,15 +30,15 @@
* java.compiler
* java.management
* jdk.jvmstat/sun.jvmstat.monitor
- * @build com.oracle.java.testlibrary.*
+ * @build jdk.test.lib.*
* @compile -encoding utf8 Test8028623.java
* @run main Test8028623
*/
-import com.oracle.java.testlibrary.JDKToolLauncher;
-import com.oracle.java.testlibrary.OutputBuffer;
-import com.oracle.java.testlibrary.Platform;
-import com.oracle.java.testlibrary.ProcessTools;
+import jdk.test.lib.JDKToolLauncher;
+import jdk.test.lib.OutputBuffer;
+import jdk.test.lib.Platform;
+import jdk.test.lib.ProcessTools;
import java.io.File;
--- a/hotspot/test/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java Mon May 04 16:30:07 2015 +0200
@@ -31,12 +31,12 @@
import java.util.Arrays;
import java.util.Scanner;
-import com.oracle.java.testlibrary.Asserts;
-import com.oracle.java.testlibrary.JDKToolFinder;
-import com.oracle.java.testlibrary.JDKToolLauncher;
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.Platform;
-import com.oracle.java.testlibrary.ProcessTools;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.JDKToolFinder;
+import jdk.test.lib.JDKToolLauncher;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.Platform;
+import jdk.test.lib.ProcessTools;
/*
* @test
@@ -48,7 +48,7 @@
* java.compiler
* java.management/sun.management
* jdk.jvmstat/sun.jvmstat.monitor
- * @build com.oracle.java.testlibrary.* JMapHProfLargeHeapProc
+ * @build jdk.test.lib.* JMapHProfLargeHeapProc
* @run main JMapHProfLargeHeapTest
*/
--- a/hotspot/test/serviceability/threads/TestFalseDeadLock.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/serviceability/threads/TestFalseDeadLock.java Mon May 04 16:30:07 2015 +0200
@@ -21,7 +21,7 @@
* questions.
*/
-import com.oracle.java.testlibrary.Utils;
+import jdk.test.lib.Utils;
import java.lang.management.ManagementFactory;
import java.lang.management.ThreadMXBean;
import java.util.Random;
--- a/hotspot/test/testlibrary/RedefineClassHelper.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/testlibrary/RedefineClassHelper.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -23,7 +23,7 @@
import java.io.PrintWriter;
import java.lang.instrument.*;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
/*
* Helper class to write tests that redefine classes.
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/Asserts.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,451 +0,0 @@
-/*
- * Copyright (c) 2013, 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 com.oracle.java.testlibrary;
-
-/**
- * Asserts that can be used for verifying assumptions in tests.
- *
- * An assertion will throw a {@link RuntimeException} if the assertion isn't
- * valid. All the asserts can be imported into a test by using a static
- * import:
- *
- * <pre>
- * {@code
- * import static com.oracle.java.testlibrary.Asserts.*;
- * }
- *
- * Always provide a message describing the assumption if the line number of the
- * failing assertion isn't enough to understand why the assumption failed. For
- * example, if the assertion is in a loop or in a method that is called
- * multiple times, then the line number won't provide enough context to
- * understand the failure.
- * </pre>
- */
-public class Asserts {
-
- /**
- * Shorthand for {@link #assertLessThan(T, T)}.
- *
- * @see #assertLessThan(T, T)
- */
- public static <T extends Comparable<T>> void assertLT(T lhs, T rhs) {
- assertLessThan(lhs, rhs);
- }
-
- /**
- * Shorthand for {@link #assertLessThan(T, T, String)}.
- *
- * @see #assertLessThan(T, T, String)
- */
- public static <T extends Comparable<T>> void assertLT(T lhs, T rhs, String msg) {
- assertLessThan(lhs, rhs, msg);
- }
-
- /**
- * Calls {@link #assertLessThan(T, T, String)} with a default message.
- *
- * @see #assertLessThan(T, T, String)
- */
- public static <T extends Comparable<T>> void assertLessThan(T lhs, T rhs) {
- assertLessThan(lhs, rhs, null);
- }
-
- /**
- * Asserts that {@code lhs} is less than {@code rhs}.
- *
- * @param lhs The left hand side of the comparison.
- * @param rhs The right hand side of the comparison.
- * @param msg A description of the assumption.
- * @throws RuntimeException if the assertion isn't valid.
- */
- public static <T extends Comparable<T>>void assertLessThan(T lhs, T rhs, String msg) {
- assertTrue(compare(lhs, rhs, msg) < 0, getMessage(lhs, rhs, "<", msg));
- }
-
- /**
- * Shorthand for {@link #assertLessThanOrEqual(T, T)}.
- *
- * @see #assertLessThanOrEqual(T, T)
- */
- public static <T extends Comparable<T>> void assertLTE(T lhs, T rhs) {
- assertLessThanOrEqual(lhs, rhs);
- }
-
- /**
- * Shorthand for {@link #assertLessThanOrEqual(T, T, String)}.
- *
- * @see #assertLessThanOrEqual(T, T, String)
- */
- public static <T extends Comparable<T>> void assertLTE(T lhs, T rhs, String msg) {
- assertLessThanOrEqual(lhs, rhs, msg);
- }
-
- /**
- * Calls {@link #assertLessThanOrEqual(T, T, String)} with a default message.
- *
- * @see #assertLessThanOrEqual(T, T, String)
- */
- public static <T extends Comparable<T>> void assertLessThanOrEqual(T lhs, T rhs) {
- assertLessThanOrEqual(lhs, rhs, null);
- }
-
- /**
- * Asserts that {@code lhs} is less than or equal to {@code rhs}.
- *
- * @param lhs The left hand side of the comparison.
- * @param rhs The right hand side of the comparison.
- * @param msg A description of the assumption.
- * @throws RuntimeException if the assertion isn't valid.
- */
- public static <T extends Comparable<T>> void assertLessThanOrEqual(T lhs, T rhs, String msg) {
- assertTrue(compare(lhs, rhs, msg) <= 0, getMessage(lhs, rhs, "<=", msg));
- }
-
- /**
- * Shorthand for {@link #assertEquals(T, T)}.
- *
- * @see #assertEquals(T, T)
- */
- public static void assertEQ(Object lhs, Object rhs) {
- assertEquals(lhs, rhs);
- }
-
- /**
- * Shorthand for {@link #assertEquals(T, T, String)}.
- *
- * @see #assertEquals(T, T, String)
- */
- public static void assertEQ(Object lhs, Object rhs, String msg) {
- assertEquals(lhs, rhs, msg);
- }
-
- /**
- * Calls {@link #assertEquals(T, T, String)} with a default message.
- *
- * @see #assertEquals(T, T, String)
- */
- public static void assertEquals(Object lhs, Object rhs) {
- assertEquals(lhs, rhs, null);
- }
-
- /**
- * Asserts that {@code lhs} is equal to {@code rhs}.
- *
- * @param lhs The left hand side of the comparison.
- * @param rhs The right hand side of the comparison.
- * @param msg A description of the assumption.
- * @throws RuntimeException if the assertion isn't valid.
- */
- public static void assertEquals(Object lhs, Object rhs, String msg) {
- if (lhs == null) {
- if (rhs != null) {
- error(msg);
- }
- } else {
- assertTrue(lhs.equals(rhs), getMessage(lhs, rhs, "==", msg));
- }
- }
-
- /**
- * Shorthand for {@link #assertGreaterThanOrEqual(T, T)}.
- *
- * @see #assertGreaterThanOrEqual(T, T)
- */
- public static <T extends Comparable<T>> void assertGTE(T lhs, T rhs) {
- assertGreaterThanOrEqual(lhs, rhs);
- }
-
- /**
- * Shorthand for {@link #assertGreaterThanOrEqual(T, T, String)}.
- *
- * @see #assertGreaterThanOrEqual(T, T, String)
- */
- public static <T extends Comparable<T>> void assertGTE(T lhs, T rhs, String msg) {
- assertGreaterThanOrEqual(lhs, rhs, msg);
- }
-
- /**
- * Calls {@link #assertGreaterThanOrEqual(T, T, String)} with a default message.
- *
- * @see #assertGreaterThanOrEqual(T, T, String)
- */
- public static <T extends Comparable<T>> void assertGreaterThanOrEqual(T lhs, T rhs) {
- assertGreaterThanOrEqual(lhs, rhs, null);
- }
-
- /**
- * Asserts that {@code lhs} is greater than or equal to {@code rhs}.
- *
- * @param lhs The left hand side of the comparison.
- * @param rhs The right hand side of the comparison.
- * @param msg A description of the assumption.
- * @throws RuntimeException if the assertion isn't valid.
- */
- public static <T extends Comparable<T>> void assertGreaterThanOrEqual(T lhs, T rhs, String msg) {
- assertTrue(compare(lhs, rhs, msg) >= 0, getMessage(lhs, rhs, ">=", msg));
- }
-
- /**
- * Shorthand for {@link #assertGreaterThan(T, T)}.
- *
- * @see #assertGreaterThan(T, T)
- */
- public static <T extends Comparable<T>> void assertGT(T lhs, T rhs) {
- assertGreaterThan(lhs, rhs);
- }
-
- /**
- * Shorthand for {@link #assertGreaterThan(T, T, String)}.
- *
- * @see #assertGreaterThan(T, T, String)
- */
- public static <T extends Comparable<T>> void assertGT(T lhs, T rhs, String msg) {
- assertGreaterThan(lhs, rhs, msg);
- }
-
- /**
- * Calls {@link #assertGreaterThan(T, T, String)} with a default message.
- *
- * @see #assertGreaterThan(T, T, String)
- */
- public static <T extends Comparable<T>> void assertGreaterThan(T lhs, T rhs) {
- assertGreaterThan(lhs, rhs, null);
- }
-
- /**
- * Asserts that {@code lhs} is greater than {@code rhs}.
- *
- * @param lhs The left hand side of the comparison.
- * @param rhs The right hand side of the comparison.
- * @param msg A description of the assumption.
- * @throws RuntimeException if the assertion isn't valid.
- */
- public static <T extends Comparable<T>> void assertGreaterThan(T lhs, T rhs, String msg) {
- assertTrue(compare(lhs, rhs, msg) > 0, getMessage(lhs, rhs, ">", msg));
- }
-
- /**
- * Shorthand for {@link #assertNotEquals(T, T)}.
- *
- * @see #assertNotEquals(T, T)
- */
- public static void assertNE(Object lhs, Object rhs) {
- assertNotEquals(lhs, rhs);
- }
-
- /**
- * Shorthand for {@link #assertNotEquals(T, T, String)}.
- *
- * @see #assertNotEquals(T, T, String)
- */
- public static void assertNE(Object lhs, Object rhs, String msg) {
- assertNotEquals(lhs, rhs, msg);
- }
-
- /**
- * Calls {@link #assertNotEquals(T, T, String)} with a default message.
- *
- * @see #assertNotEquals(T, T, String)
- */
- public static void assertNotEquals(Object lhs, Object rhs) {
- assertNotEquals(lhs, rhs, null);
- }
-
- /**
- * Asserts that {@code lhs} is not equal to {@code rhs}.
- *
- * @param lhs The left hand side of the comparison.
- * @param rhs The right hand side of the comparison.
- * @param msg A description of the assumption.
- * @throws RuntimeException if the assertion isn't valid.
- */
- public static void assertNotEquals(Object lhs, Object rhs, String msg) {
- if (lhs == null) {
- if (rhs == null) {
- error(msg);
- }
- } else {
- assertFalse(lhs.equals(rhs), getMessage(lhs, rhs,"!=", msg));
- }
- }
-
- /**
- * Calls {@link #assertNull(Object, String)} with a default message.
- *
- * @see #assertNull(Object, String)
- */
- public static void assertNull(Object o) {
- assertNull(o, "Expected " + format(o) + " to be null");
- }
-
- /**
- * Asserts that {@code o} is null.
- *
- * @param o The reference assumed to be null.
- * @param msg A description of the assumption.
- * @throws RuntimeException if the assertion isn't valid.
- */
- public static void assertNull(Object o, String msg) {
- assertEquals(o, null, msg);
- }
-
- /**
- * Calls {@link #assertNotNull(Object, String)} with a default message.
- *
- * @see #assertNotNull(Object, String)
- */
- public static void assertNotNull(Object o) {
- assertNotNull(o, "Expected non null reference");
- }
-
- /**
- * Asserts that {@code o} is <i>not</i> null.
- *
- * @param o The reference assumed <i>not</i> to be null,
- * @param msg A description of the assumption.
- * @throws RuntimeException if the assertion isn't valid.
- */
- public static void assertNotNull(Object o, String msg) {
- assertNotEquals(o, null, msg);
- }
-
- /**
- * Calls {@link #assertFalse(boolean, String)} with a default message.
- *
- * @see #assertFalse(boolean, String)
- */
- public static void assertFalse(boolean value) {
- assertFalse(value, "Expected value to be false");
- }
-
- /**
- * Asserts that {@code value} is {@code false}.
- *
- * @param value The value assumed to be false.
- * @param msg A description of the assumption.
- * @throws RuntimeException if the assertion isn't valid.
- */
- public static void assertFalse(boolean value, String msg) {
- assertTrue(!value, msg);
- }
-
- /**
- * Calls {@link #assertTrue(boolean, String)} with a default message.
- *
- * @see #assertTrue(boolean, String)
- */
- public static void assertTrue(boolean value) {
- assertTrue(value, "Expected value to be true");
- }
-
- /**
- * Asserts that {@code value} is {@code true}.
- *
- * @param value The value assumed to be true.
- * @param msg A description of the assumption.
- * @throws RuntimeException if the assertion isn't valid.
- */
- public static void assertTrue(boolean value, String msg) {
- if (!value) {
- error(msg);
- }
- }
-
- /**
- * Asserts that two strings are equal.
- *
- * If strings are not equals, then exception message
- * will contain {@code msg} followed by list of mismatched lines.
- *
- * @param str1 First string to compare.
- * @param str2 Second string to compare.
- * @param msg A description of the assumption.
- * @throws RuntimeException if strings are not equal.
- */
- public static void assertStringsEqual(String str1, String str2,
- String msg) {
- String lineSeparator = System.getProperty("line.separator");
- String str1Lines[] = str1.split(lineSeparator);
- String str2Lines[] = str2.split(lineSeparator);
-
- int minLength = Math.min(str1Lines.length, str2Lines.length);
- String longestStringLines[] = ((str1Lines.length == minLength) ?
- str2Lines : str1Lines);
-
- boolean stringsAreDifferent = false;
-
- StringBuilder messageBuilder = new StringBuilder(msg);
-
- messageBuilder.append("\n");
-
- for (int line = 0; line < minLength; line++) {
- if (!str1Lines[line].equals(str2Lines[line])) {
- messageBuilder.append(String.
- format("[line %d] '%s' differs " +
- "from '%s'\n",
- line,
- str1Lines[line],
- str2Lines[line]));
- stringsAreDifferent = true;
- }
- }
-
- if (minLength < longestStringLines.length) {
- String stringName = ((longestStringLines == str1Lines) ?
- "first" : "second");
- messageBuilder.append(String.format("Only %s string contains " +
- "following lines:\n",
- stringName));
- stringsAreDifferent = true;
- for(int line = minLength; line < longestStringLines.length; line++) {
- messageBuilder.append(String.
- format("[line %d] '%s'", line,
- longestStringLines[line]));
- }
- }
-
- if (stringsAreDifferent) {
- error(messageBuilder.toString());
- }
- }
-
- private static <T extends Comparable<T>> int compare(T lhs, T rhs, String msg) {
- assertNotNull(lhs, msg);
- assertNotNull(rhs, msg);
- return lhs.compareTo(rhs);
- }
-
- private static String format(Object o) {
- return o == null? "null" : o.toString();
- }
-
- private static void error(String msg) {
- throw new RuntimeException(msg);
- }
-
- private static String getMessage(Object lhs, Object rhs, String op, String msg) {
- return (msg == null ? "" : msg + " ") + "(assert failed: " + format(lhs) + " " + op + " " + format(rhs) + ")";
- }
-}
-
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/BuildHelper.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2014, 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 com.oracle.java.testlibrary;
-
-import java.io.File;
-import java.io.FileReader;
-import java.util.Properties;
-
-public class BuildHelper {
-
- /**
- * Commercial builds should have the BUILD_TYPE set to commercial
- * within the release file, found at the root of the JDK.
- */
- public static boolean isCommercialBuild() throws Exception {
- String buildType = getReleaseProperty("BUILD_TYPE","notFound");
- return buildType.equals("commercial");
- }
-
-
- /**
- * Return the value for property key, or defaultValue if no property not found.
- * If present, double quotes are trimmed.
- */
- public static String getReleaseProperty(String key, String defaultValue) throws Exception {
- Properties properties = getReleaseProperties();
- String value = properties.getProperty(key, defaultValue);
- return trimDoubleQuotes(value);
- }
-
- /**
- * Return the value for property key, or null if no property not found.
- * If present, double quotes are trimmed.
- */
- public static String getReleaseProperty(String key) throws Exception {
- return getReleaseProperty(key, null);
- }
-
- /**
- * Get properties from the release file
- */
- public static Properties getReleaseProperties() throws Exception {
- Properties properties = new Properties();
- properties.load(new FileReader(getReleaseFile()));
- return properties;
- }
-
- /**
- * Every JDK has a release file in its root.
- * @return A handler to the release file.
- */
- public static File getReleaseFile() throws Exception {
- String jdkPath = getJDKRoot();
- File releaseFile = new File(jdkPath,"release");
- if ( ! releaseFile.canRead() ) {
- throw new Exception("Release file is not readable, or it is absent: " +
- releaseFile.getCanonicalPath());
- }
- return releaseFile;
- }
-
- /**
- * Returns path to the JDK under test.
- * This path is obtained through the test.jdk property, usually set by JTREG.
- */
- public static String getJDKRoot() {
- String jdkPath = System.getProperty("test.jdk");
- if (jdkPath == null) {
- throw new RuntimeException("System property 'test.jdk' not set. This property is normally set by jtreg. "
- + "When running test separately, set this property using '-Dtest.jdk=/path/to/jdk'.");
- }
- return jdkPath;
- }
-
- /**
- * Trim double quotes from the beginning and the end of the given string.
- * @param original string to trim.
- * @return a new trimmed string.
- */
- public static String trimDoubleQuotes(String original) {
- if (original == null) { return null; }
- String trimmed = original.replaceAll("^\"+|\"+$", "");
- return trimmed;
- }
-}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/ByteCodeLoader.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2013, 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 com.oracle.java.testlibrary;
-
-import java.security.SecureClassLoader;
-
-/**
- * {@code ByteCodeLoader} can be used for easy loading of byte code already
- * present in memory.
- *
- * {@code InMemoryCompiler} can be used for compiling source code in a string
- * into byte code, which then can be loaded with {@code ByteCodeLoader}.
- *
- * @see InMemoryCompiler
- */
-public class ByteCodeLoader extends SecureClassLoader {
- private final String className;
- private final byte[] byteCode;
- private volatile Class<?> holder;
-
- /**
- * Creates a new {@code ByteCodeLoader} ready to load a class with the
- * given name and the given byte code.
- *
- * @param className The name of the class
- * @param byteCode The byte code of the class
- */
- public ByteCodeLoader(String className, byte[] byteCode) {
- this.className = className;
- this.byteCode = byteCode;
- }
-
- @Override
- public Class<?> loadClass(String name) throws ClassNotFoundException {
- if (!name.equals(className)) {
- return super.loadClass(name);
- }
- if (holder == null) {
- synchronized(this) {
- if (holder == null) {
- holder = findClass(name);
- }
- }
- }
- return holder;
- }
-
- @Override
- protected Class<?> findClass(String name) throws ClassNotFoundException {
- if (!name.equals(className)) {
- throw new ClassNotFoundException(name);
- }
-
- return defineClass(name, byteCode, 0, byteCode.length);
- }
-
- /**
- * Utility method for creating a new {@code ByteCodeLoader} and then
- * directly load the given byte code.
- *
- * @param className The name of the class
- * @param byteCode The byte code for the class
- * @throws ClassNotFoundException if the class can't be loaded
- * @return A {@see Class} object representing the class
- */
- public static Class<?> load(String className, byte[] byteCode) throws ClassNotFoundException {
- return new ByteCodeLoader(className, byteCode).loadClass(className);
- }
-}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/DynamicVMOption.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,165 +0,0 @@
-/*
- * Copyright (c) 2014, 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 com.oracle.java.testlibrary;
-
-import com.sun.management.HotSpotDiagnosticMXBean;
-import java.lang.management.ManagementFactory;
-
-/**
- * A utility class to work with VM options which could be altered during
- * execution.
- *
- * This class is a wrapper around {@code com.sun.management.VMOption}.
- * It provides more convenient interface to read/write the values.
- *
- */
-public class DynamicVMOption {
-
- private final HotSpotDiagnosticMXBean mxBean;
-
- /**
- * VM option name, like "MinHeapFreeRatio".
- */
- public final String name;
-
- /**
- * Creates an instance of DynamicVMOption.
- *
- * @param name the VM option name
- */
- public DynamicVMOption(String name) {
- this.name = name;
- mxBean = ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class);
- }
-
- /**
- * Sets a new value for the option.
- * Trying to set not applicable value will cause IllegalArgumentException.
- * Behavior with null is undefined, most likely NPE will be thrown.
- *
- * @param newValue the value to be set
- * @see #getValue()
- * @throws IllegalArgumentException if newValue is not applicable to the option
- */
- public final void setValue(String newValue) {
- mxBean.setVMOption(name, newValue);
- }
-
- /**
- * Returns the value of option.
- *
- * @return the current option value
- * @see #setValue(java.lang.String)
- */
- public final String getValue() {
- return mxBean.getVMOption(name).getValue();
- }
-
- /**
- * Returns true, if option is writable, false otherwise.
- *
- * @return true, if option is writable, false otherwise
- */
- public final boolean isWriteable() {
- return mxBean.getVMOption(name).isWriteable();
- }
-
- /**
- * Checks if the given value is applicable for the option.
- *
- * This method tries to set the option to the new value. If no exception
- * has been thrown the value is treated as valid.
- *
- * Calling this method will not change the option value. After an attempt
- * to set a new value, the option will be restored to its previous value.
- *
- * @param value the value to verify
- * @return true if option could be set to the given value
- */
- public boolean isValidValue(String value) {
- boolean isValid = true;
- String oldValue = getValue();
- try {
- setValue(value);
- } catch (NullPointerException e) {
- if (value == null) {
- isValid = false;
- }
- } catch (IllegalArgumentException e) {
- isValid = false;
- } finally {
- setValue(oldValue);
- }
- return isValid;
- }
-
- /**
- * Returns the value of the given VM option as String.
- *
- * This is a simple shortcut for {@code new DynamicVMOption(name).getValue()}
- *
- * @param name the name of VM option
- * @return value as a string
- * @see #getValue()
- */
- public static String getString(String name) {
- return new DynamicVMOption(name).getValue();
- }
-
- /**
- * Returns the value of the given option as int.
- *
- * @param name the name of VM option
- * @return value parsed as integer
- * @see #getString(java.lang.String)
- *
- */
- public static int getInt(String name) {
- return Integer.parseInt(getString(name));
- }
-
- /**
- * Sets the VM option to a new value.
- *
- * This is a simple shortcut for {@code new DynamicVMOption(name).setValue(value)}
- *
- * @param name the name of VM option
- * @param value the value to be set
- * @see #setValue(java.lang.String)
- */
- public static void setString(String name, String value) {
- new DynamicVMOption(name).setValue(value);
- }
-
- /**
- * Sets the VM option value to a new integer value.
- *
- * @param name the name of VM option
- * @param value the integer value to be set
- * @see #setString(java.lang.String, java.lang.String)
- */
- public static void setInt(String name, int value) {
- new DynamicVMOption(name).setValue(Integer.toString(value));
- }
-
-}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/ExitCode.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2014, 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 com.oracle.java.testlibrary;
-
-/**
- * Exit code values that could be returned by the JVM.
- */
-public enum ExitCode {
- OK(0),
- FAIL(1),
- CRASH(134);
-
- public final int value;
-
- ExitCode(int value) {
- this.value = value;
- }
-}
-
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/InMemoryJavaCompiler.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,154 +0,0 @@
-/*
- * Copyright (c) 2013, 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 com.oracle.java.testlibrary;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-
-import java.net.URI;
-import java.util.Arrays;
-
-import javax.tools.ForwardingJavaFileManager;
-import javax.tools.ForwardingJavaFileManager;
-import javax.tools.FileObject;
-import javax.tools.JavaCompiler;
-import javax.tools.JavaCompiler.CompilationTask;
-import javax.tools.JavaFileManager;
-import javax.tools.JavaFileObject;
-import javax.tools.JavaFileObject.Kind;
-import javax.tools.SimpleJavaFileObject;
-import javax.tools.ToolProvider;
-
-/**
- * {@code InMemoryJavaCompiler} can be used for compiling a {@link
- * CharSequence} to a {@code byte[]}.
- *
- * The compiler will not use the file system at all, instead using a {@link
- * ByteArrayOutputStream} for storing the byte code. For the source code, any
- * kind of {@link CharSequence} can be used, e.g. {@link String}, {@link
- * StringBuffer} or {@link StringBuilder}.
- *
- * The {@code InMemoryCompiler} can easily be used together with a {@code
- * ByteClassLoader} to easily compile and load source code in a {@link String}:
- *
- * <pre>
- * {@code
- * import com.oracle.java.testlibrary.InMemoryJavaCompiler;
- * import com.oracle.java.testlibrary.ByteClassLoader;
- *
- * class Example {
- * public static void main(String[] args) {
- * String className = "Foo";
- * String sourceCode = "public class " + className + " {" +
- * " public void bar() {" +
- * " System.out.println("Hello from bar!");" +
- * " }" +
- * "}";
- * byte[] byteCode = InMemoryJavaCompiler.compile(className, sourceCode);
- * Class fooClass = ByteClassLoader.load(className, byteCode);
- * }
- * }
- * }
- * </pre>
- */
-public class InMemoryJavaCompiler {
- private static class MemoryJavaFileObject extends SimpleJavaFileObject {
- private final String className;
- private final CharSequence sourceCode;
- private final ByteArrayOutputStream byteCode;
-
- public MemoryJavaFileObject(String className, CharSequence sourceCode) {
- super(URI.create("string:///" + className.replace('.','/') + Kind.SOURCE.extension), Kind.SOURCE);
- this.className = className;
- this.sourceCode = sourceCode;
- this.byteCode = new ByteArrayOutputStream();
- }
-
- @Override
- public CharSequence getCharContent(boolean ignoreEncodingErrors) {
- return sourceCode;
- }
-
- @Override
- public OutputStream openOutputStream() throws IOException {
- return byteCode;
- }
-
- public byte[] getByteCode() {
- return byteCode.toByteArray();
- }
-
- public String getClassName() {
- return className;
- }
- }
-
- private static class FileManagerWrapper extends ForwardingJavaFileManager {
- private MemoryJavaFileObject file;
-
- public FileManagerWrapper(MemoryJavaFileObject file) {
- super(getCompiler().getStandardFileManager(null, null, null));
- this.file = file;
- }
-
- @Override
- public JavaFileObject getJavaFileForOutput(Location location, String className,
- Kind kind, FileObject sibling)
- throws IOException {
- if (!file.getClassName().equals(className)) {
- throw new IOException("Expected class with name " + file.getClassName() +
- ", but got " + className);
- }
- return file;
- }
- }
-
- /**
- * Compiles the class with the given name and source code.
- *
- * @param className The name of the class
- * @param sourceCode The source code for the class with name {@code className}
- * @throws RuntimeException if the compilation did not succeed
- * @return The resulting byte code from the compilation
- */
- public static byte[] compile(String className, CharSequence sourceCode) {
- MemoryJavaFileObject file = new MemoryJavaFileObject(className, sourceCode);
- CompilationTask task = getCompilationTask(file);
-
- if(!task.call()) {
- throw new RuntimeException("Could not compile " + className + " with source code " + sourceCode);
- }
-
- return file.getByteCode();
- }
-
- private static JavaCompiler getCompiler() {
- return ToolProvider.getSystemJavaCompiler();
- }
-
- private static CompilationTask getCompilationTask(MemoryJavaFileObject file) {
- return getCompiler().getTask(null, new FileManagerWrapper(file), null, null, null, Arrays.asList(file));
- }
-}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/InfiniteLoop.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2014, 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 com.oracle.java.testlibrary;
-
-import java.util.Objects;
-
-/**
- * Class which runs another Runnable in infinite loop with certain pauses
- * between cycles.
- */
-public class InfiniteLoop implements Runnable {
- private final Runnable target;
- private final long mills;
-
-
- /**
- * @param target a target to run in a loop
- * @param mills the length of pause time in milliseconds
- * @throws NullPointerException if target is null
- * @throws IllegalArgumentException if the value of millis is negative
- */
- public InfiniteLoop(Runnable target, long mills) {
- Objects.requireNonNull(target);
- if (mills < 0) {
- throw new IllegalArgumentException("mills < 0");
- }
- this.target = target;
- this.mills = mills;
- }
-
- @Override
- public void run() {
- try {
- while (true) {
- target.run();
- if (mills > 0) {
- Thread.sleep(mills);
- }
- }
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- throw new Error(e);
- }
- }
-}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/InputArguments.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2013, 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 com.oracle.java.testlibrary;
-
-import java.lang.management.RuntimeMXBean;
-import java.lang.management.ManagementFactory;
-import java.util.List;
-
-/**
- * This class provides access to the input arguments to the VM.
- */
-public class InputArguments {
- private static final List<String> args;
-
- static {
- RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean();
- args = runtimeMxBean.getInputArguments();
- }
-
- /**
- * Returns true if {@code arg} is an input argument to the VM.
- *
- * This is useful for checking boolean flags such as -XX:+UseSerialGC or
- * -XX:-UsePerfData.
- *
- * @param arg The name of the argument.
- * @return {@code true} if the given argument is an input argument,
- * otherwise {@code false}.
- */
- public static boolean contains(String arg) {
- return args.contains(arg);
- }
-
- /**
- * Returns true if {@code prefix} is the start of an input argument to the
- * VM.
- *
- * This is useful for checking if flags describing a quantity, such as
- * -XX:+MaxMetaspaceSize=100m, is set without having to know the quantity.
- * To check if the flag -XX:MaxMetaspaceSize is set, use
- * {@code InputArguments.containsPrefix("-XX:MaxMetaspaceSize")}.
- *
- * @param prefix The start of the argument.
- * @return {@code true} if the given argument is the start of an input
- * argument, otherwise {@code false}.
- */
- public static boolean containsPrefix(String prefix) {
- for (String arg : args) {
- if (arg.startsWith(prefix)) {
- return true;
- }
- }
- return false;
- }
-}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/JDKToolFinder.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2013, 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 com.oracle.java.testlibrary;
-
-import java.io.FileNotFoundException;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-
-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 + (Platform.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();
- }
-}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/JDKToolLauncher.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,134 +0,0 @@
-/*
- * Copyright (c) 2013, 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 com.oracle.java.testlibrary;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-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("-XX:+PrintGC");
- * .addVMArg("-XX:+PrintGCDetails")
- * .addToolArg("-heap")
- * .addToolArg(pid);
- * ProcessBuilder pb = new ProcessBuilder(jmap.getCommand());
- * Process p = pb.start();
- * }
- * </pre>
- */
-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);
- }
- vmArgs.addAll(Arrays.asList(ProcessTools.getPlatformSpecificVMArgs()));
- }
-
- /**
- * 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()]);
- }
-}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/OutputAnalyzer.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,436 +0,0 @@
-/*
- * Copyright (c) 2013, 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 com.oracle.java.testlibrary;
-
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public final class OutputAnalyzer {
-
- private final String stdout;
- private final String stderr;
- private final int exitValue;
-
- /**
- * Create an OutputAnalyzer, a utility class for verifying output and exit
- * value from a Process
- *
- * @param process Process to analyze
- * @throws IOException If an I/O error occurs.
- */
- public OutputAnalyzer(Process process) throws IOException {
- OutputBuffer output = ProcessTools.getOutput(process);
- exitValue = process.exitValue();
- this.stdout = output.getStdout();
- this.stderr = output.getStderr();
- }
-
- /**
- * Create an OutputAnalyzer, a utility class for verifying output
- *
- * @param buf String buffer to analyze
- */
- public OutputAnalyzer(String buf) {
- this(buf, buf);
- }
-
- /**
- * Create an OutputAnalyzer, a utility class for verifying output
- *
- * @param stdout stdout buffer to analyze
- * @param stderr stderr buffer to analyze
- */
- public OutputAnalyzer(String stdout, String stderr) {
- this.stdout = stdout;
- this.stderr = stderr;
- exitValue = -1;
- }
-
- /**
- * Verify that the stdout contents of output buffer is empty
- *
- * @throws RuntimeException
- * If stdout was not empty
- */
- public void stdoutShouldBeEmpty() {
- if (!getStdout().isEmpty()) {
- reportDiagnosticSummary();
- throw new RuntimeException("stdout was not empty");
- }
- }
-
- /**
- * Verify that the stderr contents of output buffer is empty
- *
- * @throws RuntimeException
- * If stderr was not empty
- */
- public void stderrShouldBeEmpty() {
- if (!getStderr().isEmpty()) {
- reportDiagnosticSummary();
- throw new RuntimeException("stderr was not empty");
- }
- }
-
- /**
- * Verify that the stdout contents of output buffer is not empty
- *
- * @throws RuntimeException
- * If stdout was empty
- */
- public void stdoutShouldNotBeEmpty() {
- if (getStdout().isEmpty()) {
- reportDiagnosticSummary();
- throw new RuntimeException("stdout was empty");
- }
- }
-
- /**
- * Verify that the stderr contents of output buffer is not empty
- *
- * @throws RuntimeException
- * If stderr was empty
- */
- public void stderrShouldNotBeEmpty() {
- if (getStderr().isEmpty()) {
- reportDiagnosticSummary();
- throw new RuntimeException("stderr was empty");
- }
- }
-
- /**
- * Verify that the stdout and stderr contents of output buffer contains the string
- *
- * @param expectedString String that buffer should contain
- * @throws RuntimeException If the string was not found
- */
- public OutputAnalyzer shouldContain(String expectedString) {
- if (!stdout.contains(expectedString) && !stderr.contains(expectedString)) {
- reportDiagnosticSummary();
- throw new RuntimeException("'" + expectedString + "' missing from stdout/stderr \n");
- }
- return this;
- }
-
- /**
- * Verify that the stdout contents of output buffer contains the string
- *
- * @param expectedString String that buffer should contain
- * @throws RuntimeException If the string was not found
- */
- public OutputAnalyzer stdoutShouldContain(String expectedString) {
- if (!stdout.contains(expectedString)) {
- reportDiagnosticSummary();
- throw new RuntimeException("'" + expectedString + "' missing from stdout \n");
- }
- return this;
- }
-
- /**
- * Verify that the stderr contents of output buffer contains the string
- *
- * @param expectedString String that buffer should contain
- * @throws RuntimeException If the string was not found
- */
- public OutputAnalyzer stderrShouldContain(String expectedString) {
- if (!stderr.contains(expectedString)) {
- reportDiagnosticSummary();
- throw new RuntimeException("'" + expectedString + "' missing from stderr \n");
- }
- return this;
- }
-
- /**
- * Verify that the stdout and stderr contents of output buffer does not contain the string
- *
- * @param expectedString String that the buffer should not contain
- * @throws RuntimeException If the string was found
- */
- public OutputAnalyzer shouldNotContain(String notExpectedString) {
- if (stdout.contains(notExpectedString)) {
- reportDiagnosticSummary();
- throw new RuntimeException("'" + notExpectedString + "' found in stdout \n");
- }
- if (stderr.contains(notExpectedString)) {
- reportDiagnosticSummary();
- throw new RuntimeException("'" + notExpectedString + "' found in stderr \n");
- }
- return this;
- }
-
- /**
- * Verify that the stdout contents of output buffer does not contain the string
- *
- * @param expectedString String that the buffer should not contain
- * @throws RuntimeException If the string was found
- */
- public OutputAnalyzer stdoutShouldNotContain(String notExpectedString) {
- if (stdout.contains(notExpectedString)) {
- reportDiagnosticSummary();
- throw new RuntimeException("'" + notExpectedString + "' found in stdout \n");
- }
- return this;
- }
-
- /**
- * Verify that the stderr contents of output buffer does not contain the string
- *
- * @param expectedString String that the buffer should not contain
- * @throws RuntimeException If the string was found
- */
- public OutputAnalyzer stderrShouldNotContain(String notExpectedString) {
- if (stderr.contains(notExpectedString)) {
- reportDiagnosticSummary();
- throw new RuntimeException("'" + notExpectedString + "' found in stderr \n");
- }
- return this;
- }
-
- /**
- * Verify that the stdout and stderr contents of output buffer matches
- * the pattern
- *
- * @param pattern
- * @throws RuntimeException If the pattern was not found
- */
- public OutputAnalyzer shouldMatch(String pattern) {
- Matcher stdoutMatcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout);
- Matcher stderrMatcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
- if (!stdoutMatcher.find() && !stderrMatcher.find()) {
- reportDiagnosticSummary();
- throw new RuntimeException("'" + pattern
- + "' missing from stdout/stderr \n");
- }
- return this;
- }
-
- /**
- * Verify that the stdout contents of output buffer matches the
- * pattern
- *
- * @param pattern
- * @throws RuntimeException If the pattern was not found
- */
- public OutputAnalyzer stdoutShouldMatch(String pattern) {
- Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout);
- if (!matcher.find()) {
- reportDiagnosticSummary();
- throw new RuntimeException("'" + pattern
- + "' missing from stdout \n");
- }
- return this;
- }
-
- /**
- * Verify that the stderr contents of output buffer matches the
- * pattern
- *
- * @param pattern
- * @throws RuntimeException If the pattern was not found
- */
- public OutputAnalyzer stderrShouldMatch(String pattern) {
- Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
- if (!matcher.find()) {
- reportDiagnosticSummary();
- throw new RuntimeException("'" + pattern
- + "' missing from stderr \n");
- }
- return this;
- }
-
- /**
- * Verify that the stdout and stderr contents of output buffer does not
- * match the pattern
- *
- * @param pattern
- * @throws RuntimeException If the pattern was found
- */
- public OutputAnalyzer shouldNotMatch(String pattern) {
- Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout);
- if (matcher.find()) {
- reportDiagnosticSummary();
- throw new RuntimeException("'" + pattern
- + "' found in stdout: '" + matcher.group() + "' \n");
- }
- matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
- if (matcher.find()) {
- reportDiagnosticSummary();
- throw new RuntimeException("'" + pattern
- + "' found in stderr: '" + matcher.group() + "' \n");
- }
- return this;
- }
-
- /**
- * Verify that the stdout contents of output buffer does not match the
- * pattern
- *
- * @param pattern
- * @throws RuntimeException If the pattern was found
- */
- public OutputAnalyzer stdoutShouldNotMatch(String pattern) {
- Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout);
- if (matcher.find()) {
- reportDiagnosticSummary();
- throw new RuntimeException("'" + pattern
- + "' found in stdout \n");
- }
- return this;
- }
-
- /**
- * Verify that the stderr contents of output buffer does not match the
- * pattern
- *
- * @param pattern
- * @throws RuntimeException If the pattern was found
- */
- public OutputAnalyzer stderrShouldNotMatch(String pattern) {
- Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
- if (matcher.find()) {
- reportDiagnosticSummary();
- throw new RuntimeException("'" + pattern
- + "' found in stderr \n");
- }
- return this;
- }
-
- /**
- * Get the captured group of the first string matching the pattern.
- * stderr is searched before stdout.
- *
- * @param pattern The multi-line pattern to match
- * @param group The group to capture
- * @return The matched string or null if no match was found
- */
- public String firstMatch(String pattern, int group) {
- Matcher stderrMatcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
- Matcher stdoutMatcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout);
- if (stderrMatcher.find()) {
- return stderrMatcher.group(group);
- }
- if (stdoutMatcher.find()) {
- return stdoutMatcher.group(group);
- }
- return null;
- }
-
- /**
- * Get the first string matching the pattern.
- * stderr is searched before stdout.
- *
- * @param pattern The multi-line pattern to match
- * @return The matched string or null if no match was found
- */
- public String firstMatch(String pattern) {
- return firstMatch(pattern, 0);
- }
-
- /**
- * Verify the exit value of the process
- *
- * @param expectedExitValue Expected exit value from process
- * @throws RuntimeException If the exit value from the process did not match the expected value
- */
- public OutputAnalyzer shouldHaveExitValue(int expectedExitValue) {
- if (getExitValue() != expectedExitValue) {
- reportDiagnosticSummary();
- throw new RuntimeException("Expected to get exit value of ["
- + expectedExitValue + "]\n");
- }
- return this;
- }
-
-
- /**
- * Report summary that will help to diagnose the problem
- * Currently includes:
- * - standard input produced by the process under test
- * - standard output
- * - exit code
- * Note: the command line is printed by the ProcessTools
- */
- private void reportDiagnosticSummary() {
- String msg =
- " stdout: [" + stdout + "];\n" +
- " stderr: [" + stderr + "]\n" +
- " exitValue = " + getExitValue() + "\n";
-
- System.err.println(msg);
- }
-
-
- /**
- * Get the contents of the output buffer (stdout and stderr)
- *
- * @return Content of the output buffer
- */
- public String getOutput() {
- return stdout + stderr;
- }
-
- /**
- * Get the contents of the stdout buffer
- *
- * @return Content of the stdout buffer
- */
- public String getStdout() {
- return stdout;
- }
-
- /**
- * Get the contents of the stderr buffer
- *
- * @return Content of the stderr buffer
- */
- public String getStderr() {
- return stderr;
- }
-
- /**
- * Get the process exit value
- *
- * @return Process exit value
- */
- public int getExitValue() {
- return exitValue;
- }
-
- /**
- * Get the contents of the output buffer (stdout and stderr) as list of strings.
- * Output will be split by newlines.
- *
- * @return Contents of the output buffer as list of strings
- */
- public List<String> asLines() {
- return asLines(getOutput());
- }
-
- private List<String> asLines(String buffer) {
- return Arrays.asList(buffer.split("(\\r\\n|\\n|\\r)"));
- }
-}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/OutputBuffer.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2013, 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 com.oracle.java.testlibrary;
-
-public class OutputBuffer {
- private final String stdout;
- private final String stderr;
-
- /**
- * Create an OutputBuffer, a class for storing and managing stdout and stderr
- * results separately
- *
- * @param stdout stdout result
- * @param stderr stderr result
- */
- public OutputBuffer(String stdout, String stderr) {
- this.stdout = stdout;
- this.stderr = stderr;
- }
-
- /**
- * Returns the stdout result
- *
- * @return stdout result
- */
- public String getStdout() {
- return stdout;
- }
-
- /**
- * Returns the stderr result
- *
- * @return stderr result
- */
- public String getStderr() {
- return stderr;
- }
-}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/PerfCounter.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2013, 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 com.oracle.java.testlibrary;
-
-import sun.jvmstat.monitor.Monitor;
-
-/**
- * Represents a performance counter in the JVM.
- *
- * See http://openjdk.java.net/groups/hotspot/docs/Serviceability.html#bjvmstat
- * for more details about performance counters.
- */
-public class PerfCounter {
- private final Monitor monitor;
- private final String name;
-
- PerfCounter(Monitor monitor, String name) {
- this.monitor = monitor;
- this.name = name;
- }
-
- /**
- * Returns the value of this performance counter as a long.
- *
- * @return The long value of this performance counter
- * @throws RuntimeException If the value of the performance counter isn't a long
- */
- public long longValue() {
- Object value = monitor.getValue();
- if (value instanceof Long) {
- return ((Long) value).longValue();
- }
- throw new RuntimeException("Expected " + monitor.getName() + " to have a long value");
- }
-
- /**
- * Returns the name of the performance counter.
- *
- * @return The name of the performance counter.
- */
- public String getName() {
- return name;
- }
-
- @Override
- public String toString() {
- return name;
- }
-}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/PerfCounters.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2013, 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 com.oracle.java.testlibrary;
-
-import sun.jvmstat.monitor.Monitor;
-import sun.jvmstat.monitor.MonitorException;
-import sun.jvmstat.monitor.MonitoredHost;
-import sun.jvmstat.monitor.MonitoredVm;
-import sun.jvmstat.monitor.VmIdentifier;
-
-/**
- * PerfCounters can be used to get a performance counter from the currently
- * executing VM.
- *
- * Throws a runtime exception if an error occurs while communicating with the
- * currently executing VM.
- */
-public class PerfCounters {
- private final static MonitoredVm vm;
-
- static {
- try {
- String pid = Integer.toString(ProcessTools.getProcessId());
- VmIdentifier vmId = new VmIdentifier(pid);
- MonitoredHost host = MonitoredHost.getMonitoredHost(vmId);
- vm = host.getMonitoredVm(vmId);
- } catch (Exception e) {
- throw new RuntimeException("Could not connect to the VM");
- }
- }
-
- /**
- * Returns the performance counter with the given name.
- *
- * @param name The name of the performance counter.
- * @throws IllegalArgumentException If no counter with the given name exists.
- * @throws MonitorException If an error occurs while communicating with the VM.
- * @return The performance counter with the given name.
- */
- public static PerfCounter findByName(String name)
- throws MonitorException, IllegalArgumentException {
- Monitor m = vm.findByName(name);
- if (m == null) {
- throw new IllegalArgumentException("Did not find a performance counter with name " + name);
- }
- return new PerfCounter(m, name);
- }
-}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,199 +0,0 @@
-/*
- * Copyright (c) 2013, 2015, 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 com.oracle.java.testlibrary;
-
-import java.util.regex.Pattern;
-import com.oracle.java.testlibrary.Utils;
-
-public class Platform {
- private static final String osName = System.getProperty("os.name");
- private static final String dataModel = System.getProperty("sun.arch.data.model");
- private static final String vmVersion = System.getProperty("java.vm.version");
- private static final String javaVersion = System.getProperty("java.version");
- private static final String osArch = System.getProperty("os.arch");
- private static final String vmName = System.getProperty("java.vm.name");
- private static final String userName = System.getProperty("user.name");
- private static final String compiler = System.getProperty("sun.management.compiler");
-
- public static boolean isClient() {
- return vmName.endsWith(" Client VM");
- }
-
- public static boolean isServer() {
- return vmName.endsWith(" Server VM");
- }
-
- public static boolean isGraal() {
- return vmName.endsWith(" Graal VM");
- }
-
- public static boolean isZero() {
- return vmName.endsWith(" Zero VM");
- }
-
- public static boolean isMinimal() {
- return vmName.endsWith(" Minimal VM");
- }
-
- public static boolean isEmbedded() {
- return vmName.contains("Embedded");
- }
-
- public static boolean isTieredSupported() {
- return compiler.contains("Tiered Compilers");
- }
-
- public static boolean is32bit() {
- return dataModel.equals("32");
- }
-
- public static boolean is64bit() {
- return dataModel.equals("64");
- }
-
- public static boolean isAix() {
- return isOs("aix");
- }
-
- public static boolean isLinux() {
- return isOs("linux");
- }
-
- public static boolean isOSX() {
- return isOs("mac");
- }
-
- public static boolean isSolaris() {
- return isOs("sunos");
- }
-
- public static boolean isWindows() {
- return isOs("win");
- }
-
- private static boolean isOs(String osname) {
- return osName.toLowerCase().startsWith(osname.toLowerCase());
- }
-
- public static String getOsName() {
- return osName;
- }
-
- public static boolean isDebugBuild() {
- return (vmVersion.toLowerCase().contains("debug") ||
- javaVersion.toLowerCase().contains("debug"));
- }
-
- public static String getVMVersion() {
- return vmVersion;
- }
-
- // Returns true for sparc and sparcv9.
- public static boolean isSparc() {
- return isArch("sparc.*");
- }
-
- public static boolean isARM() {
- return isArch("arm.*");
- }
-
- public static boolean isPPC() {
- return isArch("ppc.*");
- }
-
- public static boolean isX86() {
- // On Linux it's 'i386', Windows 'x86' without '_64' suffix.
- return isArch("(i386)|(x86(?!_64))");
- }
-
- public static boolean isX64() {
- // On OSX it's 'x86_64' and on other (Linux, Windows and Solaris) platforms it's 'amd64'
- return isArch("(amd64)|(x86_64)");
- }
-
- private static boolean isArch(String archnameRE) {
- return Pattern.compile(archnameRE, Pattern.CASE_INSENSITIVE)
- .matcher(osArch)
- .matches();
- }
-
- public static String getOsArch() {
- return osArch;
- }
-
- /**
- * Return a boolean for whether we expect to be able to attach
- * the SA to our own processes on this system.
- */
- public static boolean shouldSAAttach() throws Exception {
-
- if (isAix()) {
- return false; // SA not implemented.
- } else if (isLinux()) {
- return canPtraceAttachLinux();
- } else if (isOSX()) {
- return canAttachOSX();
- } else {
- // Other platforms expected to work:
- return true;
- }
- }
-
- /**
- * On Linux, first check the SELinux boolean "deny_ptrace" and return false
- * as we expect to be denied if that is "1". Then expect permission to attach
- * if we are root, so return true. Then return false for an expected denial
- * if "ptrace_scope" is 1, and true otherwise.
- */
- public static boolean canPtraceAttachLinux() throws Exception {
-
- // SELinux deny_ptrace:
- String deny_ptrace = Utils.fileAsString("/sys/fs/selinux/booleans/deny_ptrace");
- if (deny_ptrace != null && deny_ptrace.contains("1")) {
- // ptrace will be denied:
- return false;
- }
-
- if (userName.equals("root")) {
- return true;
- }
-
- // ptrace_scope:
- String ptrace_scope = Utils.fileAsString("/proc/sys/kernel/yama/ptrace_scope");
- if (ptrace_scope != null && ptrace_scope.contains("1")) {
- // ptrace will be denied:
- return false;
- }
-
- // Otherwise expect to be permitted:
- return true;
- }
-
- /**
- * On OSX, expect permission to attach only if we are root.
- */
- public static boolean canAttachOSX() throws Exception {
- return userName.equals("root");
- }
-}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,249 +0,0 @@
-/*
- * Copyright (c) 2013, 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 com.oracle.java.testlibrary;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.lang.management.ManagementFactory;
-import java.lang.management.RuntimeMXBean;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-public final class ProcessTools {
-
- private ProcessTools() {
- }
-
- /**
- * Pumps stdout and stderr from running the process into a String.
- *
- * @param processHandler ProcessHandler to run.
- * @return Output from process.
- * @throws IOException If an I/O error occurs.
- */
- public static OutputBuffer getOutput(ProcessBuilder processBuilder) throws IOException {
- return getOutput(processBuilder.start());
- }
-
- /**
- * Pumps stdout and stderr the running process into a String.
- *
- * @param process Process to pump.
- * @return Output from process.
- * @throws IOException If an I/O error occurs.
- */
- public static OutputBuffer getOutput(Process process) throws IOException {
- ByteArrayOutputStream stderrBuffer = new ByteArrayOutputStream();
- ByteArrayOutputStream stdoutBuffer = new ByteArrayOutputStream();
- StreamPumper outPumper = new StreamPumper(process.getInputStream(), stdoutBuffer);
- StreamPumper errPumper = new StreamPumper(process.getErrorStream(), stderrBuffer);
- Thread outPumperThread = new Thread(outPumper);
- Thread errPumperThread = new Thread(errPumper);
-
- outPumperThread.setDaemon(true);
- errPumperThread.setDaemon(true);
-
- outPumperThread.start();
- errPumperThread.start();
-
- try {
- process.waitFor();
- outPumperThread.join();
- errPumperThread.join();
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- return null;
- }
-
- return new OutputBuffer(stdoutBuffer.toString(), stderrBuffer.toString());
- }
-
- /**
- * Get the process id of the current running Java process
- *
- * @return Process id
- */
- public static int getProcessId() throws Exception {
- RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
- int pid = Integer.parseInt(runtime.getName().split("@")[0]);
-
- return pid;
- }
-
- /**
- * Get the string containing input arguments passed to the VM
- *
- * @return arguments
- */
- public static String getVmInputArguments() {
- RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
-
- List<String> args = runtime.getInputArguments();
- StringBuilder result = new StringBuilder();
- for (String arg : args)
- result.append(arg).append(' ');
-
- return result.toString();
- }
-
- /**
- * Get platform specific VM arguments (e.g. -d64 on 64bit Solaris)
- *
- * @return String[] with platform specific arguments, empty if there are none
- */
- public static String[] getPlatformSpecificVMArgs() {
-
- if (Platform.is64bit() && Platform.isSolaris()) {
- return new String[] { "-d64" };
- }
-
- return new String[] {};
- }
-
- /**
- * Create ProcessBuilder using the java launcher from the jdk to be tested and
- * with any platform specific arguments prepended
- */
- public static ProcessBuilder createJavaProcessBuilder(String... command) throws Exception {
- return createJavaProcessBuilder(false, command);
- }
-
- public static ProcessBuilder createJavaProcessBuilder(boolean addTestVmAndJavaOptions, String... command) throws Exception {
- String javapath = JDKToolFinder.getJDKTool("java");
-
- ArrayList<String> args = new ArrayList<>();
- args.add(javapath);
- Collections.addAll(args, getPlatformSpecificVMArgs());
-
- args.add("-cp");
- args.add(System.getProperty("java.class.path"));
-
- if (addTestVmAndJavaOptions) {
- Collections.addAll(args, Utils.getTestJavaOpts());
- }
-
- Collections.addAll(args, command);
-
- // Reporting
- StringBuilder cmdLine = new StringBuilder();
- for (String cmd : args) {
- cmdLine.append(cmd).append(' ');
- }
- System.out.println("Command line: [" + cmdLine.toString() + "]");
-
- return new ProcessBuilder(args.toArray(new String[args.size()]));
- }
-
- /**
- * Executes a test jvm process, waits for it to finish and returns the process output.
- * The default jvm options from jtreg, test.vm.opts and test.java.opts, are added.
- * The java from the test.jdk is used to execute the command.
- *
- * The command line will be like:
- * {test.jdk}/bin/java {test.vm.opts} {test.java.opts} cmds
- *
- * @param cmds User specifed arguments.
- * @return The output from the process.
- */
- public static OutputAnalyzer executeTestJvm(String... cmds) throws Throwable {
- ProcessBuilder pb = createJavaProcessBuilder(Utils.addTestJavaOpts(cmds));
- return executeProcess(pb);
- }
-
- /**
- * Executes a process, waits for it to finish and returns the process output.
- * The process will have exited before this method returns.
- * @param pb The ProcessBuilder to execute.
- * @return The {@linkplain OutputAnalyzer} instance wrapping the process.
- */
- public static OutputAnalyzer executeProcess(ProcessBuilder pb) throws Exception {
- OutputAnalyzer output = null;
- Process p = null;
- boolean failed = false;
- try {
- p = pb.start();
- output = new OutputAnalyzer(p);
- p.waitFor();
-
- return output;
- } catch (Throwable t) {
- if (p != null) {
- p.destroyForcibly().waitFor();
- }
-
- failed = true;
- System.out.println("executeProcess() failed: " + t);
- throw t;
- } finally {
- if (failed) {
- System.err.println(getProcessLog(pb, output));
- }
- }
- }
-
- /**
- * Executes a process, waits for it to finish and returns the process output.
- * @param cmds The command line to execute.
- * @return The output from the process.
- */
- public static OutputAnalyzer executeProcess(String... cmds) throws Throwable {
- return executeProcess(new ProcessBuilder(cmds));
- }
-
- /**
- * Used to log command line, stdout, stderr and exit code from an executed process.
- * @param pb The executed process.
- * @param output The output from the process.
- */
- public static String getProcessLog(ProcessBuilder pb, OutputAnalyzer output) {
- String stderr = output == null ? "null" : output.getStderr();
- String stdout = output == null ? "null" : output.getStdout();
- String exitValue = output == null ? "null": Integer.toString(output.getExitValue());
- StringBuilder logMsg = new StringBuilder();
- final String nl = System.getProperty("line.separator");
- logMsg.append("--- ProcessLog ---" + nl);
- logMsg.append("cmd: " + getCommandLine(pb) + nl);
- logMsg.append("exitvalue: " + exitValue + nl);
- logMsg.append("stderr: " + stderr + nl);
- logMsg.append("stdout: " + stdout + nl);
- return logMsg.toString();
- }
-
- /**
- * @return The full command line for the ProcessBuilder.
- */
- public static String getCommandLine(ProcessBuilder pb) {
- if (pb == null) {
- return "null";
- }
- StringBuilder cmd = new StringBuilder();
- for (String s : pb.command()) {
- cmd.append(s).append(" ");
- }
- return cmd.toString().trim();
- }
-}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/StreamPumper.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2013, 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 com.oracle.java.testlibrary;
-
-import java.io.OutputStream;
-import java.io.InputStream;
-import java.io.IOException;
-
-public final class StreamPumper implements Runnable {
-
- private static final int BUF_SIZE = 256;
-
- private final OutputStream out;
- private final InputStream in;
-
- /**
- * Create a StreamPumper that reads from in and writes to out.
- *
- * @param in The stream to read from.
- * @param out The stream to write to.
- */
- public StreamPumper(InputStream in, OutputStream out) {
- this.in = in;
- this.out = out;
- }
-
- /**
- * Implements Thread.run(). Continuously read from <code>in</code> and write
- * to <code>out</code> until <code>in</code> has reached end of stream. Abort
- * on interruption. Abort on IOExceptions.
- */
- @Override
- public void run() {
- int length;
- InputStream localIn = in;
- OutputStream localOut = out;
- byte[] buffer = new byte[BUF_SIZE];
-
- try {
- while (!Thread.interrupted() && (length = localIn.read(buffer)) > 0) {
- localOut.write(buffer, 0, length);
- }
- } catch (IOException e) {
- // Just abort if something like this happens.
- e.printStackTrace();
- } finally {
- try {
- localOut.flush();
- in.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
-}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/TimeLimitedRunner.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2014, 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 com.oracle.java.testlibrary;
-
-import java.util.Objects;
-import java.util.concurrent.Callable;
-
-/**
- * Auxiliary class to run target w/ given timeout.
- */
-public class TimeLimitedRunner implements Callable<Void> {
- private final long stoptime;
- private final long timeout;
- private final double factor;
- private final Callable<Boolean> target;
-
- /**
- * @param timeout a timeout. zero means no time limitation
- * @param factor a multiplier used to estimate next iteration time
- * @param target a target to run
- * @throws NullPointerException if target is null
- * @throws IllegalArgumentException if timeout is negative or
- factor isn't positive
- */
- public TimeLimitedRunner(long timeout, double factor,
- Callable<Boolean> target) {
- Objects.requireNonNull(target, "target must not be null");
- if (timeout < 0) {
- throw new IllegalArgumentException("timeout[" + timeout + "] < 0");
- }
- if (factor <= 0d) {
- throw new IllegalArgumentException("factor[" + factor + "] <= 0");
- }
- this.stoptime = System.currentTimeMillis() + timeout;
- this.timeout = timeout;
- this.factor = factor;
- this.target = target;
- }
-
- /**
- * Runs @{linkplan target} while it returns true and timeout isn't exceeded
- */
- @Override
- public Void call() throws Exception {
- long maxDuration = 0L;
- long iterStart = System.currentTimeMillis();
- if (timeout != 0 && iterStart > stoptime) {
- return null;
- }
- while (target.call()) {
- if (timeout != 0) {
- long iterDuration = System.currentTimeMillis() - iterStart;
- maxDuration = Math.max(maxDuration, iterDuration);
- iterStart = System.currentTimeMillis();
- if (iterStart + (maxDuration * factor) > stoptime) {
- System.out.println("Not enough time to continue execution. "
- + "Interrupted.");
- break;
- }
- }
- }
- return null;
- }
-
-}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/Utils.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,435 +0,0 @@
-/*
- * Copyright (c) 2013, 2014, 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 com.oracle.java.testlibrary;
-
-import static com.oracle.java.testlibrary.Asserts.assertTrue;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.lang.reflect.Field;
-import java.net.InetAddress;
-import java.net.ServerSocket;
-import java.net.UnknownHostException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Random;
-import java.util.function.BooleanSupplier;
-import java.util.concurrent.TimeUnit;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.stream.Collectors;
-import sun.misc.Unsafe;
-
-/**
- * Common library for various test helper functions.
- */
-public final class Utils {
-
- /**
- * Returns the sequence used by operating system to separate lines.
- */
- public static final String NEW_LINE = System.getProperty("line.separator");
-
- /**
- * Returns the value of 'test.vm.opts'system property.
- */
- public static final String VM_OPTIONS = System.getProperty("test.vm.opts", "").trim();
-
- /**
- * Returns the value of 'test.java.opts'system property.
- */
- public static final String JAVA_OPTIONS = System.getProperty("test.java.opts", "").trim();
-
- private static Unsafe unsafe = null;
-
- /**
- * Defines property name for seed value.
- */
- public static final String SEED_PROPERTY_NAME = "com.oracle.java.testlibrary.random.seed";
-
- /* (non-javadoc)
- * Random generator with (or without) predefined seed. Depends on
- * "com.oracle.java.testlibrary.random.seed" property value.
- */
- private static volatile Random RANDOM_GENERATOR;
-
- /**
- * Contains the seed value used for {@link java.util.Random} creation.
- */
- public static final long SEED = Long.getLong(SEED_PROPERTY_NAME, new Random().nextLong());
- /**
- * Returns the value of 'test.timeout.factor' system property
- * converted to {@code double}.
- */
- public static final double TIMEOUT_FACTOR;
- static {
- String toFactor = System.getProperty("test.timeout.factor", "1.0");
- TIMEOUT_FACTOR = Double.parseDouble(toFactor);
- }
-
- /**
- * Returns the value of JTREG default test timeout in milliseconds
- * converted to {@code long}.
- */
- public static final long DEFAULT_TEST_TIMEOUT = TimeUnit.SECONDS.toMillis(120);
-
- private Utils() {
- // Private constructor to prevent class instantiation
- }
-
- /**
- * Returns the list of VM options.
- *
- * @return List of VM options
- */
- public static List<String> getVmOptions() {
- return Arrays.asList(safeSplitString(VM_OPTIONS));
- }
-
- /**
- * Returns the list of VM options with -J prefix.
- *
- * @return The list of VM options with -J prefix
- */
- public static List<String> getForwardVmOptions() {
- String[] opts = safeSplitString(VM_OPTIONS);
- for (int i = 0; i < opts.length; i++) {
- opts[i] = "-J" + opts[i];
- }
- return Arrays.asList(opts);
- }
-
- /**
- * Returns the default JTReg arguments for a jvm running a test.
- * This is the combination of JTReg arguments test.vm.opts and test.java.opts.
- * @return An array of options, or an empty array if no opptions.
- */
- public static String[] getTestJavaOpts() {
- List<String> opts = new ArrayList<String>();
- Collections.addAll(opts, safeSplitString(VM_OPTIONS));
- Collections.addAll(opts, safeSplitString(JAVA_OPTIONS));
- return opts.toArray(new String[0]);
- }
-
- /**
- * Returns the default JTReg arguments for a jvm running a test without
- * options that matches regular expressions in {@code filters}.
- * This is the combination of JTReg arguments test.vm.opts and test.java.opts.
- * @param filters Regular expressions used to filter out options.
- * @return An array of options, or an empty array if no options.
- */
- public static String[] getFilteredTestJavaOpts(String... filters) {
- String options[] = getTestJavaOpts();
-
- if (filters.length == 0) {
- return options;
- }
-
- List<String> filteredOptions = new ArrayList<String>(options.length);
- Pattern patterns[] = new Pattern[filters.length];
- for (int i = 0; i < filters.length; i++) {
- patterns[i] = Pattern.compile(filters[i]);
- }
-
- for (String option : options) {
- boolean matched = false;
- for (int i = 0; i < patterns.length && !matched; i++) {
- Matcher matcher = patterns[i].matcher(option);
- matched = matcher.find();
- }
- if (!matched) {
- filteredOptions.add(option);
- }
- }
-
- return filteredOptions.toArray(new String[filteredOptions.size()]);
- }
-
- /**
- * Combines given arguments with default JTReg arguments for a jvm running a test.
- * This is the combination of JTReg arguments test.vm.opts and test.java.opts
- * @return The combination of JTReg test java options and user args.
- */
- public static String[] addTestJavaOpts(String... userArgs) {
- List<String> opts = new ArrayList<String>();
- Collections.addAll(opts, getTestJavaOpts());
- Collections.addAll(opts, userArgs);
- return opts.toArray(new String[0]);
- }
-
- /**
- * Splits a string by white space.
- * Works like String.split(), but returns an empty array
- * if the string is null or empty.
- */
- private static String[] safeSplitString(String s) {
- if (s == null || s.trim().isEmpty()) {
- return new String[] {};
- }
- return s.trim().split("\\s+");
- }
-
- /**
- * @return The full command line for the ProcessBuilder.
- */
- public static String getCommandLine(ProcessBuilder pb) {
- StringBuilder cmd = new StringBuilder();
- for (String s : pb.command()) {
- cmd.append(s).append(" ");
- }
- return cmd.toString();
- }
-
- /**
- * Returns the free port on the local host.
- * The function will spin until a valid port number is found.
- *
- * @return The port number
- * @throws InterruptedException if any thread has interrupted the current thread
- * @throws IOException if an I/O error occurs when opening the socket
- */
- public static int getFreePort() throws InterruptedException, IOException {
- int port = -1;
-
- while (port <= 0) {
- Thread.sleep(100);
-
- ServerSocket serverSocket = null;
- try {
- serverSocket = new ServerSocket(0);
- port = serverSocket.getLocalPort();
- } finally {
- serverSocket.close();
- }
- }
-
- return port;
- }
-
- /**
- * Returns the name of the local host.
- *
- * @return The host name
- * @throws UnknownHostException if IP address of a host could not be determined
- */
- public static String getHostname() throws UnknownHostException {
- InetAddress inetAddress = InetAddress.getLocalHost();
- String hostName = inetAddress.getHostName();
-
- assertTrue((hostName != null && !hostName.isEmpty()),
- "Cannot get hostname");
-
- return hostName;
- }
-
- /**
- * Uses "jcmd -l" to search for a jvm pid. This function will wait
- * forever (until jtreg timeout) for the pid to be found.
- * @param key Regular expression to search for
- * @return The found pid.
- */
- public static int waitForJvmPid(String key) throws Throwable {
- final long iterationSleepMillis = 250;
- System.out.println("waitForJvmPid: Waiting for key '" + key + "'");
- System.out.flush();
- while (true) {
- int pid = tryFindJvmPid(key);
- if (pid >= 0) {
- return pid;
- }
- Thread.sleep(iterationSleepMillis);
- }
- }
-
- /**
- * Searches for a jvm pid in the output from "jcmd -l".
- *
- * Example output from jcmd is:
- * 12498 sun.tools.jcmd.JCmd -l
- * 12254 /tmp/jdk8/tl/jdk/JTwork/classes/com/sun/tools/attach/Application.jar
- *
- * @param key A regular expression to search for.
- * @return The found pid, or -1 if Enot found.
- * @throws Exception If multiple matching jvms are found.
- */
- public static int tryFindJvmPid(String key) throws Throwable {
- OutputAnalyzer output = null;
- try {
- JDKToolLauncher jcmdLauncher = JDKToolLauncher.create("jcmd");
- jcmdLauncher.addToolArg("-l");
- output = ProcessTools.executeProcess(jcmdLauncher.getCommand());
- output.shouldHaveExitValue(0);
-
- // Search for a line starting with numbers (pid), follwed by the key.
- Pattern pattern = Pattern.compile("([0-9]+)\\s.*(" + key + ").*\\r?\\n");
- Matcher matcher = pattern.matcher(output.getStdout());
-
- int pid = -1;
- if (matcher.find()) {
- pid = Integer.parseInt(matcher.group(1));
- System.out.println("findJvmPid.pid: " + pid);
- if (matcher.find()) {
- throw new Exception("Found multiple JVM pids for key: " + key);
- }
- }
- return pid;
- } catch (Throwable t) {
- System.out.println(String.format("Utils.findJvmPid(%s) failed: %s", key, t));
- throw t;
- }
- }
-
- /**
- * Return the contents of the named file as a single String,
- * or null if not found.
- * @param filename name of the file to read
- * @return String contents of file, or null if file not found.
- * @throws IOException
- * if an I/O error occurs reading from the file or a malformed or
- * unmappable byte sequence is read
- */
- public static String fileAsString(String filename) throws IOException {
- Path filePath = Paths.get(filename);
- return Files.exists(filePath)
- ? Files.lines(filePath).collect(Collectors.joining(NEW_LINE))
- : null;
- }
-
- /**
- * @return Unsafe instance.
- */
- public static synchronized Unsafe getUnsafe() {
- if (unsafe == null) {
- try {
- Field f = Unsafe.class.getDeclaredField("theUnsafe");
- f.setAccessible(true);
- unsafe = (Unsafe) f.get(null);
- } catch (NoSuchFieldException | IllegalAccessException e) {
- throw new RuntimeException("Unable to get Unsafe instance.", e);
- }
- }
- return unsafe;
- }
- private static final char[] hexArray = new char[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
-
- /**
- * Returns hex view of byte array
- *
- * @param bytes byte array to process
- * @return Space separated hexadecimal string representation of bytes
- */
-
- public static String toHexString(byte[] bytes) {
- char[] hexView = new char[bytes.length * 3];
- int i = 0;
- for (byte b : bytes) {
- hexView[i++] = hexArray[(b >> 4) & 0x0F];
- hexView[i++] = hexArray[b & 0x0F];
- hexView[i++] = ' ';
- }
- return new String(hexView);
- }
-
- /**
- * Returns {@link java.util.Random} generator initialized with particular seed.
- * The seed could be provided via system property {@link Utils#SEED_PROPERTY_NAME}
- * In case no seed is provided, the method uses a random number.
- * The used seed printed to stdout.
- * @return {@link java.util.Random} generator with particular seed.
- */
- public static Random getRandomInstance() {
- if (RANDOM_GENERATOR == null) {
- synchronized (Utils.class) {
- if (RANDOM_GENERATOR == null) {
- RANDOM_GENERATOR = new Random(SEED);
- System.out.printf("For random generator using seed: %d%n", SEED);
- System.out.printf("To re-run test with same seed value please add \"-D%s=%d\" to command line.%n", SEED_PROPERTY_NAME, SEED);
- }
- }
- }
- return RANDOM_GENERATOR;
- }
-
- /**
- * Wait for condition to be true
- *
- * @param condition, a condition to wait for
- */
- public static final void waitForCondition(BooleanSupplier condition) {
- waitForCondition(condition, -1L, 100L);
- }
-
- /**
- * Wait until timeout for condition to be true
- *
- * @param condition, a condition to wait for
- * @param timeout a time in milliseconds to wait for condition to be true
- * specifying -1 will wait forever
- * @return condition value, to determine if wait was successfull
- */
- public static final boolean waitForCondition(BooleanSupplier condition,
- long timeout) {
- return waitForCondition(condition, timeout, 100L);
- }
-
- /**
- * Wait until timeout for condition to be true for specified time
- *
- * @param condition, a condition to wait for
- * @param timeout a time in milliseconds to wait for condition to be true,
- * specifying -1 will wait forever
- * @param sleepTime a time to sleep value in milliseconds
- * @return condition value, to determine if wait was successfull
- */
- public static final boolean waitForCondition(BooleanSupplier condition,
- long timeout, long sleepTime) {
- long startTime = System.currentTimeMillis();
- while (!(condition.getAsBoolean() || (timeout != -1L
- && ((System.currentTimeMillis() - startTime) > timeout)))) {
- try {
- Thread.sleep(sleepTime);
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- throw new Error(e);
- }
- }
- return condition.getAsBoolean();
- }
-
- /**
- * Adjusts the provided timeout value for the TIMEOUT_FACTOR
- * @param tOut the timeout value to be adjusted
- * @return The timeout value adjusted for the value of "test.timeout.factor"
- * system property
- */
- public static long adjustTimeout(long tOut) {
- return Math.round(tOut * Utils.TIMEOUT_FACTOR);
- }
-}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/cli/CPUSpecificCommandLineOptionTest.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2014, 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 com.oracle.java.testlibrary.cli;
-
-import com.oracle.java.testlibrary.cli.predicate.CPUSpecificPredicate;
-
-/**
- * Base class for command line options tests that
- * requires specific CPU arch or specific CPU features.
- */
-public abstract class CPUSpecificCommandLineOptionTest
- extends CommandLineOptionTest {
- /**
- * Creates new CPU specific test instance that does not
- * require any CPU features.
- *
- * @param cpuArchPattern Regular expression that should
- * match os.arch.
- */
- public CPUSpecificCommandLineOptionTest(String cpuArchPattern) {
- this(cpuArchPattern, null, null);
- }
-
- /**
- * Creates new CPU specific test instance that does not
- * require from CPU support of {@code supportedCPUFeatures} features
- * and no support of {@code unsupportedCPUFeatures}.
- *
- * @param cpuArchPattern Regular expression that should
- * match os.arch.
- * @param supportedCPUFeatures Array with names of features that
- * should be supported by CPU. If {@code null},
- * then no features have to be supported.
- * @param unsupportedCPUFeatures Array with names of features that
- * should not be supported by CPU.
- * If {@code null}, then CPU may support any
- * features.
- */
- public CPUSpecificCommandLineOptionTest(String cpuArchPattern,
- String supportedCPUFeatures[], String unsupportedCPUFeatures[]) {
- super(new CPUSpecificPredicate(cpuArchPattern, supportedCPUFeatures,
- unsupportedCPUFeatures));
- }
-}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/cli/CommandLineOptionTest.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,396 +0,0 @@
-/*
- * Copyright (c) 2014, 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 com.oracle.java.testlibrary.cli;
-
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.function.BooleanSupplier;
-
-import com.oracle.java.testlibrary.*;
-
-/**
- * Base class for command line option tests.
- */
-public abstract class CommandLineOptionTest {
- public static final String UNLOCK_DIAGNOSTIC_VM_OPTIONS
- = "-XX:+UnlockDiagnosticVMOptions";
- public static final String UNLOCK_EXPERIMENTAL_VM_OPTIONS
- = "-XX:+UnlockExperimentalVMOptions";
- protected static final String UNRECOGNIZED_OPTION_ERROR_FORMAT
- = "Unrecognized VM option '[+-]?%s(=.*)?'";
- protected static final String EXPERIMENTAL_OPTION_ERROR_FORMAT
- = "VM option '%s' is experimental and must be enabled via "
- + "-XX:\\+UnlockExperimentalVMOptions.";
- protected static final String DIAGNOSTIC_OPTION_ERROR_FORMAT
- = " VM option '%s' is diagnostic and must be enabled via "
- + "-XX:\\+UnlockDiagnosticVMOptions.";
- private static final String PRINT_FLAGS_FINAL_FORMAT = "%s\\s*:?=\\s*%s";
-
- /**
- * Verifies that JVM startup behavior matches our expectations.
- *
- * @param option an option that should be passed to JVM
- * @param expectedMessages an array of patterns that should occur
- * in JVM output. If {@code null} then
- * JVM output could be empty.
- * @param unexpectedMessages an array of patterns that should not
- * occur in JVM output. If {@code null} then
- * JVM output could be empty.
- * @param exitErrorMessage message that will be shown if exit code is not
- * as expected.
- * @param wrongWarningMessage message that will be shown if warning
- * messages are not as expected.
- * @param exitCode expected exit code.
- * @throws Throwable if verification fails or some other issues occur.
- */
- public static void verifyJVMStartup(String option,
- String expectedMessages[], String unexpectedMessages[],
- String exitErrorMessage, String wrongWarningMessage,
- ExitCode exitCode) throws Throwable {
- CommandLineOptionTest.verifyJVMStartup(expectedMessages,
- unexpectedMessages, exitErrorMessage,
- wrongWarningMessage, exitCode, false, option);
- }
-
- /**
- * Verifies that JVM startup behavior matches our expectations.
- *
- * @param expectedMessages an array of patterns that should occur
- * in JVM output. If {@code null} then
- * JVM output could be empty.
- * @param unexpectedMessages an array of patterns that should not
- * occur in JVM output. If {@code null} then
- * JVM output could be empty.
- * @param exitErrorMessage message that will be shown if exit code is not
- * as expected.
- * @param wrongWarningMessage message that will be shown if warning
- * messages are not as expected.
- * @param exitCode expected exit code.
- * @param addTestVMOptions if {@code true} then test VM options will be
- * passed to VM.
- * @param options options that should be passed to VM in addition to mode
- * flag.
- * @throws Throwable if verification fails or some other issues occur.
- */
- public static void verifyJVMStartup(String expectedMessages[],
- String unexpectedMessages[], String exitErrorMessage,
- String wrongWarningMessage, ExitCode exitCode,
- boolean addTestVMOptions, String... options)
- throws Throwable {
- List<String> finalOptions = new ArrayList<>();
- if (addTestVMOptions) {
- Collections.addAll(finalOptions, Utils.getTestJavaOpts());
- }
- Collections.addAll(finalOptions, options);
- finalOptions.add("-version");
-
- ProcessBuilder processBuilder
- = ProcessTools.createJavaProcessBuilder(finalOptions.toArray(
- new String[finalOptions.size()]));
- OutputAnalyzer outputAnalyzer
- = new OutputAnalyzer(processBuilder.start());
-
- try {
- outputAnalyzer.shouldHaveExitValue(exitCode.value);
- } catch (RuntimeException e) {
- String errorMessage = String.format(
- "JVM process should have exit value '%d'.%n%s",
- exitCode.value, exitErrorMessage);
- throw new AssertionError(errorMessage, e);
- }
-
-
- if (expectedMessages != null) {
- for (String expectedMessage : expectedMessages) {
- try {
- outputAnalyzer.shouldMatch(expectedMessage);
- } catch (RuntimeException e) {
- String errorMessage = String.format(
- "Expected message not found: '%s'.%n%s",
- expectedMessage, wrongWarningMessage);
- throw new AssertionError(errorMessage, e);
- }
- }
- }
-
- if (unexpectedMessages != null) {
- for (String unexpectedMessage : unexpectedMessages) {
- try {
- outputAnalyzer.shouldNotMatch(unexpectedMessage);
- } catch (RuntimeException e) {
- String errorMessage = String.format(
- "Unexpected message found: '%s'.%n%s",
- unexpectedMessage, wrongWarningMessage);
- throw new AssertionError(errorMessage, e);
- }
- }
- }
- }
-
- /**
- * Verifies that JVM startup behavior matches our expectations when type
- * of newly started VM is the same as the type of current.
- *
- * @param expectedMessages an array of patterns that should occur
- * in JVM output. If {@code null} then
- * JVM output could be empty.
- * @param unexpectedMessages an array of patterns that should not
- * occur in JVM output. If {@code null} then
- * JVM output could be empty.
- * @param exitErrorMessage Message that will be shown if exit value is not
- * as expected.
- * @param wrongWarningMessage message that will be shown if warning
- * messages are not as expected.
- * @param exitCode expected exit code.
- * @param options options that should be passed to VM in addition to mode
- * flag.
- * @throws Throwable if verification fails or some other issues occur.
- */
- public static void verifySameJVMStartup(String expectedMessages[],
- String unexpectedMessages[], String exitErrorMessage,
- String wrongWarningMessage, ExitCode exitCode, String... options)
- throws Throwable {
- List<String> finalOptions = new ArrayList<>();
- finalOptions.add(CommandLineOptionTest.getVMTypeOption());
- Collections.addAll(finalOptions, options);
-
- CommandLineOptionTest.verifyJVMStartup(expectedMessages,
- unexpectedMessages, exitErrorMessage,
- wrongWarningMessage, exitCode, false,
- finalOptions.toArray(new String[finalOptions.size()]));
- }
-
- /**
- * Verifies that value of specified JVM option is the same as
- * expected value.
- * This method filter out option with {@code optionName}
- * name from test java options.
- *
- * @param optionName a name of tested option.
- * @param expectedValue expected value of tested option.
- * @param optionErrorString message will be shown if option value is not as
- * expected.
- * @param additionalVMOpts additional options that should be
- * passed to JVM.
- * @throws Throwable if verification fails or some other issues occur.
- */
- public static void verifyOptionValue(String optionName,
- String expectedValue, String optionErrorString,
- String... additionalVMOpts) throws Throwable {
- verifyOptionValue(optionName, expectedValue, optionErrorString,
- true, additionalVMOpts);
- }
-
- /**
- * Verifies that value of specified JVM option is the same as
- * expected value.
- * This method filter out option with {@code optionName}
- * name from test java options.
- *
- * @param optionName a name of tested option.
- * @param expectedValue expected value of tested option.
- * @param addTestVmOptions if {@code true}, then test VM options
- * will be used.
- * @param optionErrorString message will be shown if option value is not as
- * expected.
- * @param additionalVMOpts additional options that should be
- * passed to JVM.
- * @throws Throwable if verification fails or some other issues
- * occur.
- */
- public static void verifyOptionValue(String optionName,
- String expectedValue, String optionErrorString,
- boolean addTestVmOptions, String... additionalVMOpts)
- throws Throwable {
- List<String> vmOpts = new ArrayList<>();
-
- if (addTestVmOptions) {
- Collections.addAll(vmOpts,
- Utils.getFilteredTestJavaOpts(optionName));
- }
- Collections.addAll(vmOpts, additionalVMOpts);
- Collections.addAll(vmOpts, "-XX:+PrintFlagsFinal", "-version");
-
- ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder(
- vmOpts.toArray(new String[vmOpts.size()]));
-
- OutputAnalyzer outputAnalyzer
- = new OutputAnalyzer(processBuilder.start());
-
- try {
- outputAnalyzer.shouldHaveExitValue(0);
- } catch (RuntimeException e) {
- String errorMessage = String.format(
- "JVM should start with option '%s' without errors.",
- optionName);
- throw new AssertionError(errorMessage, e);
- }
- try {
- outputAnalyzer.shouldMatch(String.format(
- CommandLineOptionTest.PRINT_FLAGS_FINAL_FORMAT,
- optionName, expectedValue));
- } catch (RuntimeException e) {
- String errorMessage = String.format(
- "Option '%s' is expected to have '%s' value%n%s",
- optionName, expectedValue,
- optionErrorString);
- throw new AssertionError(errorMessage, e);
- }
- }
-
- /**
- * Verifies that value of specified JVM when type of newly started VM
- * is the same as the type of current.
- * This method filter out option with {@code optionName}
- * name from test java options.
- * Only mode flag will be passed to VM in addition to
- * {@code additionalVMOpts}
- *
- * @param optionName name of tested option.
- * @param expectedValue expected value of tested option.
- * @param optionErrorString message to show if option has another value
- * @param additionalVMOpts additional options that should be
- * passed to JVM.
- * @throws Throwable if verification fails or some other issues occur.
- */
- public static void verifyOptionValueForSameVM(String optionName,
- String expectedValue, String optionErrorString,
- String... additionalVMOpts) throws Throwable {
- List<String> finalOptions = new ArrayList<>();
- finalOptions.add(CommandLineOptionTest.getVMTypeOption());
- Collections.addAll(finalOptions, additionalVMOpts);
-
- CommandLineOptionTest.verifyOptionValue(optionName, expectedValue,
- optionErrorString, false,
- finalOptions.toArray(new String[finalOptions.size()]));
- }
-
- /**
- * Prepares boolean command line flag with name {@code name} according
- * to it's {@code value}.
- *
- * @param name the name of option to be prepared
- * @param value the value of option
- * @return prepared command line flag
- */
- public static String prepareBooleanFlag(String name, boolean value) {
- return String.format("-XX:%c%s", (value ? '+' : '-'), name);
- }
-
- /**
- * Prepares numeric command line flag with name {@code name} by setting
- * it's value to {@code value}.
- *
- * @param name the name of option to be prepared
- * @param value the value of option
- * @return prepared command line flag
- */
- public static String prepareNumericFlag(String name, Number value) {
- return String.format("-XX:%s=%s", name, value.toString());
- }
-
- /**
- * Returns message that should occur in VM output if option
- * {@code optionName} if unrecognized.
- *
- * @param optionName the name of option for which message should be returned
- * @return message saying that option {@code optionName} is unrecognized
- */
- public static String getUnrecognizedOptionErrorMessage(String optionName) {
- return String.format(
- CommandLineOptionTest.UNRECOGNIZED_OPTION_ERROR_FORMAT,
- optionName);
- }
-
- /**
- * Returns message that should occur in VM output if option
- * {@code optionName} is experimental and
- * -XX:+UnlockExperimentalVMOptions was not passed to VM.
- *
- * @param optionName the name of option for which message should be returned
- * @return message saying that option {@code optionName} is experimental
- */
- public static String getExperimentalOptionErrorMessage(String optionName) {
- return String.format(
- CommandLineOptionTest.EXPERIMENTAL_OPTION_ERROR_FORMAT,
- optionName);
- }
-
- /**
- * Returns message that should occur in VM output if option
- * {@code optionName} is diagnostic and -XX:+UnlockDiagnosticVMOptions
- * was not passed to VM.
- *
- * @param optionName the name of option for which message should be returned
- * @return message saying that option {@code optionName} is diganostic
- */
- public static String getDiagnosticOptionErrorMessage(String optionName) {
- return String.format(
- CommandLineOptionTest.DIAGNOSTIC_OPTION_ERROR_FORMAT,
- optionName);
- }
-
- /**
- * @return option required to start a new VM with the same type as current.
- * @throws RuntimeException when VM type is unknown.
- */
- private static String getVMTypeOption() {
- if (Platform.isServer()) {
- return "-server";
- } else if (Platform.isClient()) {
- return "-client";
- } else if (Platform.isMinimal()) {
- return "-minimal";
- } else if (Platform.isGraal()) {
- return "-graal";
- }
- throw new RuntimeException("Unknown VM mode.");
- }
-
- private final BooleanSupplier predicate;
-
- /**
- * Constructs new CommandLineOptionTest that will be executed only if
- * predicate {@code predicate} return {@code true}.
- * @param predicate a predicate responsible for test's preconditions check.
- */
- public CommandLineOptionTest(BooleanSupplier predicate) {
- this.predicate = predicate;
- }
-
- /**
- * Runs command line option test.
- */
- public final void test() throws Throwable {
- if (predicate.getAsBoolean()) {
- runTestCases();
- }
- }
-
- /**
- * @throws Throwable if some issue happened during test cases execution.
- */
- protected abstract void runTestCases() throws Throwable;
-}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/cli/predicate/AndPredicate.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2014, 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 com.oracle.java.testlibrary.cli.predicate;
-
-import java.util.function.BooleanSupplier;
-
-public class AndPredicate implements BooleanSupplier {
- private final BooleanSupplier a;
- private final BooleanSupplier b;
-
- public AndPredicate(BooleanSupplier a, BooleanSupplier b) {
- this.a = a;
- this.b = b;
- }
-
- @Override
- public boolean getAsBoolean() {
- return a.getAsBoolean() && b.getAsBoolean();
- }
-}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/cli/predicate/CPUSpecificPredicate.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2014, 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 com.oracle.java.testlibrary.cli.predicate;
-
-import com.oracle.java.testlibrary.Platform;
-import sun.hotspot.cpuinfo.CPUInfo;
-
-import java.util.function.BooleanSupplier;
-
-public class CPUSpecificPredicate implements BooleanSupplier {
- private final String cpuArchPattern;
- private final String supportedCPUFeatures[];
- private final String unsupportedCPUFeatures[];
-
- public CPUSpecificPredicate(String cpuArchPattern,
- String supportedCPUFeatures[],
- String unsupportedCPUFeatures[]) {
- this.cpuArchPattern = cpuArchPattern;
- this.supportedCPUFeatures = supportedCPUFeatures;
- this.unsupportedCPUFeatures = unsupportedCPUFeatures;
- }
-
- @Override
- public boolean getAsBoolean() {
- if (!Platform.getOsArch().matches(cpuArchPattern)) {
- System.out.println("CPU arch does not match " + cpuArchPattern);
- return false;
- }
-
- if (supportedCPUFeatures != null) {
- for (String feature : supportedCPUFeatures) {
- if (!CPUInfo.hasFeature(feature)) {
- System.out.println("CPU does not support " + feature
- + " feature");
- return false;
- }
- }
- }
-
- if (unsupportedCPUFeatures != null) {
- for (String feature : unsupportedCPUFeatures) {
- if (CPUInfo.hasFeature(feature)) {
- System.out.println("CPU support " + feature + " feature");
- return false;
- }
- }
- }
- return true;
- }
-}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/cli/predicate/NotPredicate.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2014, 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 com.oracle.java.testlibrary.cli.predicate;
-
-import java.util.function.BooleanSupplier;
-
-public class NotPredicate implements BooleanSupplier {
- private final BooleanSupplier s;
-
- public NotPredicate(BooleanSupplier s) {
- this.s = s;
- }
-
- @Override
- public boolean getAsBoolean() {
- return !s.getAsBoolean();
- }
-}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/cli/predicate/OrPredicate.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2014, 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 com.oracle.java.testlibrary.cli.predicate;
-
-import java.util.function.BooleanSupplier;
-
-public class OrPredicate implements BooleanSupplier {
- private final BooleanSupplier a;
- private final BooleanSupplier b;
-
- public OrPredicate(BooleanSupplier a, BooleanSupplier b) {
- this.a = a;
- this.b = b;
- }
-
- @Override
- public boolean getAsBoolean() {
- return a.getAsBoolean() || b.getAsBoolean();
- }
-}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/CommandExecutor.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2015, 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 com.oracle.java.testlibrary.dcmd;
-
-import com.oracle.java.testlibrary.OutputAnalyzer;
-
-/**
- * Abstract base class for Diagnostic Command executors
- */
-public abstract class CommandExecutor {
-
- /**
- * Execute a diagnostic command
- *
- * @param cmd The diagnostic command to execute
- * @return an {@link jdk.testlibrary.OutputAnalyzer} encapsulating the output of the command
- * @throws CommandExecutorException if there is an exception on the "calling side" while trying to execute the
- * Diagnostic Command. Exceptions thrown on the remote side are available as textual representations in
- * stderr, regardless of the specific executor used.
- */
- public final OutputAnalyzer execute(String cmd) throws CommandExecutorException {
- return execute(cmd, false);
- }
-
- /**
- * Execute a diagnostic command
- *
- * @param cmd The diagnostic command to execute
- * @param silent Do not print the command output
- * @return an {@link jdk.testlibrary.OutputAnalyzer} encapsulating the output of the command
- * @throws CommandExecutorException if there is an exception on the "calling side" while trying to execute the
- * Diagnostic Command. Exceptions thrown on the remote side are available as textual representations in
- * stderr, regardless of the specific executor used.
- */
- public final OutputAnalyzer execute(String cmd, boolean silent) throws CommandExecutorException {
- if (!silent) {
- System.out.printf("Running DCMD '%s' through '%s'%n", cmd, this.getClass().getSimpleName());
- }
-
- OutputAnalyzer oa = executeImpl(cmd);
-
- if (!silent) {
- System.out.println("---------------- stdout ----------------");
- System.out.println(oa.getStdout());
- System.out.println("---------------- stderr ----------------");
- System.out.println(oa.getStderr());
- System.out.println("----------------------------------------");
- System.out.println();
- }
- return oa;
- }
-
- protected abstract OutputAnalyzer executeImpl(String cmd) throws CommandExecutorException;
-}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/CommandExecutorException.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2015, 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 com.oracle.java.testlibrary.dcmd;
-
-/**
- * CommandExecutorException encapsulates exceptions thrown (on the "calling side") from the execution of Diagnostic
- * Commands
- */
-public class CommandExecutorException extends RuntimeException {
- private static final long serialVersionUID = -7039597746579144280L;
-
- public CommandExecutorException(String message, Throwable e) {
- super(message, e);
- }
-}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/FileJcmdExecutor.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2015, 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 com.oracle.java.testlibrary.dcmd;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * Executes Diagnostic Commands on the target VM (specified by pid) using the jcmd tool and its ability to read
- * Diagnostic Commands from a file.
- */
-public class FileJcmdExecutor extends PidJcmdExecutor {
-
- /**
- * Instantiates a new FileJcmdExecutor targeting the current VM
- */
- public FileJcmdExecutor() {
- super();
- }
-
- /**
- * Instantiates a new FileJcmdExecutor targeting the VM indicated by the given pid
- *
- * @param target Pid of the target VM
- */
- public FileJcmdExecutor(String target) {
- super(target);
- }
-
- protected List<String> createCommandLine(String cmd) throws CommandExecutorException {
- File cmdFile = createTempFile();
- writeCommandToTemporaryFile(cmd, cmdFile);
-
- return Arrays.asList(jcmdBinary, Integer.toString(pid),
- "-f", cmdFile.getAbsolutePath());
- }
-
- private void writeCommandToTemporaryFile(String cmd, File cmdFile) {
- try (PrintWriter pw = new PrintWriter(cmdFile)) {
- pw.println(cmd);
- } catch (IOException e) {
- String message = "Could not write to file: " + cmdFile.getAbsolutePath();
- throw new CommandExecutorException(message, e);
- }
- }
-
- private File createTempFile() {
- try {
- File cmdFile = File.createTempFile("input", "jcmd");
- cmdFile.deleteOnExit();
- return cmdFile;
- } catch (IOException e) {
- throw new CommandExecutorException("Could not create temporary file", e);
- }
- }
-
-}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/JMXExecutor.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,187 +0,0 @@
-/*
- * Copyright (c) 2015, 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 com.oracle.java.testlibrary.dcmd;
-
-import com.oracle.java.testlibrary.OutputAnalyzer;
-
-import javax.management.*;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-
-import java.lang.management.ManagementFactory;
-
-import java.util.HashMap;
-
-/**
- * Executes Diagnostic Commands on the target VM (specified by a host/port combination or a full JMX Service URL) using
- * the JMX interface. If the target is not the current VM, the JMX Remote interface must be enabled beforehand.
- */
-public class JMXExecutor extends CommandExecutor {
-
- private final MBeanServerConnection mbs;
-
- /**
- * Instantiates a new JMXExecutor targeting the current VM
- */
- public JMXExecutor() {
- super();
- mbs = ManagementFactory.getPlatformMBeanServer();
- }
-
- /**
- * Instantiates a new JMXExecutor targeting the VM indicated by the given host/port combination or a full JMX
- * Service URL
- *
- * @param target a host/port combination on the format "host:port" or a full JMX Service URL of the target VM
- */
- public JMXExecutor(String target) {
- String urlStr;
-
- if (target.matches("^\\w[\\w\\-]*(\\.[\\w\\-]+)*:\\d+$")) {
- /* Matches "hostname:port" */
- urlStr = String.format("service:jmx:rmi:///jndi/rmi://%s/jmxrmi", target);
- } else if (target.startsWith("service:")) {
- urlStr = target;
- } else {
- throw new IllegalArgumentException("Could not recognize target string: " + target);
- }
-
- try {
- JMXServiceURL url = new JMXServiceURL(urlStr);
- JMXConnector c = JMXConnectorFactory.connect(url, new HashMap<>());
- mbs = c.getMBeanServerConnection();
- } catch (IOException e) {
- throw new CommandExecutorException("Could not initiate connection to target: " + target, e);
- }
- }
-
- protected OutputAnalyzer executeImpl(String cmd) throws CommandExecutorException {
- String stdout = "";
- String stderr = "";
-
- String[] cmdParts = cmd.split(" ", 2);
- String operation = commandToMethodName(cmdParts[0]);
- Object[] dcmdArgs = produceArguments(cmdParts);
- String[] signature = {String[].class.getName()};
-
- ObjectName beanName = getMBeanName();
-
- try {
- stdout = (String) mbs.invoke(beanName, operation, dcmdArgs, signature);
- }
-
- /* Failures on the "local" side, the one invoking the command. */
- catch (ReflectionException e) {
- Throwable cause = e.getCause();
- if (cause instanceof NoSuchMethodException) {
- /* We want JMXExecutor to match the behavior of the other CommandExecutors */
- String message = "Unknown diagnostic command: " + operation;
- stderr = exceptionTraceAsString(new IllegalArgumentException(message, e));
- } else {
- rethrowExecutorException(operation, dcmdArgs, e);
- }
- }
-
- /* Failures on the "local" side, the one invoking the command. */
- catch (InstanceNotFoundException | IOException e) {
- rethrowExecutorException(operation, dcmdArgs, e);
- }
-
- /* Failures on the remote side, the one executing the invoked command. */
- catch (MBeanException e) {
- stdout = exceptionTraceAsString(e);
- }
-
- return new OutputAnalyzer(stdout, stderr);
- }
-
- private void rethrowExecutorException(String operation, Object[] dcmdArgs,
- Exception e) throws CommandExecutorException {
- String message = String.format("Could not invoke: %s %s", operation,
- String.join(" ", (String[]) dcmdArgs[0]));
- throw new CommandExecutorException(message, e);
- }
-
- private ObjectName getMBeanName() throws CommandExecutorException {
- String MBeanName = "com.sun.management:type=DiagnosticCommand";
-
- try {
- return new ObjectName(MBeanName);
- } catch (MalformedObjectNameException e) {
- String message = "MBean not found: " + MBeanName;
- throw new CommandExecutorException(message, e);
- }
- }
-
- private Object[] produceArguments(String[] cmdParts) {
- Object[] dcmdArgs = {new String[0]}; /* Default: No arguments */
-
- if (cmdParts.length == 2) {
- dcmdArgs[0] = cmdParts[1].split(" ");
- }
- return dcmdArgs;
- }
-
- /**
- * Convert from diagnostic command to MBean method name
- *
- * Examples:
- * help --> help
- * VM.version --> vmVersion
- * VM.command_line --> vmCommandLine
- */
- private static String commandToMethodName(String cmd) {
- String operation = "";
- boolean up = false; /* First letter is to be lower case */
-
- /*
- * If a '.' or '_' is encountered it is not copied,
- * instead the next character will be converted to upper case
- */
- for (char c : cmd.toCharArray()) {
- if (('.' == c) || ('_' == c)) {
- up = true;
- } else if (up) {
- operation = operation.concat(Character.toString(c).toUpperCase());
- up = false;
- } else {
- operation = operation.concat(Character.toString(c).toLowerCase());
- }
- }
-
- return operation;
- }
-
- private static String exceptionTraceAsString(Throwable cause) {
- StringWriter sw = new StringWriter();
- cause.printStackTrace(new PrintWriter(sw));
- return sw.toString();
- }
-
-}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/JcmdExecutor.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2015, 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 com.oracle.java.testlibrary.dcmd;
-
-import com.oracle.java.testlibrary.JDKToolFinder;
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.ProcessTools;
-
-import java.util.List;
-
-/**
- * Base class for Diagnostic Command Executors using the jcmd tool
- */
-public abstract class JcmdExecutor extends CommandExecutor {
- protected String jcmdBinary;
-
- protected abstract List<String> createCommandLine(String cmd) throws CommandExecutorException;
-
- protected JcmdExecutor() {
- jcmdBinary = JDKToolFinder.getJDKTool("jcmd");
- }
-
- protected OutputAnalyzer executeImpl(String cmd) throws CommandExecutorException {
- List<String> commandLine = createCommandLine(cmd);
-
- try {
- System.out.printf("Executing command '%s'%n", commandLine);
- OutputAnalyzer output = ProcessTools.executeProcess(new ProcessBuilder(commandLine));
- System.out.printf("Command returned with exit code %d%n", output.getExitValue());
-
- return output;
- } catch (Exception e) {
- String message = String.format("Caught exception while executing '%s'", commandLine);
- throw new CommandExecutorException(message, e);
- }
- }
-}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/MainClassJcmdExecutor.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2015, 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 com.oracle.java.testlibrary.dcmd;
-
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * Executes Diagnostic Commands on the target VM (specified by main class) using the jcmd tool
- */
-public class MainClassJcmdExecutor extends JcmdExecutor {
- private final String mainClass;
-
- /**
- * Instantiates a new MainClassJcmdExecutor targeting the current VM
- */
- public MainClassJcmdExecutor() {
- super();
- mainClass = System.getProperty("sun.java.command").split(" ")[0];
- }
-
- /**
- * Instantiates a new MainClassJcmdExecutor targeting the VM indicated by the given main class
- *
- * @param target Main class of the target VM
- */
- public MainClassJcmdExecutor(String target) {
- super();
- mainClass = target;
- }
-
- protected List<String> createCommandLine(String cmd) throws CommandExecutorException {
- return Arrays.asList(jcmdBinary, mainClass, cmd);
- }
-
-}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/PidJcmdExecutor.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2015, 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 com.oracle.java.testlibrary.dcmd;
-
-import com.oracle.java.testlibrary.ProcessTools;
-
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * Executes Diagnostic Commands on the target VM (specified by pid) using the jcmd tool
- */
-public class PidJcmdExecutor extends JcmdExecutor {
- protected final int pid;
-
- /**
- * Instantiates a new PidJcmdExecutor targeting the current VM
- */
- public PidJcmdExecutor() {
- super();
- try {
- pid = ProcessTools.getProcessId();
- } catch (Exception e) {
- throw new CommandExecutorException("Could not determine own pid", e);
- }
- }
-
- /**
- * Instantiates a new PidJcmdExecutor targeting the VM indicated by the given pid
- *
- * @param target Pid of the target VM
- */
- public PidJcmdExecutor(String target) {
- super();
- pid = Integer.valueOf(target);
- }
-
- protected List<String> createCommandLine(String cmd) throws CommandExecutorException {
- return Arrays.asList(jcmdBinary, Integer.toString(pid), cmd);
- }
-
-}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/dtrace/DtraceResultsAnalyzer.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2014, 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 com.oracle.java.testlibrary.dtrace;
-
-import com.oracle.java.testlibrary.OutputAnalyzer;
-
-public interface DtraceResultsAnalyzer {
- public void analyze(OutputAnalyzer oa, String logFilePath);
-}
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/dtrace/DtraceRunner.java Sat May 02 18:40:37 2015 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
-/*
- * Copyright (c) 2014, 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 com.oracle.java.testlibrary.dtrace;
-
-import com.oracle.java.testlibrary.Asserts;
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-public class DtraceRunner {
-
- private static final String DTRACE_DEFAULT_PATH = "/usr/sbin/dtrace";
- private static final String DTRACE_PATH_PROPERTY
- = "com.oracle.test.dtrace.path";
- private static final String OUTPUT_FILE_DTRACE_OPTION = "o";
- private static final String RUN_COMMAND_DTRACE_OPTION = "c";
- private static final String RUN_SCRIPT_DTRACE_OPTION = "s";
- private static final String ALLOW_ZERO_PROBE_DESCRIPTION_DTRACE_OPTION = "Z";
- private static final String DTRACE_OPTION_PREFIX = "-";
- public static final String PERMIT_DESTRUCTIVE_ACTIONS_DTRACE_OPTION = "w";
- public static final String DTRACE_OUT_LOG = "dtrace.out";
-
- private final String dtraceExecutable;
-
- public DtraceRunner() {
- dtraceExecutable = getDtracePath();
- }
-
- private List<String> getLaunchCmd(String java, String javaOpts,
- String execClass, String testArgs, String dtraceScript,
- String dtraceAddOpts) {
- Asserts.assertTrue(!java.matches("\\s"), "Current dtrace implementation"
- + " can't handle whitespaces in application path");
- List<String> result = new ArrayList<>();
- result.add(dtraceExecutable);
- result.add(DTRACE_OPTION_PREFIX + System.getProperty("sun.arch.data.model"));
- result.add(DTRACE_OPTION_PREFIX
- + ALLOW_ZERO_PROBE_DESCRIPTION_DTRACE_OPTION
- + ((dtraceAddOpts == null) ? "" : dtraceAddOpts)
- + RUN_SCRIPT_DTRACE_OPTION); // run_script should be last one
- result.add(dtraceScript);
- result.add(DTRACE_OPTION_PREFIX + OUTPUT_FILE_DTRACE_OPTION);
- result.add(DTRACE_OUT_LOG);
- result.add(DTRACE_OPTION_PREFIX + RUN_COMMAND_DTRACE_OPTION);
- result.add(java + " " + javaOpts + " " + execClass + " " + testArgs);
- return result;
- }
-
- private void backupLogFile(File file) {
- if (file.exists()) {
- file.renameTo(new File(file.getPath() + ".bak"));
- }
- }
-
- public void runDtrace(String java, String javaOpts, String execClass,
- String testArgs, String dtraceScript, String dtraceAddOpts,
- DtraceResultsAnalyzer analyzer) {
- backupLogFile(new File(DTRACE_OUT_LOG));
- ProcessBuilder pbuilder = new ProcessBuilder(
- getLaunchCmd(java, javaOpts, execClass, testArgs,
- dtraceScript, dtraceAddOpts));
- OutputAnalyzer oa;
- try {
- oa = new OutputAnalyzer(pbuilder.start());
- } catch (IOException e) {
- throw new Error("TESTBUG: Can't start process", e);
- }
- analyzer.analyze(oa, DTRACE_OUT_LOG);
- }
-
- public static boolean dtraceAvailable() {
- String path = getDtracePath();
- if (path == null) {
- return false;
- }
- // now we'll launch dtrace to trace itself just to be sure it works
- // and have all additional previleges set
- ProcessBuilder pbuilder = new ProcessBuilder(path, path);
- try {
- OutputAnalyzer oa = new OutputAnalyzer(pbuilder.start());
- if (oa.getExitValue() != 0) {
- return false;
- }
- } catch (IOException e) {
- throw new Error("Couldn't launch dtrace", e);
- }
- return true;
- }
-
- private static String getDtracePath() {
- String propPath = System.getProperty(DTRACE_PATH_PROPERTY);
- if (propPath != null && new File(propPath).exists()) {
- return propPath;
- } else if (new File(DTRACE_DEFAULT_PATH).exists()) {
- return DTRACE_DEFAULT_PATH;
- }
- return null;
- }
-}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/Asserts.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,451 @@
+/*
+ * Copyright (c) 2013, 2015, 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.test.lib;
+
+/**
+ * Asserts that can be used for verifying assumptions in tests.
+ *
+ * An assertion will throw a {@link RuntimeException} if the assertion isn't
+ * valid. All the asserts can be imported into a test by using a static
+ * import:
+ *
+ * <pre>
+ * {@code
+ * import static jdk.test.lib.Asserts.*;
+ * }
+ *
+ * Always provide a message describing the assumption if the line number of the
+ * failing assertion isn't enough to understand why the assumption failed. For
+ * example, if the assertion is in a loop or in a method that is called
+ * multiple times, then the line number won't provide enough context to
+ * understand the failure.
+ * </pre>
+ */
+public class Asserts {
+
+ /**
+ * Shorthand for {@link #assertLessThan(T, T)}.
+ *
+ * @see #assertLessThan(T, T)
+ */
+ public static <T extends Comparable<T>> void assertLT(T lhs, T rhs) {
+ assertLessThan(lhs, rhs);
+ }
+
+ /**
+ * Shorthand for {@link #assertLessThan(T, T, String)}.
+ *
+ * @see #assertLessThan(T, T, String)
+ */
+ public static <T extends Comparable<T>> void assertLT(T lhs, T rhs, String msg) {
+ assertLessThan(lhs, rhs, msg);
+ }
+
+ /**
+ * Calls {@link #assertLessThan(T, T, String)} with a default message.
+ *
+ * @see #assertLessThan(T, T, String)
+ */
+ public static <T extends Comparable<T>> void assertLessThan(T lhs, T rhs) {
+ assertLessThan(lhs, rhs, null);
+ }
+
+ /**
+ * Asserts that {@code lhs} is less than {@code rhs}.
+ *
+ * @param lhs The left hand side of the comparison.
+ * @param rhs The right hand side of the comparison.
+ * @param msg A description of the assumption.
+ * @throws RuntimeException if the assertion isn't valid.
+ */
+ public static <T extends Comparable<T>>void assertLessThan(T lhs, T rhs, String msg) {
+ assertTrue(compare(lhs, rhs, msg) < 0, getMessage(lhs, rhs, "<", msg));
+ }
+
+ /**
+ * Shorthand for {@link #assertLessThanOrEqual(T, T)}.
+ *
+ * @see #assertLessThanOrEqual(T, T)
+ */
+ public static <T extends Comparable<T>> void assertLTE(T lhs, T rhs) {
+ assertLessThanOrEqual(lhs, rhs);
+ }
+
+ /**
+ * Shorthand for {@link #assertLessThanOrEqual(T, T, String)}.
+ *
+ * @see #assertLessThanOrEqual(T, T, String)
+ */
+ public static <T extends Comparable<T>> void assertLTE(T lhs, T rhs, String msg) {
+ assertLessThanOrEqual(lhs, rhs, msg);
+ }
+
+ /**
+ * Calls {@link #assertLessThanOrEqual(T, T, String)} with a default message.
+ *
+ * @see #assertLessThanOrEqual(T, T, String)
+ */
+ public static <T extends Comparable<T>> void assertLessThanOrEqual(T lhs, T rhs) {
+ assertLessThanOrEqual(lhs, rhs, null);
+ }
+
+ /**
+ * Asserts that {@code lhs} is less than or equal to {@code rhs}.
+ *
+ * @param lhs The left hand side of the comparison.
+ * @param rhs The right hand side of the comparison.
+ * @param msg A description of the assumption.
+ * @throws RuntimeException if the assertion isn't valid.
+ */
+ public static <T extends Comparable<T>> void assertLessThanOrEqual(T lhs, T rhs, String msg) {
+ assertTrue(compare(lhs, rhs, msg) <= 0, getMessage(lhs, rhs, "<=", msg));
+ }
+
+ /**
+ * Shorthand for {@link #assertEquals(T, T)}.
+ *
+ * @see #assertEquals(T, T)
+ */
+ public static void assertEQ(Object lhs, Object rhs) {
+ assertEquals(lhs, rhs);
+ }
+
+ /**
+ * Shorthand for {@link #assertEquals(T, T, String)}.
+ *
+ * @see #assertEquals(T, T, String)
+ */
+ public static void assertEQ(Object lhs, Object rhs, String msg) {
+ assertEquals(lhs, rhs, msg);
+ }
+
+ /**
+ * Calls {@link #assertEquals(T, T, String)} with a default message.
+ *
+ * @see #assertEquals(T, T, String)
+ */
+ public static void assertEquals(Object lhs, Object rhs) {
+ assertEquals(lhs, rhs, null);
+ }
+
+ /**
+ * Asserts that {@code lhs} is equal to {@code rhs}.
+ *
+ * @param lhs The left hand side of the comparison.
+ * @param rhs The right hand side of the comparison.
+ * @param msg A description of the assumption.
+ * @throws RuntimeException if the assertion isn't valid.
+ */
+ public static void assertEquals(Object lhs, Object rhs, String msg) {
+ if (lhs == null) {
+ if (rhs != null) {
+ error(msg);
+ }
+ } else {
+ assertTrue(lhs.equals(rhs), getMessage(lhs, rhs, "==", msg));
+ }
+ }
+
+ /**
+ * Shorthand for {@link #assertGreaterThanOrEqual(T, T)}.
+ *
+ * @see #assertGreaterThanOrEqual(T, T)
+ */
+ public static <T extends Comparable<T>> void assertGTE(T lhs, T rhs) {
+ assertGreaterThanOrEqual(lhs, rhs);
+ }
+
+ /**
+ * Shorthand for {@link #assertGreaterThanOrEqual(T, T, String)}.
+ *
+ * @see #assertGreaterThanOrEqual(T, T, String)
+ */
+ public static <T extends Comparable<T>> void assertGTE(T lhs, T rhs, String msg) {
+ assertGreaterThanOrEqual(lhs, rhs, msg);
+ }
+
+ /**
+ * Calls {@link #assertGreaterThanOrEqual(T, T, String)} with a default message.
+ *
+ * @see #assertGreaterThanOrEqual(T, T, String)
+ */
+ public static <T extends Comparable<T>> void assertGreaterThanOrEqual(T lhs, T rhs) {
+ assertGreaterThanOrEqual(lhs, rhs, null);
+ }
+
+ /**
+ * Asserts that {@code lhs} is greater than or equal to {@code rhs}.
+ *
+ * @param lhs The left hand side of the comparison.
+ * @param rhs The right hand side of the comparison.
+ * @param msg A description of the assumption.
+ * @throws RuntimeException if the assertion isn't valid.
+ */
+ public static <T extends Comparable<T>> void assertGreaterThanOrEqual(T lhs, T rhs, String msg) {
+ assertTrue(compare(lhs, rhs, msg) >= 0, getMessage(lhs, rhs, ">=", msg));
+ }
+
+ /**
+ * Shorthand for {@link #assertGreaterThan(T, T)}.
+ *
+ * @see #assertGreaterThan(T, T)
+ */
+ public static <T extends Comparable<T>> void assertGT(T lhs, T rhs) {
+ assertGreaterThan(lhs, rhs);
+ }
+
+ /**
+ * Shorthand for {@link #assertGreaterThan(T, T, String)}.
+ *
+ * @see #assertGreaterThan(T, T, String)
+ */
+ public static <T extends Comparable<T>> void assertGT(T lhs, T rhs, String msg) {
+ assertGreaterThan(lhs, rhs, msg);
+ }
+
+ /**
+ * Calls {@link #assertGreaterThan(T, T, String)} with a default message.
+ *
+ * @see #assertGreaterThan(T, T, String)
+ */
+ public static <T extends Comparable<T>> void assertGreaterThan(T lhs, T rhs) {
+ assertGreaterThan(lhs, rhs, null);
+ }
+
+ /**
+ * Asserts that {@code lhs} is greater than {@code rhs}.
+ *
+ * @param lhs The left hand side of the comparison.
+ * @param rhs The right hand side of the comparison.
+ * @param msg A description of the assumption.
+ * @throws RuntimeException if the assertion isn't valid.
+ */
+ public static <T extends Comparable<T>> void assertGreaterThan(T lhs, T rhs, String msg) {
+ assertTrue(compare(lhs, rhs, msg) > 0, getMessage(lhs, rhs, ">", msg));
+ }
+
+ /**
+ * Shorthand for {@link #assertNotEquals(T, T)}.
+ *
+ * @see #assertNotEquals(T, T)
+ */
+ public static void assertNE(Object lhs, Object rhs) {
+ assertNotEquals(lhs, rhs);
+ }
+
+ /**
+ * Shorthand for {@link #assertNotEquals(T, T, String)}.
+ *
+ * @see #assertNotEquals(T, T, String)
+ */
+ public static void assertNE(Object lhs, Object rhs, String msg) {
+ assertNotEquals(lhs, rhs, msg);
+ }
+
+ /**
+ * Calls {@link #assertNotEquals(T, T, String)} with a default message.
+ *
+ * @see #assertNotEquals(T, T, String)
+ */
+ public static void assertNotEquals(Object lhs, Object rhs) {
+ assertNotEquals(lhs, rhs, null);
+ }
+
+ /**
+ * Asserts that {@code lhs} is not equal to {@code rhs}.
+ *
+ * @param lhs The left hand side of the comparison.
+ * @param rhs The right hand side of the comparison.
+ * @param msg A description of the assumption.
+ * @throws RuntimeException if the assertion isn't valid.
+ */
+ public static void assertNotEquals(Object lhs, Object rhs, String msg) {
+ if (lhs == null) {
+ if (rhs == null) {
+ error(msg);
+ }
+ } else {
+ assertFalse(lhs.equals(rhs), getMessage(lhs, rhs,"!=", msg));
+ }
+ }
+
+ /**
+ * Calls {@link #assertNull(Object, String)} with a default message.
+ *
+ * @see #assertNull(Object, String)
+ */
+ public static void assertNull(Object o) {
+ assertNull(o, "Expected " + format(o) + " to be null");
+ }
+
+ /**
+ * Asserts that {@code o} is null.
+ *
+ * @param o The reference assumed to be null.
+ * @param msg A description of the assumption.
+ * @throws RuntimeException if the assertion isn't valid.
+ */
+ public static void assertNull(Object o, String msg) {
+ assertEquals(o, null, msg);
+ }
+
+ /**
+ * Calls {@link #assertNotNull(Object, String)} with a default message.
+ *
+ * @see #assertNotNull(Object, String)
+ */
+ public static void assertNotNull(Object o) {
+ assertNotNull(o, "Expected non null reference");
+ }
+
+ /**
+ * Asserts that {@code o} is <i>not</i> null.
+ *
+ * @param o The reference assumed <i>not</i> to be null,
+ * @param msg A description of the assumption.
+ * @throws RuntimeException if the assertion isn't valid.
+ */
+ public static void assertNotNull(Object o, String msg) {
+ assertNotEquals(o, null, msg);
+ }
+
+ /**
+ * Calls {@link #assertFalse(boolean, String)} with a default message.
+ *
+ * @see #assertFalse(boolean, String)
+ */
+ public static void assertFalse(boolean value) {
+ assertFalse(value, "Expected value to be false");
+ }
+
+ /**
+ * Asserts that {@code value} is {@code false}.
+ *
+ * @param value The value assumed to be false.
+ * @param msg A description of the assumption.
+ * @throws RuntimeException if the assertion isn't valid.
+ */
+ public static void assertFalse(boolean value, String msg) {
+ assertTrue(!value, msg);
+ }
+
+ /**
+ * Calls {@link #assertTrue(boolean, String)} with a default message.
+ *
+ * @see #assertTrue(boolean, String)
+ */
+ public static void assertTrue(boolean value) {
+ assertTrue(value, "Expected value to be true");
+ }
+
+ /**
+ * Asserts that {@code value} is {@code true}.
+ *
+ * @param value The value assumed to be true.
+ * @param msg A description of the assumption.
+ * @throws RuntimeException if the assertion isn't valid.
+ */
+ public static void assertTrue(boolean value, String msg) {
+ if (!value) {
+ error(msg);
+ }
+ }
+
+ /**
+ * Asserts that two strings are equal.
+ *
+ * If strings are not equals, then exception message
+ * will contain {@code msg} followed by list of mismatched lines.
+ *
+ * @param str1 First string to compare.
+ * @param str2 Second string to compare.
+ * @param msg A description of the assumption.
+ * @throws RuntimeException if strings are not equal.
+ */
+ public static void assertStringsEqual(String str1, String str2,
+ String msg) {
+ String lineSeparator = System.getProperty("line.separator");
+ String str1Lines[] = str1.split(lineSeparator);
+ String str2Lines[] = str2.split(lineSeparator);
+
+ int minLength = Math.min(str1Lines.length, str2Lines.length);
+ String longestStringLines[] = ((str1Lines.length == minLength) ?
+ str2Lines : str1Lines);
+
+ boolean stringsAreDifferent = false;
+
+ StringBuilder messageBuilder = new StringBuilder(msg);
+
+ messageBuilder.append("\n");
+
+ for (int line = 0; line < minLength; line++) {
+ if (!str1Lines[line].equals(str2Lines[line])) {
+ messageBuilder.append(String.
+ format("[line %d] '%s' differs " +
+ "from '%s'\n",
+ line,
+ str1Lines[line],
+ str2Lines[line]));
+ stringsAreDifferent = true;
+ }
+ }
+
+ if (minLength < longestStringLines.length) {
+ String stringName = ((longestStringLines == str1Lines) ?
+ "first" : "second");
+ messageBuilder.append(String.format("Only %s string contains " +
+ "following lines:\n",
+ stringName));
+ stringsAreDifferent = true;
+ for(int line = minLength; line < longestStringLines.length; line++) {
+ messageBuilder.append(String.
+ format("[line %d] '%s'", line,
+ longestStringLines[line]));
+ }
+ }
+
+ if (stringsAreDifferent) {
+ error(messageBuilder.toString());
+ }
+ }
+
+ private static <T extends Comparable<T>> int compare(T lhs, T rhs, String msg) {
+ assertNotNull(lhs, msg);
+ assertNotNull(rhs, msg);
+ return lhs.compareTo(rhs);
+ }
+
+ private static String format(Object o) {
+ return o == null? "null" : o.toString();
+ }
+
+ private static void error(String msg) {
+ throw new RuntimeException(msg);
+ }
+
+ private static String getMessage(Object lhs, Object rhs, String op, String msg) {
+ return (msg == null ? "" : msg + " ") + "(assert failed: " + format(lhs) + " " + op + " " + format(rhs) + ")";
+ }
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/BuildHelper.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2014, 2015, 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.test.lib;
+
+import java.io.File;
+import java.io.FileReader;
+import java.util.Properties;
+
+public class BuildHelper {
+
+ /**
+ * Commercial builds should have the BUILD_TYPE set to commercial
+ * within the release file, found at the root of the JDK.
+ */
+ public static boolean isCommercialBuild() throws Exception {
+ String buildType = getReleaseProperty("BUILD_TYPE","notFound");
+ return buildType.equals("commercial");
+ }
+
+
+ /**
+ * Return the value for property key, or defaultValue if no property not found.
+ * If present, double quotes are trimmed.
+ */
+ public static String getReleaseProperty(String key, String defaultValue) throws Exception {
+ Properties properties = getReleaseProperties();
+ String value = properties.getProperty(key, defaultValue);
+ return trimDoubleQuotes(value);
+ }
+
+ /**
+ * Return the value for property key, or null if no property not found.
+ * If present, double quotes are trimmed.
+ */
+ public static String getReleaseProperty(String key) throws Exception {
+ return getReleaseProperty(key, null);
+ }
+
+ /**
+ * Get properties from the release file
+ */
+ public static Properties getReleaseProperties() throws Exception {
+ Properties properties = new Properties();
+ properties.load(new FileReader(getReleaseFile()));
+ return properties;
+ }
+
+ /**
+ * Every JDK has a release file in its root.
+ * @return A handler to the release file.
+ */
+ public static File getReleaseFile() throws Exception {
+ String jdkPath = getJDKRoot();
+ File releaseFile = new File(jdkPath,"release");
+ if ( ! releaseFile.canRead() ) {
+ throw new Exception("Release file is not readable, or it is absent: " +
+ releaseFile.getCanonicalPath());
+ }
+ return releaseFile;
+ }
+
+ /**
+ * Returns path to the JDK under test.
+ * This path is obtained through the test.jdk property, usually set by JTREG.
+ */
+ public static String getJDKRoot() {
+ String jdkPath = System.getProperty("test.jdk");
+ if (jdkPath == null) {
+ throw new RuntimeException("System property 'test.jdk' not set. This property is normally set by jtreg. "
+ + "When running test separately, set this property using '-Dtest.jdk=/path/to/jdk'.");
+ }
+ return jdkPath;
+ }
+
+ /**
+ * Trim double quotes from the beginning and the end of the given string.
+ * @param original string to trim.
+ * @return a new trimmed string.
+ */
+ public static String trimDoubleQuotes(String original) {
+ if (original == null) { return null; }
+ String trimmed = original.replaceAll("^\"+|\"+$", "");
+ return trimmed;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/ByteCodeLoader.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2013, 2015, 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.test.lib;
+
+import java.security.SecureClassLoader;
+
+/**
+ * {@code ByteCodeLoader} can be used for easy loading of byte code already
+ * present in memory.
+ *
+ * {@code InMemoryCompiler} can be used for compiling source code in a string
+ * into byte code, which then can be loaded with {@code ByteCodeLoader}.
+ *
+ * @see InMemoryCompiler
+ */
+public class ByteCodeLoader extends SecureClassLoader {
+ private final String className;
+ private final byte[] byteCode;
+ private volatile Class<?> holder;
+
+ /**
+ * Creates a new {@code ByteCodeLoader} ready to load a class with the
+ * given name and the given byte code.
+ *
+ * @param className The name of the class
+ * @param byteCode The byte code of the class
+ */
+ public ByteCodeLoader(String className, byte[] byteCode) {
+ this.className = className;
+ this.byteCode = byteCode;
+ }
+
+ @Override
+ public Class<?> loadClass(String name) throws ClassNotFoundException {
+ if (!name.equals(className)) {
+ return super.loadClass(name);
+ }
+ if (holder == null) {
+ synchronized(this) {
+ if (holder == null) {
+ holder = findClass(name);
+ }
+ }
+ }
+ return holder;
+ }
+
+ @Override
+ protected Class<?> findClass(String name) throws ClassNotFoundException {
+ if (!name.equals(className)) {
+ throw new ClassNotFoundException(name);
+ }
+
+ return defineClass(name, byteCode, 0, byteCode.length);
+ }
+
+ /**
+ * Utility method for creating a new {@code ByteCodeLoader} and then
+ * directly load the given byte code.
+ *
+ * @param className The name of the class
+ * @param byteCode The byte code for the class
+ * @throws ClassNotFoundException if the class can't be loaded
+ * @return A {@see Class} object representing the class
+ */
+ public static Class<?> load(String className, byte[] byteCode) throws ClassNotFoundException {
+ return new ByteCodeLoader(className, byteCode).loadClass(className);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/DynamicVMOption.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,165 @@
+/*
+ * Copyright (c) 2014, 2015, 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.test.lib;
+
+import com.sun.management.HotSpotDiagnosticMXBean;
+import java.lang.management.ManagementFactory;
+
+/**
+ * A utility class to work with VM options which could be altered during
+ * execution.
+ *
+ * This class is a wrapper around {@code com.sun.management.VMOption}.
+ * It provides more convenient interface to read/write the values.
+ *
+ */
+public class DynamicVMOption {
+
+ private final HotSpotDiagnosticMXBean mxBean;
+
+ /**
+ * VM option name, like "MinHeapFreeRatio".
+ */
+ public final String name;
+
+ /**
+ * Creates an instance of DynamicVMOption.
+ *
+ * @param name the VM option name
+ */
+ public DynamicVMOption(String name) {
+ this.name = name;
+ mxBean = ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class);
+ }
+
+ /**
+ * Sets a new value for the option.
+ * Trying to set not applicable value will cause IllegalArgumentException.
+ * Behavior with null is undefined, most likely NPE will be thrown.
+ *
+ * @param newValue the value to be set
+ * @see #getValue()
+ * @throws IllegalArgumentException if newValue is not applicable to the option
+ */
+ public final void setValue(String newValue) {
+ mxBean.setVMOption(name, newValue);
+ }
+
+ /**
+ * Returns the value of option.
+ *
+ * @return the current option value
+ * @see #setValue(java.lang.String)
+ */
+ public final String getValue() {
+ return mxBean.getVMOption(name).getValue();
+ }
+
+ /**
+ * Returns true, if option is writable, false otherwise.
+ *
+ * @return true, if option is writable, false otherwise
+ */
+ public final boolean isWriteable() {
+ return mxBean.getVMOption(name).isWriteable();
+ }
+
+ /**
+ * Checks if the given value is applicable for the option.
+ *
+ * This method tries to set the option to the new value. If no exception
+ * has been thrown the value is treated as valid.
+ *
+ * Calling this method will not change the option value. After an attempt
+ * to set a new value, the option will be restored to its previous value.
+ *
+ * @param value the value to verify
+ * @return true if option could be set to the given value
+ */
+ public boolean isValidValue(String value) {
+ boolean isValid = true;
+ String oldValue = getValue();
+ try {
+ setValue(value);
+ } catch (NullPointerException e) {
+ if (value == null) {
+ isValid = false;
+ }
+ } catch (IllegalArgumentException e) {
+ isValid = false;
+ } finally {
+ setValue(oldValue);
+ }
+ return isValid;
+ }
+
+ /**
+ * Returns the value of the given VM option as String.
+ *
+ * This is a simple shortcut for {@code new DynamicVMOption(name).getValue()}
+ *
+ * @param name the name of VM option
+ * @return value as a string
+ * @see #getValue()
+ */
+ public static String getString(String name) {
+ return new DynamicVMOption(name).getValue();
+ }
+
+ /**
+ * Returns the value of the given option as int.
+ *
+ * @param name the name of VM option
+ * @return value parsed as integer
+ * @see #getString(java.lang.String)
+ *
+ */
+ public static int getInt(String name) {
+ return Integer.parseInt(getString(name));
+ }
+
+ /**
+ * Sets the VM option to a new value.
+ *
+ * This is a simple shortcut for {@code new DynamicVMOption(name).setValue(value)}
+ *
+ * @param name the name of VM option
+ * @param value the value to be set
+ * @see #setValue(java.lang.String)
+ */
+ public static void setString(String name, String value) {
+ new DynamicVMOption(name).setValue(value);
+ }
+
+ /**
+ * Sets the VM option value to a new integer value.
+ *
+ * @param name the name of VM option
+ * @param value the integer value to be set
+ * @see #setString(java.lang.String, java.lang.String)
+ */
+ public static void setInt(String name, int value) {
+ new DynamicVMOption(name).setValue(Integer.toString(value));
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/ExitCode.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2014, 2015, 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.test.lib;
+
+/**
+ * Exit code values that could be returned by the JVM.
+ */
+public enum ExitCode {
+ OK(0),
+ FAIL(1),
+ CRASH(134);
+
+ public final int value;
+
+ ExitCode(int value) {
+ this.value = value;
+ }
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/InMemoryJavaCompiler.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 2013, 2015, 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.test.lib;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+
+import java.net.URI;
+import java.util.Arrays;
+
+import javax.tools.ForwardingJavaFileManager;
+import javax.tools.ForwardingJavaFileManager;
+import javax.tools.FileObject;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaCompiler.CompilationTask;
+import javax.tools.JavaFileManager;
+import javax.tools.JavaFileObject;
+import javax.tools.JavaFileObject.Kind;
+import javax.tools.SimpleJavaFileObject;
+import javax.tools.ToolProvider;
+
+/**
+ * {@code InMemoryJavaCompiler} can be used for compiling a {@link
+ * CharSequence} to a {@code byte[]}.
+ *
+ * The compiler will not use the file system at all, instead using a {@link
+ * ByteArrayOutputStream} for storing the byte code. For the source code, any
+ * kind of {@link CharSequence} can be used, e.g. {@link String}, {@link
+ * StringBuffer} or {@link StringBuilder}.
+ *
+ * The {@code InMemoryCompiler} can easily be used together with a {@code
+ * ByteClassLoader} to easily compile and load source code in a {@link String}:
+ *
+ * <pre>
+ * {@code
+ * import jdk.test.lib.InMemoryJavaCompiler;
+ * import jdk.test.lib.ByteClassLoader;
+ *
+ * class Example {
+ * public static void main(String[] args) {
+ * String className = "Foo";
+ * String sourceCode = "public class " + className + " {" +
+ * " public void bar() {" +
+ * " System.out.println("Hello from bar!");" +
+ * " }" +
+ * "}";
+ * byte[] byteCode = InMemoryJavaCompiler.compile(className, sourceCode);
+ * Class fooClass = ByteClassLoader.load(className, byteCode);
+ * }
+ * }
+ * }
+ * </pre>
+ */
+public class InMemoryJavaCompiler {
+ private static class MemoryJavaFileObject extends SimpleJavaFileObject {
+ private final String className;
+ private final CharSequence sourceCode;
+ private final ByteArrayOutputStream byteCode;
+
+ public MemoryJavaFileObject(String className, CharSequence sourceCode) {
+ super(URI.create("string:///" + className.replace('.','/') + Kind.SOURCE.extension), Kind.SOURCE);
+ this.className = className;
+ this.sourceCode = sourceCode;
+ this.byteCode = new ByteArrayOutputStream();
+ }
+
+ @Override
+ public CharSequence getCharContent(boolean ignoreEncodingErrors) {
+ return sourceCode;
+ }
+
+ @Override
+ public OutputStream openOutputStream() throws IOException {
+ return byteCode;
+ }
+
+ public byte[] getByteCode() {
+ return byteCode.toByteArray();
+ }
+
+ public String getClassName() {
+ return className;
+ }
+ }
+
+ private static class FileManagerWrapper extends ForwardingJavaFileManager {
+ private MemoryJavaFileObject file;
+
+ public FileManagerWrapper(MemoryJavaFileObject file) {
+ super(getCompiler().getStandardFileManager(null, null, null));
+ this.file = file;
+ }
+
+ @Override
+ public JavaFileObject getJavaFileForOutput(Location location, String className,
+ Kind kind, FileObject sibling)
+ throws IOException {
+ if (!file.getClassName().equals(className)) {
+ throw new IOException("Expected class with name " + file.getClassName() +
+ ", but got " + className);
+ }
+ return file;
+ }
+ }
+
+ /**
+ * Compiles the class with the given name and source code.
+ *
+ * @param className The name of the class
+ * @param sourceCode The source code for the class with name {@code className}
+ * @throws RuntimeException if the compilation did not succeed
+ * @return The resulting byte code from the compilation
+ */
+ public static byte[] compile(String className, CharSequence sourceCode) {
+ MemoryJavaFileObject file = new MemoryJavaFileObject(className, sourceCode);
+ CompilationTask task = getCompilationTask(file);
+
+ if(!task.call()) {
+ throw new RuntimeException("Could not compile " + className + " with source code " + sourceCode);
+ }
+
+ return file.getByteCode();
+ }
+
+ private static JavaCompiler getCompiler() {
+ return ToolProvider.getSystemJavaCompiler();
+ }
+
+ private static CompilationTask getCompilationTask(MemoryJavaFileObject file) {
+ return getCompiler().getTask(null, new FileManagerWrapper(file), null, null, null, Arrays.asList(file));
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/InfiniteLoop.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2014, 2015, 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.test.lib;
+
+import java.util.Objects;
+
+/**
+ * Class which runs another Runnable in infinite loop with certain pauses
+ * between cycles.
+ */
+public class InfiniteLoop implements Runnable {
+ private final Runnable target;
+ private final long mills;
+
+
+ /**
+ * @param target a target to run in a loop
+ * @param mills the length of pause time in milliseconds
+ * @throws NullPointerException if target is null
+ * @throws IllegalArgumentException if the value of millis is negative
+ */
+ public InfiniteLoop(Runnable target, long mills) {
+ Objects.requireNonNull(target);
+ if (mills < 0) {
+ throw new IllegalArgumentException("mills < 0");
+ }
+ this.target = target;
+ this.mills = mills;
+ }
+
+ @Override
+ public void run() {
+ try {
+ while (true) {
+ target.run();
+ if (mills > 0) {
+ Thread.sleep(mills);
+ }
+ }
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new Error(e);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/InputArguments.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2013, 2015, 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.test.lib;
+
+import java.lang.management.RuntimeMXBean;
+import java.lang.management.ManagementFactory;
+import java.util.List;
+
+/**
+ * This class provides access to the input arguments to the VM.
+ */
+public class InputArguments {
+ private static final List<String> args;
+
+ static {
+ RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean();
+ args = runtimeMxBean.getInputArguments();
+ }
+
+ /**
+ * Returns true if {@code arg} is an input argument to the VM.
+ *
+ * This is useful for checking boolean flags such as -XX:+UseSerialGC or
+ * -XX:-UsePerfData.
+ *
+ * @param arg The name of the argument.
+ * @return {@code true} if the given argument is an input argument,
+ * otherwise {@code false}.
+ */
+ public static boolean contains(String arg) {
+ return args.contains(arg);
+ }
+
+ /**
+ * Returns true if {@code prefix} is the start of an input argument to the
+ * VM.
+ *
+ * This is useful for checking if flags describing a quantity, such as
+ * -XX:+MaxMetaspaceSize=100m, is set without having to know the quantity.
+ * To check if the flag -XX:MaxMetaspaceSize is set, use
+ * {@code InputArguments.containsPrefix("-XX:MaxMetaspaceSize")}.
+ *
+ * @param prefix The start of the argument.
+ * @return {@code true} if the given argument is the start of an input
+ * argument, otherwise {@code false}.
+ */
+ public static boolean containsPrefix(String prefix) {
+ for (String arg : args) {
+ if (arg.startsWith(prefix)) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/JDKToolFinder.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2013, 2015, 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.test.lib;
+
+import java.io.FileNotFoundException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+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 + (Platform.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();
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/JDKToolLauncher.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,134 @@
+/*
+ * Copyright (c) 2013, 2015, 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.test.lib;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+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("-XX:+PrintGC");
+ * .addVMArg("-XX:+PrintGCDetails")
+ * .addToolArg("-heap")
+ * .addToolArg(pid);
+ * ProcessBuilder pb = new ProcessBuilder(jmap.getCommand());
+ * Process p = pb.start();
+ * }
+ * </pre>
+ */
+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);
+ }
+ vmArgs.addAll(Arrays.asList(ProcessTools.getPlatformSpecificVMArgs()));
+ }
+
+ /**
+ * 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()]);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/OutputAnalyzer.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,436 @@
+/*
+ * Copyright (c) 2013, 2015, 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.test.lib;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public final class OutputAnalyzer {
+
+ private final String stdout;
+ private final String stderr;
+ private final int exitValue;
+
+ /**
+ * Create an OutputAnalyzer, a utility class for verifying output and exit
+ * value from a Process
+ *
+ * @param process Process to analyze
+ * @throws IOException If an I/O error occurs.
+ */
+ public OutputAnalyzer(Process process) throws IOException {
+ OutputBuffer output = ProcessTools.getOutput(process);
+ exitValue = process.exitValue();
+ this.stdout = output.getStdout();
+ this.stderr = output.getStderr();
+ }
+
+ /**
+ * Create an OutputAnalyzer, a utility class for verifying output
+ *
+ * @param buf String buffer to analyze
+ */
+ public OutputAnalyzer(String buf) {
+ this(buf, buf);
+ }
+
+ /**
+ * Create an OutputAnalyzer, a utility class for verifying output
+ *
+ * @param stdout stdout buffer to analyze
+ * @param stderr stderr buffer to analyze
+ */
+ public OutputAnalyzer(String stdout, String stderr) {
+ this.stdout = stdout;
+ this.stderr = stderr;
+ exitValue = -1;
+ }
+
+ /**
+ * Verify that the stdout contents of output buffer is empty
+ *
+ * @throws RuntimeException
+ * If stdout was not empty
+ */
+ public void stdoutShouldBeEmpty() {
+ if (!getStdout().isEmpty()) {
+ reportDiagnosticSummary();
+ throw new RuntimeException("stdout was not empty");
+ }
+ }
+
+ /**
+ * Verify that the stderr contents of output buffer is empty
+ *
+ * @throws RuntimeException
+ * If stderr was not empty
+ */
+ public void stderrShouldBeEmpty() {
+ if (!getStderr().isEmpty()) {
+ reportDiagnosticSummary();
+ throw new RuntimeException("stderr was not empty");
+ }
+ }
+
+ /**
+ * Verify that the stdout contents of output buffer is not empty
+ *
+ * @throws RuntimeException
+ * If stdout was empty
+ */
+ public void stdoutShouldNotBeEmpty() {
+ if (getStdout().isEmpty()) {
+ reportDiagnosticSummary();
+ throw new RuntimeException("stdout was empty");
+ }
+ }
+
+ /**
+ * Verify that the stderr contents of output buffer is not empty
+ *
+ * @throws RuntimeException
+ * If stderr was empty
+ */
+ public void stderrShouldNotBeEmpty() {
+ if (getStderr().isEmpty()) {
+ reportDiagnosticSummary();
+ throw new RuntimeException("stderr was empty");
+ }
+ }
+
+ /**
+ * Verify that the stdout and stderr contents of output buffer contains the string
+ *
+ * @param expectedString String that buffer should contain
+ * @throws RuntimeException If the string was not found
+ */
+ public OutputAnalyzer shouldContain(String expectedString) {
+ if (!stdout.contains(expectedString) && !stderr.contains(expectedString)) {
+ reportDiagnosticSummary();
+ throw new RuntimeException("'" + expectedString + "' missing from stdout/stderr \n");
+ }
+ return this;
+ }
+
+ /**
+ * Verify that the stdout contents of output buffer contains the string
+ *
+ * @param expectedString String that buffer should contain
+ * @throws RuntimeException If the string was not found
+ */
+ public OutputAnalyzer stdoutShouldContain(String expectedString) {
+ if (!stdout.contains(expectedString)) {
+ reportDiagnosticSummary();
+ throw new RuntimeException("'" + expectedString + "' missing from stdout \n");
+ }
+ return this;
+ }
+
+ /**
+ * Verify that the stderr contents of output buffer contains the string
+ *
+ * @param expectedString String that buffer should contain
+ * @throws RuntimeException If the string was not found
+ */
+ public OutputAnalyzer stderrShouldContain(String expectedString) {
+ if (!stderr.contains(expectedString)) {
+ reportDiagnosticSummary();
+ throw new RuntimeException("'" + expectedString + "' missing from stderr \n");
+ }
+ return this;
+ }
+
+ /**
+ * Verify that the stdout and stderr contents of output buffer does not contain the string
+ *
+ * @param expectedString String that the buffer should not contain
+ * @throws RuntimeException If the string was found
+ */
+ public OutputAnalyzer shouldNotContain(String notExpectedString) {
+ if (stdout.contains(notExpectedString)) {
+ reportDiagnosticSummary();
+ throw new RuntimeException("'" + notExpectedString + "' found in stdout \n");
+ }
+ if (stderr.contains(notExpectedString)) {
+ reportDiagnosticSummary();
+ throw new RuntimeException("'" + notExpectedString + "' found in stderr \n");
+ }
+ return this;
+ }
+
+ /**
+ * Verify that the stdout contents of output buffer does not contain the string
+ *
+ * @param expectedString String that the buffer should not contain
+ * @throws RuntimeException If the string was found
+ */
+ public OutputAnalyzer stdoutShouldNotContain(String notExpectedString) {
+ if (stdout.contains(notExpectedString)) {
+ reportDiagnosticSummary();
+ throw new RuntimeException("'" + notExpectedString + "' found in stdout \n");
+ }
+ return this;
+ }
+
+ /**
+ * Verify that the stderr contents of output buffer does not contain the string
+ *
+ * @param expectedString String that the buffer should not contain
+ * @throws RuntimeException If the string was found
+ */
+ public OutputAnalyzer stderrShouldNotContain(String notExpectedString) {
+ if (stderr.contains(notExpectedString)) {
+ reportDiagnosticSummary();
+ throw new RuntimeException("'" + notExpectedString + "' found in stderr \n");
+ }
+ return this;
+ }
+
+ /**
+ * Verify that the stdout and stderr contents of output buffer matches
+ * the pattern
+ *
+ * @param pattern
+ * @throws RuntimeException If the pattern was not found
+ */
+ public OutputAnalyzer shouldMatch(String pattern) {
+ Matcher stdoutMatcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout);
+ Matcher stderrMatcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
+ if (!stdoutMatcher.find() && !stderrMatcher.find()) {
+ reportDiagnosticSummary();
+ throw new RuntimeException("'" + pattern
+ + "' missing from stdout/stderr \n");
+ }
+ return this;
+ }
+
+ /**
+ * Verify that the stdout contents of output buffer matches the
+ * pattern
+ *
+ * @param pattern
+ * @throws RuntimeException If the pattern was not found
+ */
+ public OutputAnalyzer stdoutShouldMatch(String pattern) {
+ Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout);
+ if (!matcher.find()) {
+ reportDiagnosticSummary();
+ throw new RuntimeException("'" + pattern
+ + "' missing from stdout \n");
+ }
+ return this;
+ }
+
+ /**
+ * Verify that the stderr contents of output buffer matches the
+ * pattern
+ *
+ * @param pattern
+ * @throws RuntimeException If the pattern was not found
+ */
+ public OutputAnalyzer stderrShouldMatch(String pattern) {
+ Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
+ if (!matcher.find()) {
+ reportDiagnosticSummary();
+ throw new RuntimeException("'" + pattern
+ + "' missing from stderr \n");
+ }
+ return this;
+ }
+
+ /**
+ * Verify that the stdout and stderr contents of output buffer does not
+ * match the pattern
+ *
+ * @param pattern
+ * @throws RuntimeException If the pattern was found
+ */
+ public OutputAnalyzer shouldNotMatch(String pattern) {
+ Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout);
+ if (matcher.find()) {
+ reportDiagnosticSummary();
+ throw new RuntimeException("'" + pattern
+ + "' found in stdout: '" + matcher.group() + "' \n");
+ }
+ matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
+ if (matcher.find()) {
+ reportDiagnosticSummary();
+ throw new RuntimeException("'" + pattern
+ + "' found in stderr: '" + matcher.group() + "' \n");
+ }
+ return this;
+ }
+
+ /**
+ * Verify that the stdout contents of output buffer does not match the
+ * pattern
+ *
+ * @param pattern
+ * @throws RuntimeException If the pattern was found
+ */
+ public OutputAnalyzer stdoutShouldNotMatch(String pattern) {
+ Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout);
+ if (matcher.find()) {
+ reportDiagnosticSummary();
+ throw new RuntimeException("'" + pattern
+ + "' found in stdout \n");
+ }
+ return this;
+ }
+
+ /**
+ * Verify that the stderr contents of output buffer does not match the
+ * pattern
+ *
+ * @param pattern
+ * @throws RuntimeException If the pattern was found
+ */
+ public OutputAnalyzer stderrShouldNotMatch(String pattern) {
+ Matcher matcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
+ if (matcher.find()) {
+ reportDiagnosticSummary();
+ throw new RuntimeException("'" + pattern
+ + "' found in stderr \n");
+ }
+ return this;
+ }
+
+ /**
+ * Get the captured group of the first string matching the pattern.
+ * stderr is searched before stdout.
+ *
+ * @param pattern The multi-line pattern to match
+ * @param group The group to capture
+ * @return The matched string or null if no match was found
+ */
+ public String firstMatch(String pattern, int group) {
+ Matcher stderrMatcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
+ Matcher stdoutMatcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout);
+ if (stderrMatcher.find()) {
+ return stderrMatcher.group(group);
+ }
+ if (stdoutMatcher.find()) {
+ return stdoutMatcher.group(group);
+ }
+ return null;
+ }
+
+ /**
+ * Get the first string matching the pattern.
+ * stderr is searched before stdout.
+ *
+ * @param pattern The multi-line pattern to match
+ * @return The matched string or null if no match was found
+ */
+ public String firstMatch(String pattern) {
+ return firstMatch(pattern, 0);
+ }
+
+ /**
+ * Verify the exit value of the process
+ *
+ * @param expectedExitValue Expected exit value from process
+ * @throws RuntimeException If the exit value from the process did not match the expected value
+ */
+ public OutputAnalyzer shouldHaveExitValue(int expectedExitValue) {
+ if (getExitValue() != expectedExitValue) {
+ reportDiagnosticSummary();
+ throw new RuntimeException("Expected to get exit value of ["
+ + expectedExitValue + "]\n");
+ }
+ return this;
+ }
+
+
+ /**
+ * Report summary that will help to diagnose the problem
+ * Currently includes:
+ * - standard input produced by the process under test
+ * - standard output
+ * - exit code
+ * Note: the command line is printed by the ProcessTools
+ */
+ private void reportDiagnosticSummary() {
+ String msg =
+ " stdout: [" + stdout + "];\n" +
+ " stderr: [" + stderr + "]\n" +
+ " exitValue = " + getExitValue() + "\n";
+
+ System.err.println(msg);
+ }
+
+
+ /**
+ * Get the contents of the output buffer (stdout and stderr)
+ *
+ * @return Content of the output buffer
+ */
+ public String getOutput() {
+ return stdout + stderr;
+ }
+
+ /**
+ * Get the contents of the stdout buffer
+ *
+ * @return Content of the stdout buffer
+ */
+ public String getStdout() {
+ return stdout;
+ }
+
+ /**
+ * Get the contents of the stderr buffer
+ *
+ * @return Content of the stderr buffer
+ */
+ public String getStderr() {
+ return stderr;
+ }
+
+ /**
+ * Get the process exit value
+ *
+ * @return Process exit value
+ */
+ public int getExitValue() {
+ return exitValue;
+ }
+
+ /**
+ * Get the contents of the output buffer (stdout and stderr) as list of strings.
+ * Output will be split by newlines.
+ *
+ * @return Contents of the output buffer as list of strings
+ */
+ public List<String> asLines() {
+ return asLines(getOutput());
+ }
+
+ private List<String> asLines(String buffer) {
+ return Arrays.asList(buffer.split("(\\r\\n|\\n|\\r)"));
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/OutputBuffer.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2013, 2015, 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.test.lib;
+
+public class OutputBuffer {
+ private final String stdout;
+ private final String stderr;
+
+ /**
+ * Create an OutputBuffer, a class for storing and managing stdout and stderr
+ * results separately
+ *
+ * @param stdout stdout result
+ * @param stderr stderr result
+ */
+ public OutputBuffer(String stdout, String stderr) {
+ this.stdout = stdout;
+ this.stderr = stderr;
+ }
+
+ /**
+ * Returns the stdout result
+ *
+ * @return stdout result
+ */
+ public String getStdout() {
+ return stdout;
+ }
+
+ /**
+ * Returns the stderr result
+ *
+ * @return stderr result
+ */
+ public String getStderr() {
+ return stderr;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/PerfCounter.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2013, 2015, 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.test.lib;
+
+import sun.jvmstat.monitor.Monitor;
+
+/**
+ * Represents a performance counter in the JVM.
+ *
+ * See http://openjdk.java.net/groups/hotspot/docs/Serviceability.html#bjvmstat
+ * for more details about performance counters.
+ */
+public class PerfCounter {
+ private final Monitor monitor;
+ private final String name;
+
+ PerfCounter(Monitor monitor, String name) {
+ this.monitor = monitor;
+ this.name = name;
+ }
+
+ /**
+ * Returns the value of this performance counter as a long.
+ *
+ * @return The long value of this performance counter
+ * @throws RuntimeException If the value of the performance counter isn't a long
+ */
+ public long longValue() {
+ Object value = monitor.getValue();
+ if (value instanceof Long) {
+ return ((Long) value).longValue();
+ }
+ throw new RuntimeException("Expected " + monitor.getName() + " to have a long value");
+ }
+
+ /**
+ * Returns the name of the performance counter.
+ *
+ * @return The name of the performance counter.
+ */
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public String toString() {
+ return name;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/PerfCounters.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2013, 2015, 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.test.lib;
+
+import sun.jvmstat.monitor.Monitor;
+import sun.jvmstat.monitor.MonitorException;
+import sun.jvmstat.monitor.MonitoredHost;
+import sun.jvmstat.monitor.MonitoredVm;
+import sun.jvmstat.monitor.VmIdentifier;
+
+/**
+ * PerfCounters can be used to get a performance counter from the currently
+ * executing VM.
+ *
+ * Throws a runtime exception if an error occurs while communicating with the
+ * currently executing VM.
+ */
+public class PerfCounters {
+ private final static MonitoredVm vm;
+
+ static {
+ try {
+ String pid = Integer.toString(ProcessTools.getProcessId());
+ VmIdentifier vmId = new VmIdentifier(pid);
+ MonitoredHost host = MonitoredHost.getMonitoredHost(vmId);
+ vm = host.getMonitoredVm(vmId);
+ } catch (Exception e) {
+ throw new RuntimeException("Could not connect to the VM");
+ }
+ }
+
+ /**
+ * Returns the performance counter with the given name.
+ *
+ * @param name The name of the performance counter.
+ * @throws IllegalArgumentException If no counter with the given name exists.
+ * @throws MonitorException If an error occurs while communicating with the VM.
+ * @return The performance counter with the given name.
+ */
+ public static PerfCounter findByName(String name)
+ throws MonitorException, IllegalArgumentException {
+ Monitor m = vm.findByName(name);
+ if (m == null) {
+ throw new IllegalArgumentException("Did not find a performance counter with name " + name);
+ }
+ return new PerfCounter(m, name);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/Platform.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,199 @@
+/*
+ * Copyright (c) 2013, 2015, 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.test.lib;
+
+import java.util.regex.Pattern;
+import jdk.test.lib.Utils;
+
+public class Platform {
+ private static final String osName = System.getProperty("os.name");
+ private static final String dataModel = System.getProperty("sun.arch.data.model");
+ private static final String vmVersion = System.getProperty("java.vm.version");
+ private static final String javaVersion = System.getProperty("java.version");
+ private static final String osArch = System.getProperty("os.arch");
+ private static final String vmName = System.getProperty("java.vm.name");
+ private static final String userName = System.getProperty("user.name");
+ private static final String compiler = System.getProperty("sun.management.compiler");
+
+ public static boolean isClient() {
+ return vmName.endsWith(" Client VM");
+ }
+
+ public static boolean isServer() {
+ return vmName.endsWith(" Server VM");
+ }
+
+ public static boolean isGraal() {
+ return vmName.endsWith(" Graal VM");
+ }
+
+ public static boolean isZero() {
+ return vmName.endsWith(" Zero VM");
+ }
+
+ public static boolean isMinimal() {
+ return vmName.endsWith(" Minimal VM");
+ }
+
+ public static boolean isEmbedded() {
+ return vmName.contains("Embedded");
+ }
+
+ public static boolean isTieredSupported() {
+ return compiler.contains("Tiered Compilers");
+ }
+
+ public static boolean is32bit() {
+ return dataModel.equals("32");
+ }
+
+ public static boolean is64bit() {
+ return dataModel.equals("64");
+ }
+
+ public static boolean isAix() {
+ return isOs("aix");
+ }
+
+ public static boolean isLinux() {
+ return isOs("linux");
+ }
+
+ public static boolean isOSX() {
+ return isOs("mac");
+ }
+
+ public static boolean isSolaris() {
+ return isOs("sunos");
+ }
+
+ public static boolean isWindows() {
+ return isOs("win");
+ }
+
+ private static boolean isOs(String osname) {
+ return osName.toLowerCase().startsWith(osname.toLowerCase());
+ }
+
+ public static String getOsName() {
+ return osName;
+ }
+
+ public static boolean isDebugBuild() {
+ return (vmVersion.toLowerCase().contains("debug") ||
+ javaVersion.toLowerCase().contains("debug"));
+ }
+
+ public static String getVMVersion() {
+ return vmVersion;
+ }
+
+ // Returns true for sparc and sparcv9.
+ public static boolean isSparc() {
+ return isArch("sparc.*");
+ }
+
+ public static boolean isARM() {
+ return isArch("arm.*");
+ }
+
+ public static boolean isPPC() {
+ return isArch("ppc.*");
+ }
+
+ public static boolean isX86() {
+ // On Linux it's 'i386', Windows 'x86' without '_64' suffix.
+ return isArch("(i386)|(x86(?!_64))");
+ }
+
+ public static boolean isX64() {
+ // On OSX it's 'x86_64' and on other (Linux, Windows and Solaris) platforms it's 'amd64'
+ return isArch("(amd64)|(x86_64)");
+ }
+
+ private static boolean isArch(String archnameRE) {
+ return Pattern.compile(archnameRE, Pattern.CASE_INSENSITIVE)
+ .matcher(osArch)
+ .matches();
+ }
+
+ public static String getOsArch() {
+ return osArch;
+ }
+
+ /**
+ * Return a boolean for whether we expect to be able to attach
+ * the SA to our own processes on this system.
+ */
+ public static boolean shouldSAAttach() throws Exception {
+
+ if (isAix()) {
+ return false; // SA not implemented.
+ } else if (isLinux()) {
+ return canPtraceAttachLinux();
+ } else if (isOSX()) {
+ return canAttachOSX();
+ } else {
+ // Other platforms expected to work:
+ return true;
+ }
+ }
+
+ /**
+ * On Linux, first check the SELinux boolean "deny_ptrace" and return false
+ * as we expect to be denied if that is "1". Then expect permission to attach
+ * if we are root, so return true. Then return false for an expected denial
+ * if "ptrace_scope" is 1, and true otherwise.
+ */
+ public static boolean canPtraceAttachLinux() throws Exception {
+
+ // SELinux deny_ptrace:
+ String deny_ptrace = Utils.fileAsString("/sys/fs/selinux/booleans/deny_ptrace");
+ if (deny_ptrace != null && deny_ptrace.contains("1")) {
+ // ptrace will be denied:
+ return false;
+ }
+
+ if (userName.equals("root")) {
+ return true;
+ }
+
+ // ptrace_scope:
+ String ptrace_scope = Utils.fileAsString("/proc/sys/kernel/yama/ptrace_scope");
+ if (ptrace_scope != null && ptrace_scope.contains("1")) {
+ // ptrace will be denied:
+ return false;
+ }
+
+ // Otherwise expect to be permitted:
+ return true;
+ }
+
+ /**
+ * On OSX, expect permission to attach only if we are root.
+ */
+ public static boolean canAttachOSX() throws Exception {
+ return userName.equals("root");
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/ProcessTools.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,249 @@
+/*
+ * Copyright (c) 2013, 2015, 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.test.lib;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.lang.management.ManagementFactory;
+import java.lang.management.RuntimeMXBean;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+public final class ProcessTools {
+
+ private ProcessTools() {
+ }
+
+ /**
+ * Pumps stdout and stderr from running the process into a String.
+ *
+ * @param processHandler ProcessHandler to run.
+ * @return Output from process.
+ * @throws IOException If an I/O error occurs.
+ */
+ public static OutputBuffer getOutput(ProcessBuilder processBuilder) throws IOException {
+ return getOutput(processBuilder.start());
+ }
+
+ /**
+ * Pumps stdout and stderr the running process into a String.
+ *
+ * @param process Process to pump.
+ * @return Output from process.
+ * @throws IOException If an I/O error occurs.
+ */
+ public static OutputBuffer getOutput(Process process) throws IOException {
+ ByteArrayOutputStream stderrBuffer = new ByteArrayOutputStream();
+ ByteArrayOutputStream stdoutBuffer = new ByteArrayOutputStream();
+ StreamPumper outPumper = new StreamPumper(process.getInputStream(), stdoutBuffer);
+ StreamPumper errPumper = new StreamPumper(process.getErrorStream(), stderrBuffer);
+ Thread outPumperThread = new Thread(outPumper);
+ Thread errPumperThread = new Thread(errPumper);
+
+ outPumperThread.setDaemon(true);
+ errPumperThread.setDaemon(true);
+
+ outPumperThread.start();
+ errPumperThread.start();
+
+ try {
+ process.waitFor();
+ outPumperThread.join();
+ errPumperThread.join();
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ return null;
+ }
+
+ return new OutputBuffer(stdoutBuffer.toString(), stderrBuffer.toString());
+ }
+
+ /**
+ * Get the process id of the current running Java process
+ *
+ * @return Process id
+ */
+ public static int getProcessId() throws Exception {
+ RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
+ int pid = Integer.parseInt(runtime.getName().split("@")[0]);
+
+ return pid;
+ }
+
+ /**
+ * Get the string containing input arguments passed to the VM
+ *
+ * @return arguments
+ */
+ public static String getVmInputArguments() {
+ RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
+
+ List<String> args = runtime.getInputArguments();
+ StringBuilder result = new StringBuilder();
+ for (String arg : args)
+ result.append(arg).append(' ');
+
+ return result.toString();
+ }
+
+ /**
+ * Get platform specific VM arguments (e.g. -d64 on 64bit Solaris)
+ *
+ * @return String[] with platform specific arguments, empty if there are none
+ */
+ public static String[] getPlatformSpecificVMArgs() {
+
+ if (Platform.is64bit() && Platform.isSolaris()) {
+ return new String[] { "-d64" };
+ }
+
+ return new String[] {};
+ }
+
+ /**
+ * Create ProcessBuilder using the java launcher from the jdk to be tested and
+ * with any platform specific arguments prepended
+ */
+ public static ProcessBuilder createJavaProcessBuilder(String... command) throws Exception {
+ return createJavaProcessBuilder(false, command);
+ }
+
+ public static ProcessBuilder createJavaProcessBuilder(boolean addTestVmAndJavaOptions, String... command) throws Exception {
+ String javapath = JDKToolFinder.getJDKTool("java");
+
+ ArrayList<String> args = new ArrayList<>();
+ args.add(javapath);
+ Collections.addAll(args, getPlatformSpecificVMArgs());
+
+ args.add("-cp");
+ args.add(System.getProperty("java.class.path"));
+
+ if (addTestVmAndJavaOptions) {
+ Collections.addAll(args, Utils.getTestJavaOpts());
+ }
+
+ Collections.addAll(args, command);
+
+ // Reporting
+ StringBuilder cmdLine = new StringBuilder();
+ for (String cmd : args) {
+ cmdLine.append(cmd).append(' ');
+ }
+ System.out.println("Command line: [" + cmdLine.toString() + "]");
+
+ return new ProcessBuilder(args.toArray(new String[args.size()]));
+ }
+
+ /**
+ * Executes a test jvm process, waits for it to finish and returns the process output.
+ * The default jvm options from jtreg, test.vm.opts and test.java.opts, are added.
+ * The java from the test.jdk is used to execute the command.
+ *
+ * The command line will be like:
+ * {test.jdk}/bin/java {test.vm.opts} {test.java.opts} cmds
+ *
+ * @param cmds User specifed arguments.
+ * @return The output from the process.
+ */
+ public static OutputAnalyzer executeTestJvm(String... cmds) throws Throwable {
+ ProcessBuilder pb = createJavaProcessBuilder(Utils.addTestJavaOpts(cmds));
+ return executeProcess(pb);
+ }
+
+ /**
+ * Executes a process, waits for it to finish and returns the process output.
+ * The process will have exited before this method returns.
+ * @param pb The ProcessBuilder to execute.
+ * @return The {@linkplain OutputAnalyzer} instance wrapping the process.
+ */
+ public static OutputAnalyzer executeProcess(ProcessBuilder pb) throws Exception {
+ OutputAnalyzer output = null;
+ Process p = null;
+ boolean failed = false;
+ try {
+ p = pb.start();
+ output = new OutputAnalyzer(p);
+ p.waitFor();
+
+ return output;
+ } catch (Throwable t) {
+ if (p != null) {
+ p.destroyForcibly().waitFor();
+ }
+
+ failed = true;
+ System.out.println("executeProcess() failed: " + t);
+ throw t;
+ } finally {
+ if (failed) {
+ System.err.println(getProcessLog(pb, output));
+ }
+ }
+ }
+
+ /**
+ * Executes a process, waits for it to finish and returns the process output.
+ * @param cmds The command line to execute.
+ * @return The output from the process.
+ */
+ public static OutputAnalyzer executeProcess(String... cmds) throws Throwable {
+ return executeProcess(new ProcessBuilder(cmds));
+ }
+
+ /**
+ * Used to log command line, stdout, stderr and exit code from an executed process.
+ * @param pb The executed process.
+ * @param output The output from the process.
+ */
+ public static String getProcessLog(ProcessBuilder pb, OutputAnalyzer output) {
+ String stderr = output == null ? "null" : output.getStderr();
+ String stdout = output == null ? "null" : output.getStdout();
+ String exitValue = output == null ? "null": Integer.toString(output.getExitValue());
+ StringBuilder logMsg = new StringBuilder();
+ final String nl = System.getProperty("line.separator");
+ logMsg.append("--- ProcessLog ---" + nl);
+ logMsg.append("cmd: " + getCommandLine(pb) + nl);
+ logMsg.append("exitvalue: " + exitValue + nl);
+ logMsg.append("stderr: " + stderr + nl);
+ logMsg.append("stdout: " + stdout + nl);
+ return logMsg.toString();
+ }
+
+ /**
+ * @return The full command line for the ProcessBuilder.
+ */
+ public static String getCommandLine(ProcessBuilder pb) {
+ if (pb == null) {
+ return "null";
+ }
+ StringBuilder cmd = new StringBuilder();
+ for (String s : pb.command()) {
+ cmd.append(s).append(" ");
+ }
+ return cmd.toString().trim();
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/StreamPumper.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2013, 2015, 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.test.lib;
+
+import java.io.OutputStream;
+import java.io.InputStream;
+import java.io.IOException;
+
+public final class StreamPumper implements Runnable {
+
+ private static final int BUF_SIZE = 256;
+
+ private final OutputStream out;
+ private final InputStream in;
+
+ /**
+ * Create a StreamPumper that reads from in and writes to out.
+ *
+ * @param in The stream to read from.
+ * @param out The stream to write to.
+ */
+ public StreamPumper(InputStream in, OutputStream out) {
+ this.in = in;
+ this.out = out;
+ }
+
+ /**
+ * Implements Thread.run(). Continuously read from <code>in</code> and write
+ * to <code>out</code> until <code>in</code> has reached end of stream. Abort
+ * on interruption. Abort on IOExceptions.
+ */
+ @Override
+ public void run() {
+ int length;
+ InputStream localIn = in;
+ OutputStream localOut = out;
+ byte[] buffer = new byte[BUF_SIZE];
+
+ try {
+ while (!Thread.interrupted() && (length = localIn.read(buffer)) > 0) {
+ localOut.write(buffer, 0, length);
+ }
+ } catch (IOException e) {
+ // Just abort if something like this happens.
+ e.printStackTrace();
+ } finally {
+ try {
+ localOut.flush();
+ in.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/TimeLimitedRunner.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2014, 2015, 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.test.lib;
+
+import java.util.Objects;
+import java.util.concurrent.Callable;
+
+/**
+ * Auxiliary class to run target w/ given timeout.
+ */
+public class TimeLimitedRunner implements Callable<Void> {
+ private final long stoptime;
+ private final long timeout;
+ private final double factor;
+ private final Callable<Boolean> target;
+
+ /**
+ * @param timeout a timeout. zero means no time limitation
+ * @param factor a multiplier used to estimate next iteration time
+ * @param target a target to run
+ * @throws NullPointerException if target is null
+ * @throws IllegalArgumentException if timeout is negative or
+ factor isn't positive
+ */
+ public TimeLimitedRunner(long timeout, double factor,
+ Callable<Boolean> target) {
+ Objects.requireNonNull(target, "target must not be null");
+ if (timeout < 0) {
+ throw new IllegalArgumentException("timeout[" + timeout + "] < 0");
+ }
+ if (factor <= 0d) {
+ throw new IllegalArgumentException("factor[" + factor + "] <= 0");
+ }
+ this.stoptime = System.currentTimeMillis() + timeout;
+ this.timeout = timeout;
+ this.factor = factor;
+ this.target = target;
+ }
+
+ /**
+ * Runs @{linkplan target} while it returns true and timeout isn't exceeded
+ */
+ @Override
+ public Void call() throws Exception {
+ long maxDuration = 0L;
+ long iterStart = System.currentTimeMillis();
+ if (timeout != 0 && iterStart > stoptime) {
+ return null;
+ }
+ while (target.call()) {
+ if (timeout != 0) {
+ long iterDuration = System.currentTimeMillis() - iterStart;
+ maxDuration = Math.max(maxDuration, iterDuration);
+ iterStart = System.currentTimeMillis();
+ if (iterStart + (maxDuration * factor) > stoptime) {
+ System.out.println("Not enough time to continue execution. "
+ + "Interrupted.");
+ break;
+ }
+ }
+ }
+ return null;
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/Utils.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,435 @@
+/*
+ * Copyright (c) 2013, 2015, 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.test.lib;
+
+import static jdk.test.lib.Asserts.assertTrue;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.net.InetAddress;
+import java.net.ServerSocket;
+import java.net.UnknownHostException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Random;
+import java.util.function.BooleanSupplier;
+import java.util.concurrent.TimeUnit;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+import sun.misc.Unsafe;
+
+/**
+ * Common library for various test helper functions.
+ */
+public final class Utils {
+
+ /**
+ * Returns the sequence used by operating system to separate lines.
+ */
+ public static final String NEW_LINE = System.getProperty("line.separator");
+
+ /**
+ * Returns the value of 'test.vm.opts'system property.
+ */
+ public static final String VM_OPTIONS = System.getProperty("test.vm.opts", "").trim();
+
+ /**
+ * Returns the value of 'test.java.opts'system property.
+ */
+ public static final String JAVA_OPTIONS = System.getProperty("test.java.opts", "").trim();
+
+ private static Unsafe unsafe = null;
+
+ /**
+ * Defines property name for seed value.
+ */
+ public static final String SEED_PROPERTY_NAME = "jdk.test.lib.random.seed";
+
+ /* (non-javadoc)
+ * Random generator with (or without) predefined seed. Depends on
+ * "jdk.test.lib.random.seed" property value.
+ */
+ private static volatile Random RANDOM_GENERATOR;
+
+ /**
+ * Contains the seed value used for {@link java.util.Random} creation.
+ */
+ public static final long SEED = Long.getLong(SEED_PROPERTY_NAME, new Random().nextLong());
+ /**
+ * Returns the value of 'test.timeout.factor' system property
+ * converted to {@code double}.
+ */
+ public static final double TIMEOUT_FACTOR;
+ static {
+ String toFactor = System.getProperty("test.timeout.factor", "1.0");
+ TIMEOUT_FACTOR = Double.parseDouble(toFactor);
+ }
+
+ /**
+ * Returns the value of JTREG default test timeout in milliseconds
+ * converted to {@code long}.
+ */
+ public static final long DEFAULT_TEST_TIMEOUT = TimeUnit.SECONDS.toMillis(120);
+
+ private Utils() {
+ // Private constructor to prevent class instantiation
+ }
+
+ /**
+ * Returns the list of VM options.
+ *
+ * @return List of VM options
+ */
+ public static List<String> getVmOptions() {
+ return Arrays.asList(safeSplitString(VM_OPTIONS));
+ }
+
+ /**
+ * Returns the list of VM options with -J prefix.
+ *
+ * @return The list of VM options with -J prefix
+ */
+ public static List<String> getForwardVmOptions() {
+ String[] opts = safeSplitString(VM_OPTIONS);
+ for (int i = 0; i < opts.length; i++) {
+ opts[i] = "-J" + opts[i];
+ }
+ return Arrays.asList(opts);
+ }
+
+ /**
+ * Returns the default JTReg arguments for a jvm running a test.
+ * This is the combination of JTReg arguments test.vm.opts and test.java.opts.
+ * @return An array of options, or an empty array if no opptions.
+ */
+ public static String[] getTestJavaOpts() {
+ List<String> opts = new ArrayList<String>();
+ Collections.addAll(opts, safeSplitString(VM_OPTIONS));
+ Collections.addAll(opts, safeSplitString(JAVA_OPTIONS));
+ return opts.toArray(new String[0]);
+ }
+
+ /**
+ * Returns the default JTReg arguments for a jvm running a test without
+ * options that matches regular expressions in {@code filters}.
+ * This is the combination of JTReg arguments test.vm.opts and test.java.opts.
+ * @param filters Regular expressions used to filter out options.
+ * @return An array of options, or an empty array if no options.
+ */
+ public static String[] getFilteredTestJavaOpts(String... filters) {
+ String options[] = getTestJavaOpts();
+
+ if (filters.length == 0) {
+ return options;
+ }
+
+ List<String> filteredOptions = new ArrayList<String>(options.length);
+ Pattern patterns[] = new Pattern[filters.length];
+ for (int i = 0; i < filters.length; i++) {
+ patterns[i] = Pattern.compile(filters[i]);
+ }
+
+ for (String option : options) {
+ boolean matched = false;
+ for (int i = 0; i < patterns.length && !matched; i++) {
+ Matcher matcher = patterns[i].matcher(option);
+ matched = matcher.find();
+ }
+ if (!matched) {
+ filteredOptions.add(option);
+ }
+ }
+
+ return filteredOptions.toArray(new String[filteredOptions.size()]);
+ }
+
+ /**
+ * Combines given arguments with default JTReg arguments for a jvm running a test.
+ * This is the combination of JTReg arguments test.vm.opts and test.java.opts
+ * @return The combination of JTReg test java options and user args.
+ */
+ public static String[] addTestJavaOpts(String... userArgs) {
+ List<String> opts = new ArrayList<String>();
+ Collections.addAll(opts, getTestJavaOpts());
+ Collections.addAll(opts, userArgs);
+ return opts.toArray(new String[0]);
+ }
+
+ /**
+ * Splits a string by white space.
+ * Works like String.split(), but returns an empty array
+ * if the string is null or empty.
+ */
+ private static String[] safeSplitString(String s) {
+ if (s == null || s.trim().isEmpty()) {
+ return new String[] {};
+ }
+ return s.trim().split("\\s+");
+ }
+
+ /**
+ * @return The full command line for the ProcessBuilder.
+ */
+ public static String getCommandLine(ProcessBuilder pb) {
+ StringBuilder cmd = new StringBuilder();
+ for (String s : pb.command()) {
+ cmd.append(s).append(" ");
+ }
+ return cmd.toString();
+ }
+
+ /**
+ * Returns the free port on the local host.
+ * The function will spin until a valid port number is found.
+ *
+ * @return The port number
+ * @throws InterruptedException if any thread has interrupted the current thread
+ * @throws IOException if an I/O error occurs when opening the socket
+ */
+ public static int getFreePort() throws InterruptedException, IOException {
+ int port = -1;
+
+ while (port <= 0) {
+ Thread.sleep(100);
+
+ ServerSocket serverSocket = null;
+ try {
+ serverSocket = new ServerSocket(0);
+ port = serverSocket.getLocalPort();
+ } finally {
+ serverSocket.close();
+ }
+ }
+
+ return port;
+ }
+
+ /**
+ * Returns the name of the local host.
+ *
+ * @return The host name
+ * @throws UnknownHostException if IP address of a host could not be determined
+ */
+ public static String getHostname() throws UnknownHostException {
+ InetAddress inetAddress = InetAddress.getLocalHost();
+ String hostName = inetAddress.getHostName();
+
+ assertTrue((hostName != null && !hostName.isEmpty()),
+ "Cannot get hostname");
+
+ return hostName;
+ }
+
+ /**
+ * Uses "jcmd -l" to search for a jvm pid. This function will wait
+ * forever (until jtreg timeout) for the pid to be found.
+ * @param key Regular expression to search for
+ * @return The found pid.
+ */
+ public static int waitForJvmPid(String key) throws Throwable {
+ final long iterationSleepMillis = 250;
+ System.out.println("waitForJvmPid: Waiting for key '" + key + "'");
+ System.out.flush();
+ while (true) {
+ int pid = tryFindJvmPid(key);
+ if (pid >= 0) {
+ return pid;
+ }
+ Thread.sleep(iterationSleepMillis);
+ }
+ }
+
+ /**
+ * Searches for a jvm pid in the output from "jcmd -l".
+ *
+ * Example output from jcmd is:
+ * 12498 sun.tools.jcmd.JCmd -l
+ * 12254 /tmp/jdk8/tl/jdk/JTwork/classes/com/sun/tools/attach/Application.jar
+ *
+ * @param key A regular expression to search for.
+ * @return The found pid, or -1 if Enot found.
+ * @throws Exception If multiple matching jvms are found.
+ */
+ public static int tryFindJvmPid(String key) throws Throwable {
+ OutputAnalyzer output = null;
+ try {
+ JDKToolLauncher jcmdLauncher = JDKToolLauncher.create("jcmd");
+ jcmdLauncher.addToolArg("-l");
+ output = ProcessTools.executeProcess(jcmdLauncher.getCommand());
+ output.shouldHaveExitValue(0);
+
+ // Search for a line starting with numbers (pid), follwed by the key.
+ Pattern pattern = Pattern.compile("([0-9]+)\\s.*(" + key + ").*\\r?\\n");
+ Matcher matcher = pattern.matcher(output.getStdout());
+
+ int pid = -1;
+ if (matcher.find()) {
+ pid = Integer.parseInt(matcher.group(1));
+ System.out.println("findJvmPid.pid: " + pid);
+ if (matcher.find()) {
+ throw new Exception("Found multiple JVM pids for key: " + key);
+ }
+ }
+ return pid;
+ } catch (Throwable t) {
+ System.out.println(String.format("Utils.findJvmPid(%s) failed: %s", key, t));
+ throw t;
+ }
+ }
+
+ /**
+ * Return the contents of the named file as a single String,
+ * or null if not found.
+ * @param filename name of the file to read
+ * @return String contents of file, or null if file not found.
+ * @throws IOException
+ * if an I/O error occurs reading from the file or a malformed or
+ * unmappable byte sequence is read
+ */
+ public static String fileAsString(String filename) throws IOException {
+ Path filePath = Paths.get(filename);
+ return Files.exists(filePath)
+ ? Files.lines(filePath).collect(Collectors.joining(NEW_LINE))
+ : null;
+ }
+
+ /**
+ * @return Unsafe instance.
+ */
+ public static synchronized Unsafe getUnsafe() {
+ if (unsafe == null) {
+ try {
+ Field f = Unsafe.class.getDeclaredField("theUnsafe");
+ f.setAccessible(true);
+ unsafe = (Unsafe) f.get(null);
+ } catch (NoSuchFieldException | IllegalAccessException e) {
+ throw new RuntimeException("Unable to get Unsafe instance.", e);
+ }
+ }
+ return unsafe;
+ }
+ private static final char[] hexArray = new char[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
+
+ /**
+ * Returns hex view of byte array
+ *
+ * @param bytes byte array to process
+ * @return Space separated hexadecimal string representation of bytes
+ */
+
+ public static String toHexString(byte[] bytes) {
+ char[] hexView = new char[bytes.length * 3];
+ int i = 0;
+ for (byte b : bytes) {
+ hexView[i++] = hexArray[(b >> 4) & 0x0F];
+ hexView[i++] = hexArray[b & 0x0F];
+ hexView[i++] = ' ';
+ }
+ return new String(hexView);
+ }
+
+ /**
+ * Returns {@link java.util.Random} generator initialized with particular seed.
+ * The seed could be provided via system property {@link Utils#SEED_PROPERTY_NAME}
+ * In case no seed is provided, the method uses a random number.
+ * The used seed printed to stdout.
+ * @return {@link java.util.Random} generator with particular seed.
+ */
+ public static Random getRandomInstance() {
+ if (RANDOM_GENERATOR == null) {
+ synchronized (Utils.class) {
+ if (RANDOM_GENERATOR == null) {
+ RANDOM_GENERATOR = new Random(SEED);
+ System.out.printf("For random generator using seed: %d%n", SEED);
+ System.out.printf("To re-run test with same seed value please add \"-D%s=%d\" to command line.%n", SEED_PROPERTY_NAME, SEED);
+ }
+ }
+ }
+ return RANDOM_GENERATOR;
+ }
+
+ /**
+ * Wait for condition to be true
+ *
+ * @param condition, a condition to wait for
+ */
+ public static final void waitForCondition(BooleanSupplier condition) {
+ waitForCondition(condition, -1L, 100L);
+ }
+
+ /**
+ * Wait until timeout for condition to be true
+ *
+ * @param condition, a condition to wait for
+ * @param timeout a time in milliseconds to wait for condition to be true
+ * specifying -1 will wait forever
+ * @return condition value, to determine if wait was successfull
+ */
+ public static final boolean waitForCondition(BooleanSupplier condition,
+ long timeout) {
+ return waitForCondition(condition, timeout, 100L);
+ }
+
+ /**
+ * Wait until timeout for condition to be true for specified time
+ *
+ * @param condition, a condition to wait for
+ * @param timeout a time in milliseconds to wait for condition to be true,
+ * specifying -1 will wait forever
+ * @param sleepTime a time to sleep value in milliseconds
+ * @return condition value, to determine if wait was successfull
+ */
+ public static final boolean waitForCondition(BooleanSupplier condition,
+ long timeout, long sleepTime) {
+ long startTime = System.currentTimeMillis();
+ while (!(condition.getAsBoolean() || (timeout != -1L
+ && ((System.currentTimeMillis() - startTime) > timeout)))) {
+ try {
+ Thread.sleep(sleepTime);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new Error(e);
+ }
+ }
+ return condition.getAsBoolean();
+ }
+
+ /**
+ * Adjusts the provided timeout value for the TIMEOUT_FACTOR
+ * @param tOut the timeout value to be adjusted
+ * @return The timeout value adjusted for the value of "test.timeout.factor"
+ * system property
+ */
+ public static long adjustTimeout(long tOut) {
+ return Math.round(tOut * Utils.TIMEOUT_FACTOR);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/cli/CPUSpecificCommandLineOptionTest.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2014, 2015, 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.test.lib.cli;
+
+import jdk.test.lib.cli.predicate.CPUSpecificPredicate;
+
+/**
+ * Base class for command line options tests that
+ * requires specific CPU arch or specific CPU features.
+ */
+public abstract class CPUSpecificCommandLineOptionTest
+ extends CommandLineOptionTest {
+ /**
+ * Creates new CPU specific test instance that does not
+ * require any CPU features.
+ *
+ * @param cpuArchPattern Regular expression that should
+ * match os.arch.
+ */
+ public CPUSpecificCommandLineOptionTest(String cpuArchPattern) {
+ this(cpuArchPattern, null, null);
+ }
+
+ /**
+ * Creates new CPU specific test instance that does not
+ * require from CPU support of {@code supportedCPUFeatures} features
+ * and no support of {@code unsupportedCPUFeatures}.
+ *
+ * @param cpuArchPattern Regular expression that should
+ * match os.arch.
+ * @param supportedCPUFeatures Array with names of features that
+ * should be supported by CPU. If {@code null},
+ * then no features have to be supported.
+ * @param unsupportedCPUFeatures Array with names of features that
+ * should not be supported by CPU.
+ * If {@code null}, then CPU may support any
+ * features.
+ */
+ public CPUSpecificCommandLineOptionTest(String cpuArchPattern,
+ String supportedCPUFeatures[], String unsupportedCPUFeatures[]) {
+ super(new CPUSpecificPredicate(cpuArchPattern, supportedCPUFeatures,
+ unsupportedCPUFeatures));
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/cli/CommandLineOptionTest.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,396 @@
+/*
+ * Copyright (c) 2014, 2015, 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.test.lib.cli;
+
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.function.BooleanSupplier;
+
+import jdk.test.lib.*;
+
+/**
+ * Base class for command line option tests.
+ */
+public abstract class CommandLineOptionTest {
+ public static final String UNLOCK_DIAGNOSTIC_VM_OPTIONS
+ = "-XX:+UnlockDiagnosticVMOptions";
+ public static final String UNLOCK_EXPERIMENTAL_VM_OPTIONS
+ = "-XX:+UnlockExperimentalVMOptions";
+ protected static final String UNRECOGNIZED_OPTION_ERROR_FORMAT
+ = "Unrecognized VM option '[+-]?%s(=.*)?'";
+ protected static final String EXPERIMENTAL_OPTION_ERROR_FORMAT
+ = "VM option '%s' is experimental and must be enabled via "
+ + "-XX:\\+UnlockExperimentalVMOptions.";
+ protected static final String DIAGNOSTIC_OPTION_ERROR_FORMAT
+ = " VM option '%s' is diagnostic and must be enabled via "
+ + "-XX:\\+UnlockDiagnosticVMOptions.";
+ private static final String PRINT_FLAGS_FINAL_FORMAT = "%s\\s*:?=\\s*%s";
+
+ /**
+ * Verifies that JVM startup behavior matches our expectations.
+ *
+ * @param option an option that should be passed to JVM
+ * @param expectedMessages an array of patterns that should occur
+ * in JVM output. If {@code null} then
+ * JVM output could be empty.
+ * @param unexpectedMessages an array of patterns that should not
+ * occur in JVM output. If {@code null} then
+ * JVM output could be empty.
+ * @param exitErrorMessage message that will be shown if exit code is not
+ * as expected.
+ * @param wrongWarningMessage message that will be shown if warning
+ * messages are not as expected.
+ * @param exitCode expected exit code.
+ * @throws Throwable if verification fails or some other issues occur.
+ */
+ public static void verifyJVMStartup(String option,
+ String expectedMessages[], String unexpectedMessages[],
+ String exitErrorMessage, String wrongWarningMessage,
+ ExitCode exitCode) throws Throwable {
+ CommandLineOptionTest.verifyJVMStartup(expectedMessages,
+ unexpectedMessages, exitErrorMessage,
+ wrongWarningMessage, exitCode, false, option);
+ }
+
+ /**
+ * Verifies that JVM startup behavior matches our expectations.
+ *
+ * @param expectedMessages an array of patterns that should occur
+ * in JVM output. If {@code null} then
+ * JVM output could be empty.
+ * @param unexpectedMessages an array of patterns that should not
+ * occur in JVM output. If {@code null} then
+ * JVM output could be empty.
+ * @param exitErrorMessage message that will be shown if exit code is not
+ * as expected.
+ * @param wrongWarningMessage message that will be shown if warning
+ * messages are not as expected.
+ * @param exitCode expected exit code.
+ * @param addTestVMOptions if {@code true} then test VM options will be
+ * passed to VM.
+ * @param options options that should be passed to VM in addition to mode
+ * flag.
+ * @throws Throwable if verification fails or some other issues occur.
+ */
+ public static void verifyJVMStartup(String expectedMessages[],
+ String unexpectedMessages[], String exitErrorMessage,
+ String wrongWarningMessage, ExitCode exitCode,
+ boolean addTestVMOptions, String... options)
+ throws Throwable {
+ List<String> finalOptions = new ArrayList<>();
+ if (addTestVMOptions) {
+ Collections.addAll(finalOptions, Utils.getTestJavaOpts());
+ }
+ Collections.addAll(finalOptions, options);
+ finalOptions.add("-version");
+
+ ProcessBuilder processBuilder
+ = ProcessTools.createJavaProcessBuilder(finalOptions.toArray(
+ new String[finalOptions.size()]));
+ OutputAnalyzer outputAnalyzer
+ = new OutputAnalyzer(processBuilder.start());
+
+ try {
+ outputAnalyzer.shouldHaveExitValue(exitCode.value);
+ } catch (RuntimeException e) {
+ String errorMessage = String.format(
+ "JVM process should have exit value '%d'.%n%s",
+ exitCode.value, exitErrorMessage);
+ throw new AssertionError(errorMessage, e);
+ }
+
+
+ if (expectedMessages != null) {
+ for (String expectedMessage : expectedMessages) {
+ try {
+ outputAnalyzer.shouldMatch(expectedMessage);
+ } catch (RuntimeException e) {
+ String errorMessage = String.format(
+ "Expected message not found: '%s'.%n%s",
+ expectedMessage, wrongWarningMessage);
+ throw new AssertionError(errorMessage, e);
+ }
+ }
+ }
+
+ if (unexpectedMessages != null) {
+ for (String unexpectedMessage : unexpectedMessages) {
+ try {
+ outputAnalyzer.shouldNotMatch(unexpectedMessage);
+ } catch (RuntimeException e) {
+ String errorMessage = String.format(
+ "Unexpected message found: '%s'.%n%s",
+ unexpectedMessage, wrongWarningMessage);
+ throw new AssertionError(errorMessage, e);
+ }
+ }
+ }
+ }
+
+ /**
+ * Verifies that JVM startup behavior matches our expectations when type
+ * of newly started VM is the same as the type of current.
+ *
+ * @param expectedMessages an array of patterns that should occur
+ * in JVM output. If {@code null} then
+ * JVM output could be empty.
+ * @param unexpectedMessages an array of patterns that should not
+ * occur in JVM output. If {@code null} then
+ * JVM output could be empty.
+ * @param exitErrorMessage Message that will be shown if exit value is not
+ * as expected.
+ * @param wrongWarningMessage message that will be shown if warning
+ * messages are not as expected.
+ * @param exitCode expected exit code.
+ * @param options options that should be passed to VM in addition to mode
+ * flag.
+ * @throws Throwable if verification fails or some other issues occur.
+ */
+ public static void verifySameJVMStartup(String expectedMessages[],
+ String unexpectedMessages[], String exitErrorMessage,
+ String wrongWarningMessage, ExitCode exitCode, String... options)
+ throws Throwable {
+ List<String> finalOptions = new ArrayList<>();
+ finalOptions.add(CommandLineOptionTest.getVMTypeOption());
+ Collections.addAll(finalOptions, options);
+
+ CommandLineOptionTest.verifyJVMStartup(expectedMessages,
+ unexpectedMessages, exitErrorMessage,
+ wrongWarningMessage, exitCode, false,
+ finalOptions.toArray(new String[finalOptions.size()]));
+ }
+
+ /**
+ * Verifies that value of specified JVM option is the same as
+ * expected value.
+ * This method filter out option with {@code optionName}
+ * name from test java options.
+ *
+ * @param optionName a name of tested option.
+ * @param expectedValue expected value of tested option.
+ * @param optionErrorString message will be shown if option value is not as
+ * expected.
+ * @param additionalVMOpts additional options that should be
+ * passed to JVM.
+ * @throws Throwable if verification fails or some other issues occur.
+ */
+ public static void verifyOptionValue(String optionName,
+ String expectedValue, String optionErrorString,
+ String... additionalVMOpts) throws Throwable {
+ verifyOptionValue(optionName, expectedValue, optionErrorString,
+ true, additionalVMOpts);
+ }
+
+ /**
+ * Verifies that value of specified JVM option is the same as
+ * expected value.
+ * This method filter out option with {@code optionName}
+ * name from test java options.
+ *
+ * @param optionName a name of tested option.
+ * @param expectedValue expected value of tested option.
+ * @param addTestVmOptions if {@code true}, then test VM options
+ * will be used.
+ * @param optionErrorString message will be shown if option value is not as
+ * expected.
+ * @param additionalVMOpts additional options that should be
+ * passed to JVM.
+ * @throws Throwable if verification fails or some other issues
+ * occur.
+ */
+ public static void verifyOptionValue(String optionName,
+ String expectedValue, String optionErrorString,
+ boolean addTestVmOptions, String... additionalVMOpts)
+ throws Throwable {
+ List<String> vmOpts = new ArrayList<>();
+
+ if (addTestVmOptions) {
+ Collections.addAll(vmOpts,
+ Utils.getFilteredTestJavaOpts(optionName));
+ }
+ Collections.addAll(vmOpts, additionalVMOpts);
+ Collections.addAll(vmOpts, "-XX:+PrintFlagsFinal", "-version");
+
+ ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder(
+ vmOpts.toArray(new String[vmOpts.size()]));
+
+ OutputAnalyzer outputAnalyzer
+ = new OutputAnalyzer(processBuilder.start());
+
+ try {
+ outputAnalyzer.shouldHaveExitValue(0);
+ } catch (RuntimeException e) {
+ String errorMessage = String.format(
+ "JVM should start with option '%s' without errors.",
+ optionName);
+ throw new AssertionError(errorMessage, e);
+ }
+ try {
+ outputAnalyzer.shouldMatch(String.format(
+ CommandLineOptionTest.PRINT_FLAGS_FINAL_FORMAT,
+ optionName, expectedValue));
+ } catch (RuntimeException e) {
+ String errorMessage = String.format(
+ "Option '%s' is expected to have '%s' value%n%s",
+ optionName, expectedValue,
+ optionErrorString);
+ throw new AssertionError(errorMessage, e);
+ }
+ }
+
+ /**
+ * Verifies that value of specified JVM when type of newly started VM
+ * is the same as the type of current.
+ * This method filter out option with {@code optionName}
+ * name from test java options.
+ * Only mode flag will be passed to VM in addition to
+ * {@code additionalVMOpts}
+ *
+ * @param optionName name of tested option.
+ * @param expectedValue expected value of tested option.
+ * @param optionErrorString message to show if option has another value
+ * @param additionalVMOpts additional options that should be
+ * passed to JVM.
+ * @throws Throwable if verification fails or some other issues occur.
+ */
+ public static void verifyOptionValueForSameVM(String optionName,
+ String expectedValue, String optionErrorString,
+ String... additionalVMOpts) throws Throwable {
+ List<String> finalOptions = new ArrayList<>();
+ finalOptions.add(CommandLineOptionTest.getVMTypeOption());
+ Collections.addAll(finalOptions, additionalVMOpts);
+
+ CommandLineOptionTest.verifyOptionValue(optionName, expectedValue,
+ optionErrorString, false,
+ finalOptions.toArray(new String[finalOptions.size()]));
+ }
+
+ /**
+ * Prepares boolean command line flag with name {@code name} according
+ * to it's {@code value}.
+ *
+ * @param name the name of option to be prepared
+ * @param value the value of option
+ * @return prepared command line flag
+ */
+ public static String prepareBooleanFlag(String name, boolean value) {
+ return String.format("-XX:%c%s", (value ? '+' : '-'), name);
+ }
+
+ /**
+ * Prepares numeric command line flag with name {@code name} by setting
+ * it's value to {@code value}.
+ *
+ * @param name the name of option to be prepared
+ * @param value the value of option
+ * @return prepared command line flag
+ */
+ public static String prepareNumericFlag(String name, Number value) {
+ return String.format("-XX:%s=%s", name, value.toString());
+ }
+
+ /**
+ * Returns message that should occur in VM output if option
+ * {@code optionName} if unrecognized.
+ *
+ * @param optionName the name of option for which message should be returned
+ * @return message saying that option {@code optionName} is unrecognized
+ */
+ public static String getUnrecognizedOptionErrorMessage(String optionName) {
+ return String.format(
+ CommandLineOptionTest.UNRECOGNIZED_OPTION_ERROR_FORMAT,
+ optionName);
+ }
+
+ /**
+ * Returns message that should occur in VM output if option
+ * {@code optionName} is experimental and
+ * -XX:+UnlockExperimentalVMOptions was not passed to VM.
+ *
+ * @param optionName the name of option for which message should be returned
+ * @return message saying that option {@code optionName} is experimental
+ */
+ public static String getExperimentalOptionErrorMessage(String optionName) {
+ return String.format(
+ CommandLineOptionTest.EXPERIMENTAL_OPTION_ERROR_FORMAT,
+ optionName);
+ }
+
+ /**
+ * Returns message that should occur in VM output if option
+ * {@code optionName} is diagnostic and -XX:+UnlockDiagnosticVMOptions
+ * was not passed to VM.
+ *
+ * @param optionName the name of option for which message should be returned
+ * @return message saying that option {@code optionName} is diganostic
+ */
+ public static String getDiagnosticOptionErrorMessage(String optionName) {
+ return String.format(
+ CommandLineOptionTest.DIAGNOSTIC_OPTION_ERROR_FORMAT,
+ optionName);
+ }
+
+ /**
+ * @return option required to start a new VM with the same type as current.
+ * @throws RuntimeException when VM type is unknown.
+ */
+ private static String getVMTypeOption() {
+ if (Platform.isServer()) {
+ return "-server";
+ } else if (Platform.isClient()) {
+ return "-client";
+ } else if (Platform.isMinimal()) {
+ return "-minimal";
+ } else if (Platform.isGraal()) {
+ return "-graal";
+ }
+ throw new RuntimeException("Unknown VM mode.");
+ }
+
+ private final BooleanSupplier predicate;
+
+ /**
+ * Constructs new CommandLineOptionTest that will be executed only if
+ * predicate {@code predicate} return {@code true}.
+ * @param predicate a predicate responsible for test's preconditions check.
+ */
+ public CommandLineOptionTest(BooleanSupplier predicate) {
+ this.predicate = predicate;
+ }
+
+ /**
+ * Runs command line option test.
+ */
+ public final void test() throws Throwable {
+ if (predicate.getAsBoolean()) {
+ runTestCases();
+ }
+ }
+
+ /**
+ * @throws Throwable if some issue happened during test cases execution.
+ */
+ protected abstract void runTestCases() throws Throwable;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/cli/predicate/AndPredicate.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2014, 2015, 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.test.lib.cli.predicate;
+
+import java.util.function.BooleanSupplier;
+
+public class AndPredicate implements BooleanSupplier {
+ private final BooleanSupplier a;
+ private final BooleanSupplier b;
+
+ public AndPredicate(BooleanSupplier a, BooleanSupplier b) {
+ this.a = a;
+ this.b = b;
+ }
+
+ @Override
+ public boolean getAsBoolean() {
+ return a.getAsBoolean() && b.getAsBoolean();
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/cli/predicate/CPUSpecificPredicate.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2014, 2015, 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.test.lib.cli.predicate;
+
+import jdk.test.lib.Platform;
+import sun.hotspot.cpuinfo.CPUInfo;
+
+import java.util.function.BooleanSupplier;
+
+public class CPUSpecificPredicate implements BooleanSupplier {
+ private final String cpuArchPattern;
+ private final String supportedCPUFeatures[];
+ private final String unsupportedCPUFeatures[];
+
+ public CPUSpecificPredicate(String cpuArchPattern,
+ String supportedCPUFeatures[],
+ String unsupportedCPUFeatures[]) {
+ this.cpuArchPattern = cpuArchPattern;
+ this.supportedCPUFeatures = supportedCPUFeatures;
+ this.unsupportedCPUFeatures = unsupportedCPUFeatures;
+ }
+
+ @Override
+ public boolean getAsBoolean() {
+ if (!Platform.getOsArch().matches(cpuArchPattern)) {
+ System.out.println("CPU arch does not match " + cpuArchPattern);
+ return false;
+ }
+
+ if (supportedCPUFeatures != null) {
+ for (String feature : supportedCPUFeatures) {
+ if (!CPUInfo.hasFeature(feature)) {
+ System.out.println("CPU does not support " + feature
+ + " feature");
+ return false;
+ }
+ }
+ }
+
+ if (unsupportedCPUFeatures != null) {
+ for (String feature : unsupportedCPUFeatures) {
+ if (CPUInfo.hasFeature(feature)) {
+ System.out.println("CPU support " + feature + " feature");
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/cli/predicate/NotPredicate.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2014, 2015, 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.test.lib.cli.predicate;
+
+import java.util.function.BooleanSupplier;
+
+public class NotPredicate implements BooleanSupplier {
+ private final BooleanSupplier s;
+
+ public NotPredicate(BooleanSupplier s) {
+ this.s = s;
+ }
+
+ @Override
+ public boolean getAsBoolean() {
+ return !s.getAsBoolean();
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/cli/predicate/OrPredicate.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2014, 2015, 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.test.lib.cli.predicate;
+
+import java.util.function.BooleanSupplier;
+
+public class OrPredicate implements BooleanSupplier {
+ private final BooleanSupplier a;
+ private final BooleanSupplier b;
+
+ public OrPredicate(BooleanSupplier a, BooleanSupplier b) {
+ this.a = a;
+ this.b = b;
+ }
+
+ @Override
+ public boolean getAsBoolean() {
+ return a.getAsBoolean() || b.getAsBoolean();
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/dcmd/CommandExecutor.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2015, 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.test.lib.dcmd;
+
+import jdk.test.lib.OutputAnalyzer;
+
+/**
+ * Abstract base class for Diagnostic Command executors
+ */
+public abstract class CommandExecutor {
+
+ /**
+ * Execute a diagnostic command
+ *
+ * @param cmd The diagnostic command to execute
+ * @return an {@link jdk.testlibrary.OutputAnalyzer} encapsulating the output of the command
+ * @throws CommandExecutorException if there is an exception on the "calling side" while trying to execute the
+ * Diagnostic Command. Exceptions thrown on the remote side are available as textual representations in
+ * stderr, regardless of the specific executor used.
+ */
+ public final OutputAnalyzer execute(String cmd) throws CommandExecutorException {
+ return execute(cmd, false);
+ }
+
+ /**
+ * Execute a diagnostic command
+ *
+ * @param cmd The diagnostic command to execute
+ * @param silent Do not print the command output
+ * @return an {@link jdk.testlibrary.OutputAnalyzer} encapsulating the output of the command
+ * @throws CommandExecutorException if there is an exception on the "calling side" while trying to execute the
+ * Diagnostic Command. Exceptions thrown on the remote side are available as textual representations in
+ * stderr, regardless of the specific executor used.
+ */
+ public final OutputAnalyzer execute(String cmd, boolean silent) throws CommandExecutorException {
+ if (!silent) {
+ System.out.printf("Running DCMD '%s' through '%s'%n", cmd, this.getClass().getSimpleName());
+ }
+
+ OutputAnalyzer oa = executeImpl(cmd);
+
+ if (!silent) {
+ System.out.println("---------------- stdout ----------------");
+ System.out.println(oa.getStdout());
+ System.out.println("---------------- stderr ----------------");
+ System.out.println(oa.getStderr());
+ System.out.println("----------------------------------------");
+ System.out.println();
+ }
+ return oa;
+ }
+
+ protected abstract OutputAnalyzer executeImpl(String cmd) throws CommandExecutorException;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/dcmd/CommandExecutorException.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2015, 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.test.lib.dcmd;
+
+/**
+ * CommandExecutorException encapsulates exceptions thrown (on the "calling side") from the execution of Diagnostic
+ * Commands
+ */
+public class CommandExecutorException extends RuntimeException {
+ private static final long serialVersionUID = -7039597746579144280L;
+
+ public CommandExecutorException(String message, Throwable e) {
+ super(message, e);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/dcmd/FileJcmdExecutor.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2015, 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.test.lib.dcmd;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Executes Diagnostic Commands on the target VM (specified by pid) using the jcmd tool and its ability to read
+ * Diagnostic Commands from a file.
+ */
+public class FileJcmdExecutor extends PidJcmdExecutor {
+
+ /**
+ * Instantiates a new FileJcmdExecutor targeting the current VM
+ */
+ public FileJcmdExecutor() {
+ super();
+ }
+
+ /**
+ * Instantiates a new FileJcmdExecutor targeting the VM indicated by the given pid
+ *
+ * @param target Pid of the target VM
+ */
+ public FileJcmdExecutor(String target) {
+ super(target);
+ }
+
+ protected List<String> createCommandLine(String cmd) throws CommandExecutorException {
+ File cmdFile = createTempFile();
+ writeCommandToTemporaryFile(cmd, cmdFile);
+
+ return Arrays.asList(jcmdBinary, Integer.toString(pid),
+ "-f", cmdFile.getAbsolutePath());
+ }
+
+ private void writeCommandToTemporaryFile(String cmd, File cmdFile) {
+ try (PrintWriter pw = new PrintWriter(cmdFile)) {
+ pw.println(cmd);
+ } catch (IOException e) {
+ String message = "Could not write to file: " + cmdFile.getAbsolutePath();
+ throw new CommandExecutorException(message, e);
+ }
+ }
+
+ private File createTempFile() {
+ try {
+ File cmdFile = File.createTempFile("input", "jcmd");
+ cmdFile.deleteOnExit();
+ return cmdFile;
+ } catch (IOException e) {
+ throw new CommandExecutorException("Could not create temporary file", e);
+ }
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/dcmd/JMXExecutor.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,187 @@
+/*
+ * Copyright (c) 2015, 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.test.lib.dcmd;
+
+import jdk.test.lib.OutputAnalyzer;
+
+import javax.management.*;
+import javax.management.remote.JMXConnector;
+import javax.management.remote.JMXConnectorFactory;
+import javax.management.remote.JMXServiceURL;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+import java.lang.management.ManagementFactory;
+
+import java.util.HashMap;
+
+/**
+ * Executes Diagnostic Commands on the target VM (specified by a host/port combination or a full JMX Service URL) using
+ * the JMX interface. If the target is not the current VM, the JMX Remote interface must be enabled beforehand.
+ */
+public class JMXExecutor extends CommandExecutor {
+
+ private final MBeanServerConnection mbs;
+
+ /**
+ * Instantiates a new JMXExecutor targeting the current VM
+ */
+ public JMXExecutor() {
+ super();
+ mbs = ManagementFactory.getPlatformMBeanServer();
+ }
+
+ /**
+ * Instantiates a new JMXExecutor targeting the VM indicated by the given host/port combination or a full JMX
+ * Service URL
+ *
+ * @param target a host/port combination on the format "host:port" or a full JMX Service URL of the target VM
+ */
+ public JMXExecutor(String target) {
+ String urlStr;
+
+ if (target.matches("^\\w[\\w\\-]*(\\.[\\w\\-]+)*:\\d+$")) {
+ /* Matches "hostname:port" */
+ urlStr = String.format("service:jmx:rmi:///jndi/rmi://%s/jmxrmi", target);
+ } else if (target.startsWith("service:")) {
+ urlStr = target;
+ } else {
+ throw new IllegalArgumentException("Could not recognize target string: " + target);
+ }
+
+ try {
+ JMXServiceURL url = new JMXServiceURL(urlStr);
+ JMXConnector c = JMXConnectorFactory.connect(url, new HashMap<>());
+ mbs = c.getMBeanServerConnection();
+ } catch (IOException e) {
+ throw new CommandExecutorException("Could not initiate connection to target: " + target, e);
+ }
+ }
+
+ protected OutputAnalyzer executeImpl(String cmd) throws CommandExecutorException {
+ String stdout = "";
+ String stderr = "";
+
+ String[] cmdParts = cmd.split(" ", 2);
+ String operation = commandToMethodName(cmdParts[0]);
+ Object[] dcmdArgs = produceArguments(cmdParts);
+ String[] signature = {String[].class.getName()};
+
+ ObjectName beanName = getMBeanName();
+
+ try {
+ stdout = (String) mbs.invoke(beanName, operation, dcmdArgs, signature);
+ }
+
+ /* Failures on the "local" side, the one invoking the command. */
+ catch (ReflectionException e) {
+ Throwable cause = e.getCause();
+ if (cause instanceof NoSuchMethodException) {
+ /* We want JMXExecutor to match the behavior of the other CommandExecutors */
+ String message = "Unknown diagnostic command: " + operation;
+ stderr = exceptionTraceAsString(new IllegalArgumentException(message, e));
+ } else {
+ rethrowExecutorException(operation, dcmdArgs, e);
+ }
+ }
+
+ /* Failures on the "local" side, the one invoking the command. */
+ catch (InstanceNotFoundException | IOException e) {
+ rethrowExecutorException(operation, dcmdArgs, e);
+ }
+
+ /* Failures on the remote side, the one executing the invoked command. */
+ catch (MBeanException e) {
+ stdout = exceptionTraceAsString(e);
+ }
+
+ return new OutputAnalyzer(stdout, stderr);
+ }
+
+ private void rethrowExecutorException(String operation, Object[] dcmdArgs,
+ Exception e) throws CommandExecutorException {
+ String message = String.format("Could not invoke: %s %s", operation,
+ String.join(" ", (String[]) dcmdArgs[0]));
+ throw new CommandExecutorException(message, e);
+ }
+
+ private ObjectName getMBeanName() throws CommandExecutorException {
+ String MBeanName = "com.sun.management:type=DiagnosticCommand";
+
+ try {
+ return new ObjectName(MBeanName);
+ } catch (MalformedObjectNameException e) {
+ String message = "MBean not found: " + MBeanName;
+ throw new CommandExecutorException(message, e);
+ }
+ }
+
+ private Object[] produceArguments(String[] cmdParts) {
+ Object[] dcmdArgs = {new String[0]}; /* Default: No arguments */
+
+ if (cmdParts.length == 2) {
+ dcmdArgs[0] = cmdParts[1].split(" ");
+ }
+ return dcmdArgs;
+ }
+
+ /**
+ * Convert from diagnostic command to MBean method name
+ *
+ * Examples:
+ * help --> help
+ * VM.version --> vmVersion
+ * VM.command_line --> vmCommandLine
+ */
+ private static String commandToMethodName(String cmd) {
+ String operation = "";
+ boolean up = false; /* First letter is to be lower case */
+
+ /*
+ * If a '.' or '_' is encountered it is not copied,
+ * instead the next character will be converted to upper case
+ */
+ for (char c : cmd.toCharArray()) {
+ if (('.' == c) || ('_' == c)) {
+ up = true;
+ } else if (up) {
+ operation = operation.concat(Character.toString(c).toUpperCase());
+ up = false;
+ } else {
+ operation = operation.concat(Character.toString(c).toLowerCase());
+ }
+ }
+
+ return operation;
+ }
+
+ private static String exceptionTraceAsString(Throwable cause) {
+ StringWriter sw = new StringWriter();
+ cause.printStackTrace(new PrintWriter(sw));
+ return sw.toString();
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/dcmd/JcmdExecutor.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2015, 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.test.lib.dcmd;
+
+import jdk.test.lib.JDKToolFinder;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
+
+import java.util.List;
+
+/**
+ * Base class for Diagnostic Command Executors using the jcmd tool
+ */
+public abstract class JcmdExecutor extends CommandExecutor {
+ protected String jcmdBinary;
+
+ protected abstract List<String> createCommandLine(String cmd) throws CommandExecutorException;
+
+ protected JcmdExecutor() {
+ jcmdBinary = JDKToolFinder.getJDKTool("jcmd");
+ }
+
+ protected OutputAnalyzer executeImpl(String cmd) throws CommandExecutorException {
+ List<String> commandLine = createCommandLine(cmd);
+
+ try {
+ System.out.printf("Executing command '%s'%n", commandLine);
+ OutputAnalyzer output = ProcessTools.executeProcess(new ProcessBuilder(commandLine));
+ System.out.printf("Command returned with exit code %d%n", output.getExitValue());
+
+ return output;
+ } catch (Exception e) {
+ String message = String.format("Caught exception while executing '%s'", commandLine);
+ throw new CommandExecutorException(message, e);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/dcmd/MainClassJcmdExecutor.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2015, 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.test.lib.dcmd;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Executes Diagnostic Commands on the target VM (specified by main class) using the jcmd tool
+ */
+public class MainClassJcmdExecutor extends JcmdExecutor {
+ private final String mainClass;
+
+ /**
+ * Instantiates a new MainClassJcmdExecutor targeting the current VM
+ */
+ public MainClassJcmdExecutor() {
+ super();
+ mainClass = System.getProperty("sun.java.command").split(" ")[0];
+ }
+
+ /**
+ * Instantiates a new MainClassJcmdExecutor targeting the VM indicated by the given main class
+ *
+ * @param target Main class of the target VM
+ */
+ public MainClassJcmdExecutor(String target) {
+ super();
+ mainClass = target;
+ }
+
+ protected List<String> createCommandLine(String cmd) throws CommandExecutorException {
+ return Arrays.asList(jcmdBinary, mainClass, cmd);
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/dcmd/PidJcmdExecutor.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2015, 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.test.lib.dcmd;
+
+import jdk.test.lib.ProcessTools;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Executes Diagnostic Commands on the target VM (specified by pid) using the jcmd tool
+ */
+public class PidJcmdExecutor extends JcmdExecutor {
+ protected final int pid;
+
+ /**
+ * Instantiates a new PidJcmdExecutor targeting the current VM
+ */
+ public PidJcmdExecutor() {
+ super();
+ try {
+ pid = ProcessTools.getProcessId();
+ } catch (Exception e) {
+ throw new CommandExecutorException("Could not determine own pid", e);
+ }
+ }
+
+ /**
+ * Instantiates a new PidJcmdExecutor targeting the VM indicated by the given pid
+ *
+ * @param target Pid of the target VM
+ */
+ public PidJcmdExecutor(String target) {
+ super();
+ pid = Integer.valueOf(target);
+ }
+
+ protected List<String> createCommandLine(String cmd) throws CommandExecutorException {
+ return Arrays.asList(jcmdBinary, Integer.toString(pid), cmd);
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/dtrace/DtraceResultsAnalyzer.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2014, 2015, 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.test.lib.dtrace;
+
+import jdk.test.lib.OutputAnalyzer;
+
+public interface DtraceResultsAnalyzer {
+ public void analyze(OutputAnalyzer oa, String logFilePath);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/testlibrary/jdk/test/lib/dtrace/DtraceRunner.java Mon May 04 16:30:07 2015 +0200
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2014, 2015, 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.test.lib.dtrace;
+
+import jdk.test.lib.Asserts;
+import jdk.test.lib.OutputAnalyzer;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+public class DtraceRunner {
+
+ private static final String DTRACE_DEFAULT_PATH = "/usr/sbin/dtrace";
+ private static final String DTRACE_PATH_PROPERTY
+ = "com.oracle.test.dtrace.path";
+ private static final String OUTPUT_FILE_DTRACE_OPTION = "o";
+ private static final String RUN_COMMAND_DTRACE_OPTION = "c";
+ private static final String RUN_SCRIPT_DTRACE_OPTION = "s";
+ private static final String ALLOW_ZERO_PROBE_DESCRIPTION_DTRACE_OPTION = "Z";
+ private static final String DTRACE_OPTION_PREFIX = "-";
+ public static final String PERMIT_DESTRUCTIVE_ACTIONS_DTRACE_OPTION = "w";
+ public static final String DTRACE_OUT_LOG = "dtrace.out";
+
+ private final String dtraceExecutable;
+
+ public DtraceRunner() {
+ dtraceExecutable = getDtracePath();
+ }
+
+ private List<String> getLaunchCmd(String java, String javaOpts,
+ String execClass, String testArgs, String dtraceScript,
+ String dtraceAddOpts) {
+ Asserts.assertTrue(!java.matches("\\s"), "Current dtrace implementation"
+ + " can't handle whitespaces in application path");
+ List<String> result = new ArrayList<>();
+ result.add(dtraceExecutable);
+ result.add(DTRACE_OPTION_PREFIX + System.getProperty("sun.arch.data.model"));
+ result.add(DTRACE_OPTION_PREFIX
+ + ALLOW_ZERO_PROBE_DESCRIPTION_DTRACE_OPTION
+ + ((dtraceAddOpts == null) ? "" : dtraceAddOpts)
+ + RUN_SCRIPT_DTRACE_OPTION); // run_script should be last one
+ result.add(dtraceScript);
+ result.add(DTRACE_OPTION_PREFIX + OUTPUT_FILE_DTRACE_OPTION);
+ result.add(DTRACE_OUT_LOG);
+ result.add(DTRACE_OPTION_PREFIX + RUN_COMMAND_DTRACE_OPTION);
+ result.add(java + " " + javaOpts + " " + execClass + " " + testArgs);
+ return result;
+ }
+
+ private void backupLogFile(File file) {
+ if (file.exists()) {
+ file.renameTo(new File(file.getPath() + ".bak"));
+ }
+ }
+
+ public void runDtrace(String java, String javaOpts, String execClass,
+ String testArgs, String dtraceScript, String dtraceAddOpts,
+ DtraceResultsAnalyzer analyzer) {
+ backupLogFile(new File(DTRACE_OUT_LOG));
+ ProcessBuilder pbuilder = new ProcessBuilder(
+ getLaunchCmd(java, javaOpts, execClass, testArgs,
+ dtraceScript, dtraceAddOpts));
+ OutputAnalyzer oa;
+ try {
+ oa = new OutputAnalyzer(pbuilder.start());
+ } catch (IOException e) {
+ throw new Error("TESTBUG: Can't start process", e);
+ }
+ analyzer.analyze(oa, DTRACE_OUT_LOG);
+ }
+
+ public static boolean dtraceAvailable() {
+ String path = getDtracePath();
+ if (path == null) {
+ return false;
+ }
+ // now we'll launch dtrace to trace itself just to be sure it works
+ // and have all additional previleges set
+ ProcessBuilder pbuilder = new ProcessBuilder(path, path);
+ try {
+ OutputAnalyzer oa = new OutputAnalyzer(pbuilder.start());
+ if (oa.getExitValue() != 0) {
+ return false;
+ }
+ } catch (IOException e) {
+ throw new Error("Couldn't launch dtrace", e);
+ }
+ return true;
+ }
+
+ private static String getDtracePath() {
+ String propPath = System.getProperty(DTRACE_PATH_PROPERTY);
+ if (propPath != null && new File(propPath).exists()) {
+ return propPath;
+ } else if (new File(DTRACE_DEFAULT_PATH).exists()) {
+ return DTRACE_DEFAULT_PATH;
+ }
+ return null;
+ }
+}
--- a/hotspot/test/testlibrary_tests/AssertsTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/testlibrary_tests/AssertsTest.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, 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
@@ -21,7 +21,7 @@
* questions.
*/
-import static com.oracle.java.testlibrary.Asserts.*;
+import static jdk.test.lib.Asserts.*;
/* @test
* @summary Tests the different assertions in the Assert class
--- a/hotspot/test/testlibrary_tests/OutputAnalyzerReportingTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/testlibrary_tests/OutputAnalyzerReportingTest.java Mon May 04 16:30:07 2015 +0200
@@ -35,8 +35,8 @@
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
-import com.oracle.java.testlibrary.OutputAnalyzer;
-import com.oracle.java.testlibrary.ProcessTools;
+import jdk.test.lib.OutputAnalyzer;
+import jdk.test.lib.ProcessTools;
public class OutputAnalyzerReportingTest {
--- a/hotspot/test/testlibrary_tests/OutputAnalyzerTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/testlibrary_tests/OutputAnalyzerTest.java Mon May 04 16:30:07 2015 +0200
@@ -29,7 +29,7 @@
* java.management
*/
-import com.oracle.java.testlibrary.OutputAnalyzer;
+import jdk.test.lib.OutputAnalyzer;
public class OutputAnalyzerTest {
--- a/hotspot/test/testlibrary_tests/RandomGeneratorTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/testlibrary_tests/RandomGeneratorTest.java Mon May 04 16:30:07 2015 +0200
@@ -32,14 +32,14 @@
* @run driver RandomGeneratorTest DIFFERENT_SEED
*/
-import com.oracle.java.testlibrary.ProcessTools;
-import com.oracle.java.testlibrary.Utils;
+import jdk.test.lib.ProcessTools;
+import jdk.test.lib.Utils;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
/**
- * The test verifies correctness of work {@link com.oracle.java.testlibrary.Utils#getRandomInstance()}.
+ * The test verifies correctness of work {@link jdk.test.lib.Utils#getRandomInstance()}.
* Test works in three modes: same seed provided, no seed provided and
* different seed provided. In the first case the test expects that all random numbers
* will be repeated in all next iterations. For other two modes test expects that
--- a/hotspot/test/testlibrary_tests/RedefineClassTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/testlibrary_tests/RedefineClassTest.java Mon May 04 16:30:07 2015 +0200
@@ -33,8 +33,8 @@
* @run main/othervm -javaagent:redefineagent.jar RedefineClassTest
*/
-import static com.oracle.java.testlibrary.Asserts.*;
-import com.oracle.java.testlibrary.*;
+import static jdk.test.lib.Asserts.*;
+import jdk.test.lib.*;
/*
* Proof of concept test for the test utility class RedefineClassHelper
--- a/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java Mon May 04 16:30:07 2015 +0200
@@ -21,8 +21,8 @@
* questions.
*/
-import com.oracle.java.testlibrary.Asserts;
-import com.oracle.java.testlibrary.Platform;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.Platform;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@@ -36,7 +36,7 @@
/**
* @test
* @summary Verify that for each group of mutually exclusive predicates defined
- * in com.oracle.java.testlibrary.Platform one and only one predicate
+ * in jdk.test.lib.Platform one and only one predicate
* evaluates to true.
* @library /testlibrary
* @modules java.base/sun.misc
@@ -72,7 +72,7 @@
/**
* Verifies that one and only one predicate method defined in
- * {@link com.oracle.java.testlibrary.Platform}, whose name included into
+ * {@link jdk.test.lib.Platform}, whose name included into
* methodGroup will return {@code true}.
* @param methodGroup The group of methods that should be tested.
*/
@@ -91,7 +91,7 @@
/**
* Verifies that all predicates defined in
- * {@link com.oracle.java.testlibrary.Platform} were either tested or
+ * {@link jdk.test.lib.Platform} were either tested or
* explicitly ignored.
*/
private static void verifyCoverage() {
@@ -112,7 +112,7 @@
/**
* Evaluates predicate method with name {@code name} defined in
- * {@link com.oracle.java.testlibrary.Platform}.
+ * {@link jdk.test.lib.Platform}.
*
* @param name The name of a predicate to be evaluated.
* @return evaluated predicate's value.
--- a/hotspot/test/testlibrary_tests/TestPlatformIsTieredSupported.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/testlibrary_tests/TestPlatformIsTieredSupported.java Mon May 04 16:30:07 2015 +0200
@@ -21,8 +21,8 @@
* questions.
*/
-import com.oracle.java.testlibrary.Asserts;
-import com.oracle.java.testlibrary.Platform;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.Platform;
import sun.hotspot.WhiteBox;
/**
--- a/hotspot/test/testlibrary_tests/ctw/CtwTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/testlibrary_tests/ctw/CtwTest.java Mon May 04 16:30:07 2015 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, 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
@@ -36,8 +36,8 @@
import java.nio.file.StandardCopyOption;
import java.nio.charset.Charset;
-import com.oracle.java.testlibrary.JDKToolFinder;
-import com.oracle.java.testlibrary.OutputAnalyzer;
+import jdk.test.lib.JDKToolFinder;
+import jdk.test.lib.OutputAnalyzer;
public abstract class CtwTest {
protected final String[] shouldContain;
--- a/hotspot/test/testlibrary_tests/ctw/JarDirTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/testlibrary_tests/ctw/JarDirTest.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* java.compiler
* java.management
* jdk.jvmstat/sun.jvmstat.monitor
- * @build ClassFileInstaller com.oracle.java.testlibrary.* sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
+ * @build ClassFileInstaller jdk.test.lib.* sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
* @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main JarDirTest prepare
@@ -44,7 +44,7 @@
import java.nio.file.Files;
import java.nio.file.Paths;
-import com.oracle.java.testlibrary.OutputAnalyzer;
+import jdk.test.lib.OutputAnalyzer;
public class JarDirTest extends CtwTest {
private static final String[] SHOULD_CONTAIN
--- a/hotspot/test/testlibrary_tests/ctw/JarsTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/testlibrary_tests/ctw/JarsTest.java Mon May 04 16:30:07 2015 +0200
@@ -30,7 +30,7 @@
* java.compiler
* java.management
* jdk.jvmstat/sun.jvmstat.monitor
- * @build ClassFileInstaller com.oracle.java.testlibrary.* sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
+ * @build ClassFileInstaller jdk.test.lib.* sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
* @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main JarsTest prepare
@@ -40,7 +40,7 @@
* @author igor.ignatyev@oracle.com
*/
-import com.oracle.java.testlibrary.OutputAnalyzer;
+import jdk.test.lib.OutputAnalyzer;
public class JarsTest extends CtwTest {
private static final String[] SHOULD_CONTAIN
--- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/BooleanTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/BooleanTest.java Mon May 04 16:30:07 2015 +0200
@@ -29,7 +29,7 @@
* java.compiler
* java.management/sun.management
* jdk.jvmstat/sun.jvmstat.monitor
- * @build BooleanTest ClassFileInstaller sun.hotspot.WhiteBox com.oracle.java.testlibrary.*
+ * @build BooleanTest ClassFileInstaller sun.hotspot.WhiteBox jdk.test.lib.*
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI BooleanTest
@@ -38,7 +38,7 @@
*/
import sun.hotspot.WhiteBox;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import sun.management.*;
import com.sun.management.*;
--- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/SizeTTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/SizeTTest.java Mon May 04 16:30:07 2015 +0200
@@ -33,7 +33,7 @@
* @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions SizeTTest
* @summary testing of WB::set/getSizeTVMFlag()
*/
-import com.oracle.java.testlibrary.Platform;
+import jdk.test.lib.Platform;
public class SizeTTest {
private static final String FLAG_NAME = "ArrayAllocatorMallocLimit";
--- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/UintxTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/UintxTest.java Mon May 04 16:30:07 2015 +0200
@@ -34,7 +34,7 @@
* @summary testing of WB::set/getUintxVMFlag()
* @author igor.ignatyev@oracle.com
*/
-import com.oracle.java.testlibrary.Platform;
+import jdk.test.lib.Platform;
public class UintxTest {
private static final String FLAG_NAME = "VerifyGCStartAt";
--- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/VmFlagTest.java Sat May 02 18:40:37 2015 -0700
+++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/VmFlagTest.java Mon May 04 16:30:07 2015 +0200
@@ -26,7 +26,7 @@
import sun.hotspot.WhiteBox;
import sun.management.*;
import com.sun.management.*;
-import com.oracle.java.testlibrary.*;
+import jdk.test.lib.*;
import java.lang.management.ManagementFactory;
public final class VmFlagTest<T> {