aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Burch <nick@apache.org>2010-06-10 15:02:05 +0000
committerNick Burch <nick@apache.org>2010-06-10 15:02:05 +0000
commit129cf711e1361a879e9ab92d09212107816449ee (patch)
tree5f19f7319e15a913a2f9d44423bdacf07ab95bce
parent5696c265f492dbe441dcfb7f86f62055f2ddd14a (diff)
downloadpoi-129cf711e1361a879e9ab92d09212107816449ee.tar.gz
poi-129cf711e1361a879e9ab92d09212107816449ee.zip
Add additional RevisionMarkAuthorTable test
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@953343 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/scratchpad/testcases/org/apache/poi/hwpf/model/TestRevisionMarkAuthorTable.java23
-rw-r--r--test-data/document/MarkAuthorsTable.docbin0 -> 76800 bytes
2 files changed, 23 insertions, 0 deletions
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
--- /dev/null
+++ b/test-data/document/MarkAuthorsTable.doc
Binary files differ