Skip to content

Commit 50ccbb8

Browse files
added redisques deploy
1 parent a06b748 commit 50ccbb8

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

src/test/java/org/swisspush/redisques/RedisQuesTest.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
package org.swisspush.redisques;
22

33
import io.vertx.core.AsyncResult;
4+
import io.vertx.core.DeploymentOptions;
45
import io.vertx.core.Handler;
6+
import io.vertx.core.Vertx;
57
import io.vertx.core.eventbus.Message;
68
import io.vertx.core.json.JsonArray;
79
import io.vertx.core.json.JsonObject;
810
import io.vertx.ext.unit.Async;
911
import io.vertx.ext.unit.TestContext;
1012
import io.vertx.ext.unit.junit.Timeout;
13+
import org.junit.BeforeClass;
1114
import org.junit.Ignore;
1215
import org.junit.Rule;
1316
import org.junit.Test;
17+
import org.swisspush.redisques.util.RedisquesConfiguration;
18+
import redis.clients.jedis.Jedis;
1419

1520
import javax.xml.bind.DatatypeConverter;
1621
import java.security.MessageDigest;
@@ -36,6 +41,25 @@ public class RedisQuesTest extends AbstractTestCase {
3641
@Rule
3742
public Timeout rule = Timeout.seconds(5);
3843

44+
@BeforeClass
45+
public static void deployRedisques(TestContext context) {
46+
vertx = Vertx.vertx();
47+
48+
JsonObject config = RedisquesConfiguration.with()
49+
.processorAddress("processor-address")
50+
.redisEncoding("ISO-8859-1")
51+
.refreshPeriod(2)
52+
.build()
53+
.asJsonObject();
54+
55+
RedisQues redisQues = new RedisQues();
56+
vertx.deployVerticle(redisQues, new DeploymentOptions().setConfig(config), context.asyncAssertSuccess(event -> {
57+
deploymentId = event;
58+
log.info("vert.x Deploy - " + redisQues.getClass().getSimpleName() + " was successful.");
59+
jedis = new Jedis("localhost", 6379, 5000);
60+
}));
61+
}
62+
3963
@Test
4064
public void testUnsupportedOperation(TestContext context) {
4165
Async async = context.async();

0 commit comments

Comments
 (0)