diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/host-jetty/src/test/java/org')
-rw-r--r-- | sca-java-2.x/trunk/modules/host-jetty/src/test/java/org/apache/tuscany/sca/http/jetty/JettyServerTestCase.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sca-java-2.x/trunk/modules/host-jetty/src/test/java/org/apache/tuscany/sca/http/jetty/JettyServerTestCase.java b/sca-java-2.x/trunk/modules/host-jetty/src/test/java/org/apache/tuscany/sca/http/jetty/JettyServerTestCase.java index a3199cf4d1..a83246174c 100644 --- a/sca-java-2.x/trunk/modules/host-jetty/src/test/java/org/apache/tuscany/sca/http/jetty/JettyServerTestCase.java +++ b/sca-java-2.x/trunk/modules/host-jetty/src/test/java/org/apache/tuscany/sca/http/jetty/JettyServerTestCase.java @@ -27,6 +27,8 @@ import java.net.ConnectException; import java.net.InetAddress; import java.net.Socket; import java.net.URL; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.HttpsURLConnection; @@ -70,17 +72,18 @@ public class JettyServerTestCase extends TestCase { private static final int HTTP_PORT = 8085; private WorkScheduler workScheduler = new WorkScheduler() { - + private ExecutorService executorService = Executors.newCachedThreadPool(); + public <T extends Runnable> void scheduleWork(T work) { - Thread thread = new Thread(work); - thread.start(); + executorService.submit(work); } public <T extends Runnable> void scheduleWork(T work, NotificationListener<T> listener) { scheduleWork(work); } - public void destroy() { + public ExecutorService getExecutorService() { + return executorService; } }; |