Ejemplo n.º 1
0
 @Test
 public void fragmentGetLocalNameTest() {
   assertEquals("path", OwlUtils.getLocalName(IRI.create("http://host/path#")));
   assertEquals("f", OwlUtils.getLocalName(IRI.create("http://host/path#f")));
   assertEquals("fragment", OwlUtils.getLocalName(IRI.create("http://host/path#fragment")));
   assertEquals("fragment#", OwlUtils.getLocalName(IRI.create("http://host/path#fragment#")));
 }
Ejemplo n.º 2
0
 @Test
 public void hostGetLocalNameTest() {
   assertEquals("host", OwlUtils.getLocalName(IRI.create("http://host")));
   assertEquals("host", OwlUtils.getLocalName(IRI.create("http://host/")));
   assertEquals("host", OwlUtils.getLocalName(IRI.create("http://host//")));
   assertEquals("host", OwlUtils.getLocalName(IRI.create("http://host#")));
   assertEquals("host", OwlUtils.getLocalName(IRI.create("http://host/#")));
   // This maybe wrong
   assertEquals("?", OwlUtils.getLocalName(IRI.create("http://host/#?")));
 }
Ejemplo n.º 3
0
  @Test
  public void pathGetLocalNameTest() {
    assertEquals("host", OwlUtils.getLocalName(IRI.create("http://host/")));
    assertEquals("p", OwlUtils.getLocalName(IRI.create("http://host/p")));
    assertEquals("path", OwlUtils.getLocalName(IRI.create("http://host/path")));
    assertEquals("path", OwlUtils.getLocalName(IRI.create("http://host/path/")));

    // This maybe wrong
    assertEquals("path?p=v", OwlUtils.getLocalName(IRI.create("http://host/path?p=v")));
    assertEquals("subpath", OwlUtils.getLocalName(IRI.create("http://host/path/subpath/#")));
  }
Ejemplo n.º 4
0
 @Test(expected = IllegalArgumentException.class)
 public void nonUrlGetLocalNameTest() {
   OwlUtils.getLocalName(IRI.create("non-URL"));
 }
Ejemplo n.º 5
0
 @Test(expected = IllegalArgumentException.class)
 public void emptyGetLocalNameTest() {
   OwlUtils.getLocalName(IRI.create(""));
 }
Ejemplo n.º 6
0
 @Test(expected = IllegalArgumentException.class)
 public void nullGetLocalNameTest() {
   OwlUtils.getLocalName(null);
 }