Package org.apache.shindig.config

Examples of org.apache.shindig.config.ContainerConfig$Transaction


    assertEquals("0", jsUri.getQueryParameter(Param.DEBUG.getKey()));
  }
 
  @Test
  public void makeJsUriAddPathSlashNoVersion() {
    ContainerConfig config = mockConfig("http://www.js.org", "/gadgets/js");
    TestDefaultJsUriManager manager = makeManager(config, null);
    Gadget gadget = mockGadget(false, false);
    List<String> extern = Lists.newArrayList("feature");
    Uri jsUri = manager.makeExternJsUri(gadget, extern);
    assertFalse(manager.hadError());
View Full Code Here


    assertEquals("0", jsUri.getQueryParameter(Param.DEBUG.getKey()));
  }
 
  @Test
  public void makeJsUriAddPathSlashVersioned() {
    ContainerConfig config = mockConfig("http://www.js.org", "/gadgets/js");
    Gadget gadget = mockGadget(false, false);
    List<String> extern = Lists.newArrayList("feature");
    String version = "verstring";
    Versioner versioner = this.mockVersioner(extern, version, version);
    TestDefaultJsUriManager manager = makeManager(config, versioner);
View Full Code Here

    assertEquals("0", jsUri.getQueryParameter(Param.DEBUG.getKey()));
  }
 
  @Test
  public void makeJsUriWithVersionerNoVersionOnIgnoreCache() {
    ContainerConfig config = mockConfig("http://www.js.org", "/gadgets/js");
    Gadget gadget = mockGadget(true, false)// no cache
    List<String> extern = Lists.newArrayList("feature");
    String version = "verstring";
    Versioner versioner = this.mockVersioner(extern, version, version);
    TestDefaultJsUriManager manager = makeManager(config, versioner);
View Full Code Here

  }
 
  // processJsUri tests
  @Test(expected = RuntimeException.class)
  public void processMissingHostConfig() {
    ContainerConfig config = mockConfig(null, "/gadgets/js");
    DefaultJsUriManager manager = makeManager(config, null);
    manager.processExternJsUri(Uri.parse("http://example.com?container=" + CONTAINER));
  }
View Full Code Here

    manager.processExternJsUri(Uri.parse("http://example.com?container=" + CONTAINER));
  }
 
  @Test(expected = RuntimeException.class)
  public void processMissingPathConfig() {
    ContainerConfig config = mockConfig("foo", null);
    DefaultJsUriManager manager = makeManager(config, null);
    manager.processExternJsUri(Uri.parse("http://example.com?container=" + CONTAINER));
  }
View Full Code Here

  }
 
  @Test
  public void processHostMismatch() {
    String targetHost = "target-host.org";
    ContainerConfig config = mockConfig("http://" + targetHost, "/gadgets/js");
    TestDefaultJsUriManager manager = makeManager(config, null);
    Uri testUri = Uri.parse("http://other-host.org/gadgets/js/feature" + JS_SUFFIX + "?" +
        Param.CONTAINER.getKey() + "=" + CONTAINER);
    JsUri jsUri = manager.processExternJsUri(testUri);
    assertTrue(manager.hadError());
View Full Code Here

  }
 
  @Test
  public void processPathPrefixMismatch() {
    String targetHost = "target-host.org";
    ContainerConfig config = mockConfig("http://" + targetHost, "/gadgets/js");
    TestDefaultJsUriManager manager = makeManager(config, null);
    Uri testUri = Uri.parse("http://target-host.org/gadgets/other-js/feature" + JS_SUFFIX + "?" +
        Param.CONTAINER.getKey() + "=" + CONTAINER);
    JsUri jsUri = manager.processExternJsUri(testUri);
    assertTrue(manager.hadError());
View Full Code Here

  }
 
  @Test
  public void processPathSuffixMismatch() {
    String targetHost = "target-host.org";
    ContainerConfig config = mockConfig("http://" + targetHost, "/gadgets/js");
    TestDefaultJsUriManager manager = makeManager(config, null);
    Uri testUri = Uri.parse("http://target-host.org/gadgets/js/feature.gif?" +
        Param.CONTAINER.getKey() + "=" + CONTAINER);
    JsUri jsUri = manager.processExternJsUri(testUri);
    assertTrue(manager.hadError());
View Full Code Here

  }
 
  @Test
  public void processValidUnversionedNoVersioner() {
    String targetHost = "target-host.org";
    ContainerConfig config = mockConfig("http://" + targetHost, "/gadgets/js");
    List<String> extern = Lists.newArrayList("feature", "another");
    String version = "verstring";
    TestDefaultJsUriManager manager = makeManager(config, null);
    Uri testUri = Uri.parse("http://target-host.org/gadgets/js/" + addJsLibs(extern) +
        JS_SUFFIX + "?" + Param.CONTAINER.getKey() + "=" + CONTAINER + "&" +
View Full Code Here

  }
 
  @Test
  public void processValidInvalidVersion() {
    String targetHost = "target-host.org";
    ContainerConfig config = mockConfig("http://" + targetHost, "/gadgets/js");
    List<String> extern = Lists.newArrayList("feature", "another");
    String version = "verstring";
    String badVersion = version + "-a";
    Versioner versioner = mockVersioner(extern, version, badVersion);
    TestDefaultJsUriManager manager = makeManager(config, versioner);
View Full Code Here

TOP

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

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.