11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @bug 4950756
27 * @summary Test that RequiredModelMBean.invoke will not invoke methods
28 * from the RequiredModelMBean class itself if they are not in the
29 * ModelMBeanInfo
30 * @author Eamonn McManus
31 * @modules java.management
32 * @run clean RequiredModelMBeanMethodTest
33 * @run build RequiredModelMBeanMethodTest
34 * @run main RequiredModelMBeanMethodTest
35 */
36
37 import java.lang.reflect.*;
38 import javax.management.*;
39 import javax.management.modelmbean.*;
40
41 /*
42 * We do the same test with a number of different operations:
43 *
44 * - A plain operation that is directed to the managed resource in the
45 * usual way. We give it some parameters so we can test that the
46 * class loading logic for signature parameters is reasonable.
47 *
48 * - An operation (removeNotificationListener) that is directed to the
49 * RequiredModelMBean itself. We use this particular operation because
50 * it will throw an exception, which allows us to check that it did in
51 * fact execute.
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @bug 4950756
27 * @summary Test that RequiredModelMBean.invoke will not invoke methods
28 * from the RequiredModelMBean class itself if they are not in the
29 * ModelMBeanInfo
30 * @author Eamonn McManus
31 *
32 * @run clean RequiredModelMBeanMethodTest
33 * @run build RequiredModelMBeanMethodTest
34 * @run main RequiredModelMBeanMethodTest
35 */
36
37 import java.lang.reflect.*;
38 import javax.management.*;
39 import javax.management.modelmbean.*;
40
41 /*
42 * We do the same test with a number of different operations:
43 *
44 * - A plain operation that is directed to the managed resource in the
45 * usual way. We give it some parameters so we can test that the
46 * class loading logic for signature parameters is reasonable.
47 *
48 * - An operation (removeNotificationListener) that is directed to the
49 * RequiredModelMBean itself. We use this particular operation because
50 * it will throw an exception, which allows us to check that it did in
51 * fact execute.
|