use of org.eclipse.ecf.datashare.events.IChannelDisconnectEvent in project ecf by eclipse.
the class NIODatashareTest method testChannelDisconnectEvent.
public void testChannelDisconnectEvent() throws Exception {
final ID[] eventIds = new ID[2];
channelA = createChannel(channelContainerA, new IChannelListener() {
public void handleChannelEvent(IChannelEvent e) {
if (e instanceof IChannelDisconnectEvent) {
IChannelDisconnectEvent event = (IChannelDisconnectEvent) e;
eventIds[0] = event.getChannelID();
eventIds[1] = event.getTargetID();
}
}
});
containerA.disconnect();
assertEquals(channelA.getID(), eventIds[0]);
// technically, getConnectedID() should return null when a container has
// disconnected, but anyway...
assertEquals(containerA.getConnectedID(), eventIds[1]);
}
Aggregations