}
}
public static DataPoint createProxy() throws NoSuchMethodException {
MockHibernateSession.isOpened=true;
ProxyFactory pf = new CGLIBProxyFactory();
HashSet proxyInterfaces = new HashSet();
proxyInterfaces.add(HibernateProxy.class);
Class mappedClass = DataPoint.class;
Method proxyGetIdentifierMethod = mappedClass.getMethod("getId",new Class[]{});
Method proxySetIdentifierMethod = mappedClass.getMethod("setId",new Class[]{Long.TYPE});
pf.postInstantiate(
"Test" ,
mappedClass,
proxyInterfaces,
proxyGetIdentifierMethod,
proxySetIdentifierMethod,
null
);
DataPoint proxyPoint = (DataPoint)pf.getProxy(new Long(0),new MockHibernateSession());
MockHibernateSession.isOpened=false;
return proxyPoint;
}