< prev index next >

test/com/sun/jmx/mbeanserver/introspector/SimpleIntrospectorTest.java

Print this page
rev 16783 : 8176176: fix @modules in jdk_svc tests
Reviewed-by: duke
   1 
   2 /*
   3  * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
   4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5  *
   6  * This code is free software; you can redistribute it and/or modify it
   7  * under the terms of the GNU General Public License version 2 only, as
   8  * published by the Free Software Foundation.  Oracle designates this
   9  * particular file as subject to the "Classpath" exception as provided
  10  * by Oracle in the LICENSE file that accompanied this code.
  11  *
  12  * This code is distributed in the hope that it will be useful, but WITHOUT
  13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  15  * version 2 for more details (a copy is included in the LICENSE file that
  16  * accompanied this code).
  17  *
  18  * You should have received a copy of the GNU General Public License version
  19  * 2 along with this work; if not, write to the Free Software Foundation,
  20  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  21  *
  22  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  23  * or visit www.oracle.com if you need additional information or have any
  24  * questions.
  25  */
  26 import java.lang.reflect.Method;
  27 
  28 /*
  29  * @test
  30  * @bug 8129215
  31  * @summary The test checks whether the SimpleIntrospector is honoring the
  32  *          the JavaBeans property naming convention of always starting
  33  *          with a lower-case letter
  34  *
  35  * @author Jaroslav Bachorik
  36  * @modules java.management/com.sun.jmx.mbeanserver:open

  37  * @run clean SimpleIntrospectorTest
  38  * @run build SimpleIntrospectorTest BeanClass
  39  * @run main SimpleIntrospectorTest
  40  */
  41 public class SimpleIntrospectorTest {
  42     private static Method INTROSPECT_GETTER;
  43 
  44     public static void main(String ... args) throws Exception {
  45         Class clz = Class.forName(
  46             "com.sun.jmx.mbeanserver.Introspector$SimpleIntrospector"
  47         );
  48         INTROSPECT_GETTER = clz.getDeclaredMethod(
  49             "getReadMethod",
  50             Class.class,
  51             String.class
  52         );
  53         INTROSPECT_GETTER.setAccessible(true);
  54         boolean result = true;
  55         result &= checkNumberValid();
  56         result &= checkNumberInvalid();



   1 /*
   2  * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  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 import java.lang.reflect.Method;
  26 
  27 /*
  28  * @test
  29  * @bug 8129215
  30  * @summary The test checks whether the SimpleIntrospector is honoring the
  31  *          the JavaBeans property naming convention of always starting
  32  *          with a lower-case letter
  33  *
  34  * @author Jaroslav Bachorik
  35  * @modules java.management/com.sun.jmx.mbeanserver:open
  36  *
  37  * @run clean SimpleIntrospectorTest
  38  * @run build SimpleIntrospectorTest BeanClass
  39  * @run main SimpleIntrospectorTest
  40  */
  41 public class SimpleIntrospectorTest {
  42     private static Method INTROSPECT_GETTER;
  43 
  44     public static void main(String ... args) throws Exception {
  45         Class clz = Class.forName(
  46             "com.sun.jmx.mbeanserver.Introspector$SimpleIntrospector"
  47         );
  48         INTROSPECT_GETTER = clz.getDeclaredMethod(
  49             "getReadMethod",
  50             Class.class,
  51             String.class
  52         );
  53         INTROSPECT_GETTER.setAccessible(true);
  54         boolean result = true;
  55         result &= checkNumberValid();
  56         result &= checkNumberInvalid();


< prev index next >