< prev index next >

test/jdk/jdk/jfr/event/runtime/TestSystemPropertyEvent.java

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


  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.event.runtime;
  27 
  28 import java.util.HashMap;
  29 import java.util.Map;
  30 
  31 import jdk.jfr.Recording;
  32 import jdk.jfr.consumer.RecordedEvent;
  33 import jdk.test.lib.Asserts;
  34 import jdk.test.lib.jfr.EventNames;
  35 import jdk.test.lib.jfr.Events;
  36 
  37 /*
  38  * @test
  39  * @key jfr

  40  * @library /test/lib
  41  * @run main/othervm jdk.jfr.event.runtime.TestSystemPropertyEvent
  42  */
  43 public class TestSystemPropertyEvent {
  44 
  45     private final static String EVENT_NAME = EventNames.InitialSystemProperty;
  46 
  47     public static void main(String[] args) throws Throwable {
  48         Map<String, String> systemProps = createInitialSystemProperties();
  49         // Recording should only contain properties defined at JVM start.
  50         // This property should not be included.
  51         System.setProperty("party.pooper", "buh!");
  52 
  53         Recording recording = new Recording();
  54         recording.enable(EVENT_NAME);
  55         recording.start();
  56         recording.stop();
  57 
  58         Map<String, String> eventProps = new HashMap<>();
  59         for (RecordedEvent event : Events.fromRecording(recording)) {




  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.event.runtime;
  27 
  28 import java.util.HashMap;
  29 import java.util.Map;
  30 
  31 import jdk.jfr.Recording;
  32 import jdk.jfr.consumer.RecordedEvent;
  33 import jdk.test.lib.Asserts;
  34 import jdk.test.lib.jfr.EventNames;
  35 import jdk.test.lib.jfr.Events;
  36 
  37 /**
  38  * @test
  39  * @key jfr
  40  * @requires vm.hasJFR
  41  * @library /test/lib
  42  * @run main/othervm jdk.jfr.event.runtime.TestSystemPropertyEvent
  43  */
  44 public class TestSystemPropertyEvent {
  45 
  46     private final static String EVENT_NAME = EventNames.InitialSystemProperty;
  47 
  48     public static void main(String[] args) throws Throwable {
  49         Map<String, String> systemProps = createInitialSystemProperties();
  50         // Recording should only contain properties defined at JVM start.
  51         // This property should not be included.
  52         System.setProperty("party.pooper", "buh!");
  53 
  54         Recording recording = new Recording();
  55         recording.enable(EVENT_NAME);
  56         recording.start();
  57         recording.stop();
  58 
  59         Map<String, String> eventProps = new HashMap<>();
  60         for (RecordedEvent event : Events.fromRecording(recording)) {


< prev index next >