aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r1365492 - /aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/container/BeanRecipeTest.java
Date Wed, 25 Jul 2012 08:50:54 GMT
Author: gnodet
Date: Wed Jul 25 08:50:54 2012
New Revision: 1365492

URL: http://svn.apache.org/viewvc?rev=1365492&view=rev
Log:
[ARIES-843] Bean can not be created if constructor argument use generics

Modified:
    aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/container/BeanRecipeTest.java

Modified: aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/container/BeanRecipeTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/container/BeanRecipeTest.java?rev=1365492&r1=1365491&r2=1365492&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/container/BeanRecipeTest.java
(original)
+++ aries/trunk/blueprint/blueprint-core/src/test/java/org/apache/aries/blueprint/container/BeanRecipeTest.java
Wed Jul 25 08:50:54 2012
@@ -25,6 +25,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
+import org.apache.aries.blueprint.di.ExecutionContext;
 import org.junit.Test;
 import static org.junit.Assert.*;
 
@@ -57,8 +58,24 @@ public class BeanRecipeTest {
 		public static String getObject() { return null; }
 		public static Object getBasic(int n) { return 1; }
 	}
-	
-	@Test
+
+    static public interface Example<A> {}
+    static public class ExampleImpl implements Example<String> {}
+    static public class ExampleService {
+        public ExampleService(Example<String> e) {}
+    }
+
+    @Test
+    public void parameterWithGenerics() throws Exception {
+        BlueprintContainerImpl container = new BlueprintContainerImpl(null, null, null, null,
null, null, null);
+        BeanRecipe recipe = new BeanRecipe("example", container, ExampleService.class, false);
+        recipe.setArguments(Arrays.<Object>asList(new ExampleImpl()));
+        recipe.setArgTypes(Arrays.<String>asList((String) null));
+        ExecutionContext.Holder.setContext(new BlueprintRepository(container));
+        recipe.create();
+    }
+
+    @Test
 	public void parameterLessHiding() throws Exception {
 		Set<Method> methods = new HashSet<Method>(
 				Arrays.asList(



Mime
View raw message