}
@Test
public void testInvalidFetchplanLoad() {
database = ODatabaseDocumentPool.global().acquire(url, "admin", "admin");
ODocument doc = database.newInstance();
doc.field("test", "test");
doc.save();
ORID docRid = doc.getIdentity().copy();
// RELOAD THE DOCUMENT, THIS WILL PUT IT IN L1 CACHE
doc = database.load(docRid, "*:-1");
doc = testInvalidFetchPlanInvalidateL1Cache(doc, docRid);
doc = testInvalidFetchPlanInvalidateL1Cache(doc, new ORecordId(1, 0));
doc = testInvalidFetchPlanInvalidateL1Cache(doc, new ORecordId(1, 1));
doc = testInvalidFetchPlanInvalidateL1Cache(doc, new ORecordId(1, 2));
doc = testInvalidFetchPlanInvalidateL1Cache(doc, new ORecordId(2, 0));
doc = testInvalidFetchPlanInvalidateL1Cache(doc, new ORecordId(2, 1));
doc = testInvalidFetchPlanInvalidateL1Cache(doc, new ORecordId(2, 2));
doc = testInvalidFetchPlanInvalidateL1Cache(doc, new ORecordId(3, 0));
doc = testInvalidFetchPlanInvalidateL1Cache(doc, new ORecordId(3, 1));
doc = testInvalidFetchPlanInvalidateL1Cache(doc, new ORecordId(3, 2));
doc = testInvalidFetchPlanInvalidateL1Cache(doc, new ORecordId(4, 0));
doc = testInvalidFetchPlanInvalidateL1Cache(doc, new ORecordId(4, 1));
// CLOSE DB AND RE-TEST THE LOAD TO MAKE SURE
database.close();
database = null;
database = ODatabaseDocumentPool.global().acquire(url, "admin", "admin");
doc = testInvalidFetchPlanClearL1Cache(doc, docRid);
doc = testInvalidFetchPlanClearL1Cache(doc, new ORecordId(1, 0));
doc = testInvalidFetchPlanClearL1Cache(doc, new ORecordId(1, 1));
doc = testInvalidFetchPlanClearL1Cache(doc, new ORecordId(1, 2));
doc = testInvalidFetchPlanClearL1Cache(doc, new ORecordId(2, 0));
doc = testInvalidFetchPlanClearL1Cache(doc, new ORecordId(2, 1));
doc = testInvalidFetchPlanClearL1Cache(doc, new ORecordId(2, 2));
doc = testInvalidFetchPlanClearL1Cache(doc, new ORecordId(3, 0));
doc = testInvalidFetchPlanClearL1Cache(doc, new ORecordId(3, 1));
doc = testInvalidFetchPlanClearL1Cache(doc, new ORecordId(3, 2));
doc = testInvalidFetchPlanClearL1Cache(doc, new ORecordId(4, 0));
doc = testInvalidFetchPlanClearL1Cache(doc, new ORecordId(4, 1));
doc = database.load(docRid);
doc.delete();
database.close();
}