// simulate an add
Set s = new HashSet();
s.add(oid);
((OpenJPAEntityManagerFactorySPI) factory).getConfiguration()
.getRemoteCommitEventManager().fireEvent(
new RemoteCommitEvent(RemoteCommitEvent.PAYLOAD_OIDS_WITH_ADDS,
s, null, null, null));
boolean pass = false;
for (Iterator iter = transactionListener.added.iterator(); iter
.hasNext();) {
if (iter.next().equals(oid)) {
pass = true;
break;
}
}
assertTrue(pass);
assertTrue(transactionListener.updated.size() == 0);
assertTrue(transactionListener.deleted.size() == 0);
// simulate modifications
((OpenJPAEntityManagerFactorySPI) factory).getConfiguration()
.getRemoteCommitEventManager().fireEvent(
new RemoteCommitEvent(RemoteCommitEvent.PAYLOAD_OIDS_WITH_ADDS,
null, null, s, null));
pass = false;
for (Iterator iter = transactionListener.updated.iterator(); iter
.hasNext();) {
if (iter.next().equals(oid)) {
pass = true;
break;
}
}
assertTrue(pass);
assertTrue(transactionListener.added.size() == 0);
assertTrue(transactionListener.deleted.size() == 0);
// simulate a delete
((OpenJPAEntityManagerFactorySPI) factory).getConfiguration()
.getRemoteCommitEventManager().fireEvent(
new RemoteCommitEvent(RemoteCommitEvent.PAYLOAD_OIDS_WITH_ADDS,
null, null, null, s));
pass = false;
for (Iterator iter = transactionListener.deleted.iterator(); iter
.hasNext();) {