Package org.apache.clerezza.jaxrs.extensions.prefixmanager

Examples of org.apache.clerezza.jaxrs.extensions.prefixmanager.BundlePrefixManager


    mappings[0] = "org.example.TestBundle=/custom";
    properties.put("mappings", mappings);
    ComponentContext context = createComponentContextMock(properties);
    ConfigurationAdmin configAdmin = createConfigAdminMock(new Hashtable());

    BundlePrefixManager prefixManager = createBundlePrefixManager(
        configAdmin, context);
   
    Bundle bundle = creaBundleMock("org.example.TestBundle", new Hashtable());

    assertEquals("/custom", prefixManager.getPrefix(bundle));
  }
View Full Code Here


  @Test
  public void testGetDefaultPrefix() throws Exception {
    ComponentContext context = createComponentContextMock(new Hashtable());
    ConfigurationAdmin configAdmin = createConfigAdminMock(new Hashtable());

    BundlePrefixManager prefixManager = createBundlePrefixManager(
        configAdmin, context);
   
    Dictionary headers = new Hashtable();
    headers.put(Constants.TRIAXRS_PATH_PREFIX, "/default");
    Bundle bundle = creaBundleMock("org.example.TestBundle", headers);

    assertEquals("/default", prefixManager.getPrefix(bundle));
  }
View Full Code Here

    mappings[0] = "org.example.TestBundle=/custom";
    properties.put("mappings", mappings);
    ComponentContext context = createComponentContextMock(properties);
    ConfigurationAdmin configAdmin = createConfigAdminMock(new Hashtable());

    BundlePrefixManager prefixManager = createBundlePrefixManager(
        configAdmin, context);
   
    Dictionary headers = new Hashtable();
    headers.put(Constants.TRIAXRS_PATH_PREFIX, "/default");
    Bundle bundle = creaBundleMock("org.example.TestBundle", headers);

    assertEquals("/custom", prefixManager.getPrefix(bundle));
  }
View Full Code Here

    properties.put("mappings", mappings);
    properties.put(TriaxrsPrefixManager.TRIAXRS_USE_CUSTOM_PREFIXES, false);
    ComponentContext context = createComponentContextMock(properties);
    ConfigurationAdmin configAdmin = createConfigAdminMock(new Hashtable());

    BundlePrefixManager prefixManager = createBundlePrefixManager(
        configAdmin, context);
   
    Bundle bundle = creaBundleMock("org.example.TestBundle", new Hashtable());

    assertEquals("", prefixManager.getPrefix(bundle));
  }
View Full Code Here

    properties.put(TriaxrsPrefixManager.TRIAXRS_USE_CUSTOM_PREFIXES, false);
    properties.put(TriaxrsPrefixManager.TRIAXRS_USE_DEFAULT_PREFIXES, false);
    ComponentContext context = createComponentContextMock(properties);
    ConfigurationAdmin configAdmin = createConfigAdminMock(new Hashtable());

    BundlePrefixManager prefixManager = createBundlePrefixManager(
        configAdmin, context);
   
    Dictionary headers = new Hashtable();
    headers.put(Constants.TRIAXRS_PATH_PREFIX, "/default");
    Bundle bundle = creaBundleMock("org.example.TestBundle", headers);

    assertEquals("", prefixManager.getPrefix(bundle));
  }
View Full Code Here

  }

  @Test
  public void testComponentRegistration() throws Exception {
    JaxRsHandler handler = HandlerCreator.getHandler("", null);
    BundlePrefixManager manager = new BundlePrefixManager() {

      @Override
      public String getPrefix(Bundle bundle) {
        return "/test";
      }
View Full Code Here

TOP

Related Classes of org.apache.clerezza.jaxrs.extensions.prefixmanager.BundlePrefixManager

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.