Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
String xmlPath = getResourcePath("xml/mbeanserver/testXMBean2.xml");
Object root = unmarshaller.unmarshal(xmlPath, resolver);
assertTrue("", root instanceof ModelMBeanInfoSupportWrapper);
ModelMBeanInfoSupportWrapper mbean = (ModelMBeanInfoSupportWrapper) root;
Descriptor descriptor = mbean.getDescriptors();
Object i = descriptor.getFieldValue("interceptors");
Interceptor[] interceptors = (Interceptor[]) i;
SomeBeanInterceptor sbi = (SomeBeanInterceptor) interceptors[0];
assertTrue(sbi.isFlag());
assertTrue("aClass == Integer.class", sbi.getaClass() == Integer.class);
URL homePage = new URL("http://www.jboss.org/");
assertTrue("homePage == URL(http://www.jboss.org/)", sbi.getHomePage().equals(homePage));
Long l = new Long(123456789);
assertTrue("aLong == 123456789", sbi.getaLong().equals(l));
assertTrue("aString == string1", sbi.getaString().equals("string1"));
assertTrue("anInt == 1234", sbi.getAnInt() == 1234);
InetAddress localhost = InetAddress.getByName("127.0.0.1");
assertTrue("address == 127.0.0.1", sbi.getAddress().equals(localhost));
String[] strings = {"string1", "string2", "string3"};
assertTrue("someStrings == {string1, string2, string3}",
Arrays.equals(strings, sbi.getSomeStrings()));
Properties someProperties = new Properties();
someProperties.setProperty("prop1", "value1");
someProperties.setProperty("prop2", "value2");
someProperties.setProperty("prop3", "value3");
assertTrue("someProperties == {string1, string2, string3}",
sbi.getSomeProperties().equals(someProperties));
Object i1 = interceptors[1];
assertTrue(i1 instanceof PersistenceInterceptor2);
Object i2 = interceptors[2];
assertTrue(i2 instanceof ModelMBeanInterceptor);
Object i3 = interceptors[3];
assertTrue(i3 instanceof ObjectReferenceInterceptor);
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");