[webbeans-commits] Webbeans SVN: r3575 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorNotListedInBeansXml and 2 other directories.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Thu Aug 20 22:39:30 EDT 2009
Author: shane.bryzak at jboss.com
Date: 2009-08-20 22:39:29 -0400 (Thu, 20 Aug 2009)
New Revision: 3575
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorNotListedInBeansXml/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorNotListedInBeansXml/AccountHolder.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorNotListedInBeansXml/InterceptorNotListedInBeansXmlNotEnabledTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorNotListedInBeansXml/TransactionInterceptor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorNotListedInBeansXml/Transactional.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorNotListedInBeansXml/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorNotListedInBeansXml/beans.xml
Log:
test for 9.4.a
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorNotListedInBeansXml/AccountHolder.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorNotListedInBeansXml/AccountHolder.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorNotListedInBeansXml/AccountHolder.java 2009-08-21 02:39:29 UTC (rev 3575)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.interceptors.definition.interceptorNotListedInBeansXml;
+
+class AccountHolder
+{
+ public @Transactional void transfer(double amount) {}
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorNotListedInBeansXml/InterceptorNotListedInBeansXmlNotEnabledTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorNotListedInBeansXml/InterceptorNotListedInBeansXmlNotEnabledTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorNotListedInBeansXml/InterceptorNotListedInBeansXmlNotEnabledTest.java 2009-08-21 02:39:29 UTC (rev 3575)
@@ -0,0 +1,28 @@
+package org.jboss.jsr299.tck.tests.interceptors.definition.interceptorNotListedInBeansXml;
+
+import javax.enterprise.inject.AnnotationLiteral;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+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.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+ at Artifact
+ at SpecVersion(spec="cdi", version="1.0.20090625")
+ at BeansXml("beans.xml")
+public class InterceptorNotListedInBeansXmlNotEnabledTest extends AbstractJSR299Test
+{
+ @Test
+ @SpecAssertion(section = "9.4", id = "a")
+ public void testInterceptorNotListedInBeansXmlNotInvoked()
+ {
+ TransactionInterceptor.invoked = false;
+
+ AccountHolder accountHolder = getInstanceByType(AccountHolder.class);
+ accountHolder.transfer(0);
+
+ assert !TransactionInterceptor.invoked;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorNotListedInBeansXml/TransactionInterceptor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorNotListedInBeansXml/TransactionInterceptor.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorNotListedInBeansXml/TransactionInterceptor.java 2009-08-21 02:39:29 UTC (rev 3575)
@@ -0,0 +1,17 @@
+package org.jboss.jsr299.tck.tests.interceptors.definition.interceptorNotListedInBeansXml;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+
+ at Transactional @Interceptor
+class TransactionInterceptor
+{
+ public static boolean invoked = false;
+
+ @AroundInvoke public Object alwaysReturnThis(InvocationContext ctx) throws Exception
+ {
+ invoked = true;
+ return ctx.proceed();
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorNotListedInBeansXml/Transactional.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorNotListedInBeansXml/Transactional.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorNotListedInBeansXml/Transactional.java 2009-08-21 02:39:29 UTC (rev 3575)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.interceptors.definition.interceptorNotListedInBeansXml;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+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.interceptor.InterceptorBindingType;
+
+ at Target( { TYPE, METHOD, PARAMETER, FIELD })
+ at Retention(RUNTIME)
+ at Documented
+ at InterceptorBindingType
+ at interface Transactional
+{
+
+}
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorNotListedInBeansXml/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorNotListedInBeansXml/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorNotListedInBeansXml/beans.xml 2009-08-21 02:39:29 UTC (rev 3575)
@@ -0,0 +1,5 @@
+<beans>
+ <interceptors>
+
+ </interceptors>
+</beans>
More information about the weld-commits
mailing list