{
assertEquals(expected, actual);
return;
}
CompositeDataInvocationHandler handler = (CompositeDataInvocationHandler) Proxy.getInvocationHandler(actual);
CompositeData data = handler.getCompositeData();
CompositeType type = data.getCompositeType();
Set<String> names = type.keySet();
Class clazz = expected.getClass();
for (String name : names)
{
OpenType itemType = type.getType(name);
try
{
Method method = MXBeanUtils.getCompositeDataMethod(clazz, name, itemType == SimpleType.BOOLEAN);
Object expectedValue = method.invoke(expected, null);
Object actualValue = handler.invoke(actual, method, null);
assertEquals(expectedValue, actualValue);
}
catch (RuntimeException e)
{
throw e;