[webbeans-commits] Webbeans SVN: r3573 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder and 2 other directories.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Thu Aug 20 21:46:34 EDT 2009
Author: shane.bryzak at jboss.com
Date: 2009-08-20 21:46:33 -0400 (Thu, 20 Aug 2009)
New Revision: 3573
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/FirstInterceptor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/Foo.java
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/SecondInterceptor.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/beans.xml
Log:
test for 9.4.b
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/FirstInterceptor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/FirstInterceptor.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/FirstInterceptor.java 2009-08-21 01:46:33 UTC (rev 3573)
@@ -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
+public class FirstInterceptor
+{
+ public static boolean calledFirst = false;
+
+ @AroundInvoke public Object alwaysReturnThis(InvocationContext ctx) throws Exception
+ {
+ if (!SecondInterceptor.calledFirst) calledFirst = true;
+ return ctx.proceed();
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/Foo.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/Foo.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/Foo.java 2009-08-21 01:46:33 UTC (rev 3573)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.interceptors.definition.interceptorOrder;
+
+import javax.interceptor.Interceptors;
+
+ at Interceptors({FirstInterceptor.class, SecondInterceptor.class})
+class Foo
+{
+ public void bar() {}
+}
Added: 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 (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/InterceptorOrderTest.java 2009-08-21 01:46:33 UTC (rev 3573)
@@ -0,0 +1,27 @@
+package org.jboss.jsr299.tck.tests.interceptors.definition.interceptorOrder;
+
+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 InterceptorOrderTest extends AbstractJSR299Test
+{
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "9.4", id = "b")
+ public void testInterceptorOrder()
+ {
+ FirstInterceptor.calledFirst = false;
+ SecondInterceptor.calledFirst = false;
+
+ Foo foo = getInstanceByType(Foo.class);
+ foo.bar();
+
+ assert SecondInterceptor.calledFirst;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/SecondInterceptor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/SecondInterceptor.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/SecondInterceptor.java 2009-08-21 01:46:33 UTC (rev 3573)
@@ -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
+public class SecondInterceptor
+{
+ public static boolean calledFirst = false;
+
+ @AroundInvoke public Object alwaysReturnThis(InvocationContext ctx) throws Exception
+ {
+ if (!FirstInterceptor.calledFirst) calledFirst = true;
+ return ctx.proceed();
+ }
+}
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorOrder/beans.xml 2009-08-21 01:46:33 UTC (rev 3573)
@@ -0,0 +1,6 @@
+<beans>
+ <interceptors>
+ <class>org.jboss.jsr299.tck.tests.interceptors.definition.interceptorOrder.SecondInterceptor</class>
+ <class>org.jboss.jsr299.tck.tests.interceptors.definition.interceptorOrder.FirstInterceptor</class>
+ </interceptors>
+</beans>
More information about the weld-commits
mailing list