< prev index next >

test/jdk/jdk/jfr/api/settings/TestFilterEvents.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.api.settings;
  27 
  28 import jdk.jfr.Description;
  29 import jdk.jfr.Event;
  30 import jdk.jfr.Label;
  31 import jdk.jfr.Recording;
  32 import jdk.jfr.SettingDefinition;
  33 import jdk.test.lib.jfr.Events;
  34 
  35 import static jdk.test.lib.Asserts.assertEquals;
  36 
  37 /*
  38  * @test
  39  * @summary The test uses SettingControl
  40  * @key jfr

  41  * @library /test/lib /test/jdk
  42  * @run main/othervm jdk.jfr.api.settings.TestFilterEvents
  43  */
  44 public class TestFilterEvents {
  45 
  46     private static class AbstractHTTPEvent extends Event {
  47         @Label("HTTP URI")
  48         protected String uri;
  49 
  50         @Label("URI Filter")
  51         @SettingDefinition
  52         protected boolean uriFilter(RegExpControl control) {
  53             return control.matches(uri);
  54         }
  55     }
  56 
  57     private static final class HTTPGetEvent extends AbstractHTTPEvent {
  58         @Label("Thread Names")
  59         @Description("List of thread names to accept, such as \"main\" or \"workerThread1\", \"taskThread\"")
  60         @SettingDefinition




  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.settings;
  27 
  28 import jdk.jfr.Description;
  29 import jdk.jfr.Event;
  30 import jdk.jfr.Label;
  31 import jdk.jfr.Recording;
  32 import jdk.jfr.SettingDefinition;
  33 import jdk.test.lib.jfr.Events;
  34 
  35 import static jdk.test.lib.Asserts.assertEquals;
  36 
  37 /**
  38  * @test
  39  * @summary The test uses SettingControl
  40  * @key jfr
  41  * @requires vm.hasJFR
  42  * @library /test/lib /test/jdk
  43  * @run main/othervm jdk.jfr.api.settings.TestFilterEvents
  44  */
  45 public class TestFilterEvents {
  46 
  47     private static class AbstractHTTPEvent extends Event {
  48         @Label("HTTP URI")
  49         protected String uri;
  50 
  51         @Label("URI Filter")
  52         @SettingDefinition
  53         protected boolean uriFilter(RegExpControl control) {
  54             return control.matches(uri);
  55         }
  56     }
  57 
  58     private static final class HTTPGetEvent extends AbstractHTTPEvent {
  59         @Label("Thread Names")
  60         @Description("List of thread names to accept, such as \"main\" or \"workerThread1\", \"taskThread\"")
  61         @SettingDefinition


< prev index next >