summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.x/modules/core/src/test/java/org/apache/tuscany/sca/core/work/ThreadPoolWorkManagerTestCase.java
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-06-04 23:40:28 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-06-04 23:40:28 +0000
commitffe36f15ffc3cb9115e25ed24e9208aa8d8642f9 (patch)
tree2c048e058be16bf312e3e85dc664e41af17db9d8 /branches/sca-java-1.x/modules/core/src/test/java/org/apache/tuscany/sca/core/work/ThreadPoolWorkManagerTestCase.java
parentb921d97c9a71c417d443fb79f28675c587a80958 (diff)
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
Diffstat (limited to '')
-rw-r--r--branches/sca-java-1.x/modules/core/src/test/java/org/apache/tuscany/sca/core/work/ThreadPoolWorkManagerTestCase.java19
1 files changed, 7 insertions, 12 deletions
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
*/