Package org.eclipse.ecf.remoteservice.rest.identity

Examples of org.eclipse.ecf.remoteservice.rest.identity.RestNamespace


public class RestNamespaceTest extends TestCase {
 
  public void testCreation() {
    String desc = "description";
    RestNamespace namespace = new RestNamespace(RestNamespace.NAME, desc);
    assertEquals(RestNamespace.NAME, namespace.getName());
    assertEquals(desc, namespace.getDescription());
  }
View Full Code Here


    assertEquals(RestNamespace.NAME, namespace.getName());
    assertEquals(desc, namespace.getDescription());
  }
 
  public void testCreateInstance() {
    RestNamespace namespace = new RestNamespace(RestNamespace.NAME, null);
    Object[] parameters;
    try {
      String url = "http://www.twitter.com";
      parameters = new Object[] {new URL(url)};
      ID id = namespace.createInstance(parameters);
      assertEquals(url, id.getName());
    } catch (MalformedURLException e) {
      fail();
    }   
  }
View Full Code Here

      fail();
    }   
  }
 
  public void testGetScheme() {
    RestNamespace namespace = new RestNamespace(RestNamespace.NAME, null);
    assertEquals(RestNamespace.SCHEME, namespace.getScheme());
  }
View Full Code Here

  public String[] getSupportedIntents(ContainerTypeDescription description) {
    return restIntents;
  }

  public Class[][] getSupportedParameterTypes(ContainerTypeDescription description) {
    RestNamespace restNamespace = (RestNamespace) IDFactory.getDefault().getNamespaceByName(RestNamespace.NAME);
    return restNamespace.getSupportedParameterTypes();
  }
View Full Code Here

  public void start(final BundleContext context1) throws Exception {
    plugin = this;
    this.context = context1;
    SafeRunner.run(new ExtensionRegistryRunnable(context1) {
      protected void runWithoutRegistry() throws Exception {
        context1.registerService(Namespace.class, new RestNamespace(), null);
        context1.registerService(ContainerTypeDescription.class, new ContainerTypeDescription("ecf.rest.client", new RestClientContainerInstantiator(), "Rest Client Container"), null); //$NON-NLS-1$ //$NON-NLS-2$
      }
    });
  }
View Full Code Here

TOP

Related Classes of org.eclipse.ecf.remoteservice.rest.identity.RestNamespace

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.