Package org.eclipse.ecf.core.identity

Examples of org.eclipse.ecf.core.identity.Namespace


 
  /*
   * org.eclipse.ecf.discovery.identity.IServiceIDFactory.createServiceID(Namespace, String[], String)
   */
  public void testServiceIDFactoryDefaults() {
    Namespace namespaceByName = IDFactory.getDefault().getNamespaceByName(namespace);
    IServiceTypeID serviceType = ServiceIDFactory.getDefault().createServiceTypeID(namespaceByName, services, protocols);
    assertNotNull(serviceType);
    assertTrue(Arrays.equals(services, serviceType.getServices()));
    assertEquals(IServiceTypeID.DEFAULT_NA, serviceType.getNamingAuthority());
    assertTrue(Arrays.equals(IServiceTypeID.DEFAULT_SCOPE, serviceType.getScopes()));
View Full Code Here


 
  /*
   * org.eclipse.ecf.discovery.identity.IServiceIDFactory.createServiceID(Namespace, String, String)
   */
  public void testServiceIDFactory2() {
    Namespace namespaceByName = IDFactory.getDefault().getNamespaceByName(namespace);
    ServiceTypeID serviceTypeID = new ServiceTypeID(new TestNamespace(), "_service._ecf._foo._bar._tcp.ecf.eclipse.org._IANA");
    IServiceTypeID aServiceTypeID = ServiceIDFactory.getDefault().createServiceTypeID(namespaceByName, serviceTypeID);
    assertNotNull(aServiceTypeID);
   
    // members should be the same
View Full Code Here

   * Creates a new instance of IServiceTypeId with the Namespace of the second parameter and the instance of the first parameter
   * @param aServiceTypeID Used as a prototype
   * @param stid Namespace to use
   */
  private void createFromAnother(IServiceTypeID aServiceTypeID, IServiceTypeID stid) {
    final Namespace namespace2 = stid.getNamespace();
    IServiceTypeID instance = null;
    instance = ServiceIDFactory.getDefault().createServiceTypeID(namespace2, aServiceTypeID);
    assertNotNull("it should have been possible to create a new instance of ", instance);
    assertTrue(instance.hashCode() == stid.hashCode());
    //TODO-mkuppe decide if equality should be handled by the namespace for IServiceTypeIDs?
View Full Code Here

   * Test method for
   * {@link org.eclipse.ecf.discovery.IdiscoveryLocatorAdapter#getServicesNamespace()}.
   */
  public void testGetServicesNamespace() {
    testConnect();
    final Namespace namespace = discoveryLocator.getServicesNamespace();
    assertNotNull(namespace);
    final IServiceTypeID serviceTypeID = ServiceIDFactory.getDefault().createServiceTypeID(namespace, serviceInfo.getServiceID().getServiceTypeID());
    assertNotNull("It must be possible to obtain a IServiceTypeID", serviceTypeID);
  }
View Full Code Here

    assertTrue(id2.compareTo(id1) != 0);
  }

  public void testGetNamespace() throws Exception {
    final ID id = createID();
    final Namespace ns = id.getNamespace();
    assertNotNull(ns);
  }
View Full Code Here

  }

  public void testEqualNamespaces() throws Exception {
    final ID id1 = createID();
    final ID id2 = createID();
    final Namespace ns1 = id1.getNamespace();
    final Namespace ns2 = id2.getNamespace();
    assertTrue(ns1.equals(ns2));
    assertTrue(ns2.equals(ns2));
  }
View Full Code Here

    assertTrue(id2.compareTo(id1) > 0);
  }

  public void testGetNamespace() throws Exception {
    final ID id = createID();
    final Namespace ns = id.getNamespace();
    assertNotNull(ns);
  }
View Full Code Here

  }

  public void testEqualNamespaces() throws Exception {
    final ID id1 = createID();
    final ID id2 = createID();
    final Namespace ns1 = id1.getNamespace();
    final Namespace ns2 = id2.getNamespace();
    assertTrue(ns1.equals(ns2));
    assertTrue(ns2.equals(ns2));
  }
View Full Code Here

import junit.framework.TestCase;

public class NoRegistryNamespaceTest extends TestCase {

  protected Namespace createNamespace() {
    Namespace namespace = new Namespace(this.getClass().getName(),
        null) {
      private static final long serialVersionUID = -1223105025297785358L;

      public ID createInstance(Object[] args) throws IDCreateException {
        throw new IDCreateException("can't create instance");
View Full Code Here

    super.tearDown();
    if (r != null) r.unregister();
  }
 
  public void testGetNamespace() throws Exception {
    Namespace n = IDFactory.getDefault().getNamespaceByName(this.getClass().getName());
    assertNotNull(n);
    assertTrue(n.getName().equals(getClass().getName()));
  }
View Full Code Here

TOP

Related Classes of org.eclipse.ecf.core.identity.Namespace

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.