deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject git commit: DELTASPIKE-736 unified handling of class- and method-level interceptors
Date Sat, 11 Oct 2014 23:00:48 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master 993c0565e -> 1c31a7140


DELTASPIKE-736 unified handling of class- and method-level interceptors


Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/1c31a714
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/1c31a714
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/1c31a714

Branch: refs/heads/master
Commit: 1c31a714067b1eacbdbf661e6de264941efb3400
Parents: 993c056
Author: gpetracek <gpetracek@apache.org>
Authored: Sun Oct 12 00:59:16 2014 +0200
Committer: gpetracek <gpetracek@apache.org>
Committed: Sun Oct 12 00:59:16 2014 +0200

----------------------------------------------------------------------
 .../testcontrol/impl/mock/DefaultMockFilter.java       | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/1c31a714/deltaspike/modules/test-control/impl/src/main/java/org/apache/deltaspike/testcontrol/impl/mock/DefaultMockFilter.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/test-control/impl/src/main/java/org/apache/deltaspike/testcontrol/impl/mock/DefaultMockFilter.java
b/deltaspike/modules/test-control/impl/src/main/java/org/apache/deltaspike/testcontrol/impl/mock/DefaultMockFilter.java
index 2c1ff34..7b64f15 100644
--- a/deltaspike/modules/test-control/impl/src/main/java/org/apache/deltaspike/testcontrol/impl/mock/DefaultMockFilter.java
+++ b/deltaspike/modules/test-control/impl/src/main/java/org/apache/deltaspike/testcontrol/impl/mock/DefaultMockFilter.java
@@ -22,10 +22,12 @@ import org.apache.deltaspike.testcontrol.spi.mock.MockFilter;
 
 import javax.enterprise.inject.spi.Annotated;
 import javax.enterprise.inject.spi.AnnotatedMember;
+import javax.enterprise.inject.spi.AnnotatedMethod;
 import javax.enterprise.inject.spi.AnnotatedType;
 import javax.enterprise.inject.spi.BeanManager;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Member;
+import java.util.HashSet;
 import java.util.Set;
 import java.util.logging.Logger;
 
@@ -47,8 +49,17 @@ public class DefaultMockFilter implements MockFilter
         if (annotated instanceof AnnotatedType)
         {
             origin = ((AnnotatedType)annotated).getJavaClass();
+            Set<Annotation> annotations = new HashSet<Annotation>();
+            annotations.addAll(annotated.getAnnotations());
+
+            for (AnnotatedMethod annotatedMethod :
+                (Set<javax.enterprise.inject.spi.AnnotatedMethod>)((AnnotatedType)
annotated).getMethods())
+            {
+                annotations.addAll(annotatedMethod.getAnnotations());
+            }
+
             if (isEjbOrAnnotatedTypeWithInterceptorAnnotation(
-                beanManager, annotated.getAnnotations(), origin.getName()))
+                beanManager, annotations, origin.getName()))
             {
                 return false;
             }


Mime
View raw message