コード例 #1
0
 @Test
 public void testRemoveNamespaces() throws Exception {
   con.begin();
   con.setNamespace("rdf", RDF.NAMESPACE);
   con.removeNamespace("rdf");
   con.commit();
   assertNull(con.getNamespace("rdf"));
 }
コード例 #2
0
 @Test
 public void testNullPrefixDisallowed() throws Exception {
   try {
     con.setNamespace(null, "foo");
     fail("Expected NullPointerException");
   } catch (NullPointerException e) {
     // expected
   }
   try {
     con.getNamespace(null);
     fail("Expected NullPointerException");
   } catch (NullPointerException e) {
     // expected
   }
   try {
     con.removeNamespace(null);
     fail("Expected NullPointerException");
   } catch (NullPointerException e) {
     // expected
   }
 }