forked from vert-x/mod-redis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReplyParserTester.java
More file actions
51 lines (42 loc) · 1.22 KB
/
ReplyParserTester.java
File metadata and controls
51 lines (42 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package io.vertx.redis;
import io.vertx.redis.impl.ReplyHandler;
import org.junit.Test;
import org.vertx.java.core.buffer.Buffer;
import org.vertx.testtools.TestVerticle;
import static org.vertx.testtools.VertxAssert.*;
public class ReplyParserTester extends TestVerticle {
@Test
public void testArrayArrayParser() {
Buffer b = new Buffer();
b.appendString(
"*2\r\n" +
"*3\r\n" +
":1\r\n" +
":2\r\n" +
":3\r\n" +
"*2\r\n" +
"+Foo\r\n" +
"-Bar\r\n");
ReplyParser parser = new ReplyParser(new ReplyHandler() {
@Override
public void handleReply(Reply reply) {
testComplete();
}
});
parser.handle(b);
}
@Test
public void testArrayArrayEmptyParser() {
Buffer b = new Buffer();
b.appendString(
"*1\r\n" +
"*0\r\n");
ReplyParser parser = new ReplyParser(new ReplyHandler() {
@Override
public void handleReply(Reply reply) {
testComplete();
}
});
parser.handle(b);
}
}