/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4874819
* @summary Test that MBeanInfo classes no longer throw an
* IllegalArgumentException when attribute names, operation names, and
* Java type names do not strictly follow the expected Java syntax.
* @author Daniel Fuchs
* @run clean MustBeValidCommand
* @run build MustBeValidCommand
* @run main MustBeValidCommand
*/
public class MustBeValidCommand {
{ "Attribute with valid identifiers",
"validType1","validNameAtt1" },
{ "Attribute with invalid type",
"invalid-type", "validNameAtt2" },
{ "Attribute with invalid name", "valid.type2",
"invalid-name-att3" },
{ "Attribute with invalid name and type",
"invalidtype[]","invalid.name.att4" }
};
{ "Constructor with valid name",
"ValidConstructor1" },
{ "Constructor with invalid name",
"invalid.Constructor2"},
{ "Constructor with invalid name",
"invalid-constructor-3" },
{ "Constructor with invalid name",
"invalid constructor" }
};
{ "MBean with valid class name",
"ValidMBeanClass1" },
{ "MBean with valid class name",
"valid.mbean.Class2" },
{ "MBean with invalid class name",
"invalid.MBeanClass3[]"},
{ "MBean with invalid class name",
"invalid-mbean-class-4" },
{ "MBean with invalid class name",
"invalid mbean class 5" }
};
{ "Notification with valid class name",
"ValidNotificationClass1" },
{ "Notification with valid class name",
"valid.notification.Class2" },
{ "Notification with invalid class name",
"invalid.NotificationClass3[]"},
{ "Notification with invalid class name",
"invalid-notification-class-4" },
{ "Notification with invalid class name",
"invalid notification class 5" }
};
{ "Operation with valid identifiers",
"validType1","validNameOp1" },
{ "Operation with invalid type",
"invalid-type", "validNameOp2" },
{ "Operation with invalid name", "valid.type2",
"invalid-name-op3" },
{ "Operation with invalid name and type",
"invalidtype[]","invalid.name.op4" }
};
{ "Parameter with valid identifiers",
"validType1","validNamePar1" },
{ "Parameter with invalid type",
"invalid-type", "validNamePar2" },
{ "Parameter with invalid name", "valid.type2",
"invalid-name-par3" },
{ "Parameter with invalid name and type",
"invalidtype[]","invalid.name.par4" }
};
final MBeanAttributeInfo[] result =
spec[i][0]);
final MBeanAttributeInfo item =
true,true,false);
}
return result;
}
final MBeanParameterInfo[] result =
spec[i][0]);
final MBeanParameterInfo item =
}
return result;
}
final MBeanOperationInfo[] result =
spec[i][0]);
final MBeanOperationInfo item =
}
return result;
}
final MBeanConstructorInfo[] result =
spec[i][0]);
final MBeanConstructorInfo item =
}
return result;
}
final MBeanNotificationInfo[] result =
spec[i][0]);
final MBeanNotificationInfo item =
}
return result;
}
// Instantiate the MBean server
//
final MBeanNotificationInfo[] notifs =
}
// Test OK!
//
}
}