From ffe36f15ffc3cb9115e25ed24e9208aa8d8642f9 Mon Sep 17 00:00:00 2001 From: rfeng Date: Thu, 4 Jun 2009 23:40:28 +0000 Subject: Fix for TUSCANY-3076. The DefaultWorkScheduler only has 10 threads in the pool and it causes deadlock. With this fix, it's default to a cached pool which expand/thrink on demand. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@781871 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/core/work/ThreadPoolWorkManagerTestCase.java | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'branches/sca-java-1.x/modules/core/src/test/java/org') diff --git a/branches/sca-java-1.x/modules/core/src/test/java/org/apache/tuscany/sca/core/work/ThreadPoolWorkManagerTestCase.java b/branches/sca-java-1.x/modules/core/src/test/java/org/apache/tuscany/sca/core/work/ThreadPoolWorkManagerTestCase.java index 715f5f95c0..9e5b8d035e 100644 --- a/branches/sca-java-1.x/modules/core/src/test/java/org/apache/tuscany/sca/core/work/ThreadPoolWorkManagerTestCase.java +++ b/branches/sca-java-1.x/modules/core/src/test/java/org/apache/tuscany/sca/core/work/ThreadPoolWorkManagerTestCase.java @@ -6,15 +6,15 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations - * under the License. + * under the License. */ package org.apache.tuscany.sca.core.work; @@ -25,7 +25,7 @@ import org.junit.Test; /** * This test case will test the ThreadPoolWorkManager - * + * * @version $Rev$ $Date$ */ public class ThreadPoolWorkManagerTestCase { @@ -130,7 +130,7 @@ public class ThreadPoolWorkManagerTestCase { } /** - * Tests running a mixture of fast and slow jobs some of which fail on the + * Tests running a mixture of fast and slow jobs some of which fail on the * ThreadPoolWorkManager */ @Test @@ -170,12 +170,7 @@ public class ThreadPoolWorkManagerTestCase { @Test public void testThreadPoolWorkManagerLessThan1Size() { for (int i = 0; i >= -10; i--) { - try { - new ThreadPoolWorkManager(i); - Assert.fail("Should have thrown IllegalArgumentException"); - } catch (IllegalArgumentException ex) { - Assert.assertTrue(ex.toString().indexOf(Integer.toString(i)) != -1); - } + new ThreadPoolWorkManager(i); } } @@ -215,7 +210,7 @@ public class ThreadPoolWorkManagerTestCase { /** * Waits for the specified number of jobs to complete or the timeout to fire. - * + * * @param listener The listener to use to track Work unit completion * @param completedWorkItemsToWaitFor The number of Work items to complete */ -- cgit v1.2.3