You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2013/03/06 02:53:20 UTC

svn commit: r1453128 - /commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/DiskFileItemSerializeTest.java

Author: sebb
Date: Wed Mar  6 01:53:20 2013
New Revision: 1453128

URL: http://svn.apache.org/r1453128
Log:
Simplify and avoid possible NPE warning

Modified:
    commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/DiskFileItemSerializeTest.java

Modified: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/DiskFileItemSerializeTest.java
URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/DiskFileItemSerializeTest.java?rev=1453128&r1=1453127&r2=1453128&view=diff
==============================================================================
--- commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/DiskFileItemSerializeTest.java (original)
+++ commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/DiskFileItemSerializeTest.java Wed Mar  6 01:53:20 2013
@@ -18,6 +18,7 @@ package org.apache.commons.fileupload;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
@@ -171,12 +172,8 @@ public class DiskFileItemSerializeTest
      * Compare content bytes.
      */
     private void compareBytes(String text, byte[] origBytes, byte[] newBytes) {
-        if (origBytes == null) {
-            fail(text + " origBytes are null");
-        }
-        if (newBytes == null) {
-            fail(text + " newBytes are null");
-        }
+        assertNotNull("origBytes must not be null", origBytes);
+        assertNotNull("newBytes must not be null", newBytes);
         assertEquals(text + " byte[] length", origBytes.length, newBytes.length);
         for (int i = 0; i < origBytes.length; i++) {
             assertEquals(text + " byte[" + i + "]", origBytes[i], newBytes[i]);