< prev index next >

test/jdk/jdk/jfr/api/metadata/annotations/TestStackTrace.java

Print this page
rev 51054 : imported patch 9000013-aixDisableJFR-requires.patch


  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.EventType;
  30 import jdk.jfr.StackTrace;
  31 import jdk.test.lib.Asserts;
  32 import jdk.test.lib.jfr.Events;
  33 
  34 /*
  35  * @test
  36  * @key jfr

  37  * @library /test/lib
  38  * @run main/othervm jdk.jfr.api.metadata.annotations.TestStackTrace
  39  */
  40 public class TestStackTrace {
  41 
  42     @StackTrace(true)
  43     static class StackTraceOnEvent extends Event {
  44     }
  45 
  46     @StackTrace(false)
  47     static class StackTraceOffEvent extends Event {
  48     }
  49 
  50     public static void main(String[] args) throws Exception {
  51         EventType onEvent = EventType.getEventType(StackTraceOnEvent.class);
  52         EventType offEvent = EventType.getEventType(StackTraceOffEvent.class);
  53 
  54         String defaultValue = Events.getSetting(onEvent, StackTrace.NAME).getDefaultValue();
  55         Asserts.assertEquals(defaultValue, "true", "@StackTrace(true) should reault in 'true'");
  56 


  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.EventType;
  30 import jdk.jfr.StackTrace;
  31 import jdk.test.lib.Asserts;
  32 import jdk.test.lib.jfr.Events;
  33 
  34 /**
  35  * @test
  36  * @key jfr
  37  * @requires vm.hasJFR
  38  * @library /test/lib
  39  * @run main/othervm jdk.jfr.api.metadata.annotations.TestStackTrace
  40  */
  41 public class TestStackTrace {
  42 
  43     @StackTrace(true)
  44     static class StackTraceOnEvent extends Event {
  45     }
  46 
  47     @StackTrace(false)
  48     static class StackTraceOffEvent extends Event {
  49     }
  50 
  51     public static void main(String[] args) throws Exception {
  52         EventType onEvent = EventType.getEventType(StackTraceOnEvent.class);
  53         EventType offEvent = EventType.getEventType(StackTraceOffEvent.class);
  54 
  55         String defaultValue = Events.getSetting(onEvent, StackTrace.NAME).getDefaultValue();
  56         Asserts.assertEquals(defaultValue, "true", "@StackTrace(true) should reault in 'true'");
  57 
< prev index next >