openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tandrasc...@apache.org
Subject svn commit: r1843975 - in /openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/portable/events: PortableEventTest.java extensions/TreeExtension.java
Date Tue, 16 Oct 2018 07:52:58 GMT
Author: tandraschko
Date: Tue Oct 16 07:52:58 2018
New Revision: 1843975

URL: http://svn.apache.org/viewvc?rev=1843975&view=rev
Log:
added some unittests for generic lifecycle events

Modified:
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/portable/events/PortableEventTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/portable/events/extensions/TreeExtension.java

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/portable/events/PortableEventTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/portable/events/PortableEventTest.java?rev=1843975&r1=1843974&r2=1843975&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/portable/events/PortableEventTest.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/portable/events/PortableEventTest.java
Tue Oct 16 07:52:58 2018
@@ -256,6 +256,8 @@ public class PortableEventTest extends A
         Assert.assertSame(3, TreeExtension.TREE_CALLED);
         Assert.assertSame(1, TreeExtension.APPLE_TREE_CALLED);
         Assert.assertSame(1, TreeExtension.CHERRY_TREE_CALLED);
+        Assert.assertSame(1, TreeExtension.APPLE_TREE_GENERIC_CALLED);
+        Assert.assertSame(1, TreeExtension.CHERRY_TREE_GENERIC_CALLED);
         
         shutDownContainer();
     }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/portable/events/extensions/TreeExtension.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/portable/events/extensions/TreeExtension.java?rev=1843975&r1=1843974&r2=1843975&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/portable/events/extensions/TreeExtension.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/portable/events/extensions/TreeExtension.java
Tue Oct 16 07:52:58 2018
@@ -23,13 +23,17 @@ import javax.enterprise.inject.spi.Exten
 import javax.enterprise.inject.spi.ProcessAnnotatedType;
 
 import org.apache.webbeans.test.portable.events.beans.Apple;
+import org.apache.webbeans.test.portable.events.beans.AppleTree;
 import org.apache.webbeans.test.portable.events.beans.Cherry;
+import org.apache.webbeans.test.portable.events.beans.CherryTree;
 import org.apache.webbeans.test.portable.events.beans.Tree;
 
 public class TreeExtension implements Extension
 {
     public static int GENERIC_CALLED = 0;
     public static int TREE_CALLED = 0;
+    public static int APPLE_TREE_GENERIC_CALLED = 0;
+    public static int CHERRY_TREE_GENERIC_CALLED = 0;
     public static int APPLE_TREE_CALLED = 0;
     public static int CHERRY_TREE_CALLED = 0;
     
@@ -37,6 +41,8 @@ public class TreeExtension implements Ex
     {
         GENERIC_CALLED = 0;
         TREE_CALLED = 0;
+        APPLE_TREE_GENERIC_CALLED = 0;
+        CHERRY_TREE_GENERIC_CALLED = 0;
         APPLE_TREE_CALLED = 0;
         CHERRY_TREE_CALLED = 0;
     }
@@ -51,12 +57,22 @@ public class TreeExtension implements Ex
         TREE_CALLED++;
     }
     
-    public void appleTree(@Observes ProcessAnnotatedType<Tree<Apple>> event)
+    public void genericAppleTree(@Observes ProcessAnnotatedType<Tree<Apple>>
event)
+    {
+        APPLE_TREE_GENERIC_CALLED++;
+    } 
+
+    public void genericCherryTree(@Observes ProcessAnnotatedType<Tree<Cherry>>
event)
+    {
+        CHERRY_TREE_GENERIC_CALLED++;
+    }
+    
+    public void appleTree(@Observes ProcessAnnotatedType<AppleTree> event)
     {
         APPLE_TREE_CALLED++;
     } 
 
-    public void cherryTree(@Observes ProcessAnnotatedType<Tree<Cherry>> event)
+    public void cherryTree(@Observes ProcessAnnotatedType<CherryTree> event)
     {
         CHERRY_TREE_CALLED++;
     } 



Mime
View raw message