jdk/test/sun/management/jmxremote/startstop/JMXStartStopDoSomething.java
author duke
Wed, 05 Jul 2017 20:31:05 +0200
changeset 30073 989253a902c3
parent 25182 1f6766bac82c
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11991
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
diff changeset
     1
/*
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
diff changeset
     2
 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
diff changeset
     4
 *
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
diff changeset
     7
 * published by the Free Software Foundation.
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
diff changeset
     8
 *
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
diff changeset
    13
 * accompanied this code).
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
diff changeset
    14
 *
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
diff changeset
    18
 *
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
diff changeset
    21
 * questions.
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
diff changeset
    22
 */
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
diff changeset
    23
22349
2aa385c1c4d8 8022221: Intermittent test failures in sun/management/jmxremote/startstop/JMXStartStopTest.sh
jbachorik
parents: 14907
diff changeset
    24
import java.io.IOException;
2aa385c1c4d8 8022221: Intermittent test failures in sun/management/jmxremote/startstop/JMXStartStopTest.sh
jbachorik
parents: 14907
diff changeset
    25
import jdk.testlibrary.ProcessTools;
11991
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
diff changeset
    26
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
diff changeset
    27
public class JMXStartStopDoSomething {
22349
2aa385c1c4d8 8022221: Intermittent test failures in sun/management/jmxremote/startstop/JMXStartStopTest.sh
jbachorik
parents: 14907
diff changeset
    28
    public static void doSomething() throws IOException{
2aa385c1c4d8 8022221: Intermittent test failures in sun/management/jmxremote/startstop/JMXStartStopTest.sh
jbachorik
parents: 14907
diff changeset
    29
        int r = System.in.read();
2aa385c1c4d8 8022221: Intermittent test failures in sun/management/jmxremote/startstop/JMXStartStopTest.sh
jbachorik
parents: 14907
diff changeset
    30
        System.out.println("read: " + r);
11991
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
diff changeset
    31
    }
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
diff changeset
    32
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
diff changeset
    33
    public static void main(String args[]) throws Exception {
22349
2aa385c1c4d8 8022221: Intermittent test failures in sun/management/jmxremote/startstop/JMXStartStopTest.sh
jbachorik
parents: 14907
diff changeset
    34
        System.out.println("main enter");
2aa385c1c4d8 8022221: Intermittent test failures in sun/management/jmxremote/startstop/JMXStartStopTest.sh
jbachorik
parents: 14907
diff changeset
    35
        System.out.flush();
14013
10f55dd791e1 7186723: TEST_BUG: Race condition in sun/management/jmxremote/startstop/JMXStartStopTest.sh
dsamersoff
parents: 11991
diff changeset
    36
        doSomething();
22349
2aa385c1c4d8 8022221: Intermittent test failures in sun/management/jmxremote/startstop/JMXStartStopTest.sh
jbachorik
parents: 14907
diff changeset
    37
        System.out.println("main exit");
11991
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
diff changeset
    38
    }
800d0ff7b043 7110104: It should be possible to stop and start JMX Agent at runtime
dsamersoff
parents:
diff changeset
    39
}