commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject svn commit: r1648105 - in /commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging: ImagingTest.java common/bytesource/ByteSourceDataTest.java common/bytesource/ByteSourceImageTest.java
Date Sat, 27 Dec 2014 20:13:55 GMT
Author: britter
Date: Sat Dec 27 20:13:54 2014
New Revision: 1648105

URL: http://svn.apache.org/r1648105
Log:
Use junit's array comparison method

Modified:
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/ImagingTest.java
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceDataTest.java
    commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceImageTest.java

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/ImagingTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/ImagingTest.java?rev=1648105&r1=1648104&r2=1648105&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/ImagingTest.java
(original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/ImagingTest.java
Sat Dec 27 20:13:54 2014
@@ -17,6 +17,8 @@
 
 package org.apache.commons.imaging;
 
+import static org.junit.Assert.assertArrayEquals;
+
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
@@ -47,13 +49,6 @@ public abstract class ImagingTest extend
         return result;
     }
 
-    public void compareByteArrays(final byte a[], final byte b[]) {
-        assertTrue(a.length == b.length);
-        for (int i = 0; i < b.length; i++) {
-            assertTrue(b[i] == a[i]);
-        }
-    }
-
     protected void purgeMemory() {
         try {
             System.gc();

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceDataTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceDataTest.java?rev=1648105&r1=1648104&r2=1648105&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceDataTest.java
(original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceDataTest.java
Sat Dec 27 20:13:54 2014
@@ -17,6 +17,8 @@
 
 package org.apache.commons.imaging.common.bytesource;
 
+import static org.junit.Assert.assertArrayEquals;
+
 import java.io.ByteArrayInputStream;
 import java.io.File;
 import java.io.FileInputStream;
@@ -94,13 +96,13 @@ public class ByteSourceDataTest extends
             final InputStream is = byteSource.getInputStream();
             final byte dst[] = IOUtils.toByteArray(is);
 
-            compareByteArrays(src, dst);
+            assertArrayEquals(src, dst);
         }
 
         {
             // test getAll() method.
             final byte all[] = byteSource.getAll();
-            compareByteArrays(src, all);
+            assertArrayEquals(src, all);
         }
 
         if (src.length > 2) {

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceImageTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceImageTest.java?rev=1648105&r1=1648104&r2=1648105&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceImageTest.java
(original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceImageTest.java
Sat Dec 27 20:13:54 2014
@@ -17,6 +17,8 @@
 
 package org.apache.commons.imaging.common.bytesource;
 
+import static org.junit.Assert.assertArrayEquals;
+
 import java.awt.Dimension;
 import java.awt.image.BufferedImage;
 import java.io.File;
@@ -151,7 +153,7 @@ public class ByteSourceImageTest extends
             return;
         }
 
-        compareByteArrays(iccBytesFile, iccBytesBytes);
+        assertArrayEquals(iccBytesFile, iccBytesBytes);
     }
 
     public void checkGetImageInfo(final File imageFile, final byte[] imageFileBytes)



Mime
View raw message