[webbeans-commits] Webbeans SVN: r3584 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Sun Aug 23 20:07:25 EDT 2009
Author: shane.bryzak at jboss.com
Date: 2009-08-23 20:07:24 -0400 (Sun, 23 Aug 2009)
New Revision: 3584
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/AccountTransaction.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Transactional.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/TransactionalInterceptor.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java
Log:
test for 6.4.1.aa
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/AccountTransaction.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/AccountTransaction.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/AccountTransaction.java 2009-08-24 00:07:24 UTC (rev 3584)
@@ -0,0 +1,7 @@
+package org.jboss.jsr299.tck.tests.context.dependent;
+
+ at Transactional
+class AccountTransaction
+{
+ public void execute() {}
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java 2009-08-23 23:48:48 UTC (rev 3583)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java 2009-08-24 00:07:24 UTC (rev 3584)
@@ -397,4 +397,24 @@
roomBean.destroy(room, roomCreationalContext);
assert InteriorDecorator.isDestroyed();
}
+
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "6.4.1", id = "aa")
+ public void testDependentScopedInterceptorsAreDependentObjectsOfBean()
+ {
+ TransactionalInterceptor.destroyed = false;
+ TransactionalInterceptor.intercepted = false;
+
+ Bean<AccountTransaction> bean = getBeans(AccountTransaction.class).iterator().next();
+ CreationalContext<AccountTransaction> ctx = getCurrentManager().createCreationalContext(bean);
+
+ AccountTransaction trans = bean.create(ctx);
+ trans.execute();
+
+ assert TransactionalInterceptor.intercepted = true;
+
+ bean.destroy(trans, ctx);
+
+ assert TransactionalInterceptor.destroyed;
+ }
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Transactional.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Transactional.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Transactional.java 2009-08-24 00:07:24 UTC (rev 3584)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.context.dependent;
+
+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/context/dependent/TransactionalInterceptor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/TransactionalInterceptor.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/TransactionalInterceptor.java 2009-08-24 00:07:24 UTC (rev 3584)
@@ -0,0 +1,25 @@
+package org.jboss.jsr299.tck.tests.context.dependent;
+
+import javax.annotation.PreDestroy;
+import javax.enterprise.context.Dependent;
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+
+ at Dependent @Transactional @Interceptor
+class TransactionalInterceptor
+{
+ public static boolean destroyed = false;
+ public static boolean intercepted = false;
+
+ @AroundInvoke public Object alwaysReturnThis(InvocationContext ctx) throws Exception
+ {
+ intercepted = true;
+ return ctx.proceed();
+ }
+
+ @PreDestroy public void destroy()
+ {
+ destroyed = true;
+ }
+}
More information about the weld-commits
mailing list