Package org.eclipse.ecf.core

Examples of org.eclipse.ecf.core.IContainer


  protected IFileTransferListener senderTransferListener = getFileTransferListener("sender");
  protected IFileTransferListener receiverTransferListener = getFileTransferListener("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


   */
  protected abstract String getContainerType();

  public Object start(IApplicationContext context) throws Exception {
    // First, create container of appropriate type
    IContainer container = createContainer();
    // Then, from container create remote service container
    rsContainer = createRemoteServiceContainer(container);
    // Now register remote service
    registerRemoteService(getRemoteServiceClass(), createRemoteService(),
        createRemoteServiceProperties());
View Full Code Here

  IContainerEntry storeContainer(IStorableContainerAdapter containerAdapter) throws StorageException {
    return containerStore.store(containerAdapter);
  }

  public ID testStoreContainer() throws Exception {
    final IContainer container = createContainer();
    final IContainerEntry containerEntry = storeContainer(getStorableContainerAdapter(container));
    final ISecurePreferences prefs = containerEntry.getPreferences();
    assertNotNull(prefs);
    return container.getID();
  }
View Full Code Here

    // Now retrieve from container store with given ID
    final IContainerEntry containerEntry = containerStore.retrieve(containerID);
    assertNotNull(containerEntry);

    final IContainer containera = containerEntry.createContainer();

    final ID containerIDa = containera.getID();
    assertNotNull(containerIDa);
    assertTrue(containerIDa.equals(containerID));

  }
View Full Code Here

    clients = createClients();
  }

  public void testConnectOneClient() throws Exception {
    final int clientIndex = 0;
    final IContainer client = getClient(clientIndex);
    assertNull(client.getConnectedID());
    final ID serverConnectID = getServerConnectID(clientIndex);
    assertNotNull(serverConnectID);
    connectClient(client, serverConnectID, getConnectContext(clientIndex));
    assertEquals(serverConnectID, client.getConnectedID());
    sleep(SLEEPTIME);
    client.disconnect();
    assertNull(client.getConnectedID());
  }
View Full Code Here

    assertNull(client.getConnectedID());
  }

  public void testConnectTwoClients() throws Exception {
    for (int i = 0; i < 2; i++) {
      final IContainer client = getClient(i);
      assertNull(client.getConnectedID());
      final ID serverConnectID = getServerConnectID(i);
      assertNotNull(serverConnectID);
      connectClient(client, serverConnectID, getConnectContext(i));
      assertEquals(serverConnectID, client.getConnectedID());
    }

    sleep(3000);

    for (int i = 0; i < 2; i++) {
      final IContainer client = getClient(i);
      client.disconnect();
      assertNull(client.getConnectedID());
    }
  }
View Full Code Here

  protected void tearDown() throws Exception {
    getContainerManager().removeAllContainers();
  }

  public void testCreateContainer() throws Exception {
    IContainer container = createRestContainer(RestConstants.TEST_DE_TARGET);
    assertNotNull(container);
    assertTrue(container instanceof RestClientContainer);
  }
View Full Code Here

  protected abstract ISharedObject createSharedObject(ID objectID) throws Exception;

  public void testAddSharedObject() throws Exception {
    if (chatRoomContainer[0] == null) return;
    final IContainer client0Container = chatRoomContainer[0];
    assertNotNull(client0Container);
    //
    final ISharedObjectContainer socontainer = (ISharedObjectContainer) client0Container.getAdapter(ISharedObjectContainer.class);
    final ISharedObjectManager manager = socontainer.getSharedObjectManager();
    assertNotNull(manager);
    final ID objectID = createSharedObjectID();
    final ID id = manager.addSharedObject(objectID, createSharedObject(objectID), null);
    assertNotNull(id);
View Full Code Here

    assertNotNull(container);
    assertTrue(container instanceof RestClientContainer);
  }

  public void testCreateContainer1() throws Exception {
    IContainer container = createRestContainer(RestConstants.TEST_DE_TARGET);
    assertNotNull(container);
    assertTrue(container instanceof RestClientContainer);
  }
View Full Code Here

  }

  public void testCreateContainer2() throws Exception {
    ContainerTypeDescription description = getContainerFactory()
        .getDescriptionByName(RestConstants.REST_CONTAINER_TYPE);
    IContainer container = getContainerFactory().createContainer(description,
        new Object[] { new URL(RestConstants.TEST_DE_TARGET) });
    assertNotNull(container);
    assertTrue(container instanceof RestClientContainer);
  }
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.