{
public void testConnectionManager() throws Exception
{
ConnectionManager cm = new TestConnectionManager();
ManagedConnectionFactory mcf = new TestManagedConnectionFactory();
SimpleMetaData metadata = new SimpleMetaData();
metadata.addMetaData(ConnectionFactoryInterceptor.CONNECTION_FACTORY, ConnectionFactoryInterceptor.CONNECTION_MANAGER, cm);
metadata.addMetaData(ConnectionFactoryInterceptor.CONNECTION_MANAGER, ConnectionFactoryInterceptor.MANAGED_CONNECTION_FACTORY, mcf);
DataSource ds = (DataSource) assertCreateHollowProxy(new Class[] { DataSource.class }, metadata, DataSource.class);
Connection c = ds.getConnection();
assertNotNull(c);
assertTrue(c instanceof TestConnection);
TestConnection tc = (TestConnection) c;