testMethod = "testReplaceFromMappedbySide";
if (isTestToBePerformed) {
// Set relationship
Set projects = new HashSet();
Project projNew = new Project(99L, "Skunkworks",
new BigDecimal(10000.35));
pm.makePersistent(projNew);
projects.add(projNew);
emp1.setProjects(projects);
Object projNewOid = pm.getObjectId((Object)projNew);
pm.flush();
assertFalse(testMethod + ": Test aborted, precondition is false; " +
"expected projNewOid to be non-null", projNewOid == null);
// 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();