* Tests lazy init proxy to represent concrete objects
*/
@Test
public void testConcreteProxy()
{
ConcreteObject proxy = (ConcreteObject)LazyInitProxyFactory.createProxy(
ConcreteObject.class, concreteObjectLocator);
// test proxy implements ILazyInitProxy
assertThat(proxy, instanceOf(ILazyInitProxy.class));
assertTrue(((ILazyInitProxy)proxy).getObjectLocator() == concreteObjectLocator);
// test we do not have a jdk dynamic proxy
assertFalse(Proxy.isProxyClass(proxy.getClass()));
// test method invocation
assertEquals(proxy.getMessage(), "concrete");
// test serialization
ConcreteObject proxy2 = WicketObjects.cloneObject(proxy);
assertTrue(proxy != proxy2);
assertEquals(proxy2.getMessage(), "concrete");
// test equals/hashcode method interception
final IObjectMethodTester tester = new ObjectMethodTester();
assertTrue(tester.isValid());