Пример #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#")));
 }
Пример #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/#?")));
 }
Пример #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/#")));
  }
Пример #4
0
 @Test(expected = IllegalArgumentException.class)
 public void nonUrlGetLocalNameTest() {
   OwlUtils.getLocalName(IRI.create("non-URL"));
 }
Пример #5
0
 @Test(expected = IllegalArgumentException.class)
 public void emptyGetLocalNameTest() {
   OwlUtils.getLocalName(IRI.create(""));
 }
Пример #6
0
 @Test(expected = IllegalArgumentException.class)
 public void nullGetLocalNameTest() {
   OwlUtils.getLocalName(null);
 }