8286460: Remove dependence on JAR filename in CDS tests

Reviewed-by: ccheung, iklam
This commit is contained in:
Christian Stein 2022-05-10 18:13:41 +00:00 committed by Calvin Cheung
parent 9073a98d57
commit 52dbfa99fe
14 changed files with 28 additions and 126 deletions

@ -1,5 +1,5 @@
#!/bin/bash
# Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2020, 2022, 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
@ -102,14 +102,7 @@ public class $i extends DynamicArchiveTestBase {
String verifyOpt =
Platform.isDebugBuild() ? "-XX:-VerifyDependencies" : "-showversion";
String[] classPaths = javaClassPath.split(File.pathSeparator);
String junitJar = null;
for (String path : classPaths) {
if (path.endsWith("junit.jar")) {
junitJar = path;
break;
}
}
String junitJar = Path.of(Test.class.getProtectionDomain().getCodeSource().getLocation().toURI()).toString();
dumpAndRun(topArchiveName, "-Xlog:cds,cds+dynamic=debug,class+load=trace",
"-cp", appJar + ps + junitJar, verifyOpt,

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2022, 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
@ -70,14 +70,7 @@ public class MethodHandlesAsCollectorTest extends DynamicArchiveTestBase {
String verifyOpt =
Platform.isDebugBuild() ? "-XX:-VerifyDependencies" : "-showversion";
String[] classPaths = javaClassPath.split(File.pathSeparator);
String junitJar = null;
for (String path : classPaths) {
if (path.endsWith("junit.jar")) {
junitJar = path;
break;
}
}
String junitJar = Path.of(Test.class.getProtectionDomain().getCodeSource().getLocation().toURI()).toString();
dumpAndRun(topArchiveName, "-Xlog:cds,cds+dynamic=debug,class+load=trace",
"-cp", appJar + ps + junitJar, verifyOpt,

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2022, 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
@ -70,14 +70,7 @@ public class MethodHandlesCastFailureTest extends DynamicArchiveTestBase {
String verifyOpt =
Platform.isDebugBuild() ? "-XX:-VerifyDependencies" : "-showversion";
String[] classPaths = javaClassPath.split(File.pathSeparator);
String junitJar = null;
for (String path : classPaths) {
if (path.endsWith("junit.jar")) {
junitJar = path;
break;
}
}
String junitJar = Path.of(Test.class.getProtectionDomain().getCodeSource().getLocation().toURI()).toString();
dumpAndRun(topArchiveName, "-Xlog:cds,cds+dynamic=debug,class+load=trace",
"-cp", appJar + ps + junitJar, verifyOpt,

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2022, 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
@ -70,14 +70,7 @@ public class MethodHandlesGeneralTest extends DynamicArchiveTestBase {
String verifyOpt =
Platform.isDebugBuild() ? "-XX:-VerifyDependencies" : "-showversion";
String[] classPaths = javaClassPath.split(File.pathSeparator);
String junitJar = null;
for (String path : classPaths) {
if (path.endsWith("junit.jar")) {
junitJar = path;
break;
}
}
String junitJar = Path.of(Test.class.getProtectionDomain().getCodeSource().getLocation().toURI()).toString();
dumpAndRun(topArchiveName, "-Xlog:cds,cds+dynamic=debug,class+load=trace",
"-cp", appJar + ps + junitJar, verifyOpt,

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2022, 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
@ -70,14 +70,7 @@ public class MethodHandlesInvokersTest extends DynamicArchiveTestBase {
String verifyOpt =
Platform.isDebugBuild() ? "-XX:-VerifyDependencies" : "-showversion";
String[] classPaths = javaClassPath.split(File.pathSeparator);
String junitJar = null;
for (String path : classPaths) {
if (path.endsWith("junit.jar")) {
junitJar = path;
break;
}
}
String junitJar = Path.of(Test.class.getProtectionDomain().getCodeSource().getLocation().toURI()).toString();
dumpAndRun(topArchiveName, "-Xlog:cds,cds+dynamic=debug,class+load=trace",
"-cp", appJar + ps + junitJar, verifyOpt,

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2022, 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
@ -70,14 +70,7 @@ public class MethodHandlesPermuteArgumentsTest extends DynamicArchiveTestBase {
String verifyOpt =
Platform.isDebugBuild() ? "-XX:-VerifyDependencies" : "-showversion";
String[] classPaths = javaClassPath.split(File.pathSeparator);
String junitJar = null;
for (String path : classPaths) {
if (path.endsWith("junit.jar")) {
junitJar = path;
break;
}
}
String junitJar = Path.of(Test.class.getProtectionDomain().getCodeSource().getLocation().toURI()).toString();
dumpAndRun(topArchiveName, "-Xlog:cds,cds+dynamic=debug,class+load=trace",
"-cp", appJar + ps + junitJar, verifyOpt,

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2022, 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
@ -70,14 +70,7 @@ public class MethodHandlesSpreadArgumentsTest extends DynamicArchiveTestBase {
String verifyOpt =
Platform.isDebugBuild() ? "-XX:-VerifyDependencies" : "-showversion";
String[] classPaths = javaClassPath.split(File.pathSeparator);
String junitJar = null;
for (String path : classPaths) {
if (path.endsWith("junit.jar")) {
junitJar = path;
break;
}
}
String junitJar = Path.of(Test.class.getProtectionDomain().getCodeSource().getLocation().toURI()).toString();
dumpAndRun(topArchiveName, "-Xlog:cds,cds+dynamic=debug,class+load=trace",
"-cp", appJar + ps + junitJar, verifyOpt,

@ -1,5 +1,5 @@
#!/bin/bash
# Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2020, 2022, 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
@ -106,14 +106,7 @@ public class $i {
String verifyOpt =
Platform.isDebugBuild() ? "-XX:-VerifyDependencies" : "-showversion";
String[] classPaths = javaClassPath.split(File.pathSeparator);
String junitJar = null;
for (String path : classPaths) {
if (path.endsWith("junit.jar")) {
junitJar = path;
break;
}
}
String junitJar = Path.of(Test.class.getProtectionDomain().getCodeSource().getLocation().toURI()).toString();
String jars = appJar + ps + junitJar;

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2022, 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
@ -74,14 +74,7 @@ public class MethodHandlesAsCollectorTest {
String verifyOpt =
Platform.isDebugBuild() ? "-XX:-VerifyDependencies" : "-showversion";
String[] classPaths = javaClassPath.split(File.pathSeparator);
String junitJar = null;
for (String path : classPaths) {
if (path.endsWith("junit.jar")) {
junitJar = path;
break;
}
}
String junitJar = Path.of(Test.class.getProtectionDomain().getCodeSource().getLocation().toURI()).toString();
String jars = appJar + ps + junitJar;

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2022, 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
@ -74,14 +74,7 @@ public class MethodHandlesCastFailureTest {
String verifyOpt =
Platform.isDebugBuild() ? "-XX:-VerifyDependencies" : "-showversion";
String[] classPaths = javaClassPath.split(File.pathSeparator);
String junitJar = null;
for (String path : classPaths) {
if (path.endsWith("junit.jar")) {
junitJar = path;
break;
}
}
String junitJar = Path.of(Test.class.getProtectionDomain().getCodeSource().getLocation().toURI()).toString();
String jars = appJar + ps + junitJar;

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2022, 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
@ -74,14 +74,7 @@ public class MethodHandlesGeneralTest {
String verifyOpt =
Platform.isDebugBuild() ? "-XX:-VerifyDependencies" : "-showversion";
String[] classPaths = javaClassPath.split(File.pathSeparator);
String junitJar = null;
for (String path : classPaths) {
if (path.endsWith("junit.jar")) {
junitJar = path;
break;
}
}
String junitJar = Path.of(Test.class.getProtectionDomain().getCodeSource().getLocation().toURI()).toString();
String jars = appJar + ps + junitJar;

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2022, 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
@ -74,14 +74,7 @@ public class MethodHandlesInvokersTest {
String verifyOpt =
Platform.isDebugBuild() ? "-XX:-VerifyDependencies" : "-showversion";
String[] classPaths = javaClassPath.split(File.pathSeparator);
String junitJar = null;
for (String path : classPaths) {
if (path.endsWith("junit.jar")) {
junitJar = path;
break;
}
}
String junitJar = Path.of(Test.class.getProtectionDomain().getCodeSource().getLocation().toURI()).toString();
String jars = appJar + ps + junitJar;

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2022, 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
@ -74,14 +74,7 @@ public class MethodHandlesPermuteArgumentsTest {
String verifyOpt =
Platform.isDebugBuild() ? "-XX:-VerifyDependencies" : "-showversion";
String[] classPaths = javaClassPath.split(File.pathSeparator);
String junitJar = null;
for (String path : classPaths) {
if (path.endsWith("junit.jar")) {
junitJar = path;
break;
}
}
String junitJar = Path.of(Test.class.getProtectionDomain().getCodeSource().getLocation().toURI()).toString();
String jars = appJar + ps + junitJar;

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2022, 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
@ -74,14 +74,7 @@ public class MethodHandlesSpreadArgumentsTest {
String verifyOpt =
Platform.isDebugBuild() ? "-XX:-VerifyDependencies" : "-showversion";
String[] classPaths = javaClassPath.split(File.pathSeparator);
String junitJar = null;
for (String path : classPaths) {
if (path.endsWith("junit.jar")) {
junitJar = path;
break;
}
}
String junitJar = Path.of(Test.class.getProtectionDomain().getCodeSource().getLocation().toURI()).toString();
String jars = appJar + ps + junitJar;