Search in sources :

Example 1 with IChannelConnectEvent

use of org.eclipse.ecf.datashare.events.IChannelConnectEvent in project ecf by eclipse.

the class NIODatashareTest method testChannelConnectEvent.

public void testChannelConnectEvent() throws Exception {
    final ID[] eventIds = new ID[2];
    channelA = createChannel(channelContainerA, new IChannelListener() {

        public void handleChannelEvent(IChannelEvent e) {
            if (e instanceof IChannelConnectEvent) {
                IChannelConnectEvent event = (IChannelConnectEvent) e;
                eventIds[0] = event.getChannelID();
                eventIds[1] = event.getTargetID();
            }
        }
    });
    containerA.connect(null, null);
    assertEquals(channelA.getID(), eventIds[0]);
    assertEquals(containerA.getConnectedID(), eventIds[1]);
}
Also used : IChannelListener(org.eclipse.ecf.datashare.IChannelListener) IChannelEvent(org.eclipse.ecf.datashare.events.IChannelEvent) IChannelConnectEvent(org.eclipse.ecf.datashare.events.IChannelConnectEvent) ID(org.eclipse.ecf.core.identity.ID)

Aggregations

ID (org.eclipse.ecf.core.identity.ID)1 IChannelListener (org.eclipse.ecf.datashare.IChannelListener)1 IChannelConnectEvent (org.eclipse.ecf.datashare.events.IChannelConnectEvent)1 IChannelEvent (org.eclipse.ecf.datashare.events.IChannelEvent)1