String[] names = {"name", "descriptorType", "role", "persistPolicy"};
String[] values = {"mytest", "MBean", "constructor", "Something"};
try
{
new DescriptorSupport(names, values);
fail("Descriptor support object created with invalid attributes");
}
catch (RuntimeOperationsException ex)
{
}
// Create an invalid Descriptor object. Check persistPeriod
// Persist period should be bigger or equal than -1
names = new String[]{"name", "descriptorType", "persistPolicy", "persistPeriod"};
values = new String[]{"mytest", "MBean", "Never", "-2"};
try
{
new DescriptorSupport(names, values);
fail("Descriptor support object created with invalid persistPeriod");
}
catch (RuntimeOperationsException ex)
{
}
// Create an invalid Descriptor object. Check visiblity
// visibility should be between 1 and 4
names = new String[]{"name", "descriptorType", "visibility"};
values = new String[]{"mytest", "MBean", "0"};
try
{
new DescriptorSupport(names, values);
fail("Descriptor support object created with invalid visiblity");
}
catch (RuntimeOperationsException ex)
{
}
// Create an invalid Descriptor object. Check visiblity
// visibility should be between 1 and 4
names = new String[]{"name", "descriptorType", "visibility"};
values = new String[]{"mytest", "MBean", "5"};
try
{
new DescriptorSupport(names, values);
fail("Descriptor support object created with invalid visiblity");
}
catch (RuntimeOperationsException ex)
{
}