[weld-commits] Weld SVN: r4860 - in cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests: lifecycleCallback and 1 other directory.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Mon Nov 9 08:03:38 EST 2009


Author: jharting
Date: 2009-11-09 08:03:37 -0500 (Mon, 09 Nov 2009)
New Revision: 4860

Added:
   cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/invocationContext/LifecycleCallbackInterceptor.java
Modified:
   cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/invocationContext/InvocationContextTest.java
   cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/invocationContext/SimpleBean.java
   cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/LifecycleCallbackInterceptorTest.java
Log:
Removed ri-broken flags, added test for InvocationContext

Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/invocationContext/InvocationContextTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/invocationContext/InvocationContextTest.java	2009-11-09 12:38:09 UTC (rev 4859)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/invocationContext/InvocationContextTest.java	2009-11-09 13:03:37 UTC (rev 4860)
@@ -52,34 +52,39 @@
 
    @Test
    @SpecAssertion(section = "6", id = "g")
-   public void testGetMethodMethod()
+   public void testGetMethodForAroundInvokeInterceptorMethod()
    {
       assert getInstanceByType(SimpleBean.class).testGetMethod();
    }
+   
+   @Test
+   @SpecAssertion(section = "6", id = "h")
+   public void testGetMethodForLifecycleCallbackInterceptorMethod()
+   {
+      getInstanceByType(SimpleBean.class);
+      assert LifecycleCallbackInterceptor.isGetMethodReturnsNull();
+   }
 
-   @Test(groups = "ri-broken")
+   @Test
    @SpecAssertions( { 
       @SpecAssertion(section = "6", id = "i"), 
       @SpecAssertion(section = "6", id = "j"), 
       @SpecAssertion(section = "6", id = "k")
    })
-   // WELD-275
    public void testMethodParameters()
    {
       assert getInstanceByType(SimpleBean.class).add(1, 2) == 5;
    }
 
-   @Test(expectedExceptions = IllegalArgumentException.class, groups = "ri-broken")
+   @Test(expectedExceptions = IllegalArgumentException.class)
    @SpecAssertion(section = "6", id = "la")
-   // WELD-275
    public void testIllegalNumberOfParameters()
    {
       getInstanceByType(SimpleBean.class).add2(1, 1);
    }
 
-   @Test(expectedExceptions = IllegalArgumentException.class, groups = "ri-broken")
+   @Test(expectedExceptions = IllegalArgumentException.class)
    @SpecAssertion(section = "6", id = "lb")
-   // WELD-275
    public void testIllegalTypeOfParameters()
    {
       assert getInstanceByType(SimpleBean.class).add3(1, 1) == 2;

Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/invocationContext/LifecycleCallbackInterceptor.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/invocationContext/LifecycleCallbackInterceptor.java	                        (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/invocationContext/LifecycleCallbackInterceptor.java	2009-11-09 13:03:37 UTC (rev 4860)
@@ -0,0 +1,27 @@
+package org.jboss.jsr299.tck.interceptors.tests.invocationContext;
+
+import javax.annotation.PostConstruct;
+import javax.interceptor.InvocationContext;
+
+class LifecycleCallbackInterceptor
+{
+   private static boolean getMethodReturnsNull = false;
+
+   @PostConstruct
+   public void postConstruct(InvocationContext ctx)
+   {
+      getMethodReturnsNull = ctx.getMethod() == null;
+      try
+      {
+         ctx.proceed();
+      }
+      catch (Exception e)
+      {
+      }
+   }
+
+   public static boolean isGetMethodReturnsNull()
+   {
+      return getMethodReturnsNull;
+   }
+}

Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/invocationContext/SimpleBean.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/invocationContext/SimpleBean.java	2009-11-09 12:38:09 UTC (rev 4859)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/invocationContext/SimpleBean.java	2009-11-09 13:03:37 UTC (rev 4860)
@@ -2,6 +2,7 @@
 
 import javax.interceptor.Interceptors;
 
+ at Interceptors(LifecycleCallbackInterceptor.class)
 class SimpleBean
 {
    private int id = 0;
@@ -57,9 +58,10 @@
    public void foo()
    {
    }
-   
+
    @Interceptors(Interceptor10.class)
-   public String echo(String s) {
+   public String echo(String s)
+   {
       echoCalled = true;
       return s;
    }

Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/LifecycleCallbackInterceptorTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/LifecycleCallbackInterceptorTest.java	2009-11-09 12:38:09 UTC (rev 4859)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/LifecycleCallbackInterceptorTest.java	2009-11-09 13:03:37 UTC (rev 4860)
@@ -38,9 +38,8 @@
       assert GoatInterceptor.isPostConstructInterceptorCalled();
    }
    
-   @Test(groups = "ri-broken")
+   @Test
    @SpecAssertion(section = "5", id = "a")
-   // WELD-279
    public void testPreDestroyInterceptor()
    {
       // create the instance



More information about the weld-commits mailing list