You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by ve...@apache.org on 2011/07/30 23:58:44 UTC

svn commit: r1152523 - /webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/AttachmentsTest.java

Author: veithen
Date: Sat Jul 30 21:58:44 2011
New Revision: 1152523

URL: http://svn.apache.org/viewvc?rev=1152523&view=rev
Log:
Make correct usage of JUnit assertions.

Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/AttachmentsTest.java

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/AttachmentsTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/AttachmentsTest.java?rev=1152523&r1=1152522&r2=1152523&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/AttachmentsTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/attachments/AttachmentsTest.java Sat Jul 30 21:58:44 2011
@@ -64,10 +64,10 @@ public class AttachmentsTest extends Abs
         Attachments attachments = new Attachments(inStream, TestConstants.MTOM_MESSAGE_CONTENT_TYPE);
 
         String[] contentIDs = attachments.getAllContentIDs();
-        assertEquals(contentIDs.length, 3);
-        assertEquals(contentIDs[0], "0.urn:uuid:A3ADBAEE51A1A87B2A11443668160702@apache.org");
-        assertEquals(contentIDs[1], "1.urn:uuid:A3ADBAEE51A1A87B2A11443668160943@apache.org");
-        assertEquals(contentIDs[2], "2.urn:uuid:A3ADBAEE51A1A87B2A11443668160994@apache.org");
+        assertEquals(3, contentIDs.length);
+        assertEquals("0.urn:uuid:A3ADBAEE51A1A87B2A11443668160702@apache.org", contentIDs[0]);
+        assertEquals("1.urn:uuid:A3ADBAEE51A1A87B2A11443668160943@apache.org", contentIDs[1]);
+        assertEquals("2.urn:uuid:A3ADBAEE51A1A87B2A11443668160994@apache.org", contentIDs[2]);
     }
     
     public void testGetContentIDSet() {
@@ -87,8 +87,7 @@ public class AttachmentsTest extends Abs
         // Make sure the length is correct
         long length = attachments.getContentLength();
         long fileSize = IOUtils.getStreamAsByteArray(getTestResource(TestConstants.MTOM_MESSAGE)).length;
-        assertTrue("Expected MessageContent Length of " + fileSize + " but received " + length,
-                   length == fileSize);
+        assertEquals("Return value of getContentLength()", fileSize, length);
     }
 
     private void testGetSOAPPartContentID(String contentTypeStartParam, String contentId)
@@ -209,7 +208,7 @@ public class AttachmentsTest extends Abs
         IOTestUtils.compareStreams(dataIs, expectedDataIs);
 
         // Confirm that no more streams are left
-        assertEquals(null, ias.getNextStream());
+        assertNull(ias.getNextStream());
         
         // After all is done, we should *still* be able to access and
         // re-consume the SOAP part stream, as it should be cached.. can we?