assertNotNull(listener2.updated);
assertNotNull(listener2.deleted);
boolean pass = false;
for (Iterator iter = listener2.added.iterator(); iter.hasNext();) {
Id roid = Id.newInstance(RuntimeTest1.class, oid);
Id it = (Id) iter.next();
//FixMe --det. why it.equals(roid) fails when the are actually equal
if (it.toString().equals(roid.toString())) {
pass = true;
break;
}
}
assertTrue("pass = " + pass, pass);
assertTrue(listener2.updated.size() == 0);
assertTrue(listener2.deleted.size() == 0);
// modify an object
startTx(pm);
t1.setStringField("baz");
endTx(pm);
try {
Thread.currentThread().sleep(250);
}
catch (InterruptedException ie) {
}
// ensure that the commit info was not propagated to factory1.
assertFalse(listener1.commitNotificationReceived);
// ensure that the commit info propagated to the remote
// factories correctly.
assertNotNull(listener2.added);
assertNotNull(listener2.updated);
assertNotNull(listener2.deleted);
pass = false;
for (Iterator iter = listener2.updated.iterator(); iter.hasNext();) {
Id it = (Id) iter.next();
if (it.toString().equals(roid.toString())) {
pass = true;
break;
}
}
assertTrue(pass);
assertTrue(listener2.added.size() == 0);
assertTrue(listener2.deleted.size() == 0);
// delete an object
startTx(pm);
pm.remove(t1);
endTx(pm);
try {
Thread.currentThread().sleep(250);
}
catch (InterruptedException ie) {
}
// ensure that the commit info was not propagated to factory1.
assertFalse(listener1.commitNotificationReceived);
// ensure that the commit info propagated to the remote
// factories correctly.
assertNotNull(listener2.added);
assertNotNull(listener2.updated);
assertNotNull(listener2.deleted);
pass = false;
for (Iterator iter = listener2.deleted.iterator(); iter.hasNext();) {
Id it = (Id) iter.next();
if (it.toString().equals(roid.toString())) {
pass = true;
break;
}
}
assertTrue(pass);