You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by gn...@apache.org on 2018/01/30 23:15:40 UTC

svn commit: r1822717 - in /aries/trunk/blueprint/blueprint-core/src/test: java/org/apache/aries/blueprint/WiringTest.java resources/test-threadpool.xml

Author: gnodet
Date: Tue Jan 30 23:15:40 2018
New Revision: 1822717

URL: http://svn.apache.org/viewvc?rev=1822717&view=rev
Log:
[ARIES-1248] Add test for threadpool creation with generics

Added:
    aries/trunk/blueprint/blueprint-core/src/test/resources/test-threadpool.xml
Modified:
    aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/WiringTest.java

Modified: aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/WiringTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/WiringTest.java?rev=1822717&r1=1822716&r2=1822717&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/WiringTest.java (original)
+++ aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/WiringTest.java Tue Jan 30 23:15:40 2018
@@ -514,6 +514,13 @@ public class WiringTest extends Abstract
         repository.create("typedClassGenericTracker");
     }
 
+    public void testThreadPoolCreation() throws Exception {
+        ComponentDefinitionRegistryImpl registry = parse("/test-threadpool.xml");
+        Repository repository = new TestBlueprintContainer(registry).getRepository();
+        repository.create("executorService");
+    }
+
+
     public void testCircular() throws Exception {
         BlueprintRepository repository = createBlueprintContainer().getRepository();
 

Added: aries/trunk/blueprint/blueprint-core/src/test/resources/test-threadpool.xml
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/test/resources/test-threadpool.xml?rev=1822717&view=auto
==============================================================================
--- aries/trunk/blueprint/blueprint-core/src/test/resources/test-threadpool.xml (added)
+++ aries/trunk/blueprint/blueprint-core/src/test/resources/test-threadpool.xml Tue Jan 30 23:15:40 2018
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file 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.
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+
+    <bean id="executorService" class="java.util.concurrent.ThreadPoolExecutor">
+        <argument>
+            <value>10</value>
+        </argument>
+        <argument>
+            <value>10</value>
+        </argument>
+        <argument>
+            <value>10</value>
+        </argument>
+        <argument value="SECONDS" />
+        <argument>
+            <bean class="java.util.concurrent.LinkedBlockingQueue" />
+        </argument>
+    </bean>
+
+</blueprint>
\ No newline at end of file