From: Nick Burch Date: Thu, 10 Jun 2010 15:02:05 +0000 (+0000) Subject: Add additional RevisionMarkAuthorTable test X-Git-Tag: REL_3_7_BETA1~11 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=129cf711e1361a879e9ab92d09212107816449ee;p=poi.git Add additional RevisionMarkAuthorTable test git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@953343 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestRevisionMarkAuthorTable.java b/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestRevisionMarkAuthorTable.java index 3b541e766b..6ef2d2b906 100644 --- a/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestRevisionMarkAuthorTable.java +++ b/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestRevisionMarkAuthorTable.java @@ -47,5 +47,28 @@ public final class TestRevisionMarkAuthorTable extends TestCase { assertNotNull(rmt); assertEquals(1, rmt.getSize()); assertEquals("Unknown", rmt.getAuthor(0)); + + assertEquals(null, rmt.getAuthor(1)); + assertEquals(null, rmt.getAuthor(2)); + assertEquals(null, rmt.getAuthor(3)); + } + + /** + * Several authors, one of whom has no name + */ + public void testMultipleAuthors() { + HWPFDocument doc = HWPFTestDataSamples.openSampleFile("MarkAuthorsTable.doc"); + + RevisionMarkAuthorTable rmt = doc.getRevisionMarkAuthorTable(); + assertNotNull(rmt); + assertEquals(4, rmt.getSize()); + assertEquals("Unknown", rmt.getAuthor(0)); + assertEquals("BSanders", rmt.getAuthor(1)); + assertEquals(" ", rmt.getAuthor(2)); + assertEquals("Ryan Lauck", rmt.getAuthor(3)); + + assertEquals(null, rmt.getAuthor(4)); + assertEquals(null, rmt.getAuthor(5)); + assertEquals(null, rmt.getAuthor(6)); } } diff --git a/test-data/document/MarkAuthorsTable.doc b/test-data/document/MarkAuthorsTable.doc new file mode 100644 index 0000000000..acafa3aa4d Binary files /dev/null and b/test-data/document/MarkAuthorsTable.doc differ