// little hack for the test. use PB and ODMG api to verify results
int odmgZoosBefore = getDBObjectCountWithNewPB(((DatabaseImpl) db_1).getPBKey(), ODMGZoo.class);
int projectsBefore = getDBObjectCountWithNewPB(((DatabaseImpl) db_1).getPBKey(), Project.class);
int farAwaysBefore = getDBObjectCountWithNewPB(((DatabaseImpl) db_2).getPBKey(), FarAwayClass.class);
Transaction tx_1 = odmg_1.newTransaction();
tx_1.begin();
//store
storeObjects(tx_1, getNewODMGZoos(5));
storeObjects(tx_1, getNewProjects(3));
//store more
storeObjects(tx_1, getNewODMGZoos(5));
storeObjects(tx_1, getNewProjects(2));
tx_1.commit();
Transaction tx_2 = odmg_2.newTransaction();
tx_2.begin();
//store
storeObjects(tx_2, getNewFarAways(9));
//store more
storeObjects(tx_2, getNewFarAways(11));
tx_2.commit();
int odmgZoosAfter = getDBObjectCountWithNewPB(((DatabaseImpl) db_1).getPBKey(), ODMGZoo.class);
int projectsAfter = getDBObjectCountWithNewPB(((DatabaseImpl) db_1).getPBKey(), Project.class);
int farAwaysAfter = getDBObjectCountWithNewPB(((DatabaseImpl) db_2).getPBKey(), FarAwayClass.class);
int odmgZoosAfterOQL = getDBObjectCountViaOqlQueryUseNewTransaction(odmg_1, ODMGZoo.class);
int projectsAfterOQL = getDBObjectCountViaOqlQueryUseNewTransaction(odmg_1, Project.class);
int farAwaysAfterOQL = getDBObjectCountViaOqlQueryUseNewTransaction(odmg_2, FarAwayClass.class);
assertEquals("Wrong number of odmgZoos found", (odmgZoosBefore + 10), odmgZoosAfter);
assertEquals("Wrong number of projects found", (projectsBefore + 5), projectsAfter);
assertEquals("Wrong number of odmgZoos found", (odmgZoosBefore + 10), odmgZoosAfterOQL);
assertEquals("Wrong number of projects found", (projectsBefore + 5), projectsAfterOQL);
assertEquals("Wrong number of farAways found", (farAwaysBefore + 20), farAwaysAfter);
assertEquals("Wrong number of farAways found", (farAwaysBefore + 20), farAwaysAfterOQL);
//************
// we do twice
//************
// little hack for the test
odmgZoosBefore = getDBObjectCountWithNewPB(((DatabaseImpl) db_1).getPBKey(), ODMGZoo.class);
projectsBefore = getDBObjectCountWithNewPB(((DatabaseImpl) db_1).getPBKey(), Project.class);
farAwaysBefore = getDBObjectCountWithNewPB(((DatabaseImpl) db_2).getPBKey(), FarAwayClass.class);
tx_1.begin();
//store
storeObjects(tx_1, getNewODMGZoos(5));
storeObjects(tx_1, getNewProjects(3));
//store more
storeObjects(tx_1, getNewODMGZoos(5));
storeObjects(tx_1, getNewProjects(2));
tx_1.commit();
tx_2.begin();
//store
storeObjects(tx_2, getNewFarAways(9));
//store more
storeObjects(tx_2, getNewFarAways(11));
tx_2.commit();
odmgZoosAfter = getDBObjectCountWithNewPB(((DatabaseImpl) db_1).getPBKey(), ODMGZoo.class);
projectsAfter = getDBObjectCountWithNewPB(((DatabaseImpl) db_1).getPBKey(), Project.class);
farAwaysAfter = getDBObjectCountWithNewPB(((DatabaseImpl) db_2).getPBKey(), FarAwayClass.class);
odmgZoosAfterOQL = getDBObjectCountViaOqlQueryUseNewTransaction(odmg_1, ODMGZoo.class);