* This should be ObjectCacheEmptyImpl, because this is declared at jdbc-connection-descriptor
* level.
*/
public void testPerDatabaseCache()
{
ConnectionRepository cr = MetadataManager.getInstance()
.readConnectionRepository(MetadataTest.TEST_REPOSITORY);
MetadataManager.getInstance().mergeConnectionRepository(cr);
PersistenceBroker pb = PersistenceBrokerFactory.createPersistenceBroker(new PBKey("runtime_2"));
try
{
ObjectCache oc = pb.serviceObjectCache();
CacheObject testObj = new CacheObject(null, "testPerDatabaseCache");
Identity oid = new Identity(testObj, pb);
oc.cache(oid, testObj);
Object result = oc.lookup(oid);
assertNull("We should not found this object in cache", result);
}
finally
{
if (pb != null && !pb.isClosed()) pb.close();
MetadataManager.getInstance().connectionRepository().removeDescriptor(cr.getAllDescriptor().get(0));
}
}