< prev index next >

test/javax/management/modelmbean/InfoSupportTest.java

Print this page
rev 11832 : 8078896: Add @modules as needed to the jdk_svc tests
Reviewed-by: alanb, mchung
   1 /*
   2  * Copyright (c) 2004, 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.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  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 4967769 4980655 4980668 4981214
  27  * @summary Test that ModelMBeanInfoSupport.setDescriptor rejects
  28  * null descriptor, that empty arrays are handled correctly,
  29  * that getDescriptors("mbean") works, and that default values for
  30  * MBean descriptors are correctly assigned.
  31  * @author Eamonn McManus

  32  * @run clean InfoSupportTest
  33  * @run build InfoSupportTest
  34  * @run main InfoSupportTest
  35  */
  36 
  37 import java.util.*;
  38 import javax.management.Descriptor;
  39 import javax.management.RuntimeOperationsException;
  40 import javax.management.modelmbean.*;
  41 
  42 public class InfoSupportTest {
  43     public static void main(String[] args) throws Exception {
  44         boolean ok = true;
  45 
  46         ok &= testSetDescriptorNull();
  47         ok &= testEmptyArrayParameters();
  48         ok &= testGetDescriptorsForMBean();
  49 
  50         if (ok)
  51             System.out.println("Test passed");


   1 /*
   2  * Copyright (c) 2004, 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.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  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 4967769 4980655 4980668 4981214
  27  * @summary Test that ModelMBeanInfoSupport.setDescriptor rejects
  28  * null descriptor, that empty arrays are handled correctly,
  29  * that getDescriptors("mbean") works, and that default values for
  30  * MBean descriptors are correctly assigned.
  31  * @author Eamonn McManus
  32  * @modules java.management
  33  * @run clean InfoSupportTest
  34  * @run build InfoSupportTest
  35  * @run main InfoSupportTest
  36  */
  37 
  38 import java.util.*;
  39 import javax.management.Descriptor;
  40 import javax.management.RuntimeOperationsException;
  41 import javax.management.modelmbean.*;
  42 
  43 public class InfoSupportTest {
  44     public static void main(String[] args) throws Exception {
  45         boolean ok = true;
  46 
  47         ok &= testSetDescriptorNull();
  48         ok &= testEmptyArrayParameters();
  49         ok &= testGetDescriptorsForMBean();
  50 
  51         if (ok)
  52             System.out.println("Test passed");


< prev index next >