Package org.eclipse.ecf.core

Examples of org.eclipse.ecf.core.IContainer


    Namespace namespace = adapter.getRemoteServiceNamespace();
    assertNotNull(namespace);
  }

  public void testGetContainerFromManager() throws Exception {
    IContainer container = createRestContainer(RestConstants.TEST_DE_TARGET);
    ID id = container.getID();
    IContainer container2 = getContainerManager().getContainer(id);
    assertNotNull(container2);
  }
View Full Code Here


    IContainer container2 = getContainerManager().getContainer(id);
    assertNotNull(container2);
  }

  public void testDispose() throws Exception {
    IContainer container = createRestContainer(RestConstants.TEST_DE_TARGET);
    container.dispose();
    assertNull(container.getConnectedID());
  }
View Full Code Here

    final Collection discoveryContainers = ((CompositeDiscoveryContainer) discoveryLocator)
        .getDiscoveryContainers();
    final Set s = new HashSet();
    for (final Iterator itr = discoveryContainers.iterator(); itr.hasNext();) {
      final IDiscoveryLocator object = (IDiscoveryLocator) itr.next();
      final IContainer adapter = (IContainer) object
          .getAdapter(IContainer.class);
      s.add(adapter.getID());
    }
    // make sure it's never (accidentally) modified by a test
    idsToExpect = Collections.unmodifiableSet(s);
   
    eventsToExpect = discoveryContainers.size();
View Full Code Here

    discoveryLocator.addServiceListener(serviceListener);
    addListenerRegisterAndWait(serviceListener, serviceInfo);
    discoveryLocator.removeServiceListener(serviceListener);

    // make sure we use a live container;
    final IContainer ic = (IContainer) serviceListener.getLocator();
    assertTrue(ic.getConnectedID() != null);
   
    // check if we received correct amount of events
    final IContainerEvent[] events = serviceListener.getEvent();
    assertNotNull("Test listener didn't receive any discovery events.", events);
    assertEquals("Test listener received unexpected amount of discovery events: \n\t" + Arrays.asList(events), eventsToExpect, events.length);
View Full Code Here

    setClientCount(2);
    clients = createClients();
  }

  protected ID getServerConnectID(int client) {
    final IContainer container = getClient(client);
    final Namespace connectNamespace = container.getConnectNamespace();
    final String username = getUsername(client);
    try {
      return IDFactory.getDefault().createID(connectNamespace, username);
    } catch (final IDCreateException e) {
      fail("Could not create server connect ID");
View Full Code Here

      return null;
    }
  }

  protected IPresenceContainerAdapter getPresenceAdapter(int client) {
    final IContainer c = getClient(client);
    if (c == null)
      return null;
    return (IPresenceContainerAdapter) c.getAdapter(IPresenceContainerAdapter.class);
  }
View Full Code Here

  protected String getClientContainerName() {
    return XMPP_CONTAINER;
  }

  protected ISendFileTransferContainerAdapter getOutgoingFileTransfer(int client) {
    final IContainer c = getClient(client);
    if (c != null)
      return (ISendFileTransferContainerAdapter) c.getAdapter(ISendFileTransferContainerAdapter.class);
    else
      return null;
  }
View Full Code Here

  protected IFileTransferListener senderTransferListener = getSenderFileTransferListener("sender");
  protected IFileTransferListener receiverTransferListener = getReceiverFileTransferListener("receiver");

  protected ID getServerConnectID(int client) {
    final IContainer container = getClient(client);
    final Namespace connectNamespace = container.getConnectNamespace();
    final String username = getUsername(client);
    try {
      return IDFactory.getDefault().createID(connectNamespace, username);
    } catch (final IDCreateException e) {
      e.printStackTrace(System.err);
View Full Code Here

    }
    return remoteService;
  }
 
  public void start(int port) throws Exception {
    IContainer client = ContainerFactory.getDefault().createContainer(
        CLIENT_TYPE);
    // Get adapter for accessing remote services
    IRemoteServiceContainerAdapter adapter = (IRemoteServiceContainerAdapter) client
        .getAdapter(IRemoteServiceContainerAdapter.class);

    rsContainer = new RemoteServiceContainer(client,adapter);
   
    System.out.println("Client created with ID=" + client.getID());

    ID connectTargetID = IDFactory.getDefault().createStringID(
        NLS.bind(SERVER_ID, new Integer(port)));
   
    System.out.println("Attempting connect to id="+connectTargetID);
    client.connect(connectTargetID, null);
    System.out.println("Client connected to connectTargetID="
        + connectTargetID);

    Thread.sleep(1000);
   
View Full Code Here

    super.tearDown();
    server.stop();
    server = null;
  }
  public void testGetRemoteServiceContainerAdapter() throws Exception {
    IContainer container = server.getFirstServerContainer();
    assertNotNull(container);
    IRemoteServiceContainerAdapter adapter = (IRemoteServiceContainerAdapter) container.getAdapter(IRemoteServiceContainerAdapter.class);
    assertNotNull(adapter);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.ecf.core.IContainer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.