String clazz = mbean.getClassName();
assertTrue("class is org.jboss.naming.JNDIBindingService",
clazz.equals("org.jboss.naming.JNDIBindingService"));
ModelMBeanInfo info = mbean.getMBeanInfo();
MBeanAttributeInfo[] attrs = info.getAttributes();
assertTrue("There are 2 attributes", attrs.length == 2);
MBeanAttributeInfo rn = info.getAttribute("RootName");
assertNotNull(rn);
assertEquals("RootName.name", rn.getName(), "RootName");
assertEquals("RootName.type", rn.getType(), "java.lang.String");
MBeanAttributeInfo bindings = info.getAttribute("Bindings");
assertNotNull(bindings);
assertEquals("Bindings.name", bindings.getName(), "Bindings");
assertEquals("Bindings.type", bindings.getType(), "org.jboss.naming.JNDIBindings");
MBeanConstructorInfo[] ctors = info.getConstructors();
assertEquals("ctors length", ctors.length, 1);
assertEquals("description",
"An xmbean description with custom interceptors that are handled by the JavaBeanSchemaInitializer",
info.getDescription().trim());
MBeanNotificationInfo[] notices = info.getNotifications();
assertEquals("notices length", notices.length, 1);
assertEquals("notices[0].name", notices[0].getName(), "bindEvent");
assertEquals("notices[0].description",
notices[0].getDescription(), "The bind event notification");
String[] types = {"org.jboss.naming.JNDIBindingService.bindEvent"};
assertEquals("notices[0].types",
notices[0].getNotifTypes(), types);
MBeanOperationInfo[] ops = info.getOperations();
assertEquals("ops length", ops.length, 2);
assertEquals("ops[0].name", ops[0].getName(), "start");
assertEquals("ops[1].name", ops[1].getName(), "stop");
}