jdk/test/javax/management/descriptor/DefaultDescriptorTest.java
author tonyp
Wed, 30 Mar 2011 10:26:59 -0400
changeset 8928 e5c53268bef5
parent 5506 202f599c92aa
child 30376 2ccf2cf7ea48
permissions -rw-r--r--
7023069: G1: Introduce symmetric locking in the slow allocation path 7023151: G1: refactor the code that operates on _cur_alloc_region to be re-used for allocs by the GC threads 7018286: G1: humongous allocation attempts should take the GC locker into account Summary: First, this change replaces the asymmetric locking scheme in the G1 slow alloc path by a summetric one. Second, it factors out the code that operates on _cur_alloc_region so that it can be re-used for allocations by the GC threads in the future. Reviewed-by: stefank, brutisso, johnc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     2
 * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
 * @test
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
 * @bug 6204469
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 * @summary Test that MBean*Info can be constructed with default descriptor
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 * @author Eamonn McManus
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 * @run clean DefaultDescriptorTest
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 * @run build DefaultDescriptorTest
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * @run main DefaultDescriptorTest
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import java.lang.reflect.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import javax.management.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import javax.management.modelmbean.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
import javax.management.openmbean.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
public class DefaultDescriptorTest {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
    public static void main(String[] args) throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
        final Descriptor empty =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
            ImmutableDescriptor.EMPTY_DESCRIPTOR;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
        final Class thisClass = DefaultDescriptorTest.class;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
        final Method getWhatever = thisClass.getMethod("getWhatever");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
        final Method setWhatever = thisClass.getMethod("setWhatever",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
                                                       int.class);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
        final Method doWhatever = thisClass.getMethod("doWhatever",
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
                                                      String.class);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
        final Constructor<?> con = thisClass.getConstructor();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
        final OpenMBeanParameterInfoSupport ombpi1 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
            new OpenMBeanParameterInfoSupport("x", "y", SimpleType.STRING);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
        final OpenMBeanParameterInfoSupport ombpi2 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
            new OpenMBeanParameterInfoSupport("x", "y", SimpleType.STRING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
                                              (Descriptor) null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
        final OpenMBeanParameterInfoSupport ombpi3 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
            new OpenMBeanParameterInfoSupport("x", "y", SimpleType.STRING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
                                              empty);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
        final OpenMBeanParameterInfoSupport ombpi4 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
            new OpenMBeanParameterInfoSupport("x", "y", SimpleType.STRING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
                                              "defaultString");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
        final OpenMBeanParameterInfoSupport ombpi5 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
            new OpenMBeanParameterInfoSupport("x", "y", SimpleType.INTEGER,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
                                              null, 3, 5);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
        final OpenMBeanParameterInfoSupport ombpi6 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
            new OpenMBeanParameterInfoSupport("x", "y", SimpleType.LONG,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
                                              53L, new Long[] {28L, 53L});
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
        final ModelMBeanInfoSupport mmbi1 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
            new ModelMBeanInfoSupport("yo", "yo", null, null, null, null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
        final ModelMBeanInfoSupport mmbi2 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
            new ModelMBeanInfoSupport("yo", "yo", null, null, null, null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
                                      (Descriptor) null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
//      final ModelMBeanInfoSupport mmbi3 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
//          new ModelMBeanInfoSupport("yo", "yo", null, null, null, null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
//                                    empty);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
        // an empty descriptor is currently illegal for MMBIS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
        final ModelMBeanAttributeInfo mmbai1 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
            new ModelMBeanAttributeInfo("yo", "yo", getWhatever, setWhatever);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
        final ModelMBeanAttributeInfo mmbai2 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
            new ModelMBeanAttributeInfo("yo", "yo", getWhatever, setWhatever,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
                                        (Descriptor) null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
        final ModelMBeanAttributeInfo mmbai3 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
            new ModelMBeanAttributeInfo("yo", "yo", "yo", true, true, false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
        final ModelMBeanAttributeInfo mmbai4 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
            new ModelMBeanAttributeInfo("yo", "yo", "yo", true, true, false,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
                                        (Descriptor) null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
        final ModelMBeanConstructorInfo mmbci1 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
            new ModelMBeanConstructorInfo("yo", con);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
        final ModelMBeanConstructorInfo mmbci2 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
            new ModelMBeanConstructorInfo("yo", con, (Descriptor) null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
        final ModelMBeanConstructorInfo mmbci3 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
            new ModelMBeanConstructorInfo("yo", "yo", null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
        final ModelMBeanConstructorInfo mmbci4 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
            new ModelMBeanConstructorInfo("yo", "yo", null, (Descriptor) null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
        final ModelMBeanNotificationInfo mmbni1 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
            new ModelMBeanNotificationInfo(new String[] {"x.y.z"}, "yo", "yo");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
        final ModelMBeanNotificationInfo mmbni2 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
            new ModelMBeanNotificationInfo(new String[] {"x.y.z"}, "yo", "yo",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
                                           (Descriptor) null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
        final ModelMBeanOperationInfo mmboi1 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
            new ModelMBeanOperationInfo("yo", doWhatever);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
        final ModelMBeanOperationInfo mmboi2 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
            new ModelMBeanOperationInfo("yo", doWhatever, (Descriptor) null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
        final ModelMBeanOperationInfo mmboi3 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
            new ModelMBeanOperationInfo("yo", "yo", null, "typo",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
                                        MBeanOperationInfo.ACTION);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
        final ModelMBeanOperationInfo mmboi4 =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
            new ModelMBeanOperationInfo("yo", "yo", null, "typo",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
                                        MBeanOperationInfo.ACTION,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
                                        (Descriptor) null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
        final DescriptorRead[] infos = {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
            new MBeanInfo("a.b.c", "blah", null, null, null, null),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
            new MBeanInfo("a.b.c", "blah", null, null, null, null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
                          (Descriptor) null),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
            new MBeanInfo("a.b.c", "blah", null, null, null, null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
                          empty),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
            new MBeanAttributeInfo("blah", "blah", getWhatever, setWhatever),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
// Following constructor deleted because Method has implicit Descriptor
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
// from annotations
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
//          new MBeanAttributeInfo("blah", "blah", getWhatever, setWhatever,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
//                                 (Descriptor) null),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
//          new MBeanAttributeInfo("blah", "blah", getWhatever, setWhatever,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
//                                 empty),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
            new MBeanAttributeInfo("blah", "a.b.c", "blah",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
                                   true, true, false),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
            new MBeanAttributeInfo("blah", "a.b.c", "blah",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
                                   true, true, false, (Descriptor) null),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
            new MBeanAttributeInfo("blah", "a.b.c", "blah",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
                                   true, true, false, empty),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
            new MBeanConstructorInfo("blah", con),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
// Following constructor deleted because Constructor has implicit Descriptor
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
// from annotations
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
//          new MBeanConstructorInfo("blah", con, (Descriptor) null),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
//          new MBeanConstructorInfo("blah", con, empty),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
            new MBeanConstructorInfo("blah", "blah", null),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
            new MBeanConstructorInfo("blah", "blah", null, (Descriptor) null),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
            new MBeanConstructorInfo("blah", "blah", null, empty),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
            // this class should be abstract but isn't
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
            new MBeanFeatureInfo("blah", "blah"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
            new MBeanFeatureInfo("blah", "blah", (Descriptor) null),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
            new MBeanFeatureInfo("blah", "blah", empty),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
            new MBeanNotificationInfo(new String[] {"a.b.c"}, "blah", "blah"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
            new MBeanNotificationInfo(new String[] {"a.b.c"}, "blah", "blah",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
                                      (Descriptor) null),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
            new MBeanNotificationInfo(new String[] {"a.b.c"}, "blah", "blah",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
                                      empty),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
            new MBeanOperationInfo("blah", doWhatever),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
// Following constructor deleted because Method has implicit Descriptor
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
// from annotations
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
//          new MBeanOperationInfo("blah", doWhatever, (Descriptor) null),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
//          new MBeanOperationInfo("blah", doWhatever, empty),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
            new MBeanOperationInfo("blah", "blah", null, "a.b.c",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
                                   MBeanOperationInfo.ACTION_INFO),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
            new MBeanOperationInfo("blah", "blah", null, "a.b.c",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
                                   MBeanOperationInfo.ACTION,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
                                   (Descriptor) null),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
            new MBeanOperationInfo("blah", "blah", null, "a.b.c",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
                                   MBeanOperationInfo.INFO,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
                                   empty),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
            new MBeanParameterInfo("blah", "a.b.c", "blah"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
            new MBeanParameterInfo("blah", "a.b.c", "blah", (Descriptor) null),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
            new MBeanParameterInfo("blah", "a.b.c", "blah", empty),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
            new OpenMBeanInfoSupport("x", "y", null, null, null, null),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
            new OpenMBeanInfoSupport("x", "y", null, null, null, null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
                                     (Descriptor) null),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
            new OpenMBeanInfoSupport("x", "y", null, null, null, null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
                                     empty),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
            ombpi1,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
            ombpi2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
            ombpi3,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
            ombpi4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
            ombpi5,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
            ombpi6,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
            new OpenMBeanAttributeInfoSupport("x", "y", SimpleType.STRING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
                                              true, true, false),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
            new OpenMBeanAttributeInfoSupport("x", "y", SimpleType.STRING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
                                              true, true, false,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
                                              (Descriptor) null),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
            new OpenMBeanAttributeInfoSupport("x", "y", SimpleType.STRING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
                                              true, true, false,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
                                              empty),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
            new OpenMBeanAttributeInfoSupport("x", "y", SimpleType.STRING,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
                                              true, true, false,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
                                              "defaultString"),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
            new OpenMBeanAttributeInfoSupport("x", "y", SimpleType.INTEGER,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
                                              true, true, false,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
                                              null, 3, 5),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
            new OpenMBeanAttributeInfoSupport("x", "y", SimpleType.LONG,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
                                              true, true, false,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
                                              53L, new Long[] {28L, 53L}),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
            new OpenMBeanConstructorInfoSupport("x", "y",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
                                                new OpenMBeanParameterInfo[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
                                                    ombpi1, ombpi2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
                                                }),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
            new OpenMBeanConstructorInfoSupport("x", "y",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
                                                new OpenMBeanParameterInfo[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
                                                    ombpi1, ombpi2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
                                                }, (Descriptor) null),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
            new OpenMBeanConstructorInfoSupport("x", "y",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
                                                new OpenMBeanParameterInfo[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
                                                    ombpi1, ombpi2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
                                                }, empty),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
            new OpenMBeanOperationInfoSupport("x", "y",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
                                              new OpenMBeanParameterInfo[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
                                                  ombpi1, ombpi2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
                                              }, SimpleType.DATE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
                                              MBeanOperationInfo.ACTION),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
            new OpenMBeanOperationInfoSupport("x", "y",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
                                              new OpenMBeanParameterInfo[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
                                                  ombpi1, ombpi2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
                                              }, SimpleType.DATE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
                                              MBeanOperationInfo.ACTION,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
                                              (Descriptor) null),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
            new OpenMBeanOperationInfoSupport("x", "y",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
                                              new OpenMBeanParameterInfo[] {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
                                                  ombpi1, ombpi2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
                                              }, SimpleType.DATE,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
                                              MBeanOperationInfo.ACTION,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
                                              empty),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
            mmbi1,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
            mmbi2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
            new ModelMBeanInfoSupport(mmbi1),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
            new ModelMBeanInfoSupport(mmbi2),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
            (DescriptorRead) mmbi1.clone(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
            (DescriptorRead) mmbi2.clone(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
            mmbai1,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
            mmbai2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
            mmbai3,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
            mmbai4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
            new ModelMBeanAttributeInfo(mmbai1),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
            new ModelMBeanAttributeInfo(mmbai2),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
            new ModelMBeanAttributeInfo(mmbai3),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
            new ModelMBeanAttributeInfo(mmbai4),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
            (DescriptorRead) mmbai1.clone(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
            (DescriptorRead) mmbai2.clone(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
            (DescriptorRead) mmbai3.clone(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
            (DescriptorRead) mmbai4.clone(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
            mmbci1,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
            mmbci2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
            mmbci3,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
            mmbci4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
            // Oddly enough there's no public copy constructor for this class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
            (DescriptorRead) mmbci1.clone(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
            (DescriptorRead) mmbci2.clone(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
            (DescriptorRead) mmbci3.clone(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
            (DescriptorRead) mmbci4.clone(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
            mmbni1,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
            mmbni2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
            new ModelMBeanNotificationInfo(mmbni1),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
            new ModelMBeanNotificationInfo(mmbni2),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
            (DescriptorRead) mmbni1.clone(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
            (DescriptorRead) mmbni2.clone(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
            mmboi1,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
            mmboi2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
            mmboi3,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
            mmboi4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
            new ModelMBeanOperationInfo(mmboi1),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
            new ModelMBeanOperationInfo(mmboi2),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
            new ModelMBeanOperationInfo(mmboi3),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
            new ModelMBeanOperationInfo(mmboi4),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
            (DescriptorRead) mmboi1.clone(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
            (DescriptorRead) mmboi2.clone(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
            (DescriptorRead) mmboi3.clone(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
            (DescriptorRead) mmboi4.clone(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
        };
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
        System.out.println("Testing that a default descriptor is always " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
                           "supplied");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
        for (DescriptorRead info : infos) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
            System.out.println(info);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
            Descriptor d = info.getDescriptor();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
            if (d == null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
                throw new Exception("getDescriptor returned null: " + info);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
        System.out.println("Test passed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
    public int getWhatever() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
        return 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
    public void setWhatever(int x) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
    public void doWhatever(String x) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
}