"name", "description", SimpleType.STRING)
};
OpenMBeanAttributeInfoSupport[] attributes = new OpenMBeanAttributeInfoSupport[]
{
new OpenMBeanAttributeInfoSupport(
"name", "description", SimpleType.STRING, true, true, false)
};
OpenMBeanConstructorInfoSupport[] constructors = new OpenMBeanConstructorInfoSupport[]
{
new OpenMBeanConstructorInfoSupport(
"name", "description", parms)
};
OpenMBeanOperationInfoSupport[] operations = new OpenMBeanOperationInfoSupport[]
{
new OpenMBeanOperationInfoSupport(
"name", "description", parms,
SimpleType.STRING, OpenMBeanOperationInfoSupport.ACTION_INFO)
};
MBeanNotificationInfo[] notifications = new MBeanNotificationInfo[]
{
new MBeanNotificationInfo(new String[] { "type1", "type" }, "name", "description")
};
OpenMBeanInfoSupport info = new OpenMBeanInfoSupport(
"name", "description", attributes, constructors,
operations, notifications);
assertTrue("Null is not equal to any instance", info.equals(null) == false);
assertTrue("Instance is only equal another OpenMBeanInfo instance", info.equals(new Object()) == false);
assertTrue("Instance should equal itself", info.equals(info));
OpenMBeanInfoSupport info2 = new OpenMBeanInfoSupport(
"name", "description", attributes, constructors,
operations, notifications);
assertTrue("Instances with same values should be equal", info.equals(info2));
assertTrue("Instances with same values should be equal", info2.equals(info));
info2 = new OpenMBeanInfoSupport(
"name2", "description", attributes, constructors,
operations, notifications);
assertTrue("Instances with different class names are not equal", info.equals(info2) == false);
assertTrue("Instances with different class names are not equal", info2.equals(info) == false);
info2 = new OpenMBeanInfoSupport(
"name", "description2", attributes, constructors,
operations, notifications);
assertTrue("Instances with different descriptions are equal", info.equals(info2));
assertTrue("Instances with different descriptions are equal", info2.equals(info));
OpenMBeanAttributeInfoSupport[] attributes2 = new OpenMBeanAttributeInfoSupport[]
{
new OpenMBeanAttributeInfoSupport(
"name2", "description", SimpleType.STRING, true, true, false)
};
info2 = new OpenMBeanInfoSupport(
"name", "description", attributes2, constructors,
operations, notifications);
assertTrue("Instances with different attributes are not equal", info.equals(info2) == false);
assertTrue("Instances with different attributes are not equal", info2.equals(info) == false);
attributes2 = new OpenMBeanAttributeInfoSupport[]
{
new OpenMBeanAttributeInfoSupport(
"name2", "description", SimpleType.STRING, true, true, false),
new OpenMBeanAttributeInfoSupport(
"name3", "description", SimpleType.STRING, true, true, false)
};
info2 = new OpenMBeanInfoSupport(
"name", "description", attributes2, constructors,