Use Arrays.equals(...) instead of hand written method for arrays comparison
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package redis.clients.jedis.tests;
|
package redis.clients.jedis.tests;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -62,10 +63,9 @@ public class JedisTest extends JedisCommandTestBase {
|
|||||||
if(exp instanceof byte[] && resp instanceof byte[]) {
|
if(exp instanceof byte[] && resp instanceof byte[]) {
|
||||||
final byte[] bexp = (byte[]) exp;
|
final byte[] bexp = (byte[]) exp;
|
||||||
final byte[] bresp = (byte[]) resp;
|
final byte[] bresp = (byte[]) resp;
|
||||||
if(isArraysAreEquals(bexp, bresp)) {
|
if(Arrays.equals(bexp, bresp)) {
|
||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
// Assert.assertArrayEquals(bexp, bresp);
|
|
||||||
} else if (exp instanceof List && resp instanceof List) {
|
} else if (exp instanceof List && resp instanceof List) {
|
||||||
final List subexp = (List) exp;
|
final List subexp = (List) exp;
|
||||||
final List subresp = (List) resp;
|
final List subresp = (List) resp;
|
||||||
@@ -86,17 +86,17 @@ public class JedisTest extends JedisCommandTestBase {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isArraysAreEquals(final byte[] expected, final byte[] result) {
|
// public static boolean isArraysAreEqualsPlop(final byte[] expected, final byte[] result) {
|
||||||
if(expected.length != result.length) {
|
// if(expected.length != result.length) {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
for(int i=0; i < expected.length; i++) {
|
// for(int i=0; i < expected.length; i++) {
|
||||||
if(expected[i] != result[i]) {
|
// if(expected[i] != result[i]) {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
return true;
|
// return true;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user