assertEquals("age", new Integer(10040), value);
// Check that the address proxy works.
BeanProxy addressProxy = (BeanProxy) rootProxy.getPropertyProxy(
Person.ADDRESS);
ListProxy linesProxy = (ListProxy) addressProxy.getPropertyProxy(
Address.LINES);
int size = linesProxy.size();
OpaqueProxy lineProxy;
for (int i = 0; i < size; i += 1) {
lineProxy = (OpaqueProxy) linesProxy.getItemProxy(i);
String expectedLine = (String) lines.get(i);
String actualLine = (String) lineProxy.getModelObject();
assertEquals("Line " + i, expectedLine, actualLine);
}
ProxyModelChangedEvent event = new ProxyModelChangedEvent(
firstNameProxy, "Fred", "Wilma", true);
deepListenerMock.expects.proxyModelChanged(event);
value = firstNameProxy.setModelObject("Wilma");
assertEquals("old value", "Fred", value);
// Test that paths work properly.
checkPath(
rootProxy, rootProxy, "", Arrays.asList(
new Object[]{rootProxy}));
checkPath(
rootProxy, linesProxy, "/address/lines",
Arrays.asList(
new Object[]{
rootProxy,
addressProxy,
linesProxy
}));
lineProxy = (OpaqueProxy) linesProxy.getItemProxy(2);
checkPath(
rootProxy, lineProxy, "/address/lines/2",
Arrays.asList(
new Object[]{
rootProxy,