Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/jdk/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,8 @@ java/lang/invoke/RicochetTest.java 8251969 generic-

# jdk_instrument

java/lang/instrument/RedefineBigClass.sh 8065756 generic-all
java/lang/instrument/RetransformBigClass.sh 8065756 generic-all
java/lang/instrument/RedefineBigClassTest.java 8065756 generic-all
java/lang/instrument/RetransformBigClassDriver.java 8065756 generic-all

############################################################################

Expand Down
7 changes: 4 additions & 3 deletions test/jdk/java/lang/instrument/AddTransformerTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2026, 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
Expand Down Expand Up @@ -27,8 +27,9 @@
* @summary confirms that added transformers all really run
* @author Gabriel Adauto, Wily Technology
*
* @run build AddTransformerTest ATransformerManagementTestCase
* @run shell MakeJAR.sh redefineAgent
* @library /test/lib
* @run build AddTransformerTest ATransformerManagementTestCase InstrumentationHandoff
* @run driver jdk.test.lib.util.JavaAgentBuilder InstrumentationHandoff redefineAgent.jar Can-Redefine-Classes:true Can-Retransform-Classes:false
* @run main/othervm -javaagent:redefineAgent.jar AddTransformerTest AddTransformerTest
*/
public class
Expand Down
63 changes: 0 additions & 63 deletions test/jdk/java/lang/instrument/AppendToBootstrapClassPathSetUp.sh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@
* @summary simple test for the Boot-Class-Path manifest attribute
* @author Gabriel Adauto, Wily Technology, Robert Field, Sun Microsystems
*
* @run build AppendToBootstrapClassPathTest ExampleForBootClassPath
* @run shell AppendToBootstrapClassPathSetUp.sh
* @run shell MakeJAR.sh bootclasspathAgent
* @library /test/lib
* @run build AppendToBootstrapClassPathTest ExampleForBootClassPath MoveClassToHidden InstrumentationHandoff
* @run driver MoveClassToHidden ExampleForBootClassPath
* @run driver jdk.test.lib.util.JavaAgentBuilder InstrumentationHandoff bootclasspathAgent.jar Boot-Class-Path:hidden/
* @run main/othervm -javaagent:bootclasspathAgent.jar AppendToBootstrapClassPathTest AppendToBootstrapClassPathTest
*/

Expand Down
66 changes: 0 additions & 66 deletions test/jdk/java/lang/instrument/AppendToClassPathSetUp.sh

This file was deleted.

7 changes: 4 additions & 3 deletions test/jdk/java/lang/instrument/AppendToClassPathTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@
* @summary simple test for the Class-Path manifest attribute
* @author Gabriel Adauto, Wily Technology; Robert Field, Sun Microsystems
*
* @run build AppendToClassPathTest
* @run shell AppendToClassPathSetUp.sh
* @run shell MakeJAR.sh classpathAgent
* @library /test/lib
* @run build AppendToClassPathTest ExampleForClassPath MoveClassToHidden InstrumentationHandoff
* @run driver MoveClassToHidden ExampleForClassPath
* @run driver jdk.test.lib.util.JavaAgentBuilder InstrumentationHandoff classpathAgent.jar Class-Path:hidden/
* @run main/othervm -javaagent:classpathAgent.jar AppendToClassPathTest AppendToClassPathTest
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
/*
* Copyright (c) 2004, 2026, 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
* @bug 5055293 8273188
* @key intermittent
* @summary Test non US-ASCII characters in the value of the Boot-Class-Path
* attribute.
*
* @library /test/lib
* @build Setup Agent AgentSupport DummyMain Cleanup
* @run main/othervm/timeout=240 BootClassPathDriver
*/

import java.io.File;
import java.nio.file.Files;
import java.nio.file.Path;
import jdk.test.lib.compiler.CompilerUtils;
import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools;
import jdk.test.lib.util.JarUtils;

public class BootClassPathDriver {

public static void main(String[] args) throws Exception {
String testClasses = System.getProperty("test.classes");
String testSrc = System.getProperty("test.src");

// Run Setup to create non-ASCII boot dir and manifest
OutputAnalyzer setup = ProcessTools.executeTestJava(
"-classpath", testClasses, "Setup", testClasses, "Agent");
setup.reportDiagnosticSummary();
setup.shouldHaveExitValue(0);

// Read the boot directory name
String bootDir = Files.readString(Path.of(testClasses, "boot.dir")).trim();
System.out.println("Boot dir: " + bootDir);

// Compile AgentSupport into the boot directory
CompilerUtils.compile(Path.of(testSrc, "AgentSupport.java"), Path.of(bootDir));

// Create agent jar
Path manifestPath = Path.of(testClasses, "MANIFEST.MF");
Path agentJar = Path.of(testClasses, "Agent.jar");

ProcessBuilder pb = new ProcessBuilder(
Path.of(System.getProperty("test.jdk"), "bin", "jar").toString(),
"cvfm", agentJar.toString(), manifestPath.toString(),
"-C", testClasses, "Agent.class");
pb.inheritIO();
int rc = pb.start().waitFor();
if (rc != 0) throw new RuntimeException("jar failed with exit code " + rc);

// Run the test
OutputAnalyzer output = ProcessTools.executeTestJava(
"-javaagent:" + agentJar,
"-classpath", testClasses,
"DummyMain");
output.reportDiagnosticSummary();
output.shouldHaveExitValue(0);

// Cleanup
OutputAnalyzer cleanup = ProcessTools.executeTestJava(
"-classpath", testClasses, "Cleanup", bootDir);
cleanup.reportDiagnosticSummary();

System.out.println("PASS: BootClassPathTest passed.");
}
}
106 changes: 0 additions & 106 deletions test/jdk/java/lang/instrument/BootClassPath/BootClassPathTest.sh

This file was deleted.

Loading