CompiledMethodLoadTest.java revision 2362
2106N/A/*
2362N/A * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
2106N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2106N/A *
2106N/A * This code is free software; you can redistribute it and/or modify it
2106N/A * under the terms of the GNU General Public License version 2 only, as
2106N/A * published by the Free Software Foundation.
2106N/A *
2106N/A * This code is distributed in the hope that it will be useful, but WITHOUT
2106N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2106N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2106N/A * version 2 for more details (a copy is included in the LICENSE file that
2106N/A * accompanied this code).
2106N/A *
2106N/A * You should have received a copy of the GNU General Public License version
2106N/A * 2 along with this work; if not, write to the Free Software Foundation,
2106N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2106N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
2106N/A */
2106N/A
2106N/A
2106N/A/* @test
2106N/A * @bug 6580131
2106N/A * @summary Test jvmti demo compiledMethodLoad
2106N/A *
2106N/A * @compile ../DemoRun.java ../Hello.java
2106N/A * @build CompiledMethodLoadTest
2106N/A * @run main CompiledMethodLoadTest Hello
2106N/A */
2106N/A
2106N/Apublic class CompiledMethodLoadTest {
2106N/A
2106N/A public static void main(String args[]) throws Exception {
2106N/A DemoRun demo;
2106N/A
2106N/A /* Run demo that uses JVMTI compiledMethodLoad agent (no options) */
2106N/A demo = new DemoRun("compiledMethodLoad", "" /* options to compiledMethodLoad */ );
2106N/A demo.runit(args[0]);
2106N/A
2106N/A /* Make sure patterns in output look ok */
2106N/A if (demo.output_contains("ERROR")) {
2106N/A throw new RuntimeException("Test failed - ERROR seen in output");
2106N/A }
2106N/A
2106N/A /* Must be a pass. */
2106N/A System.out.println("Test passed - cleanly terminated");
2106N/A }
2106N/A}