[jboss-cvs] JBossAS SVN: r66036 - in projects/aop/trunk/aop/src: test/org/jboss/test/aop/annotatedAdviceParams and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Oct 11 13:02:40 EDT 2007


Author: flavia.rainone at jboss.com
Date: 2007-10-11 13:02:39 -0400 (Thu, 11 Oct 2007)
New Revision: 66036

Added:
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotatedAdviceParams/ReturnAspectGenerics.java
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotatedAdviceParams/ReturnInvalidJDK50TestCase.java
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotatedAdviceParams/ReturnJDK50TestCase.java
Modified:
   projects/aop/trunk/aop/src/resources/test/annotatedAdviceParams/jboss-aop.xml
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotatedAdviceParams/ReturnAspect.java
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotatedAdviceParams/ReturnInvalidPOJO.java
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotatedAdviceParams/ReturnPOJO.java
   projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotatedAdviceParams/ReturnTestCase.java
Log:
[JBAOP-472] Added method return type tests.

Modified: projects/aop/trunk/aop/src/resources/test/annotatedAdviceParams/jboss-aop.xml
===================================================================
--- projects/aop/trunk/aop/src/resources/test/annotatedAdviceParams/jboss-aop.xml	2007-10-11 16:59:37 UTC (rev 66035)
+++ projects/aop/trunk/aop/src/resources/test/annotatedAdviceParams/jboss-aop.xml	2007-10-11 17:02:39 UTC (rev 66036)
@@ -1105,6 +1105,86 @@
       <finally name="finally13" aspect="org.jboss.test.aop.annotatedAdviceParams.ReturnAspect"/>
 	</bind>
    
+   <aspect class="org.jboss.test.aop.annotatedAdviceParams.ReturnAspectGenerics" scope="PER_VM"/>
+
+   <bind pointcut="execution(java.util.List org.jboss.test.aop.annotatedAdviceParams.ReturnPOJO->*(..))">
+      <around name="around3" aspect="org.jboss.test.aop.annotatedAdviceParams.ReturnAspectGenerics"/>
+      <around name="around6" aspect="org.jboss.test.aop.annotatedAdviceParams.ReturnAspectGenerics"/>
+      <after name="after1" aspect="org.jboss.test.aop.annotatedAdviceParams.ReturnAspectGenerics"/>
+      <after name="after2" aspect="org.jboss.test.aop.annotatedAdviceParams.ReturnAspectGenerics"/>
+      <after name="after3" aspect="org.jboss.test.aop.annotatedAdviceParams.ReturnAspectGenerics"/>
+      <after name="after4" aspect="org.jboss.test.aop.annotatedAdviceParams.ReturnAspectGenerics"/>
+      <after name="after6" aspect="org.jboss.test.aop.annotatedAdviceParams.ReturnAspectGenerics"/>
+      <after name="after9" aspect="org.jboss.test.aop.annotatedAdviceParams.ReturnAspectGenerics"/>
+      <after name="after10" aspect="org.jboss.test.aop.annotatedAdviceParams.ReturnAspectGenerics"/>
+      <finally name="finally1" aspect="org.jboss.test.aop.annotatedAdviceParams.ReturnAspectGenerics"/>
+      <finally name="finally2" aspect="org.jboss.test.aop.annotatedAdviceParams.ReturnAspectGenerics"/>
+      <finally name="finally3" aspect="org.jboss.test.aop.annotatedAdviceParams.ReturnAspectGenerics"/>
+      <finally name="finally4" aspect="org.jboss.test.aop.annotatedAdviceParams.ReturnAspectGenerics"/>
+      <finally name="finally6" aspect="org.jboss.test.aop.annotatedAdviceParams.ReturnAspectGenerics"/>
+      <finally name="finally11" aspect="org.jboss.test.aop.annotatedAdviceParams.ReturnAspectGenerics"/>
+   </bind>
+   
+   <bind pointcut="execution(java.util.List org.jboss.test.aop.annotatedAdviceParams.ReturnInvalidPOJO->*Around1(..))">
+      <around name="around1" aspect="org.jboss.test.aop.annotatedAdviceParams.ReturnAspectGenerics"/>
+   </bind>
+   
+   <bind pointcut="execution(java.util.List org.jboss.test.aop.annotatedAdviceParams.ReturnInvalidPOJO->*Around2(..))">
+      <around name="around2" aspect="org.jboss.test.aop.annotatedAdviceParams.ReturnAspectGenerics"/>
+   </bind>
+   
+   <bind pointcut="execution(java.util.List org.jboss.test.aop.annotatedAdviceParams.ReturnInvalidPOJO->*Around4(..))">
+      <around name="around4" aspect="org.jboss.test.aop.annotatedAdviceParams.ReturnAspectGenerics"/>
+   </bind>
+   
+   <bind pointcut="execution(java.util.List org.jboss.test.aop.annotatedAdviceParams.ReturnInvalidPOJO->*Around5(..))">
+      <around name="around5" aspect="org.jboss.test.aop.annotatedAdviceParams.ReturnAspectGenerics"/>
+   </bind>
+   
+   <bind pointcut="execution(java.util.List org.jboss.test.aop.annotatedAdviceParams.ReturnInvalidPOJO->*Around6(..))">
+      <around name="around6" aspect="org.jboss.test.aop.annotatedAdviceParams.ReturnAspectGenerics"/>
+   </bind>
+   
+   <bind pointcut="execution(java.util.List org.jboss.test.aop.annotatedAdviceParams.ReturnInvalidPOJO->*Around7(..))">
+      <around name="around7" aspect="org.jboss.test.aop.annotatedAdviceParams.ReturnAspectGenerics"/>
+   </bind>
+   
+   <bind pointcut="execution(java.util.List org.jboss.test.aop.annotatedAdviceParams.ReturnInvalidPOJO->*Around8(..))">
+      <around name="around8" aspect="org.jboss.test.aop.annotatedAdviceParams.ReturnAspectGenerics"/>
+   </bind>
+   
+   <bind pointcut="execution(java.util.List org.jboss.test.aop.annotatedAdviceParams.ReturnInvalidPOJO->*After5(..))">
+      <after name="after5" aspect="org.jboss.test.aop.annotatedAdviceParams.ReturnAspectGenerics"/>
+   </bind>
+   
+   <bind pointcut="execution(java.util.List org.jboss.test.aop.annotatedAdviceParams.ReturnInvalidPOJO->*After7(..))">
+      <after name="after7" aspect="org.jboss.test.aop.annotatedAdviceParams.ReturnAspectGenerics"/>
+   </bind>
+   
+   <bind pointcut="execution(java.util.List org.jboss.test.aop.annotatedAdviceParams.ReturnInvalidPOJO->*After8(..))">
+      <after name="after8" aspect="org.jboss.test.aop.annotatedAdviceParams.ReturnAspectGenerics"/>
+   </bind>
+   
+   <bind pointcut="execution(java.util.List org.jboss.test.aop.annotatedAdviceParams.ReturnInvalidPOJO->*Finally5(..))">
+      <after name="finally5" aspect="org.jboss.test.aop.annotatedAdviceParams.ReturnAspectGenerics"/>
+   </bind>
+   
+   <bind pointcut="execution(java.util.List org.jboss.test.aop.annotatedAdviceParams.ReturnInvalidPOJO->*Finally7(..))">
+      <after name="finally7" aspect="org.jboss.test.aop.annotatedAdviceParams.ReturnAspectGenerics"/>
+   </bind>
+   
+   <bind pointcut="execution(java.util.List org.jboss.test.aop.annotatedAdviceParams.ReturnInvalidPOJO->*Finally8(..))">
+      <after name="finally8" aspect="org.jboss.test.aop.annotatedAdviceParams.ReturnAspectGenerics"/>
+   </bind>
+   
+   <bind pointcut="execution(java.util.List org.jboss.test.aop.annotatedAdviceParams.ReturnInvalidPOJO->*Finally9(..))">
+      <after name="finally9" aspect="org.jboss.test.aop.annotatedAdviceParams.ReturnAspectGenerics"/>
+   </bind>
+   
+   <bind pointcut="execution(java.util.List org.jboss.test.aop.annotatedAdviceParams.ReturnInvalidPOJO->*Finally10(..))">
+      <after name="finally10" aspect="org.jboss.test.aop.annotatedAdviceParams.ReturnAspectGenerics"/>
+   </bind>
+   
    <!-- @Target test -->
 	<aspect class="org.jboss.test.aop.annotatedAdviceParams.TargetAspect" scope="PER_VM"/>
 

Modified: projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotatedAdviceParams/ReturnAspect.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotatedAdviceParams/ReturnAspect.java	2007-10-11 16:59:37 UTC (rev 66035)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotatedAdviceParams/ReturnAspect.java	2007-10-11 17:02:39 UTC (rev 66036)
@@ -298,6 +298,7 @@
    
    public SubValue finally13()
    {
+      finallyAdvice = "finally13";
       return new SubValue(13);
    }
 }
\ No newline at end of file

Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotatedAdviceParams/ReturnAspectGenerics.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotatedAdviceParams/ReturnAspectGenerics.java	                        (rev 0)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotatedAdviceParams/ReturnAspectGenerics.java	2007-10-11 17:02:39 UTC (rev 66036)
@@ -0,0 +1,240 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.aop.annotatedAdviceParams;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+
+import junit.framework.Assert;
+
+import org.jboss.aop.advice.annotation.Return;
+import org.jboss.aop.advice.annotation.Thrown;
+import org.jboss.aop.joinpoint.CurrentInvocation;
+
+/**
+ * Aspect used on @Return parameter tests that involve generic return types.
+ * 
+ * @author <a href="flavia.rainone at jboss.com">Flavia Rainone</a>
+ * @see org.jboss.test.aop.annotatedAdviceParams.ArgAspect
+ * @see org.jboss.test.aop.annotatedAdviceParams.ArgAspetInterfaces
+ */
+public class ReturnAspectGenerics
+{
+   static boolean around3 = false;
+   static boolean around6 = false;
+   
+   static boolean after1 = false;
+   static boolean after2 = false;
+   static boolean after3 = false;
+   static boolean after4 = false;
+   static boolean after6 = false;
+   static boolean after9 = false;
+   static boolean after10 = false;
+
+   static boolean finally1 = false;
+   static boolean finally2 = false;
+   static boolean finally3 = false;
+   static boolean finally4 = false;
+   static boolean finally6 = false;
+   static boolean finally11 = false;
+      
+   public static void clear()
+   {
+      around3 = false;
+      around6 = false;
+      
+      after1 = false;
+      after2 = false;
+      after3 = false;
+      after4 = false;
+      after6 = false;
+      after9 = false;
+      after10 = false;
+      
+      finally1 = false;
+      finally2 = false;
+      finally3 = false;
+      finally4 = false;
+      finally6 = false;
+      finally11 = false;
+   }
+   
+   public Collection<SuperValue> around1() throws Throwable
+   {
+      Assert.fail("This advice should never be executed");
+      return null;
+   }
+   
+   public Collection around2() throws Throwable
+   {
+      Assert.fail("This advice should never be executed");
+      return null;
+   }
+   
+   public List<SuperValue> around3() throws Throwable
+   {
+      around3 = true;
+      return (List<SuperValue>) CurrentInvocation.proceed();
+   }
+   
+   public List<? extends Object> around4() throws Throwable
+   {
+      Assert.fail("This advice should never be executed");
+      return null;
+   }
+   
+   public List<Interface> around5() throws Throwable
+   {
+      Assert.fail("This advice should never be executed");
+      return null;
+   }
+   
+   public List around6() throws Throwable
+   {
+      around6 = true;
+      return (List) CurrentInvocation.proceed();
+   }
+   
+   public ArrayList<Object> around7() throws Throwable
+   {
+      Assert.fail("This advice should never be executed");
+      return null;
+   }
+   
+   public Set<Object> around8() throws Throwable
+   {
+      Assert.fail("This advice should never be executed");
+      return null;
+   }
+   
+   public void after1(@Return List<SuperValue> arg)
+   {
+      after1 = true;
+   }
+   
+   public <A> void after2(@Return List<A> arg)
+   {
+      after2 = true;
+   }
+   
+   public void after3(@Return List arg)
+   {
+      after3 = true;
+   }
+   
+   public void after4(@Return Collection<SuperValue> arg)
+   {
+      after4 = true;
+   }
+   
+   public void after5(@Return Collection<Object> arg)
+   {
+      Assert.fail("This advice should never be executed");
+   }
+   
+   public void after6(@Return Collection arg)
+   {
+      after6 = true;
+   }
+   
+   public void after7(@Return ArrayList<SubValue> arg)
+   {
+      Assert.fail("This advice should never be executed");
+   }
+   
+   public void after8(@Return Set<SubValue> arg)
+   {
+      Assert.fail("This advice should never be executed");
+   }
+   
+   public ArrayList<SuperValue> after9()
+   {
+      after9 = true;
+      return null;
+   }
+   
+   public List<SuperValue> after10()
+   {
+      after10 = true;
+      return null;
+   }
+   
+   public void finally1(@Return List<SuperValue> arg, @Thrown Throwable thrown)
+   {
+      finally1 = true;
+   }
+   
+   public <A extends Object> void finally2(@Return List<A> arg, @Thrown Throwable thrown)
+   {
+      finally2 = true;
+   }
+   
+   public void finally3(@Return List arg, @Thrown Throwable thrown)
+   {
+      finally3 = true;
+   }
+   
+   public void finally4(@Return Collection<SuperValue> arg, @Thrown Throwable thrown)
+   {
+      finally4 = true;
+   }
+   
+   public void finally5(@Return Collection<Interface> arg, @Thrown Throwable thrown)
+   {
+      Assert.fail("This advice should never be executed");
+   }
+   
+   public void finally6(@Return Collection arg, @Thrown Throwable thrown)
+   {
+      finally6 = true;
+   }
+   
+   public void finally7(@Return ArrayList arg, @Thrown Throwable thrown)
+   {
+      Assert.fail("This advice should never be executed");
+   }
+   
+   public void finally8(@Return Set arg, @Thrown Throwable thrown)
+   {
+      Assert.fail("This advice should never be executed");
+   }
+   
+   public List<?> finally9()
+   {
+      Assert.fail("This advice should never be executed");
+      return null;
+   }
+   
+   public ArrayList<?> finally10()
+   {
+      Assert.fail("This advice should never be executed");
+      return null;
+   }
+   
+   public ArrayList<SuperValue> finally11()
+   {
+      finally11 = true;
+      return null;
+   }
+}
\ No newline at end of file

Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotatedAdviceParams/ReturnInvalidJDK50TestCase.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotatedAdviceParams/ReturnInvalidJDK50TestCase.java	                        (rev 0)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotatedAdviceParams/ReturnInvalidJDK50TestCase.java	2007-10-11 17:02:39 UTC (rev 66036)
@@ -0,0 +1,221 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.aop.annotatedAdviceParams;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+import org.jboss.aop.advice.NoMatchingAdviceException;
+import org.jboss.test.aop.AOPTestWithSetup;
+
+/**
+ * Tests that have been temporarily removed from {@link ReturnInvalidTestCase} (task
+ * JBAOP-458)
+ * 
+ * @author <a href="flavia.rainone at jboss.com">Flavia Rainone</a>
+ */
+public class ReturnInvalidJDK50TestCase extends AOPTestWithSetup
+{
+   private ReturnInvalidPOJO pojo;
+   
+   public static void main(String[] args)
+   {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite()
+   {
+      TestSuite suite = new TestSuite("ReturnTestCase");
+      suite.addTestSuite(ReturnInvalidJDK50TestCase.class);
+      return suite;
+   }
+   
+   public ReturnInvalidJDK50TestCase(String name)
+   {
+      super(name);
+   }
+   
+   public void setUp() throws Exception
+   {
+      super.setUp();
+      ReturnAspectGenerics.clear();
+      this.pojo = new ReturnInvalidPOJO();
+   }
+   
+   public void testGenerics()
+   {
+      boolean thrown = false;
+      try
+      {
+         pojo.methodGenericsAround1();
+      }
+      catch (NoMatchingAdviceException e)
+      {
+         thrown = true;
+      }
+      assertTrue(thrown);
+
+      thrown = false;
+      try
+      {
+         pojo.methodGenericsAround2();
+      }
+      catch (NoMatchingAdviceException e)
+      {
+         thrown = true;
+      }
+      assertTrue(thrown);
+
+      thrown = false;
+      try
+      {
+         pojo.methodGenericsAround4();
+      }
+      catch (NoMatchingAdviceException e)
+      {
+         thrown = true;
+      }
+      assertTrue(thrown);
+
+      thrown = false;
+      try
+      {
+         pojo.methodGenericsAround5();
+      }
+      catch (NoMatchingAdviceException e)
+      {
+         thrown = true;
+      }
+      assertTrue(thrown);
+
+      thrown = false;
+      try
+      {
+         pojo.methodGenericsAround7();
+      }
+      catch (NoMatchingAdviceException e)
+      {
+         thrown = true;
+      }
+      assertTrue(thrown);
+
+      thrown = false;
+      try
+      {
+         pojo.methodGenericsAround8();
+      }
+      catch (NoMatchingAdviceException e)
+      {
+         thrown = true;
+      }
+      assertTrue(thrown);
+
+      thrown = false;
+      try
+      {
+         pojo.methodGenericsAfter5();
+      }
+      catch (NoMatchingAdviceException e)
+      {
+         thrown = true;
+      }
+      assertTrue(thrown);
+
+      thrown = false;
+      try
+      {
+         pojo.methodGenericsAfter7();
+      }
+      catch (NoMatchingAdviceException e)
+      {
+         thrown = true;
+      }
+      assertTrue(thrown);
+      
+      thrown = false;
+      try
+      {
+         pojo.methodGenericsAfter8();
+      }
+      catch (NoMatchingAdviceException e)
+      {
+         thrown = true;
+      }
+      assertTrue(thrown);
+      
+      thrown = false;
+      try
+      {
+         pojo.methodGenericsFinally5();
+      }
+      catch (NoMatchingAdviceException e)
+      {
+         thrown = true;
+      }
+      assertTrue(thrown);
+      
+      thrown = false;
+      try
+      {
+         pojo.methodGenericsFinally7();
+      }
+      catch (NoMatchingAdviceException e)
+      {
+         thrown = true;
+      }
+      assertTrue(thrown);
+      
+      thrown = false;
+      try
+      {
+         pojo.methodGenericsFinally8();
+      }
+      catch (NoMatchingAdviceException e)
+      {
+         thrown = true;
+      }
+      assertTrue(thrown);
+      
+      thrown = false;
+      try
+      {
+         pojo.methodGenericsFinally9();
+      }
+      catch (NoMatchingAdviceException e)
+      {
+         thrown = true;
+      }
+      assertTrue(thrown);
+      
+      thrown = false;
+      try
+      {
+         pojo.methodGenericsFinally10();
+      }
+      catch (NoMatchingAdviceException e)
+      {
+         thrown = true;
+      }
+      assertTrue(thrown);
+   }
+}
\ No newline at end of file

Modified: projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotatedAdviceParams/ReturnInvalidPOJO.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotatedAdviceParams/ReturnInvalidPOJO.java	2007-10-11 16:59:37 UTC (rev 66035)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotatedAdviceParams/ReturnInvalidPOJO.java	2007-10-11 17:02:39 UTC (rev 66036)
@@ -21,6 +21,8 @@
  */
 package org.jboss.test.aop.annotatedAdviceParams;
 
+import java.util.List;
+
 /**
  * Plain old java object used both on @Return parameter tests with invalid advices(
  * its joinpoint executions will throw a NoMatchingAdviceException, due to the fact
@@ -103,4 +105,76 @@
    {
       return new SuperValue(10);
    }
+   
+   /* methodGenerics() */
+   
+   public List<SuperValue> methodGenericsAround1()
+   {
+      return null;
+   }
+   
+   public List<SuperValue> methodGenericsAround2()
+   {
+      return null;
+   }
+   
+   public List<SuperValue> methodGenericsAround4()
+   {
+      return null;
+   }
+   
+   public List<SuperValue> methodGenericsAround5()
+   {
+      return null;
+   }
+   
+   public List<SuperValue> methodGenericsAround7()
+   {
+      return null;
+   }
+   
+   public List<SuperValue> methodGenericsAround8()
+   {
+      return null;
+   }
+   
+   public List<SuperValue> methodGenericsAfter5()
+   {
+      return null;
+   }
+   
+   public List<SuperValue> methodGenericsAfter7()
+   {
+      return null;
+   }
+   
+   public List<SuperValue> methodGenericsAfter8()
+   {
+      return null;
+   }
+   
+   public List<SuperValue> methodGenericsFinally5()
+   {
+      return null;
+   }
+   
+   public List<SuperValue> methodGenericsFinally7()
+   {
+      return null;
+   }
+   
+   public List<SuperValue> methodGenericsFinally8()
+   {
+      return null;
+   }
+   
+   public List<SuperValue> methodGenericsFinally9()
+   {
+      return null;
+   }
+   
+   public List<SuperValue> methodGenericsFinally10()
+   {
+      return null;
+   }
 }
\ No newline at end of file

Added: projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotatedAdviceParams/ReturnJDK50TestCase.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotatedAdviceParams/ReturnJDK50TestCase.java	                        (rev 0)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotatedAdviceParams/ReturnJDK50TestCase.java	2007-10-11 17:02:39 UTC (rev 66036)
@@ -0,0 +1,112 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.aop.annotatedAdviceParams;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+import org.jboss.test.aop.AOPTestWithSetup;
+
+/**
+ * Tests that have been temporarily removed from {@link ReturnTestCase} (task
+ * JBBUILD-422)
+ * 
+ * @author  <a href="flavia.rainone at jboss.com">Flavia Rainone</a>
+ */
+public class ReturnJDK50TestCase extends AOPTestWithSetup
+{
+   private ReturnPOJO pojo;
+   
+   public static void main(String[] args)
+   {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite()
+   {
+      TestSuite suite = new TestSuite("ReturnJDK50TestCase");
+      suite.addTestSuite(ReturnTestCase.class);
+      return suite;
+   }
+   
+   public ReturnJDK50TestCase(String name)
+   {
+      super(name);
+   }
+   
+   public void setUp() throws Exception
+   {
+      super.setUp();
+      ReturnAspectGenerics.clear();
+      this.pojo = new ReturnPOJO();
+   }
+   
+   public void testGenerics1() throws Exception
+   {
+      pojo.methodGenerics(false);
+      assertTrue(ReturnAspectGenerics.around3);
+      assertTrue(ReturnAspectGenerics.after1);
+      assertTrue(ReturnAspectGenerics.after2);
+      assertTrue(ReturnAspectGenerics.after3);
+      assertTrue(ReturnAspectGenerics.after4);
+      assertTrue(ReturnAspectGenerics.after6);
+      assertTrue(ReturnAspectGenerics.after9);
+      assertTrue(ReturnAspectGenerics.after10);
+      assertTrue(ReturnAspectGenerics.finally1);
+      assertTrue(ReturnAspectGenerics.finally2);
+      assertTrue(ReturnAspectGenerics.finally3);
+      assertTrue(ReturnAspectGenerics.finally4);
+      assertTrue(ReturnAspectGenerics.finally6);
+      assertTrue(ReturnAspectGenerics.finally11);
+   }
+   
+   public void testGenerics2() throws Exception
+   {
+      boolean thrown = false;
+      try
+      {
+         pojo.methodGenerics(true);
+      }
+      catch (Throwable t)
+      {
+         thrown = true;
+      }
+      assertTrue(thrown);
+      
+      assertTrue(ReturnAspectGenerics.around3);
+      assertTrue(ReturnAspectGenerics.around6);
+      assertFalse(ReturnAspectGenerics.after1);
+      assertFalse(ReturnAspectGenerics.after2);
+      assertFalse(ReturnAspectGenerics.after3);
+      assertFalse(ReturnAspectGenerics.after4);
+      assertFalse(ReturnAspectGenerics.after6);
+      assertFalse(ReturnAspectGenerics.after9);
+      assertFalse(ReturnAspectGenerics.after10);
+      assertTrue(ReturnAspectGenerics.finally1);
+      assertTrue(ReturnAspectGenerics.finally2);
+      assertTrue(ReturnAspectGenerics.finally3);
+      assertTrue(ReturnAspectGenerics.finally4);
+      assertTrue(ReturnAspectGenerics.finally6);
+      assertTrue(ReturnAspectGenerics.finally11);
+   }
+}
\ No newline at end of file

Modified: projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotatedAdviceParams/ReturnPOJO.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotatedAdviceParams/ReturnPOJO.java	2007-10-11 16:59:37 UTC (rev 66035)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotatedAdviceParams/ReturnPOJO.java	2007-10-11 17:02:39 UTC (rev 66036)
@@ -21,6 +21,8 @@
  */
 package org.jboss.test.aop.annotatedAdviceParams;
 
+import java.util.List;
+
 /**
  * Plain old java object used both on @Return parameter tests, and on advice return
  * type tests.
@@ -85,4 +87,14 @@
    {
       throw new POJOException();
    }
+   
+   public List<SuperValue> methodGenerics(boolean throwException)
+   throws POJOException
+   {
+      if (throwException)
+      {
+         throw new POJOException();
+      }
+      return null;
+   }
 }
\ No newline at end of file

Modified: projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotatedAdviceParams/ReturnTestCase.java
===================================================================
--- projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotatedAdviceParams/ReturnTestCase.java	2007-10-11 16:59:37 UTC (rev 66035)
+++ projects/aop/trunk/aop/src/test/org/jboss/test/aop/annotatedAdviceParams/ReturnTestCase.java	2007-10-11 17:02:39 UTC (rev 66036)
@@ -224,18 +224,18 @@
       assertSame(thrown, ReturnAspect.finallyThrown);
    }
    
-   public void method13()
+   public void test13()
    {
-      boolean thrown = false;
+      Throwable thrown = null;
       try
       {
          pojo.method13();
       }
       catch(POJOException e)
       {
-         thrown = true;
+         thrown = e;
       }
-      assertTrue(thrown);
+      assertNotNull(thrown);
       
       assertEquals("around12", ReturnAspect.aroundAdvice);
       assertNull(ReturnAspect.aroundReturn);
@@ -243,6 +243,6 @@
       assertNull(ReturnAspect.afterReturn);
       assertEquals("finally13", ReturnAspect.finallyAdvice);
       assertNull(ReturnAspect.finallyReturn);
-      assertNull(ReturnAspect.finallyThrown);
+      assertSame(thrown, ReturnAspect.finallyThrown);
    }
 }
\ No newline at end of file




More information about the jboss-cvs-commits mailing list