Skip to content
Permalink
Browse files
8246387: switch to jtreg 5.1
8238943: switch to jtreg 5.0
8235866: bump jtreg requiredVersion to 4.2b16
8219552: bump jtreg requiredVersion to b14 in test/jdk/sanity/client/
8219417: bump jtreg requiredVersion to b14
8236111: narrow allowSmartActionArgs disabling

Reviewed-by: phh, clanger
Backport-of: e47b2bc
  • Loading branch information
shipilev committed Aug 9, 2021
1 parent 4e32429 commit 5f9429b58f68a2d71b3dae96e15353b780c745a3
@@ -918,11 +918,12 @@ var getJibProfilesDependencies = function (input, common) {
},

jtreg: {
server: "javare",
revision: "4.2",
build_number: "b13",
server: "jpg",
product: "jtreg",
version: "5.1",
build_number: "b01",
checksum_file: "MD5_VALUES",
file: "jtreg_bin-4.2.zip",
file: "bundles/jtreg_bin-5.1.zip",
environment_name: "JT_HOME",
environment_path: input.get("jtreg", "install_path") + "/jtreg/bin"
},
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 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
@@ -124,29 +124,4 @@ public void startingTestRun(Parameters params) {
compileJdk = map.get("regtest.compilejdk");
testJdk = map.get("regtest.testjdk");
}

@Override
public void startingTest(TestResult tr) {
// no-op
}

@Override
public void stoppingTestRun() {
// no-op
}

@Override
public void finishedTesting() {
// no-op
}

@Override
public void finishedTestRun(boolean allOK) {
// no-op
}

@Override
public void error(String msg) {
// no-op
}
}
@@ -71,7 +71,7 @@ requires.properties= \
docker.support

# Minimum jtreg version
requiredVersion=4.2 b13
requiredVersion=5.1 b1

# Path to libraries in the topmost test directory. This is needed so @library
# does not need ../../../ notation to reach them
@@ -0,0 +1,2 @@
# disabled till JDK-8219140 is fixed
allowSmartActionArgs=false
@@ -23,7 +23,7 @@ modules=java.xml
groups=TEST.groups

# Minimum jtreg version
requiredVersion=4.2 b12
requiredVersion=5.1 b1

# Path to libraries in the topmost test directory. This is needed so @library
# does not need ../../ notation to reach them
@@ -23,7 +23,8 @@ javax/management com/sun/awt sun/awt sun/java2d javax/xml/jaxp/testng/validation

# Tests that cannot run concurrently
exclusiveAccess.dirs=java/rmi/Naming java/util/prefs sun/management/jmxremote sun/tools/jstatd \
sun/security/mscapi java/util/stream java/util/Arrays/largeMemory java/util/BitSet/stream javax/rmi
sun/security/mscapi java/util/stream java/util/Arrays/largeMemory java/util/BitSet/stream javax/rmi \
sanity/client

# Group definitions
groups=TEST.groups
@@ -55,7 +56,7 @@ requires.properties= \
release.implementor

# Minimum jtreg version
requiredVersion=4.2 b12
requiredVersion=5.1 b1

# Path to libraries in the topmost test directory. This is needed so @library
# does not need ../../ notation to reach them
@@ -0,0 +1,2 @@
# disabled till JDK-8219408 is fixed
allowSmartActionArgs=false
@@ -0,0 +1,2 @@
# disabled till JDK-8219408 is fixed
allowSmartActionArgs=false
@@ -0,0 +1,2 @@
# disabled till JDK-8219408 is fixed
allowSmartActionArgs=false
@@ -0,0 +1,2 @@
# disabled till JDK-8219408 is fixed
allowSmartActionArgs=false
@@ -0,0 +1,2 @@
# disabled till JDK-8219408 is fixed
allowSmartActionArgs=false
@@ -0,0 +1,2 @@
# disabled till JDK-8219408 is fixed
allowSmartActionArgs=false
@@ -0,0 +1,2 @@
# disabled till JDK-8219408 is fixed
allowSmartActionArgs=false
@@ -0,0 +1,2 @@
# disabled till JDK-8219408 is fixed
allowSmartActionArgs=false
@@ -8,7 +8,7 @@ How to run:
1) Download/Install the JDK to be tested in the system.
(For example C:/java/jdk1.9.0 in windows or
/export/jdk/jdk1.9.0 in linux/mac/solaris)
2) Download/Install JTReg harness, minimum required version is 4.1 b13.
2) Download/Install JTReg harness.
3) Open terminal(cmd in windows, *not* cygwin) and go to the this directory.
4) To run
- see the notes below on how to prepare for the test run
@@ -42,4 +42,4 @@ operate on controls of the demo and verify that it is behaving as expected. Both
Jemmy and SwingSet3 sources are available as copies in lib folder.

Original Jemmy repository is https://jemmy.java.net
Original SwingSet3 repository is https://java.net/projects/swingset3
Original SwingSet3 repository is https://java.net/projects/swingset3
@@ -42,7 +42,7 @@

/*
* @test
* @key headful screenshots intermittent
* @key headful screenshots
* @summary Verifies buttons on SwingSet3 ButtonDemo page by clicking each
* button, taking its screenshots and checking that pressed button
* image is different from initial button image.
@@ -51,7 +51,7 @@

/*
* @test
* @key headful
* @key headful screenshots
* @summary Verifies SwingSet3 EditorPaneDemo by navigating and and validating
* the page contents in all pages
*

This file was deleted.

@@ -1,3 +1,25 @@
# Copyright (c) 2019, 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 contains test-suite configuration information related to this portion
# of the test suite.
#
@@ -6,9 +28,3 @@

# The list of keywords supported in this part of the test suite
keys=screenshots

# Tests that cannot run concurrently
exclusiveAccess.dirs=SwingSet

# Tests require jtreg 4.1 b13 features
#requiredVersion=4.1 b13
@@ -0,0 +1,2 @@
# disabled till JDK-8219408 is fixed
allowSmartActionArgs=false
@@ -15,7 +15,7 @@ keys=intermittent randomness
groups=TEST.groups

# Minimum jtreg version
requiredVersion=4.2 b12
requiredVersion=5.1 b1

# Use new module options
useNewOptions=true
@@ -103,6 +103,11 @@
*/
public static final String TEST_CLASSES = System.getProperty("test.classes", ".");
/**
* Returns the value of 'test.name' system property
*/
public static final String TEST_NAME = System.getProperty("test.name", ".");

/**
* Defines property name for seed value.
*/
public static final String SEED_PROPERTY_NAME = "jdk.test.lib.random.seed";
@@ -736,58 +741,6 @@ public static String distro() {
}
}

// This method is intended to be called from a jtreg test.
// It will identify the name of the test by means of stack walking.
// It can handle both jtreg tests and a testng tests wrapped inside jtreg tests.
// For jtreg tests the name of the test will be searched by stack-walking
// until the method main() is found; the class containing that method is the
// main test class and will be returned as the name of the test.
// Special handling is used for testng tests.
public static String getTestName() {
String result = null;
// If we are using testng, then we should be able to load the "Test" annotation.
Class testClassAnnotation;

try {
testClassAnnotation = Class.forName("org.testng.annotations.Test");
} catch (ClassNotFoundException e) {
testClassAnnotation = null;
}

StackTraceElement[] elms = (new Throwable()).getStackTrace();
for (StackTraceElement n: elms) {
String className = n.getClassName();

// If this is a "main" method, then use its class name, but only
// if we are not using testng.
if (testClassAnnotation == null && "main".equals(n.getMethodName())) {
result = className;
break;
}

// If this is a testng test, the test will have no "main" method. We can
// detect a testng test class by looking for the org.testng.annotations.Test
// annotation. If present, then use the name of this class.
if (testClassAnnotation != null) {
try {
Class c = Class.forName(className);
if (c.isAnnotationPresent(testClassAnnotation)) {
result = className;
break;
}
} catch (ClassNotFoundException e) {
throw new RuntimeException("Unexpected exception: " + e, e);
}
}
}

if (result == null) {
throw new RuntimeException("Couldn't find main test class in stack trace");
}

return result;
}

/**
* Creates an empty file in "user.dir" if the property set.
* <p>
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 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
@@ -489,7 +489,7 @@ public static File getTestArtifact(String name, boolean checkExistence) {
// create file containing the specified class list
public static File makeClassList(String classes[])
throws Exception {
return makeClassList(getTestName() + "-", classes);
return makeClassList(testName + "-", classes);
}

// create file containing the specified class list
@@ -519,18 +519,7 @@ public static void addToClassList(PrintStream ps, String classes[])
}
}


// Optimization for getting a test name.
// Test name does not change during execution of the test,
// but getTestName() uses stack walking hence it is expensive.
// Therefore cache it and reuse it.
private static String testName;
public static String getTestName() {
if (testName == null) {
testName = Utils.getTestName();
}
return testName;
}
private static String testName = Utils.TEST_NAME.replace('/', '.');

private static final SimpleDateFormat timeStampFormat =
new SimpleDateFormat("HH'h'mm'm'ss's'SSS");
@@ -539,7 +528,7 @@ public static String getTestName() {

// Call this method to start new archive with new unique name
public static void startNewArchiveName() {
defaultArchiveName = getTestName() +
defaultArchiveName = testName +
timeStampFormat.format(new Date()) + ".jsa";
}

@@ -551,7 +540,7 @@ public static String getDefaultArchiveName() {
// ===================== FILE ACCESS convenience methods
public static File getOutputFile(String name) {
File dir = new File(System.getProperty("test.classes", "."));
return new File(dir, getTestName() + "-" + name);
return new File(dir, testName + "-" + name);
}


@@ -8,7 +8,7 @@ keys=intermittent randomness
groups=TEST.groups

# Minimum jtreg version
requiredVersion=4.2 b12
requiredVersion=5.1 b1

# Use new module options
useNewOptions=true

1 comment on commit 5f9429b

@openjdk-notifier

This comment has been minimized.

Please sign in to comment.