public final void testRemoveDocumentFail() throws Exception { VirtualCollectionImpl vc = this.getMyVC(); try { vc.removeDocument("foobar.xml"); assertTrue(EXPECTED_EXCEPTION, false); } catch (XMLDBException e) { assertTrue(INVALID_COLL_MSG + e.errorCode, this.isInvalidColl(e.errorCode)); } }
public final void testGetVCLSchemaSuccess() throws Exception { VirtualCollectionImpl vc = this.getMyVC(); VCLSchema vcl = vc.getVCLSchema(); assertNotNull("Expected was an instance of VCLSchema and not null.", vcl); assertTrue( "Expected was an instance of VCLSchema and not " + vcl.getClass(), vcl instanceof VCLSchema); assertNotNull(vcl.getCollectionReference()); }
public final void testInsertDocumentStringStringFail() throws Exception { String xml = "<foo><bar/></foo>"; String id = "failtest.xml"; VirtualCollectionImpl vc = this.getMyVC(); try { vc.insertDocument(id, xml); assertTrue(EXPECTED_EXCEPTION, false); } catch (XMLDBException e) { assertTrue(INVALID_COLL_MSG + e.errorCode, this.isInvalidColl(e.errorCode)); } }
public final void testInsertDocumentStringURLFail() throws Exception { String id = "failtest.xml"; URL url = new File("data/test/conf.xml").toURL(); VirtualCollectionImpl vc = this.getMyVC(); try { vc.insertDocument(id, url); assertTrue(EXPECTED_EXCEPTION, false); } catch (XMLDBException e) { assertTrue(INVALID_COLL_MSG + e.errorCode, this.isInvalidColl(e.errorCode)); } }