]> source.dussan.org Git - poi.git/commitdiff
Add additional RevisionMarkAuthorTable test
authorNick Burch <nick@apache.org>
Thu, 10 Jun 2010 15:02:05 +0000 (15:02 +0000)
committerNick Burch <nick@apache.org>
Thu, 10 Jun 2010 15:02:05 +0000 (15:02 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@953343 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/testcases/org/apache/poi/hwpf/model/TestRevisionMarkAuthorTable.java
test-data/document/MarkAuthorsTable.doc [new file with mode: 0644]

index 3b541e766ba3ea591100fa8a029667f388ecd285..6ef2d2b9065f716958c65e0c1c600154f82e766f 100644 (file)
@@ -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 (file)
index 0000000..acafa3a
Binary files /dev/null and b/test-data/document/MarkAuthorsTable.doc differ