SimpleModelMBeanCommand.java revision 2362
1879N/A * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. 1612N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1612N/A * This code is free software; you can redistribute it and/or modify it 1612N/A * under the terms of the GNU General Public License version 2 only, as 1612N/A * published by the Free Software Foundation. 1612N/A * This code is distributed in the hope that it will be useful, but WITHOUT 1612N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1612N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1612N/A * version 2 for more details (a copy is included in the LICENSE file that 1612N/A * You should have received a copy of the GNU General Public License version 1612N/A * 2 along with this work; if not, write to the Free Software Foundation, 1612N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1612N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1612N/A * or visit www.oracle.com if you need additional information or have any 1879N/A * @summary Test that MBeanInfo classes no longer throw an 1879N/A * IllegalArgumentException when attribute names, operation names, and 1879N/A * Java type names do not strictly follow the expected Java syntax. 1879N/A * @author Eamonn McManus, Daniel Fuchs 1879N/A * @run clean SimpleModelMBeanCommand 1612N/A * @run build SimpleModelMBeanCommand 1612N/A // doesn't look like an attribute so not seen by caching logic 1612N/A // JTReg doesn't like System.exit(0); 1612N/A "local attr",
true,
true,
false,
1612N/A "local attr 2",
true,
true,
false,
new String[] {
"java.lang.Object",
"java.lang.String"});
/* Check that we can get an attribute of type Object[] */ /* Check that we can get an attribute of type int */ /* Check that we can call an operation that returns int */ /* Check that we don't get an exception if you sendNotification without any listeners. */ new String[] {
"javax.management.Notification"});
/* Check that we can call addAttributeChangeNotificationListener mbs.
invoke(
on,
"addAttributeChangeNotificationListener",
"javax.management.NotificationListener",
/* Check that the default caching behaviour is not to cache. */ /* Check that attributes without getters or setters work. The value is stored in the descriptor. This test includes an explicit currencyTimeLimit attribute. */ /* Check that attributes without getters or setters work. The value is stored in the descriptor. This test does not have an explicit currencyTimeLimit attribute. */ private static final int NTESTS =
8;