use of org.eclipse.ecf.core.IContainer in project ecf by eclipse.
the class ClientContainerConnectTest method testListenerDisconnected.
public void testListenerDisconnected() throws Exception {
final IContainer client = getClients()[0];
client.addListener(createListener());
client.connect(createServerID(), null);
client.disconnect();
final Object o = clientDisconnectedEvents.get(0);
assertTrue(o instanceof IContainerDisconnectedEvent);
final IContainerDisconnectedEvent cco = (IContainerDisconnectedEvent) o;
assertTrue(cco.getLocalContainerID().equals(client.getID()));
assertTrue(cco.getTargetID().equals(createServerID()));
}
use of org.eclipse.ecf.core.IContainer in project ecf by eclipse.
the class ClientContainerConnectTest method testListenerConnecting.
public void testListenerConnecting() throws Exception {
final IContainer client = getClients()[0];
client.addListener(createListener());
client.connect(createServerID(), null);
final Object o = clientConnectingEvents.get(0);
assertTrue(o instanceof IContainerConnectingEvent);
final IContainerConnectingEvent cco = (IContainerConnectingEvent) o;
assertTrue(cco.getLocalContainerID().equals(client.getID()));
assertTrue(cco.getTargetID().equals(createServerID()));
assertTrue(cco.getData() == null);
}
use of org.eclipse.ecf.core.IContainer in project ecf by eclipse.
the class ClientContainerConnectTest method testGetConnectedID.
public void testGetConnectedID() throws Exception {
final IContainer client = getClients()[0];
assertNull(client.getConnectedID());
client.connect(createServerID(), null);
assertNotNull(client.getConnectedID());
client.disconnect();
assertNull(client.getConnectedID());
}
use of org.eclipse.ecf.core.IContainer in project ecf by eclipse.
the class ClientContainerConnectTest method testClientListener.
public void testClientListener() throws Exception {
final IContainer client = getClients()[0];
client.addListener(createListener());
assertTrue(clientConnectingEvents.size() == 0);
assertTrue(clientConnectedEvents.size() == 0);
client.connect(createServerID(), null);
assertTrue(clientConnectingEvents.size() == 1);
assertTrue(clientConnectedEvents.size() == 1);
assertTrue(clientDisconnectingEvents.size() == 0);
assertTrue(clientDisconnectedEvents.size() == 0);
sleep(2000);
client.disconnect();
assertTrue(clientDisconnectingEvents.size() == 1);
assertTrue(clientDisconnectedEvents.size() == 1);
}
use of org.eclipse.ecf.core.IContainer in project ecf by eclipse.
the class SSLClientContainerConnectTest method testClientListener.
public void testClientListener() throws Exception {
final IContainer client = getClients()[0];
client.addListener(createListener());
assertTrue(clientConnectingEvents.size() == 0);
assertTrue(clientConnectedEvents.size() == 0);
client.connect(createServerID(), null);
assertTrue(clientConnectingEvents.size() == 1);
assertTrue(clientConnectedEvents.size() == 1);
assertTrue(clientDisconnectingEvents.size() == 0);
assertTrue(clientDisconnectedEvents.size() == 0);
sleep(2000);
client.disconnect();
assertTrue(clientDisconnectingEvents.size() == 1);
assertTrue(clientDisconnectedEvents.size() == 1);
}
Aggregations