res.beginTest();
// Execute first transaction on persistent Collections
beginTx(pm, task, threadId, txId);
long[] ls = new long[]{oids, oids + 1, oids + 2, oids + 3, oids + 4, oids + 5};
long[] reverse = new long[]{oids + 5, oids + 4, oids + 3, oids + 2, oids + 1, oids};
AllCollection ac = new AllCollection("stressCollection" + nbBeginTest);
ac.setLongs(ls);
ac.setRefs(new Object[]{ac});
pm.makePersistent(ac);
commitTx(pm, task, threadId, txId);
// Reverse the data
ac.setLongs(reverse);
ac.setRefs(new Object[]{ac});
// Verify result
List expectedLong = new ArrayList(reverse.length);
for (int i = 0; i < reverse.length; i++) {
expectedLong.add(new Long(reverse[i]));
}
List expectedRef = new ArrayList(1);
expectedRef.add(ac);
//Collection
Assert.assertNotNull("The collection of Long is null", ac.getCol_Long());
assertSameCollection("The collection of Long", expectedLong, ac.getCol_Long());
Assert.assertNotNull("The collection of reference is null", ac.getCol_ref());
assertSameCollection("The collection of ref", expectedRef, ac.getCol_ref());
//HashSet
Assert.assertNotNull("The Hashset of Long is null", ac.getHset_Long());
assertSameCollection("The Hashset of Long", expectedLong, ac.getHset_Long());
Assert.assertNotNull("The Hashset of reference is null", ac.getHset_ref());
assertSameCollection("The Hashset of ref", expectedRef, ac.getHset_ref());
//List
Assert.assertNotNull("The list of Long is null", ac.getList_Long());
assertSameList("The list of Long", expectedLong, ac.getList_Long());
Assert.assertNotNull("The list of reference is null", ac.getList_ref());
assertSameList("The list of reference", expectedRef, ac.getList_ref());
//Set
Assert.assertNotNull("The set of Long is null", ac.getSet_Long());
assertSameCollection("The set of Long", expectedLong, ac.getSet_Long());
Assert.assertNotNull("The set of reference is null", ac.getSet_ref());
assertSameCollection("The set of ref", expectedRef, ac.getSet_ref());
// Execute second transaction on persistent Collections
beginTx(pm, task, threadId, txId);
logger.log(BasicLevel.DEBUG, ac.getId() + " is being deleted");
pm.deletePersistent(ac);
commitTx(pm, task, threadId, txId);
res.endTest();
} catch (JDOFatalException e) {