12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package jdk.jfr.api.metadata.annotations;
27
28 import jdk.jfr.Event;
29 import jdk.jfr.Recording;
30 import jdk.jfr.Registered;
31
32 /*
33 * @test Tests that commit doesn't throw exception when an event has not been registered.
34 * @key jfr
35 * @library /test/lib
36 * @run main/othervm jdk.jfr.api.metadata.annotations.TestRegisteredFalseAndRunning
37 * @run main/othervm -XX:FlightRecorderOptions=retransform=false jdk.jfr.api.metadata.annotations.TestRegisteredFalseAndRunning
38 */
39 public class TestRegisteredFalseAndRunning {
40 @Registered(false)
41 static class NoAutoEvent extends Event {
42 String hello;
43 }
44
45 public static void main(String... args) {
46 try (Recording r = new Recording()) {
47 r.start();
48 NoAutoEvent event = new NoAutoEvent();
49 event.commit();
50 }
51 }
52 }
|
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package jdk.jfr.api.metadata.annotations;
27
28 import jdk.jfr.Event;
29 import jdk.jfr.Recording;
30 import jdk.jfr.Registered;
31
32 /**
33 * @test Tests that commit doesn't throw exception when an event has not been registered.
34 * @key jfr
35 * @requires vm.hasJFR
36 * @library /test/lib
37 * @run main/othervm jdk.jfr.api.metadata.annotations.TestRegisteredFalseAndRunning
38 * @run main/othervm -XX:FlightRecorderOptions=retransform=false jdk.jfr.api.metadata.annotations.TestRegisteredFalseAndRunning
39 */
40 public class TestRegisteredFalseAndRunning {
41 @Registered(false)
42 static class NoAutoEvent extends Event {
43 String hello;
44 }
45
46 public static void main(String... args) {
47 try (Recording r = new Recording()) {
48 r.start();
49 NoAutoEvent event = new NoAutoEvent();
50 event.commit();
51 }
52 }
53 }
|