7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @bug 8035668
27 * @library /lib/testlibrary
28 * @summary Test checks case when target application finishes execution and jstat didn't complete work.
29 jstat is started with interval = 100 (jstat -compiler 100) and monitored application finishes
30 after 500ms. This shouldn't cause crash or hang in target application or in jstat.
31 * @modules java.management
32 * @build jdk.testlibrary.* JStatInterval
33 * @run main JStatInterval
34 */
35
36 import jdk.testlibrary.ProcessTools;
37 import jdk.testlibrary.JDKToolLauncher;
38
39 import java.io.BufferedReader;
40 import java.io.InputStreamReader;
41 import java.util.concurrent.TimeUnit;
42 import java.util.concurrent.atomic.AtomicBoolean;
43 import java.util.concurrent.atomic.AtomicInteger;
44
45 public class JStatInterval {
46 private static final String READY = "READY";
47 private static final String ERROR = "!ERROR";
48
49 public static class Application {
50 public static void main(String[] args) {
51 try {
|
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @bug 8035668
27 * @summary Test checks case when target application finishes execution and jstat didn't complete work.
28 * jstat is started with interval = 100 (jstat -compiler 100) and monitored application finishes
29 * after 500ms. This shouldn't cause crash or hang in target application or in jstat.
30 *
31 * @library /lib/testlibrary
32 * @modules java.management
33 * jdk.jcmd
34 *
35 * @build jdk.testlibrary.* JStatInterval
36 * @run main JStatInterval
37 */
38
39 import jdk.testlibrary.ProcessTools;
40 import jdk.testlibrary.JDKToolLauncher;
41
42 import java.io.BufferedReader;
43 import java.io.InputStreamReader;
44 import java.util.concurrent.TimeUnit;
45 import java.util.concurrent.atomic.AtomicBoolean;
46 import java.util.concurrent.atomic.AtomicInteger;
47
48 public class JStatInterval {
49 private static final String READY = "READY";
50 private static final String ERROR = "!ERROR";
51
52 public static class Application {
53 public static void main(String[] args) {
54 try {
|