Fix broken U tests
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
package redis.clients.jedis.tests;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.junit.Assert;
|
||||
import redis.clients.jedis.Jedis;
|
||||
import redis.clients.jedis.JedisShardInfo;
|
||||
import redis.clients.jedis.Protocol;
|
||||
@@ -41,4 +43,26 @@ public class JedisTest extends JedisCommandTestBase {
|
||||
Jedis jedis = new Jedis(shardInfo);
|
||||
jedis.get("foo");
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public static void compareList(List expected, List result) {
|
||||
final Iterator expectedit = expected.iterator();
|
||||
final Iterator responseit = result.iterator();
|
||||
while(expectedit.hasNext()) {
|
||||
final Object exp = expectedit.next();
|
||||
final Object resp = responseit.next();
|
||||
if(exp instanceof byte[]) {
|
||||
final byte[] bexp = (byte[]) exp;
|
||||
final byte[] bresp = (byte[]) resp;
|
||||
Assert.assertArrayEquals(bexp, bresp);
|
||||
} else if (exp instanceof List) {
|
||||
final List subexp = (List) exp;
|
||||
final List subresp = (List) resp;
|
||||
compareList(subexp, subresp);
|
||||
} else {
|
||||
assertEquals(exp, resp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user