]> source.dussan.org Git - poi.git/commitdiff
junit improvements:
authorJaven O'Neal <onealj@apache.org>
Thu, 5 Jan 2017 07:16:27 +0000 (07:16 +0000)
committerJaven O'Neal <onealj@apache.org>
Thu, 5 Jan 2017 07:16:27 +0000 (07:16 +0000)
assertEquals(null, ...) -> assertNull(...)
attachment.getAttachFileName().toString() -> attachment.getAttachFileName().getValue()

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1777423 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/testcases/org/apache/poi/hsmf/TestFileWithAttachmentsRead.java

index 544ddef49b0bf730a62607f3dc7ad63738d7618f..d9c45ff9f2f2de5ea8aaf9693f4a5e7af63a2b9d 100644 (file)
@@ -81,17 +81,17 @@ public class TestFileWithAttachmentsRead extends TestCase {
 
       // Now check in detail
       attachment = twoSimpleAttachments.getAttachmentFiles()[0];
-      assertEquals("TEST-U~1.DOC", attachment.getAttachFileName().toString());
-      assertEquals("test-unicode.doc", attachment.getAttachLongFileName().toString());
+      assertEquals("TEST-U~1.DOC", attachment.getAttachFileName().getValue());
+      assertEquals("test-unicode.doc", attachment.getAttachLongFileName().getValue());
       assertEquals(".doc", attachment.getAttachExtension().getValue());
-      assertEquals(null, attachment.getAttachMimeTag());
+      assertNull(attachment.getAttachMimeTag());
       assertEquals(24064, attachment.getAttachData().getValue().length);
 
       attachment = twoSimpleAttachments.getAttachmentFiles()[1];
-      assertEquals("pj1.txt", attachment.getAttachFileName().toString());
-      assertEquals("pj1.txt", attachment.getAttachLongFileName().toString());
+      assertEquals("pj1.txt", attachment.getAttachFileName().getValue());
+      assertEquals("pj1.txt", attachment.getAttachLongFileName().getValue());
       assertEquals(".txt", attachment.getAttachExtension().getValue());
-      assertEquals(null, attachment.getAttachMimeTag());
+      assertNull(attachment.getAttachMimeTag());
       assertEquals(89, attachment.getAttachData().getValue().length);
    }
    
@@ -106,20 +106,20 @@ public class TestFileWithAttachmentsRead extends TestCase {
 
        // Second is a PDF
        attachment = pdfMsgAttachments.getAttachmentFiles()[1];
-       assertEquals("smbprn~1.pdf", attachment.getAttachFileName().toString());
-       assertEquals("smbprn.00009008.KdcPjl.pdf", attachment.getAttachLongFileName().toString());
+       assertEquals("smbprn~1.pdf", attachment.getAttachFileName().getValue());
+       assertEquals("smbprn.00009008.KdcPjl.pdf", attachment.getAttachLongFileName().getValue());
        assertEquals(".pdf", attachment.getAttachExtension().getValue());
-       assertEquals(null, attachment.getAttachMimeTag());
-       assertEquals(null, attachment.getAttachmentDirectory());
+       assertNull(attachment.getAttachMimeTag());
+       assertNull(attachment.getAttachmentDirectory());
        assertEquals(13539, attachment.getAttachData().getValue().length);
        
        // First in a nested message
        attachment = pdfMsgAttachments.getAttachmentFiles()[0];
-       assertEquals("Test Attachment", attachment.getAttachFileName().toString());
-       assertEquals(null, attachment.getAttachLongFileName());
-       assertEquals(null, attachment.getAttachExtension());
-       assertEquals(null, attachment.getAttachMimeTag());
-       assertEquals(null, attachment.getAttachData());
+       assertEquals("Test Attachment", attachment.getAttachFileName().getValue());
+       assertNull(attachment.getAttachLongFileName());
+       assertNull(attachment.getAttachExtension());
+       assertNull(attachment.getAttachMimeTag());
+       assertNull(attachment.getAttachData());
        assertNotNull(attachment.getAttachmentDirectory());
        
        // Check we can see some bits of it