/** * Tests the update of a document. * * @throws IOException if anything goes wrong mocking the documents * @throws MaintainerServiceException if anything goes wrong maintaining the the document * annotations */ @Test public void testUpdate() throws IOException, MaintainerServiceException { // ignore the docName ftm, just test the marvelous setup MockDocument doc = ((TestDocumentFactory) setup.getDocFactory()).getDocument(docName); // TODO: this is not the place to put this code, but it's the most comfortable copyOriginalSelections(doc); annotationMaintainer.updateAnnotations(docName, doc.getSource(), doc.getModifiedSource()); // test the result assertSameAnnotations(doc.getUpdatedAnnotations(), doc.getAnnotations()); }