From 33e3be55dc2d815cbd0208bf59d12a7e727f3105 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 9 Jun 2013 15:15:46 +0200 Subject: wip --- src/test/java/io/trygvis/test/spring/PlainSpringTest.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/test/java/io/trygvis/test/spring/PlainSpringTest.java') diff --git a/src/test/java/io/trygvis/test/spring/PlainSpringTest.java b/src/test/java/io/trygvis/test/spring/PlainSpringTest.java index 07e67fb..d06d8d6 100644 --- a/src/test/java/io/trygvis/test/spring/PlainSpringTest.java +++ b/src/test/java/io/trygvis/test/spring/PlainSpringTest.java @@ -3,6 +3,8 @@ package io.trygvis.test.spring; import io.trygvis.async.AsyncService; import io.trygvis.queue.Queue; import io.trygvis.queue.QueueService; +import io.trygvis.queue.Task; +import io.trygvis.queue.TaskEffect; import io.trygvis.spring.DefaultConfig; import org.junit.Test; import org.junit.runner.RunWith; @@ -17,6 +19,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 java.util.Collections.emptyList; import static org.fest.assertions.Assertions.assertThat; import static org.junit.Assert.assertNotNull; @@ -41,13 +44,15 @@ public class PlainSpringTest { public void testBasic() throws SQLException, InterruptedException { Queue test = queueService.getQueue("test", 10, true); final AtomicReference> ref = new AtomicReference<>(); - asyncService.registerQueue(test, new AsyncService.AsyncCallable() { - public void run(List arguments) throws Exception { + asyncService.registerQueue(test, new TaskEffect() { + @Override + public List apply(Task task) throws Exception { System.out.println("PlainSpringTest.run"); - ref.set(arguments); + ref.set(task.arguments); synchronized (ref) { ref.notify(); } + return emptyList(); } }); -- cgit v1.2.3