示例#1
0
 @Test
 public void testClearNamespaces() throws Exception {
   con.begin();
   con.setNamespace("rdf", RDF.NAMESPACE);
   con.setNamespace("rdfs", RDFS.NAMESPACE);
   con.clearNamespaces();
   con.commit();
   assertTrue(!con.getNamespaces().hasNext());
 }
示例#2
0
  @Test
  public void testGetNamespaces() throws Exception {
    con.begin();
    con.setNamespace("rdf", RDF.NAMESPACE);
    con.commit();

    CloseableIteration<? extends Namespace, SailException> namespaces = con.getNamespaces();
    try {
      assertTrue(namespaces.hasNext());
      Namespace rdf = namespaces.next();
      assertEquals("rdf", rdf.getPrefix());
      assertEquals(RDF.NAMESPACE, rdf.getName());
      assertTrue(!namespaces.hasNext());
    } finally {
      namespaces.close();
    }
  }