commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1453128 - /commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/DiskFileItemSerializeTest.java
Date Wed, 06 Mar 2013 01:53:20 GMT
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]);



Mime
View raw message