Accounted for experimental events in TestLookForUntestedEvents JEP-349-branch
authormseledtsov
Thu, 19 Sep 2019 17:33:18 -0700
branchJEP-349-branch
changeset 58239 bb89bc4d6689
parent 58213 354c7790c548
child 58249 e17143e28542
Accounted for experimental events in TestLookForUntestedEvents
test/jdk/jdk/jfr/event/metadata/TestLookForUntestedEvents.java
--- a/test/jdk/jdk/jfr/event/metadata/TestLookForUntestedEvents.java	Wed Sep 18 18:15:29 2019 +0200
+++ b/test/jdk/jdk/jfr/event/metadata/TestLookForUntestedEvents.java	Thu Sep 19 17:33:18 2019 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -81,6 +81,13 @@
         Arrays.asList("DumpReason")
     );
 
+    // Experimental events
+    private static final Set<String> experimentalEvents = new HashSet<>(
+      Arrays.asList(
+                    "Flush", "FlushStorage", "FlushStacktrace",
+                    "FlushStringPool", "FlushMetadata", "FlushTypeSet")
+    );
+
 
     public static void main(String[] args) throws Exception {
         for (EventType type : FlightRecorder.getFlightRecorder().getEventTypes()) {
@@ -138,6 +145,10 @@
             }
         }
 
+        // remove experimental events from eventsFromEventNamesClass since jfrEventTypes
+        // excludes experimental events
+        eventsFromEventNamesClass.removeAll(experimentalEvents);
+
         if (!jfrEventTypes.equals(eventsFromEventNamesClass)) {
             String exceptionMsg = "Events declared in jdk.test.lib.jfr.EventNames differ " +
                          "from events returned by FlightRecorder.getEventTypes()";