21 * questions.
22 */
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 * @modules jdk.management.agent/jdk.internal.agent
46 * @build jdk.testlibrary.* PortAllocator TestApp ManagementAgentJcmd
47 * @run testng/othervm -XX:+UsePerfData JMXStatusPerfCountersTest
48 */
49 public class JMXStatusPerfCountersTest {
50 private final static String TEST_APP_NAME = "TestApp";
51
52 private final static String REMOTE_STATUS_KEY = "sun.management.JMXConnectorServer.remote.enabled";
53
54 private static ProcessBuilder testAppPb;
55 private Process testApp;
56
57 private ManagementAgentJcmd jcmd;
58
59 @BeforeClass
60 public static void setupClass() throws Exception {
61 testAppPb = ProcessTools.createJavaProcessBuilder(
62 "-XX:+UsePerfData",
63 "-cp", System.getProperty("test.class.path"),
64 TEST_APP_NAME
65 );
|
21 * questions.
22 */
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 * @key intermittent
42 * @summary Makes sure that the current management agent status is reflected
43 * in the related performance counters.
44 *
45 * @library /lib/testlibrary
46 *
47 * @build jdk.testlibrary.* PortAllocator TestApp ManagementAgentJcmd
48 * @run testng/othervm -XX:+UsePerfData JMXStatusPerfCountersTest
49 */
50 public class JMXStatusPerfCountersTest {
51 private final static String TEST_APP_NAME = "TestApp";
52
53 private final static String REMOTE_STATUS_KEY = "sun.management.JMXConnectorServer.remote.enabled";
54
55 private static ProcessBuilder testAppPb;
56 private Process testApp;
57
58 private ManagementAgentJcmd jcmd;
59
60 @BeforeClass
61 public static void setupClass() throws Exception {
62 testAppPb = ProcessTools.createJavaProcessBuilder(
63 "-XX:+UsePerfData",
64 "-cp", System.getProperty("test.class.path"),
65 TEST_APP_NAME
66 );
|