23
24 import java.io.IOException;
25 import java.net.BindException;
26 import java.util.Properties;
27 import java.util.function.Predicate;
28 import static org.testng.Assert.*;
29 import org.testng.annotations.AfterMethod;
30 import org.testng.annotations.BeforeClass;
31 import org.testng.annotations.BeforeMethod;
32 import org.testng.annotations.BeforeTest;
33 import org.testng.annotations.Test;
34
35 import jdk.testlibrary.ProcessTools;
36
37
38 /**
39 * @test
40 * @bug 8075926
41 * @summary Makes sure that the current management agent status is reflected
42 * in the related performance counters.
43 * @library /lib/testlibrary
44 * @build jdk.testlibrary.* PortAllocator TestApp ManagementAgentJcmd
45 * @run testng/othervm -XX:+UsePerfData JMXStatusPerfCountersTest
46 */
47 public class JMXStatusPerfCountersTest {
48 private final static String TEST_APP_NAME = "TestApp";
49
50 private final static String REMOTE_STATUS_KEY = "sun.management.JMXConnectorServer.remote.enabled";
51
52 private static ProcessBuilder testAppPb;
53 private Process testApp;
54
55 private ManagementAgentJcmd jcmd;
56
57 @BeforeClass
58 public static void setupClass() throws Exception {
59 testAppPb = ProcessTools.createJavaProcessBuilder(
60 "-XX:+UsePerfData",
61 "-cp", System.getProperty("test.class.path"),
62 TEST_APP_NAME
|
23
24 import java.io.IOException;
25 import java.net.BindException;
26 import java.util.Properties;
27 import java.util.function.Predicate;
28 import static org.testng.Assert.*;
29 import org.testng.annotations.AfterMethod;
30 import org.testng.annotations.BeforeClass;
31 import org.testng.annotations.BeforeMethod;
32 import org.testng.annotations.BeforeTest;
33 import org.testng.annotations.Test;
34
35 import jdk.testlibrary.ProcessTools;
36
37
38 /**
39 * @test
40 * @bug 8075926
41 * @summary Makes sure that the current management agent status is reflected
42 * in the related performance counters.
43 * @key intermittent
44 * @library /lib/testlibrary
45 * @build jdk.testlibrary.* PortAllocator TestApp ManagementAgentJcmd
46 * @run testng/othervm -XX:+UsePerfData JMXStatusPerfCountersTest
47 */
48 public class JMXStatusPerfCountersTest {
49 private final static String TEST_APP_NAME = "TestApp";
50
51 private final static String REMOTE_STATUS_KEY = "sun.management.JMXConnectorServer.remote.enabled";
52
53 private static ProcessBuilder testAppPb;
54 private Process testApp;
55
56 private ManagementAgentJcmd jcmd;
57
58 @BeforeClass
59 public static void setupClass() throws Exception {
60 testAppPb = ProcessTools.createJavaProcessBuilder(
61 "-XX:+UsePerfData",
62 "-cp", System.getProperty("test.class.path"),
63 TEST_APP_NAME
|