From b856e8693cddd01bc618dc4abdaf3fe2cec6fea0 Mon Sep 17 00:00:00 2001 From: rfeng Date: Fri, 17 Sep 2010 22:41:40 +0000 Subject: Fix the missing method git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@998358 13f79535-47bb-0310-9956-ffa450edef68 --- .../tuscany/sca/http/tomcat/TomcatServerTestCase.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'sca-java-2.x/trunk/contrib/modules') diff --git a/sca-java-2.x/trunk/contrib/modules/host-tomcat/src/test/java/org/apache/tuscany/sca/http/tomcat/TomcatServerTestCase.java b/sca-java-2.x/trunk/contrib/modules/host-tomcat/src/test/java/org/apache/tuscany/sca/http/tomcat/TomcatServerTestCase.java index 4bcf0623e8..7e2f4e1614 100644 --- a/sca-java-2.x/trunk/contrib/modules/host-tomcat/src/test/java/org/apache/tuscany/sca/http/tomcat/TomcatServerTestCase.java +++ b/sca-java-2.x/trunk/contrib/modules/host-tomcat/src/test/java/org/apache/tuscany/sca/http/tomcat/TomcatServerTestCase.java @@ -25,6 +25,8 @@ import java.io.InputStreamReader; import java.io.OutputStream; 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; @@ -74,19 +76,20 @@ public class TomcatServerTestCase extends TestCase { private static final int HTTP_PORT = 8085; private WorkScheduler workScheduler = new WorkScheduler() { - + private ExecutorService executorService = Executors.newCachedThreadPool(); + public void scheduleWork(T work) { - Thread thread = new Thread(work); - thread.start(); + executorService.submit(work); } public void scheduleWork(T work, NotificationListener listener) { scheduleWork(work); } - public void destroy() { + public ExecutorService getExecutorService() { + return executorService; } - }; + }; /** * Verifies requests are properly routed according to the Servlet mapping -- cgit v1.2.3