Package org.apache.shindig.config

Examples of org.apache.shindig.config.ContainerConfig


    replay(config);
    return config;
  }

  private ContainerConfig mockDefaultConfig(String jsHost, String jsPath) {
    ContainerConfig config = createMock(ContainerConfig.class);
    expect(config.getString(CONTAINER, DefaultJsUriManager.JS_HOST_PARAM))
        .andReturn(null).anyTimes();
    expect(config.getString(CONTAINER, DefaultJsUriManager.JS_PATH_PARAM))
        .andReturn(null).anyTimes();
    expect(config.getString(ContainerConfig.DEFAULT_CONTAINER, DefaultJsUriManager.JS_HOST_PARAM))
        .andReturn(jsHost).anyTimes();
    expect(config.getString(ContainerConfig.DEFAULT_CONTAINER, DefaultJsUriManager.JS_PATH_PARAM))
        .andReturn(jsPath).anyTimes();
    replay(config);
    return config;
  }
View Full Code Here


          @Override
          public ContentRewriterFeature.Config get(HttpRequest req) {
            return overrideFeatureNoOverrideExpires;
          }
        };
    ContainerConfig config = new BasicContainerConfig();
    config
        .newTransaction()
        .addContainer(DEFAULT_CONTAINER_CONFIG)
        .addContainer(MOCK_CONTAINER_CONFIG)
        .commit();
    proxyUriManager = new DefaultProxyUriManager(config, null);
View Full Code Here

  @Before
  public void setUp() throws Exception {
    parser = new CajaCssParser();
    sanitizer = new CajaCssSanitizer(parser);

    ContainerConfig config = new BasicContainerConfig();
    config.newTransaction().addContainer(DEFAULT_CONTAINER_CONFIG).addContainer(MOCK_CONTAINER_CONFIG).commit();
    ProxyUriManager proxyUriManager = new DefaultProxyUriManager(config, null);

    importRewriter = new SanitizingProxyUriManager(proxyUriManager, "text/css");
    imageRewriter = new SanitizingProxyUriManager(proxyUriManager, "image/*");
    gadgetContext = new GadgetContext() {
View Full Code Here

  private static final String GADGET_URI = "http://example.com/gadget.xml";

  // makeJsUri tests
  @Test(expected = RuntimeException.class)
  public void makeMissingHostConfig() {
    ContainerConfig config = mockConfig(null, "/gadgets/js");
    DefaultJsUriManager manager = makeManager(config, null);
    JsUri ctx = mockGadgetContext(false, false, null);
    manager.makeExternJsUri(ctx);
  }
View Full Code Here

    manager.makeExternJsUri(ctx);
  }

  @Test(expected = RuntimeException.class)
  public void makeMissingPathConfig() {
    ContainerConfig config = mockConfig("foo", null);
    DefaultJsUriManager manager = makeManager(config, null);
    JsUri ctx = mockGadgetContext(false, false, null);
    manager.makeExternJsUri(ctx);
  }
View Full Code Here

    manager.makeExternJsUri(ctx);
  }

  @Test
  public void makeJsUriNoPathSlashNoVersion() {
    ContainerConfig config = mockConfig("http://www.js.org", "/gadgets/js/");
    TestDefaultJsUriManager manager = makeManager(config, null);
    List<String> extern = Lists.newArrayList("feature");
    JsUri ctx = mockGadgetContext(false, false, extern);
    Uri jsUri = manager.makeExternJsUri(ctx);
    assertFalse(manager.hadError());
View Full Code Here

        jsUri.getQueryParameter(Param.CONTAINER_MODE.getKey()));
  }

  @Test
  public void makeJsUriExtensionParams() {
    ContainerConfig config = mockConfig("http://www.js.org", "/gadgets/js/");
    TestDefaultJsUriManager manager = makeManager(config, null);
    List<String> extern = Lists.newArrayList("feature");
    JsUri ctx = mockGadgetContext(false, false, extern, null, false,
        ImmutableMap.of("test", "1"), null, "rep");
    Uri jsUri = manager.makeExternJsUri(ctx);
View Full Code Here

    assertEquals("rep", jsUri.getQueryParameter(Param.REPOSITORY_ID.getKey()));
  }

  @Test
  public void makeJsUriAddPathSlashNoVersion() {
    ContainerConfig config = mockConfig("http://www.js.org", "/gadgets/js");
    TestDefaultJsUriManager manager = makeManager(config, null);
    List<String> extern = Lists.newArrayList("feature");
    JsUri ctx = mockGadgetContext(false, false, extern);
    Uri jsUri = manager.makeExternJsUri(ctx);
    assertFalse(manager.hadError());
View Full Code Here

    assertNull(jsUri.getQueryParameters(Param.REPOSITORY_ID.getKey()));
  }

  @Test
  public void makeJsUriAddPathSlashVersioned() {
    ContainerConfig config = mockConfig("http://www.js.org", "/gadgets/js");
    List<String> extern = Lists.newArrayList("feature");
    JsUri ctx = mockGadgetContext(false, false, extern);
    String version = "verstring";
    Versioner versioner = this.mockVersioner(ctx, version, version);
    TestDefaultJsUriManager manager = makeManager(config, versioner);
View Full Code Here

        jsUri.getQueryParameter(Param.CONTAINER_MODE.getKey()));
  }

  @Test
  public void makeJsUriWithVersionerNoVersionOnIgnoreCache() {
    ContainerConfig config = mockConfig("http://www.js.org", "/gadgets/js");
    List<String> extern = Lists.newArrayList("feature");
    JsUri ctx = mockGadgetContext(true, false, extern)// no cache
    String version = "verstring";
    Versioner versioner = this.mockVersioner(ctx, version, version);
    TestDefaultJsUriManager manager = makeManager(config, versioner);
View Full Code Here

TOP

Related Classes of org.apache.shindig.config.ContainerConfig

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.