[webbeans-commits] Webbeans SVN: r3583 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition: interceptorOrder and 1 other directory.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Sun Aug 23 19:48:48 EDT 2009
Author: shane.bryzak at jboss.com
Date: 2009-08-23 19:48:48 -0400 (Sun, 23 Aug 2009)
New Revision: 3583
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/AccountTransaction.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/AnotherInterceptor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/Transactional.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/TransactionalInterceptor.java
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/interceptorOrder/InterceptorOrderTest.java
Log:
test for 9.4.f
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-22 05:11:05 UTC (rev 3582)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java 2009-08-23 23:48:48 UTC (rev 3583)
@@ -234,7 +234,10 @@
}
@Test(groups = "ri-broken")
- @SpecAssertion(section = "9.1.1", id = "a")
+ @SpecAssertions({
+ @SpecAssertion(section = "9.1.1", id = "a"),
+ @SpecAssertion(section = "9.1.1", id = "b")
+ })
public void testInterceptorBindingsCanDeclareOtherInterceptorBindings()
{
AtomicInterceptor.intercepted = false;
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/AccountTransaction.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/AccountTransaction.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/AccountTransaction.java 2009-08-23 23:48:48 UTC (rev 3583)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.tests.interceptors.definition.interceptorOrder;
+
+import javax.interceptor.Interceptors;
+
+ at Transactional
+ at Interceptors(AnotherInterceptor.class)
+class AccountTransaction
+{
+ public void execute() {}
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/AnotherInterceptor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/AnotherInterceptor.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/AnotherInterceptor.java 2009-08-23 23:48:48 UTC (rev 3583)
@@ -0,0 +1,17 @@
+package org.jboss.jsr299.tck.tests.interceptors.definition.interceptorOrder;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+
+ at Interceptor
+class AnotherInterceptor
+{
+ public static boolean first = false;
+
+ @AroundInvoke public Object alwaysReturnThis(InvocationContext ctx) throws Exception
+ {
+ if (!TransactionalInterceptor.first) first = true;
+ return ctx.proceed();
+ }
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/InterceptorOrderTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/InterceptorOrderTest.java 2009-08-22 05:11:05 UTC (rev 3582)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/InterceptorOrderTest.java 2009-08-23 23:48:48 UTC (rev 3583)
@@ -18,7 +18,7 @@
@SpecAssertion(section = "9.4", id = "b"),
@SpecAssertion(section = "9.5", id = "ea")
})
- public void testInterceptorOrder()
+ public void testInterceptorsCalledInOrderDefinedByBeansXml()
{
FirstInterceptor.calledFirst = false;
SecondInterceptor.calledFirst = false;
@@ -28,4 +28,17 @@
assert SecondInterceptor.calledFirst;
}
+
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "9.4", id = "f")
+ public void testInterceptorsDeclaredUsingInterceptorsCalledBeforeInterceptorBinding()
+ {
+ TransactionalInterceptor.first = false;
+ AnotherInterceptor.first = false;
+
+ AccountTransaction transaction = getInstanceByType(AccountTransaction.class);
+ transaction.execute();
+
+ assert AnotherInterceptor.first;
+ }
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/Transactional.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/Transactional.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/Transactional.java 2009-08-23 23:48:48 UTC (rev 3583)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.interceptors.definition.interceptorOrder;
+
+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/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/TransactionalInterceptor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/TransactionalInterceptor.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/TransactionalInterceptor.java 2009-08-23 23:48:48 UTC (rev 3583)
@@ -0,0 +1,18 @@
+package org.jboss.jsr299.tck.tests.interceptors.definition.interceptorOrder;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+
+ at Transactional @Interceptor
+class TransactionalInterceptor
+{
+ public static boolean first = false;
+
+ @AroundInvoke public Object alwaysReturnThis(InvocationContext ctx) throws Exception
+ {
+ if (!AnotherInterceptor.first) first = true;
+ return ctx.proceed();
+ }
+
+}
More information about the weld-commits
mailing list