Search in sources :

Example 81 with IContainer

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()));
}
Also used : IContainerDisconnectedEvent(org.eclipse.ecf.core.events.IContainerDisconnectedEvent) IContainer(org.eclipse.ecf.core.IContainer)

Example 82 with IContainer

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);
}
Also used : IContainerConnectingEvent(org.eclipse.ecf.core.events.IContainerConnectingEvent) IContainer(org.eclipse.ecf.core.IContainer)

Example 83 with IContainer

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());
}
Also used : IContainer(org.eclipse.ecf.core.IContainer)

Example 84 with IContainer

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);
}
Also used : IContainer(org.eclipse.ecf.core.IContainer)

Example 85 with IContainer

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);
}
Also used : IContainer(org.eclipse.ecf.core.IContainer)

Aggregations

IContainer (org.eclipse.ecf.core.IContainer)121 ID (org.eclipse.ecf.core.identity.ID)29 ContainerTypeDescription (org.eclipse.ecf.core.ContainerTypeDescription)20 IRosterEntry (org.eclipse.ecf.presence.roster.IRosterEntry)9 IRoster (org.eclipse.ecf.presence.roster.IRoster)8 IChannelContainerAdapter (org.eclipse.ecf.datashare.IChannelContainerAdapter)7 IRemoteServiceContainer (org.eclipse.ecf.remoteservice.IRemoteServiceContainer)7 IRemoteServiceContainerAdapter (org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter)7 ISharedObjectContainer (org.eclipse.ecf.core.sharedobject.ISharedObjectContainer)5 IPresenceContainerAdapter (org.eclipse.ecf.presence.IPresenceContainerAdapter)5 RemoteServiceContainer (org.eclipse.ecf.remoteservice.RemoteServiceContainer)5 Action (org.eclipse.jface.action.Action)5 IAction (org.eclipse.jface.action.IAction)5 URL (java.net.URL)4 Job (org.eclipse.core.runtime.jobs.Job)4 ContainerConnectException (org.eclipse.ecf.core.ContainerConnectException)4 IContainerManager (org.eclipse.ecf.core.IContainerManager)4 ISharedObject (org.eclipse.ecf.core.sharedobject.ISharedObject)4 ISharedObjectManager (org.eclipse.ecf.core.sharedobject.ISharedObjectManager)4 RestClientContainer (org.eclipse.ecf.remoteservice.rest.client.RestClientContainer)4