[webbeans-commits] Webbeans SVN: r3564 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/interceptors/definition/broken and 2 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Wed Aug 19 22:29:17 EDT 2009


Author: shane.bryzak at jboss.com
Date: 2009-08-19 22:29:17 -0400 (Wed, 19 Aug 2009)
New Revision: 3564

Added:
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Loggable.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/SecureTransaction.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/broken/interceptorWithNoBinding/
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/broken/interceptorWithNoBinding/BrokenInterceptor.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/broken/interceptorWithNoBinding/InterceptorWithNoBindingTest.java
Modified:
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java
   tck/trunk/impl/src/main/resources/tck-audit-cdi.xml
Log:
section 9 interceptor tests


Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java	2009-08-19 22:58:34 UTC (rev 3563)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java	2009-08-20 02:29:17 UTC (rev 3564)
@@ -28,6 +28,7 @@
 import java.util.Set;
 
 import javax.enterprise.inject.AnnotationLiteral;
+import javax.enterprise.inject.spi.Bean;
 import javax.enterprise.inject.spi.InterceptionType;
 import javax.enterprise.inject.spi.Interceptor;
 
@@ -166,7 +167,10 @@
    }
    
    @Test(groups = "ri-broken")
-   @SpecAssertion(section = "7.2", id = "a")
+   @SpecAssertions({
+     @SpecAssertion(section = "7.2", id = "a"),
+     @SpecAssertion(section = "9.2", id = "a")
+   })
    public void testManagedBeanIsIntercepted()
    {
       MissileInterceptor.intercepted = false;
@@ -216,4 +220,15 @@
       assert elements.contains(ElementType.TYPE);
       assert elements.contains(ElementType.METHOD);          
    }
+   
+   @Test(groups = "ri-broken")
+   @SpecAssertions({
+      @SpecAssertion(section = "9.1.2", id = "a"),
+      @SpecAssertion(section = "9.1.2", id = "b")
+   })
+   public void testStereotypeInterceptorBindings()
+   {      
+      Bean<SecureTransaction> bean = getBeans(SecureTransaction.class).iterator().next();
+      assert bean.getBindings().contains(Logged.class);            
+   }   
 }

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Loggable.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Loggable.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Loggable.java	2009-08-20 02:29:17 UTC (rev 3564)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.tests.interceptors.definition;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.stereotype.Stereotype;
+
+ at Target( { TYPE, METHOD })
+ at Retention(RUNTIME)
+ at Documented
+ at Stereotype
+ at Logged
+ at interface Loggable {
+
+}

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/SecureTransaction.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/SecureTransaction.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/SecureTransaction.java	2009-08-20 02:29:17 UTC (rev 3564)
@@ -0,0 +1,7 @@
+package org.jboss.jsr299.tck.tests.interceptors.definition;
+
+ at Loggable
+class SecureTransaction
+{
+
+}

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/broken/interceptorWithNoBinding/BrokenInterceptor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/broken/interceptorWithNoBinding/BrokenInterceptor.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/broken/interceptorWithNoBinding/BrokenInterceptor.java	2009-08-20 02:29:17 UTC (rev 3564)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.interceptors.definition.broken.interceptorWithNoBinding;
+
+import javax.interceptor.Interceptor;
+
+ at Interceptor
+class BrokenInterceptor
+{
+
+}

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/broken/interceptorWithNoBinding/InterceptorWithNoBindingTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/broken/interceptorWithNoBinding/InterceptorWithNoBindingTest.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/broken/interceptorWithNoBinding/InterceptorWithNoBindingTest.java	2009-08-20 02:29:17 UTC (rev 3564)
@@ -0,0 +1,26 @@
+package org.jboss.jsr299.tck.tests.interceptors.definition.broken.interceptorWithNoBinding;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DeploymentError;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecVersion;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+/**
+ * 
+ * @author Shane Bryzak
+ */
+ at Artifact
+ at ExpectedDeploymentException(DeploymentError.class)
+ at SpecVersion(spec="cdi", version="1.0.20090625")
+public class InterceptorWithNoBindingTest extends AbstractJSR299Test
+{
+   @Test(groups = "ri-broken")
+   @SpecAssertion(section = "9.2", id = "c")
+   public void testInterceptorWithNoBindingNotOk()
+   {
+      
+   }
+}

Modified: tck/trunk/impl/src/main/resources/tck-audit-cdi.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit-cdi.xml	2009-08-19 22:58:34 UTC (rev 3563)
+++ tck/trunk/impl/src/main/resources/tck-audit-cdi.xml	2009-08-20 02:29:17 UTC (rev 3564)
@@ -3932,8 +3932,9 @@
       <text>Interceptor bindings are transitive�an interceptor binding declared by an interceptor binding type is inherited by all beans and other interceptor binding types that declare that interceptor binding type.</text>
     </assertion>
 
-    <assertion id="c">
-      <text>Interceptor binding types declared |@Target(TYPE)| may not be applied to interceptor binding types declared |@Target({TYPE, METHOD})|.</text>
+    <assertion id="c" testable="false">
+      <text>Interceptor binding types declared |@Target(TYPE)| may not be applied to interceptor binding types declared |@Target({TYPE, METHOD})|.</text>
+      <note>The behaviour here is undefined.</note>
     </assertion>
   </section>
 
@@ -3946,8 +3947,9 @@
       <text>An interceptor binding declared by a stereotype are inherited by any bean that declares that stereotype.</text>
     </assertion>
 
-    <assertion id="c">
-      <text>If a stereotype declares interceptor bindings, it must be defined as |@Target(TYPE)|.</text>
+    <assertion id="c" testable="false">
+      <text>If a stereotype declares interceptor bindings, it must be defined as |@Target(TYPE)|.</text>
+      <note>The behaviour here is undefined.</note>
     </assertion>
   </section>
 




More information about the weld-commits mailing list