aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/io/trygvis/test/spring/PlainSpringTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/io/trygvis/test/spring/PlainSpringTest.java')
-rw-r--r--src/test/java/io/trygvis/test/spring/PlainSpringTest.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/test/java/io/trygvis/test/spring/PlainSpringTest.java b/src/test/java/io/trygvis/test/spring/PlainSpringTest.java
index 9a7a436..07e67fb 100644
--- a/src/test/java/io/trygvis/test/spring/PlainSpringTest.java
+++ b/src/test/java/io/trygvis/test/spring/PlainSpringTest.java
@@ -2,6 +2,7 @@ package io.trygvis.test.spring;
import io.trygvis.async.AsyncService;
import io.trygvis.queue.Queue;
+import io.trygvis.queue.QueueService;
import io.trygvis.spring.DefaultConfig;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -15,6 +16,7 @@ import java.util.concurrent.atomic.AtomicReference;
import static java.lang.System.getProperty;
import static java.lang.System.setProperty;
+import static java.util.Arrays.asList;
import static org.fest.assertions.Assertions.assertThat;
import static org.junit.Assert.assertNotNull;
@@ -25,6 +27,9 @@ public class PlainSpringTest {
@Autowired
private AsyncService asyncService;
+ @Autowired
+ private QueueService queueService;
+
static {
String username = getProperty("user.name");
setProperty("database.url", getProperty("jdbc.url", "jdbc:postgresql://localhost/" + username));
@@ -34,8 +39,9 @@ public class PlainSpringTest {
@Test
public void testBasic() throws SQLException, InterruptedException {
+ Queue test = queueService.getQueue("test", 10, true);
final AtomicReference<List<String>> ref = new AtomicReference<>();
- Queue test = asyncService.registerQueue("test", 10, new AsyncService.AsyncCallable() {
+ asyncService.registerQueue(test, new AsyncService.AsyncCallable() {
public void run(List<String> arguments) throws Exception {
System.out.println("PlainSpringTest.run");
ref.set(arguments);
@@ -47,7 +53,7 @@ public class PlainSpringTest {
synchronized (ref) {
System.out.println("Scheduling task");
- asyncService.schedule(test, "hello", "world");
+ asyncService.schedule(test, asList("hello", "world"));
System.out.println("Waiting");
ref.wait(1000);
}