Package org.apache.shindig.common.uri

Examples of org.apache.shindig.common.uri.Uri$UriException


    TestDefaultIframeUriManager manager = makeManager(
        false,   // security token beacon not required
        false,   // locked domain not (always) required
        true);

    Uri result = manager.makeRenderingUri(gadget);
    assertNotNull(result);

    UriBuilder uri = new UriBuilder(result);
    assertEquals("", uri.getScheme());
    assertEquals(LD_PREFIX + LD_SUFFIX, uri.getAuthority());
View Full Code Here


    TestDefaultIframeUriManager manager = makeManager(
        false,   // security token beacon not required
        true);   // locked domain always required

    Uri result = manager.makeRenderingUri(gadget);
    assertNotNull(result);

    UriBuilder uri = new UriBuilder(result);
    assertEquals("", uri.getScheme());
    assertEquals(LD_PREFIX + LD_SUFFIX, uri.getAuthority());
View Full Code Here

    TestDefaultIframeUriManager manager = makeManager(
        false,   // security token beacon not required
        false);   // locked domain always required

    Uri result = manager.makeRenderingUri(gadget);
    assertNotNull(result);

    UriBuilder uri = new UriBuilder(result);
    assertEquals("", uri.getScheme());
    assertEquals(UNLOCKED_DOMAIN, uri.getAuthority());
View Full Code Here

  public void versionAddedWithVersioner() throws Exception {
    String version = "abcdlkjwef";
    Gadget gadget = mockGadget();
    TestDefaultIframeUriManager manager = makeManager(false, false);
    manager.setVersioner(this.mockVersioner(version, true));
    Uri result = manager.makeRenderingUri(gadget);
    assertNotNull(result);
    UriBuilder uri = new UriBuilder(result);
    assertEquals(TYPE_HTML_NUM_BASE_PARAMS + 1, uri.getQueryParameters().size());
    assertEquals(version, uri.getQueryParameter(Param.VERSION.getKey()));
View Full Code Here

    inPrefs.put("specKey1", "inVal1");
    inPrefs.put("otherKey1", "inVal2");

    Gadget gadget = mockGadget(true, specPrefs, inPrefs);
    TestDefaultIframeUriManager manager = makeManager(false, false);
    Uri result = manager.makeRenderingUri(gadget);
    assertNotNull(result);
    UriBuilder uri = new UriBuilder(result);

    // otherKey1/inVal2 pair ignored; not known by the gadget
    assertEquals(TYPE_HTML_NUM_BASE_PARAMS + 2, uri.getQueryParameters().size());
View Full Code Here

    inPrefs.put("specKey1", "inVal1");
    inPrefs.put("otherKey1", "inVal2");

    Gadget gadget = mockGadget(false, specPrefs, inPrefs);
    TestDefaultIframeUriManager manager = makeManager(false, false);
    Uri result = manager.makeRenderingUri(gadget);
    assertNotNull(result);
    UriBuilder uri = new UriBuilder(result);

    // otherKey1/inVal2 pair ignored; not known by the gadget
    assertEquals(TYPE_HTML_NUM_BASE_PARAMS, uri.getQueryParameters().size());
View Full Code Here

  public void honorSchemeOverride() throws Exception {
    String scheme = "file";
    Gadget gadget = mockGadget();
    TestDefaultIframeUriManager manager = makeManager(false, false);
    manager.setScheme(scheme);
    Uri result = manager.makeRenderingUri(gadget);
    assertNotNull(result);
    UriBuilder uri = new UriBuilder(result);
    assertEquals(scheme, uri.getScheme());

    Map<String, Uri> uris = manager.makeAllRenderingUris(gadget);
View Full Code Here

    assertFalse(scheme.equalsIgnoreCase(new UriBuilder(uris.get(ANOTHER_VIEW)).getScheme()));
  }

  @Test
  public void badUriValidatingUri() throws Exception {
    Uri uri = new UriBuilder().addQueryParameter(Param.URL.getKey(), "^':   bad:").toUri();
    TestDefaultIframeUriManager manager = makeManager(false, false);
    UriStatus status = manager.validateRenderingUri(uri);
    assertEquals(UriStatus.BAD_URI, status);
  }
View Full Code Here

    assertEquals(UriStatus.BAD_URI, status);
  }

  @Test
  public void validUnversionedNoVersioner() throws Exception {
    Uri uri = makeValidationTestUri(LD_PREFIX + LD_SUFFIX, "version");
    DefaultIframeUriManager manager = makeManager(false, false);
    assertEquals(UriStatus.VALID_UNVERSIONED, manager.validateRenderingUri(uri));
  }
View Full Code Here

    assertEquals(UriStatus.VALID_UNVERSIONED, manager.validateRenderingUri(uri));
  }

  @Test
  public void validUnversionedNoVersion() throws Exception {
    Uri uri = makeValidationTestUri(LD_PREFIX + LD_SUFFIX, null);
    DefaultIframeUriManager manager = makeManager(false, false);
    manager.setVersioner(this.mockVersioner("version", false))// Invalid, if present.
    assertEquals(UriStatus.VALID_UNVERSIONED, manager.validateRenderingUri(uri));
  }
View Full Code Here

TOP

Related Classes of org.apache.shindig.common.uri.Uri$UriException

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.