summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/contrib
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-09-17 22:41:40 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-09-17 22:41:40 +0000
commitb856e8693cddd01bc618dc4abdaf3fe2cec6fea0 (patch)
tree532cd33d34deeec2367a36c5333937e74236cdf0 /sca-java-2.x/trunk/contrib
parenta5638afd3dc676480e437bae56b66c58d8709a59 (diff)
Fix the missing method
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@998358 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/contrib')
-rw-r--r--sca-java-2.x/trunk/contrib/modules/host-tomcat/src/test/java/org/apache/tuscany/sca/http/tomcat/TomcatServerTestCase.java13
1 files changed, 8 insertions, 5 deletions
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 <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;
}
- };
+ };
/**
* Verifies requests are properly routed according to the Servlet mapping