8336257: Additional tests in jmxremote/startstop to match on PID not app name

Reviewed-by: cjplummer, alanb, amenkov, dcubed
This commit is contained in:
Kevin Walls 2024-07-11 20:45:34 +00:00
parent 889055713e
commit 687601ebca
2 changed files with 5 additions and 4 deletions
test/jdk/sun/management/jmxremote/startstop

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024, 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
@ -72,7 +72,7 @@ public class JMXStartStopTest {
private static final boolean verbose = false;
private static ManagementAgentJcmd jcmd = new ManagementAgentJcmd(TEST_APP_NAME, verbose);
private static ManagementAgentJcmd jcmd;
private static void dbg_print(String msg) {
if (verbose) {
@ -347,6 +347,7 @@ public class JMXStartStopTest {
"the requested port not being available");
}
pid = p.pid();
jcmd = new ManagementAgentJcmd(p, verbose);
} catch (TimeoutException e) {
if (p != null) {
p.destroy();

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2024, 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
@ -67,7 +67,6 @@ public class JMXStatusPerfCountersTest {
@BeforeTest
public void setup() {
jcmd = new ManagementAgentJcmd(TEST_APP_NAME, false);
}
@BeforeMethod
@ -76,6 +75,7 @@ public class JMXStatusPerfCountersTest {
TEST_APP_NAME, testAppPb,
(Predicate<String>)l->l.trim().equals("main enter")
);
jcmd = new ManagementAgentJcmd(testApp, false);
}
@AfterMethod