final TestBridge bridge = new TestBridge(local, external);
EventManager manager = new DefaultEventManager(2);
bridge.startup(manager, EventBridge.RECEIVE_LOCAL_EXTERNAL);
final SnapshotEvent eventWithNoSubject = new SnapshotEvent(
this,
this,
null,
null,
null,
null);
manager.postEvent(eventWithNoSubject, local);
// check that event was received and that subject was injected...
// since bridge is notified asynchronously by default,
// we must wait till notification is received
ThreadedTestHelper helper = new ThreadedTestHelper() {
@Override
protected void assertResult() throws Exception {
assertTrue(bridge.lastLocalEvent instanceof SnapshotEvent);
assertEquals(local, bridge.lastLocalEvent.getSubject());
}
};
helper.assertWithTimeout(5000);
final SnapshotEvent eventWithSubject = new SnapshotEvent(
this,
this,
null,
null,
null,
null);
eventWithSubject.setSubject(local);
manager.postEvent(eventWithNoSubject, local);
// check that event was received and that subject was injected...
// since bridge is notified asynchronously by default,