From e7f8e1fdb59e9dcf8ecdfa44137a8f8048e67f85 Mon Sep 17 00:00:00 2001 From: Igor Ignatyev Date: Tue, 16 Jun 2020 09:50:45 -0700 Subject: [PATCH] 8211977: move testlibrary tests into one place Reviewed-by: erikj, dholmes, ihse --- make/Main.gmk | 15 +- make/RunTests.gmk | 2 + make/common/FindTests.gmk | 2 +- make/test/JtregNativeHotspot.gmk | 2 - make/test/JtregNativeLibTest.gmk | 94 +++++++ test/hotspot/jtreg/TEST.groups | 1 - .../jvmti/libSimpleClassFileLoadHook.c | 2 +- .../jtreg/testlibrary_tests/AssertsTest.java | 238 ------------------ .../OutputAnalyzerReportingTest.java | 126 ---------- .../testlibrary_tests/OutputAnalyzerTest.java | 195 -------------- .../SimpleClassFileLoadHookTest.java | 0 .../jtreg/testlibrary_tests/process/Test.java | 28 --- test/lib-test/ProblemList.txt | 40 +++ .../RedefineClassTest.java | 0 test/lib-test/TEST.ROOT | 29 +++ test/lib-test/TEST.groups | 24 ++ .../jdk/test/lib}/AssertsTest.java | 0 .../jdk/test/lib}/RandomGeneratorTest.java | 0 ...stMutuallyExclusivePlatformPredicates.java | 0 .../lib}/TestPlatformIsTieredSupported.java | 0 .../jdk/test/lib/apps/LingeredAppTest.java | 10 +- .../process}/OutputAnalyzerReportingTest.java | 0 .../test/lib/process}/OutputAnalyzerTest.java | 19 +- .../process/TestNativeProcessBuilder.java | 10 +- .../test/lib}/process/exejvm-test-launcher.c | 11 +- .../sun/hotspot}/whitebox/BlobSanityTest.java | 0 .../sun/hotspot/whitebox}/CPUInfoTest.java | 0 .../whitebox/vm_flags/BooleanTest.java | 0 .../whitebox/vm_flags/DoubleTest.java | 0 .../hotspot}/whitebox/vm_flags/IntxTest.java | 0 .../hotspot}/whitebox/vm_flags/SizeTTest.java | 0 .../whitebox/vm_flags/StringTest.java | 0 .../whitebox/vm_flags/Uint64Test.java | 0 .../hotspot}/whitebox/vm_flags/UintxTest.java | 0 .../whitebox/vm_flags/VmFlagTest.java | 0 35 files changed, 243 insertions(+), 605 deletions(-) create mode 100644 make/test/JtregNativeLibTest.gmk delete mode 100644 test/hotspot/jtreg/testlibrary_tests/AssertsTest.java delete mode 100644 test/hotspot/jtreg/testlibrary_tests/OutputAnalyzerReportingTest.java delete mode 100644 test/hotspot/jtreg/testlibrary_tests/OutputAnalyzerTest.java rename test/hotspot/jtreg/testlibrary_tests/{ => jvmti}/SimpleClassFileLoadHookTest.java (100%) delete mode 100644 test/hotspot/jtreg/testlibrary_tests/process/Test.java create mode 100644 test/lib-test/ProblemList.txt rename test/{hotspot/jtreg/testlibrary_tests => lib-test}/RedefineClassTest.java (100%) create mode 100644 test/lib-test/TEST.groups rename test/{jdk/lib/testlibrary => lib-test/jdk/test/lib}/AssertsTest.java (100%) rename test/{hotspot/jtreg/testlibrary_tests => lib-test/jdk/test/lib}/RandomGeneratorTest.java (100%) rename test/{hotspot/jtreg/testlibrary_tests => lib-test/jdk/test/lib}/TestMutuallyExclusivePlatformPredicates.java (100%) rename test/{hotspot/jtreg/testlibrary_tests => lib-test/jdk/test/lib}/TestPlatformIsTieredSupported.java (100%) rename test/{jdk/lib/testlibrary => lib-test/jdk/test/lib/process}/OutputAnalyzerReportingTest.java (100%) rename test/{jdk/lib/testlibrary => lib-test/jdk/test/lib/process}/OutputAnalyzerTest.java (90%) rename test/{hotspot/jtreg/testlibrary_tests => lib-test/jdk/test/lib}/process/TestNativeProcessBuilder.java (88%) rename test/{hotspot/jtreg/testlibrary_tests => lib-test/jdk/test/lib}/process/exejvm-test-launcher.c (92%) rename test/{hotspot/jtreg/testlibrary_tests => lib-test/sun/hotspot}/whitebox/BlobSanityTest.java (100%) rename test/{jdk/lib/testlibrary => lib-test/sun/hotspot/whitebox}/CPUInfoTest.java (100%) rename test/{hotspot/jtreg/testlibrary_tests => lib-test/sun/hotspot}/whitebox/vm_flags/BooleanTest.java (100%) rename test/{hotspot/jtreg/testlibrary_tests => lib-test/sun/hotspot}/whitebox/vm_flags/DoubleTest.java (100%) rename test/{hotspot/jtreg/testlibrary_tests => lib-test/sun/hotspot}/whitebox/vm_flags/IntxTest.java (100%) rename test/{hotspot/jtreg/testlibrary_tests => lib-test/sun/hotspot}/whitebox/vm_flags/SizeTTest.java (100%) rename test/{hotspot/jtreg/testlibrary_tests => lib-test/sun/hotspot}/whitebox/vm_flags/StringTest.java (100%) rename test/{hotspot/jtreg/testlibrary_tests => lib-test/sun/hotspot}/whitebox/vm_flags/Uint64Test.java (100%) rename test/{hotspot/jtreg/testlibrary_tests => lib-test/sun/hotspot}/whitebox/vm_flags/UintxTest.java (100%) rename test/{hotspot/jtreg/testlibrary_tests => lib-test/sun/hotspot}/whitebox/vm_flags/VmFlagTest.java (100%) diff --git a/make/Main.gmk b/make/Main.gmk index 99fc816edf3..3e5450ca3c1 100644 --- a/make/Main.gmk +++ b/make/Main.gmk @@ -640,6 +640,18 @@ $(eval $(call SetupTarget, test-image-jdk-jtreg-native, \ DEPS := build-test-jdk-jtreg-native, \ )) +$(eval $(call SetupTarget, build-test-libtest-jtreg-native, \ + MAKEFILE := test/JtregNativeLibTest, \ + TARGET := build-test-libtest-jtreg-native, \ + DEPS := buildtools-jdk, \ +)) + +$(eval $(call SetupTarget, test-image-libtest-jtreg-native, \ + MAKEFILE := test/JtregNativeLibTest, \ + TARGET := test-image-libtest-jtreg-native, \ + DEPS := build-test-libtest-jtreg-native, \ +)) + $(eval $(call SetupTarget, build-test-hotspot-jtreg-graal, \ MAKEFILE := test/JtregGraalUnit, \ TARGET := build-test-hotspot-jtreg-graal, \ @@ -982,6 +994,7 @@ else interim-image: $(INTERIM_JMOD_TARGETS) build-test-hotspot-jtreg-native: hotspot-$(JVM_VARIANT_MAIN)-libs + build-test-libtest-jtreg-native: hotspot-$(JVM_VARIANT_MAIN)-libs endif @@ -1105,7 +1118,7 @@ endif docs-image: docs-jdk # This target builds the test image -test-image: prepare-test-image test-image-jdk-jtreg-native test-image-demos-jdk +test-image: prepare-test-image test-image-jdk-jtreg-native test-image-demos-jdk test-image-libtest-jtreg-native ifneq ($(JVM_TEST_IMAGE_TARGETS), ) # If JVM_TEST_IMAGE_TARGETS is externally defined, use it instead of the diff --git a/make/RunTests.gmk b/make/RunTests.gmk index 805de4dd785..98df3be6e65 100644 --- a/make/RunTests.gmk +++ b/make/RunTests.gmk @@ -342,11 +342,13 @@ hotspot_JTREG_MAX_MEM := 0 hotspot_JTREG_ASSERT := false hotspot_JTREG_NATIVEPATH := $(TEST_IMAGE_DIR)/hotspot/jtreg/native jdk_JTREG_NATIVEPATH := $(TEST_IMAGE_DIR)/jdk/jtreg/native +lib-test_JTREG_NATIVEPATH := $(TEST_IMAGE_DIR)/lib-test/jtreg/native jdk_JTREG_PROBLEM_LIST += $(TOPDIR)/test/jdk/ProblemList.txt jaxp_JTREG_PROBLEM_LIST += $(TOPDIR)/test/jaxp/ProblemList.txt langtools_JTREG_PROBLEM_LIST += $(TOPDIR)/test/langtools/ProblemList.txt hotspot_JTREG_PROBLEM_LIST += $(TOPDIR)/test/hotspot/jtreg/ProblemList.txt +lib-test_JTREG_PROBLEM_LIST += $(TOPDIR)/test/lib-test/ProblemList.txt langtools_JTREG_MAX_MEM := 768m diff --git a/make/common/FindTests.gmk b/make/common/FindTests.gmk index a823125de03..b12630349c0 100644 --- a/make/common/FindTests.gmk +++ b/make/common/FindTests.gmk @@ -43,7 +43,7 @@ $(eval $(call IncludeCustomExtension, common/FindTests.gmk)) TEST_BASEDIRS += $(TOPDIR)/test $(TOPDIR) # JTREG_TESTROOTS might have been set by a custom extension -JTREG_TESTROOTS += $(addprefix $(TOPDIR)/test/, hotspot/jtreg jdk langtools jaxp) +JTREG_TESTROOTS += $(addprefix $(TOPDIR)/test/, hotspot/jtreg jdk langtools jaxp lib-test) # Extract the names of the Jtreg group files from the TEST.ROOT files. The # TEST.ROOT files being properties files can be interpreted as makefiles so diff --git a/make/test/JtregNativeHotspot.gmk b/make/test/JtregNativeHotspot.gmk index 5c58a042a2e..cfddb6fe0d9 100644 --- a/make/test/JtregNativeHotspot.gmk +++ b/make/test/JtregNativeHotspot.gmk @@ -872,10 +872,8 @@ BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exesigtest := -ljvm ifeq ($(call isTargetOs, windows), true) BUILD_HOTSPOT_JTREG_EXECUTABLES_CFLAGS_exeFPRegs := -MT BUILD_HOTSPOT_JTREG_EXCLUDE += exesigtest.c libterminatedThread.c - BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exejvm-test-launcher := jvm.lib BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libatExit := jvm.lib else - BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exejvm-test-launcher := -ljvm BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libbootclssearch_agent += -lpthread BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libsystemclssearch_agent += -lpthread BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libgetsysprop001 += -lpthread diff --git a/make/test/JtregNativeLibTest.gmk b/make/test/JtregNativeLibTest.gmk new file mode 100644 index 00000000000..4bae9d9189c --- /dev/null +++ b/make/test/JtregNativeLibTest.gmk @@ -0,0 +1,94 @@ +# +# Copyright (c) 2020, 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. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# 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. +# + +################################################################################ +# This file builds the native component of the JTReg tests for testlibrary. +# It also covers the test-image part, where the built files are copied to the +# test image. +################################################################################ + +default: all + +include $(SPEC) +include MakeBase.gmk +include TestFilesCompilation.gmk + +$(eval $(call IncludeCustomExtension, test/JtregNativeLibTest.gmk)) + +################################################################################ +# Targets for building the native tests themselves. +################################################################################ + +# This might have been added to by a custom extension. +BUILD_LIBTEST_JTREG_NATIVE_SRC += $(TOPDIR)/test/lib-test + +BUILD_LIBTEST_JTREG_OUTPUT_DIR := $(OUTPUTDIR)/support/test/lib-test/jtreg/native + +BUILD_LIBTEST_JTREG_IMAGE_DIR := $(TEST_IMAGE_DIR)/lib-test/jtreg + +ifeq ($(call isTargetOs, windows), true) + BUILD_LIBTEST_JTREG_EXECUTABLES_LIBS_exejvm-test-launcher := jvm.lib +else + BUILD_LIBTEST_JTREG_EXECUTABLES_LIBS_exejvm-test-launcher := -ljvm +endif + +# This evaluation is expensive and should only be done if this target was +# explicitly called. +ifneq ($(filter build-test-libtest-jtreg-native, $(MAKECMDGOALS)), ) + $(eval $(call SetupTestFilesCompilation, BUILD_LIBTEST_JTREG_LIBRARIES, \ + TYPE := LIBRARY, \ + SOURCE_DIRS := $(BUILD_LIBTEST_JTREG_NATIVE_SRC), \ + OUTPUT_DIR := $(BUILD_LIBTEST_JTREG_OUTPUT_DIR), \ + EXCLUDE := $(BUILD_LIBTEST_JTREG_EXCLUDE), \ + )) + + $(eval $(call SetupTestFilesCompilation, BUILD_LIBTEST_JTREG_EXECUTABLES, \ + TYPE := PROGRAM, \ + SOURCE_DIRS := $(BUILD_LIBTEST_JTREG_NATIVE_SRC), \ + OUTPUT_DIR := $(BUILD_LIBTEST_JTREG_OUTPUT_DIR), \ + EXCLUDE := $(BUILD_LIBTEST_JTREG_EXCLUDE), \ + )) +endif + +build-test-libtest-jtreg-native: $(BUILD_LIBTEST_JTREG_LIBRARIES) $(BUILD_LIBTEST_JTREG_EXECUTABLES) + +################################################################################ +# Targets for building test-image. +################################################################################ + +# Copy to lib-test jtreg test image +$(eval $(call SetupCopyFiles, COPY_LIBTEST_JTREG_NATIVE, \ + SRC := $(BUILD_LIBTEST_JTREG_OUTPUT_DIR), \ + DEST := $(TEST_IMAGE_DIR)/lib-test/jtreg/native, \ + FILES := $(wildcard $(addprefix $(BUILD_LIBTEST_JTREG_OUTPUT_DIR), /bin/* /lib/*)), \ + FLATTEN := true, \ +)) + +test-image-libtest-jtreg-native: $(COPY_LIBTEST_JTREG_NATIVE) + +all: build-test-libtest-jtreg-native +test-image: test-image-libtest-jtreg-native + +.PHONY: default all build-test-libtest-jtreg-native test-image-libtest-jtreg-native test-image diff --git a/test/hotspot/jtreg/TEST.groups b/test/hotspot/jtreg/TEST.groups index d92dbd7570f..104eca2ef12 100644 --- a/test/hotspot/jtreg/TEST.groups +++ b/test/hotspot/jtreg/TEST.groups @@ -309,7 +309,6 @@ tier1_runtime = \ -runtime/Thread/TestThreadDumpMonitorContention.java \ -runtime/Unsafe/RangeCheck.java \ sanity/ \ - testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java \ -:tier1_runtime_appcds_exclude \ -runtime/signal diff --git a/test/hotspot/jtreg/testlibrary/jvmti/libSimpleClassFileLoadHook.c b/test/hotspot/jtreg/testlibrary/jvmti/libSimpleClassFileLoadHook.c index a95d7b28a89..ffa457323f7 100644 --- a/test/hotspot/jtreg/testlibrary/jvmti/libSimpleClassFileLoadHook.c +++ b/test/hotspot/jtreg/testlibrary/jvmti/libSimpleClassFileLoadHook.c @@ -22,7 +22,7 @@ */ /* - * A simple way to test JVMTI ClassFileLoadHook. See ../testlibrary_tests/SimpleClassFileLoadHookTest.java + * A simple way to test JVMTI ClassFileLoadHook. See ../testlibrary_tests/jvmti/SimpleClassFileLoadHookTest.java * for an example. */ #include diff --git a/test/hotspot/jtreg/testlibrary_tests/AssertsTest.java b/test/hotspot/jtreg/testlibrary_tests/AssertsTest.java deleted file mode 100644 index fd0ca96c270..00000000000 --- a/test/hotspot/jtreg/testlibrary_tests/AssertsTest.java +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -import static jdk.test.lib.Asserts.*; - -/* @test - * @summary Tests the different assertions in the Assert class - * @modules java.base/jdk.internal.misc - * @library /test/lib - */ -public class AssertsTest { - private static class Foo implements Comparable { - final int id; - public Foo(int id) { - this.id = id; - } - - public int compareTo(Foo f) { - return new Integer(id).compareTo(new Integer(f.id)); - } - } - - public static void main(String[] args) throws Exception { - testLessThan(); - testLessThanOrEqual(); - testEquals(); - testGreaterThanOrEqual(); - testGreaterThan(); - testNotEquals(); - testNull(); - testNotNull(); - testTrue(); - testFalse(); - } - - private static void testLessThan() throws Exception { - expectPass(Assertion.LT, 1, 2); - - expectFail(Assertion.LT, 2, 2); - expectFail(Assertion.LT, 2, 1); - expectFail(Assertion.LT, null, 2); - expectFail(Assertion.LT, 2, null); - } - - private static void testLessThanOrEqual() throws Exception { - expectPass(Assertion.LTE, 1, 2); - expectPass(Assertion.LTE, 2, 2); - - expectFail(Assertion.LTE, 3, 2); - expectFail(Assertion.LTE, null, 2); - expectFail(Assertion.LTE, 2, null); - } - - private static void testEquals() throws Exception { - expectPass(Assertion.EQ, 1, 1); - expectPass(Assertion.EQ, null, null); - - Foo f1 = new Foo(1); - expectPass(Assertion.EQ, f1, f1); - - Foo f2 = new Foo(1); - expectFail(Assertion.EQ, f1, f2); - expectFail(Assertion.LTE, null, 2); - expectFail(Assertion.LTE, 2, null); - } - - private static void testGreaterThanOrEqual() throws Exception { - expectPass(Assertion.GTE, 1, 1); - expectPass(Assertion.GTE, 2, 1); - - expectFail(Assertion.GTE, 1, 2); - expectFail(Assertion.GTE, null, 2); - expectFail(Assertion.GTE, 2, null); - } - - private static void testGreaterThan() throws Exception { - expectPass(Assertion.GT, 2, 1); - - expectFail(Assertion.GT, 1, 1); - expectFail(Assertion.GT, 1, 2); - expectFail(Assertion.GT, null, 2); - expectFail(Assertion.GT, 2, null); - } - - private static void testNotEquals() throws Exception { - expectPass(Assertion.NE, null, 1); - expectPass(Assertion.NE, 1, null); - - Foo f1 = new Foo(1); - Foo f2 = new Foo(1); - expectPass(Assertion.NE, f1, f2); - - expectFail(Assertion.NE, null, null); - expectFail(Assertion.NE, f1, f1); - expectFail(Assertion.NE, 1, 1); - } - - private static void testNull() throws Exception { - expectPass(Assertion.NULL, null); - - expectFail(Assertion.NULL, 1); - } - - private static void testNotNull() throws Exception { - expectPass(Assertion.NOTNULL, 1); - - expectFail(Assertion.NOTNULL, null); - } - - private static void testTrue() throws Exception { - expectPass(Assertion.TRUE, true); - - expectFail(Assertion.TRUE, false); - } - - private static void testFalse() throws Exception { - expectPass(Assertion.FALSE, false); - - expectFail(Assertion.FALSE, true); - } - - private static > void expectPass(Assertion assertion, T ... args) - throws Exception { - Assertion.run(assertion, args); - } - - private static > void expectFail(Assertion assertion, T ... args) - throws Exception { - try { - Assertion.run(assertion, args); - } catch (RuntimeException e) { - return; - } - throw new Exception("Expected " + Assertion.format(assertion, (Object[]) args) + - " to throw a RuntimeException"); - } - -} - -enum Assertion { - LT, LTE, EQ, GTE, GT, NE, NULL, NOTNULL, FALSE, TRUE; - - public static > void run(Assertion assertion, T ... args) { - String msg = "Expected " + format(assertion, args) + " to pass"; - switch (assertion) { - case LT: - assertLessThan(args[0], args[1], msg); - break; - case LTE: - assertLessThanOrEqual(args[0], args[1], msg); - break; - case EQ: - assertEquals(args[0], args[1], msg); - break; - case GTE: - assertGreaterThanOrEqual(args[0], args[1], msg); - break; - case GT: - assertGreaterThan(args[0], args[1], msg); - break; - case NE: - assertNotEquals(args[0], args[1], msg); - break; - case NULL: - assertNull(args == null ? args : args[0], msg); - break; - case NOTNULL: - assertNotNull(args == null ? args : args[0], msg); - break; - case FALSE: - assertFalse((Boolean) args[0], msg); - break; - case TRUE: - assertTrue((Boolean) args[0], msg); - break; - default: - // do nothing - } - } - - public static String format(Assertion assertion, Object ... args) { - switch (assertion) { - case LT: - return asString("assertLessThan", args); - case LTE: - return asString("assertLessThanOrEqual", args); - case EQ: - return asString("assertEquals", args); - case GTE: - return asString("assertGreaterThanOrEquals", args); - case GT: - return asString("assertGreaterThan", args); - case NE: - return asString("assertNotEquals", args); - case NULL: - return asString("assertNull", args); - case NOTNULL: - return asString("assertNotNull", args); - case FALSE: - return asString("assertFalse", args); - case TRUE: - return asString("assertTrue", args); - default: - return ""; - } - } - - private static String asString(String assertion, Object ... args) { - if (args == null) { - return String.format("%s(null)", assertion); - } - if (args.length == 1) { - return String.format("%s(%s)", assertion, args[0]); - } else { - return String.format("%s(%s, %s)", assertion, args[0], args[1]); - } - } -} diff --git a/test/hotspot/jtreg/testlibrary_tests/OutputAnalyzerReportingTest.java b/test/hotspot/jtreg/testlibrary_tests/OutputAnalyzerReportingTest.java deleted file mode 100644 index c8abc6f50f1..00000000000 --- a/test/hotspot/jtreg/testlibrary_tests/OutputAnalyzerReportingTest.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* - * @test - * @summary Test the OutputAnalyzer reporting functionality, - * such as printing additional diagnostic info - * (exit code, stdout, stderr, command line, etc.) - * @library /test/lib - * @modules java.base/jdk.internal.misc - * java.management - */ - -import java.io.ByteArrayOutputStream; -import java.io.PrintStream; - -import jdk.test.lib.process.OutputAnalyzer; -import jdk.test.lib.process.ProcessTools; - - -public class OutputAnalyzerReportingTest { - - public static void main(String[] args) throws Exception { - // Create the output analyzer under test - String stdout = "aaaaaa"; - String stderr = "bbbbbb"; - OutputAnalyzer output = new OutputAnalyzer(stdout, stderr); - - // Expected summary values should be the same for all cases, - // since the outputAnalyzer object is the same - String expectedExitValue = "-1"; - String expectedSummary = - " stdout: [" + stdout + "];\n" + - " stderr: [" + stderr + "]\n" + - " exitValue = " + expectedExitValue + "\n"; - - - DiagnosticSummaryTestRunner testRunner = - new DiagnosticSummaryTestRunner(); - - // should have exit value - testRunner.init(expectedSummary); - int unexpectedExitValue = 2; - try { - output.shouldHaveExitValue(unexpectedExitValue); - } catch (RuntimeException e) { } - testRunner.closeAndCheckResults(); - - // should not contain - testRunner.init(expectedSummary); - try { - output.shouldNotContain(stdout); - } catch (RuntimeException e) { } - testRunner.closeAndCheckResults(); - - // should contain - testRunner.init(expectedSummary); - try { - output.shouldContain("unexpected-stuff"); - } catch (RuntimeException e) { } - testRunner.closeAndCheckResults(); - - // should not match - testRunner.init(expectedSummary); - try { - output.shouldNotMatch("[a]"); - } catch (RuntimeException e) { } - testRunner.closeAndCheckResults(); - - // should match - testRunner.init(expectedSummary); - try { - output.shouldMatch("[qwerty]"); - } catch (RuntimeException e) { } - testRunner.closeAndCheckResults(); - - } - - private static class DiagnosticSummaryTestRunner { - private ByteArrayOutputStream byteStream = - new ByteArrayOutputStream(10000); - - private String expectedSummary = ""; - private PrintStream errStream; - - - public void init(String expectedSummary) { - this.expectedSummary = expectedSummary; - byteStream.reset(); - errStream = new PrintStream(byteStream); - System.setErr(errStream); - } - - public void closeAndCheckResults() { - // check results - errStream.close(); - String stdErrStr = byteStream.toString(); - if (!stdErrStr.contains(expectedSummary)) { - throw new RuntimeException("The output does not contain " - + "the diagnostic message, or the message is incorrect"); - } - } - } - -} diff --git a/test/hotspot/jtreg/testlibrary_tests/OutputAnalyzerTest.java b/test/hotspot/jtreg/testlibrary_tests/OutputAnalyzerTest.java deleted file mode 100644 index 6faedf4a8c5..00000000000 --- a/test/hotspot/jtreg/testlibrary_tests/OutputAnalyzerTest.java +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @summary Test the OutputAnalyzer utility class - * @library /test/lib - * @modules java.base/jdk.internal.misc - * java.management - */ - -import jdk.test.lib.process.OutputAnalyzer; - -public class OutputAnalyzerTest { - - public static void main(String args[]) throws Exception { - - String stdout = "aaaaaa"; - String stderr = "bbbbbb"; - - // Regexps used for testing pattern matching of the test input - String stdoutPattern = "[a]"; - String stderrPattern = "[b]"; - String nonExistingPattern = "[c]"; - - OutputAnalyzer output = new OutputAnalyzer(stdout, stderr); - - if (!stdout.equals(output.getStdout())) { - throw new Exception("getStdout() returned '" + output.getStdout() + "', expected '" + stdout + "'"); - } - - if (!stderr.equals(output.getStderr())) { - throw new Exception("getStderr() returned '" + output.getStderr() + "', expected '" + stderr + "'"); - } - - try { - output.shouldContain(stdout); - output.stdoutShouldContain(stdout); - output.shouldContain(stderr); - output.stderrShouldContain(stderr); - } catch (RuntimeException e) { - throw new Exception("shouldContain() failed", e); - } - - try { - output.shouldContain("cccc"); - throw new Exception("shouldContain() failed to throw exception"); - } catch (RuntimeException e) { - // expected - } - - try { - output.stdoutShouldContain(stderr); - throw new Exception("stdoutShouldContain() failed to throw exception"); - } catch (RuntimeException e) { - // expected - } - - try { - output.stderrShouldContain(stdout); - throw new Exception("stdoutShouldContain() failed to throw exception"); - } catch (RuntimeException e) { - // expected - } - - try { - output.shouldNotContain("cccc"); - output.stdoutShouldNotContain("cccc"); - output.stderrShouldNotContain("cccc"); - } catch (RuntimeException e) { - throw new Exception("shouldNotContain() failed", e); - } - - try { - output.shouldNotContain(stdout); - throw new Exception("shouldContain() failed to throw exception"); - } catch (RuntimeException e) { - // expected - } - - try { - output.stdoutShouldNotContain(stdout); - throw new Exception("shouldContain() failed to throw exception"); - } catch (RuntimeException e) { - // expected - } - - try { - output.stderrShouldNotContain(stderr); - throw new Exception("shouldContain() failed to throw exception"); - } catch (RuntimeException e) { - // expected - } - - // Should match - try { - output.shouldMatch(stdoutPattern); - output.stdoutShouldMatch(stdoutPattern); - output.shouldMatch(stderrPattern); - output.stderrShouldMatch(stderrPattern); - } catch (RuntimeException e) { - throw new Exception("shouldMatch() failed", e); - } - - try { - output.shouldMatch(nonExistingPattern); - throw new Exception("shouldMatch() failed to throw exception"); - } catch (RuntimeException e) { - // expected - } - - try { - output.stdoutShouldMatch(stderrPattern); - throw new Exception( - "stdoutShouldMatch() failed to throw exception"); - } catch (RuntimeException e) { - // expected - } - - try { - output.stderrShouldMatch(stdoutPattern); - throw new Exception( - "stderrShouldMatch() failed to throw exception"); - } catch (RuntimeException e) { - // expected - } - - // Should not match - try { - output.shouldNotMatch(nonExistingPattern); - output.stdoutShouldNotMatch(nonExistingPattern); - output.stderrShouldNotMatch(nonExistingPattern); - } catch (RuntimeException e) { - throw new Exception("shouldNotMatch() failed", e); - } - - try { - output.shouldNotMatch(stdoutPattern); - throw new Exception("shouldNotMatch() failed to throw exception"); - } catch (RuntimeException e) { - // expected - } - - try { - output.stdoutShouldNotMatch(stdoutPattern); - throw new Exception("shouldNotMatch() failed to throw exception"); - } catch (RuntimeException e) { - // expected - } - - try { - output.stderrShouldNotMatch(stderrPattern); - throw new Exception("shouldNotMatch() failed to throw exception"); - } catch (RuntimeException e) { - // expected - } - - { - String aaaa = "aaaa"; - String result = output.firstMatch(aaaa); - if (!aaaa.equals(result)) { - throw new Exception("firstMatch(String) faild to match. Expected: " + aaaa + " got: " + result); - } - } - - { - String aa = "aa"; - String aa_grouped_aa = aa + "(" + aa + ")"; - String result = output.firstMatch(aa_grouped_aa, 1); - if (!aa.equals(result)) { - throw new Exception("firstMatch(String, int) failed to match. Expected: " + aa + " got: " + result); - } - } - } -} diff --git a/test/hotspot/jtreg/testlibrary_tests/SimpleClassFileLoadHookTest.java b/test/hotspot/jtreg/testlibrary_tests/jvmti/SimpleClassFileLoadHookTest.java similarity index 100% rename from test/hotspot/jtreg/testlibrary_tests/SimpleClassFileLoadHookTest.java rename to test/hotspot/jtreg/testlibrary_tests/jvmti/SimpleClassFileLoadHookTest.java diff --git a/test/hotspot/jtreg/testlibrary_tests/process/Test.java b/test/hotspot/jtreg/testlibrary_tests/process/Test.java deleted file mode 100644 index 17375e305dd..00000000000 --- a/test/hotspot/jtreg/testlibrary_tests/process/Test.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2020, 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. - */ - -public class Test { - public static void test() { - System.out.println ("Hello Test"); - } -} diff --git a/test/lib-test/ProblemList.txt b/test/lib-test/ProblemList.txt new file mode 100644 index 00000000000..3d3ff27ad2f --- /dev/null +++ b/test/lib-test/ProblemList.txt @@ -0,0 +1,40 @@ +# +# Copyright (c) 2020, 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. +# + +############################################################################# +# +# List of quarantined tests -- tests that should not be run by default, because +# they may fail due to known reason. The reason (CR#) must be mandatory specified. +# +# List items are testnames followed by labels, all MUST BE commented +# as to why they are here and use a label: +# generic-all Problems on all platforms +# generic-ARCH Where ARCH is one of: x64, i586, ppc64, ppc64le, s390x etc. +# OSNAME-all Where OSNAME is one of: linux, windows, macosx, aix +# OSNAME-ARCH Specific on to one OSNAME and ARCH, e.g. macosx-x64 +# OSNAME-REV Specific on to one OSNAME and REV, e.g. macosx-10.7.4 +# +# More than one label is allowed but must be on the same line. +# +############################################################################# + diff --git a/test/hotspot/jtreg/testlibrary_tests/RedefineClassTest.java b/test/lib-test/RedefineClassTest.java similarity index 100% rename from test/hotspot/jtreg/testlibrary_tests/RedefineClassTest.java rename to test/lib-test/RedefineClassTest.java diff --git a/test/lib-test/TEST.ROOT b/test/lib-test/TEST.ROOT index 130e7aa2355..927dc437ebc 100644 --- a/test/lib-test/TEST.ROOT +++ b/test/lib-test/TEST.ROOT @@ -1,9 +1,38 @@ +# +# Copyright (c) 2020, 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. +# + # This file identifies the root of the test-suite hierarchy. # It also contains test-suite configuration information. +# The list of keywords supported in this test suite +# randomness: test uses randomness, test cases differ from run to run +keys=randomness + # Minimum jtreg version requiredVersion=5.1 b1 # Path to libraries in the topmost test directory. This is needed so @library # does not need ../../ notation to reach them external.lib.roots = ../../ + +groups=TEST.groups diff --git a/test/lib-test/TEST.groups b/test/lib-test/TEST.groups new file mode 100644 index 00000000000..eb0c9b317ae --- /dev/null +++ b/test/lib-test/TEST.groups @@ -0,0 +1,24 @@ +# +# Copyright (c) 2020, 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. +# + +tier1 = . diff --git a/test/jdk/lib/testlibrary/AssertsTest.java b/test/lib-test/jdk/test/lib/AssertsTest.java similarity index 100% rename from test/jdk/lib/testlibrary/AssertsTest.java rename to test/lib-test/jdk/test/lib/AssertsTest.java diff --git a/test/hotspot/jtreg/testlibrary_tests/RandomGeneratorTest.java b/test/lib-test/jdk/test/lib/RandomGeneratorTest.java similarity index 100% rename from test/hotspot/jtreg/testlibrary_tests/RandomGeneratorTest.java rename to test/lib-test/jdk/test/lib/RandomGeneratorTest.java diff --git a/test/hotspot/jtreg/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java b/test/lib-test/jdk/test/lib/TestMutuallyExclusivePlatformPredicates.java similarity index 100% rename from test/hotspot/jtreg/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java rename to test/lib-test/jdk/test/lib/TestMutuallyExclusivePlatformPredicates.java diff --git a/test/hotspot/jtreg/testlibrary_tests/TestPlatformIsTieredSupported.java b/test/lib-test/jdk/test/lib/TestPlatformIsTieredSupported.java similarity index 100% rename from test/hotspot/jtreg/testlibrary_tests/TestPlatformIsTieredSupported.java rename to test/lib-test/jdk/test/lib/TestPlatformIsTieredSupported.java diff --git a/test/lib-test/jdk/test/lib/apps/LingeredAppTest.java b/test/lib-test/jdk/test/lib/apps/LingeredAppTest.java index dfbc8830b63..600d05189c6 100644 --- a/test/lib-test/jdk/test/lib/apps/LingeredAppTest.java +++ b/test/lib-test/jdk/test/lib/apps/LingeredAppTest.java @@ -24,9 +24,9 @@ /* * @test * @summary Unit test for LingeredApp - * @compile LingeredAppTest.java - * @compile LingeredApp.java - * @run main LingeredAppTest + * @library /test/lib + * @build jdk.test.lib.apps.LingeredAppTest jdk.test.lib.apps.LingeredApp + * @run main jdk.test.lib.apps.LingeredAppTest */ package jdk.test.lib.apps; @@ -52,13 +52,13 @@ public class LingeredAppTest { cmd.add("-XX:+PrintFlagsFinal"); - LingeredApp a = LingeredApp.startApp(cmd.toArray(new String[cmd.length]); + LingeredApp a = LingeredApp.startApp(cmd.toArray(new String[cmd.size()])); System.out.printf("App pid: %d\n", a.getPid()); a.stopApp(); System.out.println("App output:"); int count = 0; - for (String line : a.getAppOutput()) { + for (String line : a.getOutput().getStdoutAsList()) { count += 1; } System.out.println("Found " + count + " lines in VM output"); diff --git a/test/jdk/lib/testlibrary/OutputAnalyzerReportingTest.java b/test/lib-test/jdk/test/lib/process/OutputAnalyzerReportingTest.java similarity index 100% rename from test/jdk/lib/testlibrary/OutputAnalyzerReportingTest.java rename to test/lib-test/jdk/test/lib/process/OutputAnalyzerReportingTest.java diff --git a/test/jdk/lib/testlibrary/OutputAnalyzerTest.java b/test/lib-test/jdk/test/lib/process/OutputAnalyzerTest.java similarity index 90% rename from test/jdk/lib/testlibrary/OutputAnalyzerTest.java rename to test/lib-test/jdk/test/lib/process/OutputAnalyzerTest.java index 7a252e62445..2e1bd159ebd 100644 --- a/test/jdk/lib/testlibrary/OutputAnalyzerTest.java +++ b/test/lib-test/jdk/test/lib/process/OutputAnalyzerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2020, 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 @@ -199,6 +199,23 @@ public class OutputAnalyzerTest { } catch (RuntimeException e) { // expected } + + { + String aaaa = "aaaa"; + String result = output.firstMatch(aaaa); + if (!aaaa.equals(result)) { + throw new Exception("firstMatch(String) failed to match. Expected: " + aaaa + " got: " + result); + } + } + + { + String aa = "aa"; + String aa_grouped_aa = aa + "(" + aa + ")"; + String result = output.firstMatch(aa_grouped_aa, 1); + if (!aa.equals(result)) { + throw new Exception("firstMatch(String, int) failed to match. Expected: " + aa + " got: " + result); + } + } } } diff --git a/test/hotspot/jtreg/testlibrary_tests/process/TestNativeProcessBuilder.java b/test/lib-test/jdk/test/lib/process/TestNativeProcessBuilder.java similarity index 88% rename from test/hotspot/jtreg/testlibrary_tests/process/TestNativeProcessBuilder.java rename to test/lib-test/jdk/test/lib/process/TestNativeProcessBuilder.java index 9acd6a64c18..6c2f53d31eb 100644 --- a/test/hotspot/jtreg/testlibrary_tests/process/TestNativeProcessBuilder.java +++ b/test/lib-test/jdk/test/lib/process/TestNativeProcessBuilder.java @@ -25,7 +25,6 @@ * @test * @summary Test the native process builder API. * @library /test/lib - * @build Test * @run main/native TestNativeProcessBuilder */ @@ -39,6 +38,13 @@ public class TestNativeProcessBuilder { ProcessBuilder pb = ProcessTools.createNativeTestProcessBuilder("jvm-test-launcher"); pb.environment().put("CLASSPATH", Utils.TEST_CLASS_PATH); new OutputAnalyzer(pb.start()) - .shouldHaveExitValue(0); + .shouldHaveExitValue(0) + .stdoutShouldContain("Hello Test"); + } + + public static class Test { + public static void test() { + System.out.println("Hello Test"); + } } } diff --git a/test/hotspot/jtreg/testlibrary_tests/process/exejvm-test-launcher.c b/test/lib-test/jdk/test/lib/process/exejvm-test-launcher.c similarity index 92% rename from test/hotspot/jtreg/testlibrary_tests/process/exejvm-test-launcher.c rename to test/lib-test/jdk/test/lib/process/exejvm-test-launcher.c index dee0bb0ff5a..550f0f3c9dc 100644 --- a/test/hotspot/jtreg/testlibrary_tests/process/exejvm-test-launcher.c +++ b/test/lib-test/jdk/test/lib/process/exejvm-test-launcher.c @@ -42,8 +42,9 @@ JNIEnv* create_vm(JavaVM **jvm) args.ignoreUnrecognized = 0; int ret = JNI_CreateJavaVM(jvm, (void**)&env, &args); - if (ret < 0) + if (ret < 0) { exit(10); + } return env; } @@ -53,13 +54,15 @@ void run(JNIEnv *env) { jclass test_class; jmethodID test_method; - test_class = (*env)->FindClass(env, "Test"); - if (test_class == NULL) + test_class = (*env)->FindClass(env, "TestNativeProcessBuilder$Test"); + if (test_class == NULL) { exit(11); + } test_method = (*env)->GetStaticMethodID(env, test_class, "test", "()V"); - if (test_method == NULL) + if (test_method == NULL) { exit(12); + } (*env)->CallStaticVoidMethod(env, test_class, test_method); } diff --git a/test/hotspot/jtreg/testlibrary_tests/whitebox/BlobSanityTest.java b/test/lib-test/sun/hotspot/whitebox/BlobSanityTest.java similarity index 100% rename from test/hotspot/jtreg/testlibrary_tests/whitebox/BlobSanityTest.java rename to test/lib-test/sun/hotspot/whitebox/BlobSanityTest.java diff --git a/test/jdk/lib/testlibrary/CPUInfoTest.java b/test/lib-test/sun/hotspot/whitebox/CPUInfoTest.java similarity index 100% rename from test/jdk/lib/testlibrary/CPUInfoTest.java rename to test/lib-test/sun/hotspot/whitebox/CPUInfoTest.java diff --git a/test/hotspot/jtreg/testlibrary_tests/whitebox/vm_flags/BooleanTest.java b/test/lib-test/sun/hotspot/whitebox/vm_flags/BooleanTest.java similarity index 100% rename from test/hotspot/jtreg/testlibrary_tests/whitebox/vm_flags/BooleanTest.java rename to test/lib-test/sun/hotspot/whitebox/vm_flags/BooleanTest.java diff --git a/test/hotspot/jtreg/testlibrary_tests/whitebox/vm_flags/DoubleTest.java b/test/lib-test/sun/hotspot/whitebox/vm_flags/DoubleTest.java similarity index 100% rename from test/hotspot/jtreg/testlibrary_tests/whitebox/vm_flags/DoubleTest.java rename to test/lib-test/sun/hotspot/whitebox/vm_flags/DoubleTest.java diff --git a/test/hotspot/jtreg/testlibrary_tests/whitebox/vm_flags/IntxTest.java b/test/lib-test/sun/hotspot/whitebox/vm_flags/IntxTest.java similarity index 100% rename from test/hotspot/jtreg/testlibrary_tests/whitebox/vm_flags/IntxTest.java rename to test/lib-test/sun/hotspot/whitebox/vm_flags/IntxTest.java diff --git a/test/hotspot/jtreg/testlibrary_tests/whitebox/vm_flags/SizeTTest.java b/test/lib-test/sun/hotspot/whitebox/vm_flags/SizeTTest.java similarity index 100% rename from test/hotspot/jtreg/testlibrary_tests/whitebox/vm_flags/SizeTTest.java rename to test/lib-test/sun/hotspot/whitebox/vm_flags/SizeTTest.java diff --git a/test/hotspot/jtreg/testlibrary_tests/whitebox/vm_flags/StringTest.java b/test/lib-test/sun/hotspot/whitebox/vm_flags/StringTest.java similarity index 100% rename from test/hotspot/jtreg/testlibrary_tests/whitebox/vm_flags/StringTest.java rename to test/lib-test/sun/hotspot/whitebox/vm_flags/StringTest.java diff --git a/test/hotspot/jtreg/testlibrary_tests/whitebox/vm_flags/Uint64Test.java b/test/lib-test/sun/hotspot/whitebox/vm_flags/Uint64Test.java similarity index 100% rename from test/hotspot/jtreg/testlibrary_tests/whitebox/vm_flags/Uint64Test.java rename to test/lib-test/sun/hotspot/whitebox/vm_flags/Uint64Test.java diff --git a/test/hotspot/jtreg/testlibrary_tests/whitebox/vm_flags/UintxTest.java b/test/lib-test/sun/hotspot/whitebox/vm_flags/UintxTest.java similarity index 100% rename from test/hotspot/jtreg/testlibrary_tests/whitebox/vm_flags/UintxTest.java rename to test/lib-test/sun/hotspot/whitebox/vm_flags/UintxTest.java diff --git a/test/hotspot/jtreg/testlibrary_tests/whitebox/vm_flags/VmFlagTest.java b/test/lib-test/sun/hotspot/whitebox/vm_flags/VmFlagTest.java similarity index 100% rename from test/hotspot/jtreg/testlibrary_tests/whitebox/vm_flags/VmFlagTest.java rename to test/lib-test/sun/hotspot/whitebox/vm_flags/VmFlagTest.java