openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1629886 - /openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/decorators/tests/RepeatedGenericTypeDecoratorTest.java
Date Tue, 07 Oct 2014 13:08:42 GMT
Author: rmannibucau
Date: Tue Oct  7 13:08:42 2014
New Revision: 1629886

URL: http://svn.apache.org/r1629886
Log:
making MyServiceDecorator more dangerous (not finite if you browse parameterized type)

Modified:
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/decorators/tests/RepeatedGenericTypeDecoratorTest.java

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/decorators/tests/RepeatedGenericTypeDecoratorTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/decorators/tests/RepeatedGenericTypeDecoratorTest.java?rev=1629886&r1=1629885&r2=1629886&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/decorators/tests/RepeatedGenericTypeDecoratorTest.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/decorators/tests/RepeatedGenericTypeDecoratorTest.java
Tue Oct  7 13:08:42 2014
@@ -23,6 +23,7 @@ import javax.decorator.Delegate;
 import javax.enterprise.inject.Any;
 import javax.inject.Inject;
 
+import junit.framework.Assert;
 import org.apache.webbeans.test.AbstractUnitTest;
 import org.junit.Test;
 
@@ -37,6 +38,7 @@ public class RepeatedGenericTypeDecorato
 
         MyService myService = getInstance(MyService.class);
 
+        MyServiceDecorator.called = false;
         myService.doSomethingStrange(new MyInterface<MyInterface>()
         {
             @Override
@@ -45,8 +47,7 @@ public class RepeatedGenericTypeDecorato
                 // have no idea here too
             }
         });
-
-        shutDownContainer();
+        Assert.assertTrue(MyServiceDecorator.called);
     }
 
 
@@ -69,19 +70,19 @@ public class RepeatedGenericTypeDecorato
 
 
     @Decorator
-    public static class MyServiceDecorator implements MyInterface<MyInterface<MyInterface>>
+    public static class MyServiceDecorator<T extends MyInterface<T>> implements
MyInterface<T>
     {
+        private static boolean called;
 
         @Delegate
         @Inject
         @Any
-        private MyInterface<MyInterface<MyInterface>> delegate;
+        private MyInterface<T> delegate;
 
         @Override
-        public void doSomethingStrange(MyInterface<MyInterface> param)
+        public void doSomethingStrange(T param)
         {
-            // really have no idea what to do here
-            param.doSomethingStrange(param);
+            called = true;
         }
     }
 }



Mime
View raw message