Package ch.entwine.weblounge.common.url

Examples of ch.entwine.weblounge.common.url.Path


   * @see java.lang.Object#equals(java.lang.Object)
   */
  @Override
  public boolean equals(Object obj) {
    if (obj != null && obj instanceof Path) {
      Path url = (Path) obj;
      return path.equals(url.getPath());
    }
    return super.equals(obj);
  }
View Full Code Here


  /**
   * Test method for {@link ch.entwine.weblounge.common.impl.url.UrlImpl#UrlImpl(java.lang.String, char)}.
   */
  @Test
  public void testUrlImplUrlString() {
    Path u = new UrlImpl(defaultUrl, "a/b");
    String extendedPath = UrlUtils.concat(defaultUrlPath, "a/b/");
    assertEquals(u.getPath(), extendedPath);
  }
View Full Code Here

  /**
   * Test method for {@link ch.entwine.weblounge.common.impl.url.UrlImpl#startsWith(java.lang.String)}.
   */
  @Test
  public void testStartsWith() {
    Path u = new UrlImpl("/ab/c/d");
    assertTrue(u.startsWith("/ab"));
    assertFalse(u.startsWith("ab"));
    assertFalse(u.startsWith("abc"));
    assertFalse(u.startsWith("/abc"));
  }
View Full Code Here

  /**
   * Test method for {@link ch.entwine.weblounge.common.impl.url.UrlImpl#endsWith(java.lang.String)}.
   */
  @Test
  public void testEndsWith() {
    Path u = new UrlImpl("/ab/c/d");
    assertTrue(u.endsWith("d"));
    assertTrue(u.endsWith("/d"));
    assertTrue(u.endsWith("/d/"));
    assertFalse(u.endsWith("cd"));
    assertFalse(u.endsWith("c/d/f"));
  }
View Full Code Here

  /**
   * Test method for {@link ch.entwine.weblounge.common.impl.url.UrlImpl#isPrefixOf(ch.entwine.weblounge.common.url.Path)}.
   */
  @Test
  public void testIsPrefixOf() {
    Path u1 = new UrlImpl(defaultUrl, "/abc");
    Path u2 = new UrlImpl("/abc");
    assertTrue(defaultUrl.isPrefixOf(u1));
    assertTrue(defaultUrl.isPrefixOf(defaultUrl));
    assertFalse(defaultUrl.isPrefixOf(u2));
  }
View Full Code Here

  /**
   * Test method for {@link ch.entwine.weblounge.common.impl.url.UrlImpl#isExtensionOf(ch.entwine.weblounge.common.url.Path)}.
   */
  @Test
  public void testIsExtensionOf() {
    Path u1 = new UrlImpl(defaultUrl, "/abc");
    Path u2 = new UrlImpl("/abc");
    assertTrue(u1.isExtensionOf(defaultUrl));
    assertTrue(defaultUrl.isExtensionOf(defaultUrl));
    assertFalse(u1.isExtensionOf(u2));
    assertFalse(u2.isExtensionOf(u1));
  }
View Full Code Here

TOP

Related Classes of ch.entwine.weblounge.common.url.Path

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.