[webbeans-commits] Webbeans SVN: r3571 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition: broken/invalidLifecycleInterceptor and 1 other directories.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Thu Aug 20 21:16:10 EDT 2009
Author: shane.bryzak at jboss.com
Date: 2009-08-20 21:16:10 -0400 (Thu, 20 Aug 2009)
New Revision: 3571
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorCalledBeforeDecorator/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorCalledBeforeDecorator/Foo.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorCalledBeforeDecorator/FooDecorator.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorCalledBeforeDecorator/InterceptorCalledBeforeDecoratorTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorCalledBeforeDecorator/TransactionInterceptor.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Secure.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Transactional.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/broken/invalidLifecycleInterceptor/Transactional.java
Log:
test for 9.4.g
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Secure.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Secure.java 2009-08-20 23:25:19 UTC (rev 3570)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Secure.java 2009-08-21 01:16:10 UTC (rev 3571)
@@ -10,12 +10,12 @@
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
-import javax.enterprise.inject.BindingType;
+import javax.interceptor.InterceptorBindingType;
@Target( { TYPE, METHOD, PARAMETER, FIELD })
@Retention(RUNTIME)
@Documented
- at BindingType
+ at InterceptorBindingType
@interface Secure
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Transactional.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Transactional.java 2009-08-20 23:25:19 UTC (rev 3570)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Transactional.java 2009-08-21 01:16:10 UTC (rev 3571)
@@ -10,12 +10,12 @@
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
-import javax.enterprise.inject.BindingType;
+import javax.interceptor.InterceptorBindingType;
@Target( { TYPE, METHOD, PARAMETER, FIELD })
@Retention(RUNTIME)
@Documented
- at BindingType
+ at InterceptorBindingType
@interface Transactional
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/broken/invalidLifecycleInterceptor/Transactional.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/broken/invalidLifecycleInterceptor/Transactional.java 2009-08-20 23:25:19 UTC (rev 3570)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/broken/invalidLifecycleInterceptor/Transactional.java 2009-08-21 01:16:10 UTC (rev 3571)
@@ -8,12 +8,12 @@
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
-import javax.enterprise.inject.BindingType;
+import javax.interceptor.InterceptorBindingType;
@Target( { TYPE, METHOD })
@Retention(RUNTIME)
@Documented
- at BindingType
+ at InterceptorBindingType
@interface Transactional
{
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorCalledBeforeDecorator/Foo.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorCalledBeforeDecorator/Foo.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorCalledBeforeDecorator/Foo.java 2009-08-21 01:16:10 UTC (rev 3571)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.interceptors.definition.interceptorCalledBeforeDecorator;
+
+import javax.interceptor.Interceptors;
+
+ at Interceptors(TransactionInterceptor.class)
+class Foo
+{
+ public static boolean interceptorCalledFirst;
+ public static boolean decoratorCalledFirst;
+
+ public void bar() {}
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorCalledBeforeDecorator/FooDecorator.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorCalledBeforeDecorator/FooDecorator.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorCalledBeforeDecorator/FooDecorator.java 2009-08-21 01:16:10 UTC (rev 3571)
@@ -0,0 +1,17 @@
+package org.jboss.jsr299.tck.tests.interceptors.definition.interceptorCalledBeforeDecorator;
+
+import javax.decorator.Decorates;
+import javax.decorator.Decorator;
+
+ at Decorator
+class FooDecorator
+{
+ @Decorates Foo delegate;
+
+ public void bar()
+ {
+ if (!Foo.interceptorCalledFirst) Foo.decoratorCalledFirst = true;
+
+ delegate.bar();
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorCalledBeforeDecorator/InterceptorCalledBeforeDecoratorTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorCalledBeforeDecorator/InterceptorCalledBeforeDecoratorTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorCalledBeforeDecorator/InterceptorCalledBeforeDecoratorTest.java 2009-08-21 01:16:10 UTC (rev 3571)
@@ -0,0 +1,25 @@
+package org.jboss.jsr299.tck.tests.interceptors.definition.interceptorCalledBeforeDecorator;
+
+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.testng.annotations.Test;
+
+ at Artifact
+ at SpecVersion(spec="cdi", version="1.0.20090625")
+public class InterceptorCalledBeforeDecoratorTest extends AbstractJSR299Test
+{
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "9.4", id = "g")
+ public void testInterceptorCalledBeforeDecorator()
+ {
+ Foo.interceptorCalledFirst = false;
+ Foo.decoratorCalledFirst = false;
+
+ Foo foo = getInstanceByType(Foo.class);
+ foo.bar();
+
+ assert Foo.interceptorCalledFirst;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorCalledBeforeDecorator/TransactionInterceptor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorCalledBeforeDecorator/TransactionInterceptor.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/interceptorCalledBeforeDecorator/TransactionInterceptor.java 2009-08-21 01:16:10 UTC (rev 3571)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.interceptors.definition.interceptorCalledBeforeDecorator;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+
+ at Interceptor
+public class TransactionInterceptor
+{
+ @AroundInvoke public Object alwaysReturnThis(InvocationContext ctx) throws Exception
+ {
+ if (!Foo.decoratorCalledFirst) Foo.interceptorCalledFirst = true;
+
+ return ctx.proceed();
+ }
+}
More information about the weld-commits
mailing list