public void testReplaceFromMappedbySide() {
testMethod = "testReplaceFromMappedbySide";
if (isTestToBePerformed) {
// Set relationship
IProject projNew = new Project(99L, "Skunkworks",
new BigDecimal(10000.35));
pm.makePersistent(projNew);
Set<IProject> projects = new HashSet<IProject>();
projects.add(projNew);
emp1.setProjects(projects);
Object projNewOid = pm.getObjectId((Object)projNew);
pm.flush();
// Postcondition
deferredAssertTrue(projNew.getMembers().contains(emp1),
ASSERTION_FAILED + testMethod,
"Postcondition is false; "
+ "other side of relationship not set on flush");
pm.currentTransaction().commit();
cleanupPM();
getPM();
pm.currentTransaction().begin();
emp1 = (Employee)pm.getObjectById(emp1Oid);
projNew = (Project)pm.getObjectById(projNewOid);
proj1 = (Project)pm.getObjectById(proj1Oid);
deferredAssertTrue(projNew.getMembers().contains(emp1),
ASSERTION_FAILED + testMethod,
"Postcondition is false; "
+ "other side of relationship not set in new pm");
pm.currentTransaction().commit();