[jboss-cvs] JBossAS SVN: r59492 - in branches/Branch_AOP_1_5/aop: src/resources/test/jdk15 and 5 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jan 10 13:57:11 EST 2007


Author: kabir.khan at jboss.com
Date: 2007-01-10 13:57:06 -0500 (Wed, 10 Jan 2007)
New Revision: 59492

Added:
   branches/Branch_AOP_1_5/aop/src/resources/test/jdk15/regression/
   branches/Branch_AOP_1_5/aop/src/resources/test/jdk15/regression/jboss-aop.xml
   branches/Branch_AOP_1_5/aop/src/test/org/jboss/test/aop/jdk15/regression/
   branches/Branch_AOP_1_5/aop/src/test/org/jboss/test/aop/jdk15/regression/jbaop316annotationsinwrapperonly/
   branches/Branch_AOP_1_5/aop/src/test/org/jboss/test/aop/jdk15/regression/jbaop316annotationsinwrapperonly/AnnotationsInWrapperMethodOnlyTestCase.java
   branches/Branch_AOP_1_5/aop/src/test/org/jboss/test/aop/jdk15/regression/jbaop316annotationsinwrapperonly/POJO.java
   branches/Branch_AOP_1_5/aop/src/test/org/jboss/test/aop/jdk15/regression/jbaop316annotationsinwrapperonly/TestAnnotation.java
Modified:
   branches/Branch_AOP_1_5/aop/build.xml
   branches/Branch_AOP_1_5/aop/src/test/org/jboss/test/aop/regression/jbaop316annotationsinwrapperonly/AnnotationsInWrapperMethodOnlyTestCase.java
   branches/Branch_AOP_1_5/aop/src/test/org/jboss/test/aop/regression/jbaop316annotationsinwrapperonly/TestAnnotation.java
Log:
[JBAOP-329] Duplicate jbaop316annotationsinwrapperonly under jdk15/regression/jbaop316annotationsinwrapperonly so that we can test for parameter annotations in jdk 5.

Modified: branches/Branch_AOP_1_5/aop/build.xml
===================================================================
--- branches/Branch_AOP_1_5/aop/build.xml	2007-01-10 18:31:00 UTC (rev 59491)
+++ branches/Branch_AOP_1_5/aop/build.xml	2007-01-10 18:57:06 UTC (rev 59492)
@@ -1192,6 +1192,19 @@
       </junit>
 
       <junit printsummary="yes" fork="yes" haltonfailure="no">
+         <sysproperty key="jboss.aop.path" value="${source.res}/test/jdk15/regression/jboss-aop.xml"/>
+         <jvmarg value="-javaagent:${build.lib}/jboss-aop-jdk50.jar"/>
+         <classpath>
+            <path refid="test15.classpath"/>
+            <pathelement location="${build.tests.classes}"/>
+            <pathelement location="docs"/>
+         </classpath>
+         <formatter usefile="true" type="plain" extension="-jdk15-loadtime-tests.txt"/>
+         <formatter usefile="true" type="xml" extension="-jdk15-loadtime-tests.xml"/>
+         <test todir="${report.dir}" name="org.jboss.test.aop.jdk15.regression.jbaop316annotationsinwrapperonly.AnnotationsInWrapperMethodOnlyTestCase" />
+      </junit>
+
+      <junit printsummary="yes" fork="yes" haltonfailure="no">
          <sysproperty key="jboss.aop.class.path" value="${build.tests.classes}"/>
          <!-- The manifest.mf file of the jar contains
            Premain-Class: which class is the agent
@@ -1343,10 +1356,24 @@
          <src path="${build.tests.classes}"/>
          <include name="org/jboss/test/aop/jdk15/**"/>
          <exclude name="org/jboss/test/aop/jdk15/dynamic/**"/>
+         <exclude name="org/jboss/test/aop/jdk15/regression/**"/>
          <aoppath path="${source.res}/test/jdk15/jboss-aop.xml"/>
          <aopclasspath path="${build.tests.classes}"/>
       </aopc>
-
+      <junit printsummary="yes" fork="yes" haltonfailure="no">
+         <sysproperty key="jboss.aop.path" value="${source.res}/test/jdk15/jboss-aop.xml"/>
+         <sysproperty key="jboss.aop.class.path" value="${build.tests.classes}"/>
+         <classpath>
+            <path refid="test15.classpath"/>
+            <pathelement location="${build.tests.classes}"/>
+            <pathelement location="docs"/>
+         </classpath>
+         <formatter usefile="true" type="plain" extension="-jdk15-precompiled-tests.txt"/>
+         <formatter usefile="true" type="xml" extension="-jdk15-precompiled-tests.xml"/>
+         <test todir="${report.dir}" name="org.jboss.test.aop.jdk15.AOPTester"/>
+         <test todir="${report.dir}" name="org.jboss.test.aop.jdk15.annotated.AnnotatedTestCase"/>
+      </junit>
+   	
       <aopc compilerclasspathref="aop.task.classpath">
          <classpath refid="aop.task.classpath"/>
          <classpath path="${build.tests.classes}"/>
@@ -1354,6 +1381,39 @@
          <include name="org/jboss/test/aop/basic/**"/>
          <aoppath path="${source.res}/test/basic/jboss-aop.xml"/>
       </aopc>
+      <junit printsummary="yes" fork="yes" haltonfailure="no">
+         <sysproperty key="jboss.aop.path" value="${source.res}/test/basic/jboss-aop.xml"/>
+         <sysproperty key="jboss.aop.class.path" value="${build.tests.classes}"/>
+         <classpath>
+            <path refid="test15.classpath"/>
+            <pathelement location="${build.tests.classes}"/>
+            <pathelement location="docs"/>
+         </classpath>
+         <formatter usefile="true" type="plain" extension="-jdk15-precompiled-tests.txt"/>
+         <formatter usefile="true" type="xml" extension="-jdk15-precompiled-tests.xml"/>
+         <test todir="${report.dir}" name="org.jboss.test.aop.basic.AOPTester"/>
+      </junit>
+
+   	<aopc compilerclasspathref="aop.task.classpath">
+         <classpath refid="aop.task.classpath"/>
+         <classpath path="${build.tests.classes}"/>
+         <src path="${build.tests.classes}"/>
+         <include name="org/jboss/test/aop/jdk15/regression/**"/>
+         <aoppath path="${source.res}/test/jdk15/regression/jboss-aop.xml"/>
+      </aopc>
+      <junit printsummary="yes" fork="yes" haltonfailure="no">
+         <sysproperty key="jboss.aop.path" value="${source.res}/test/basic/jboss-aop.xml"/>
+         <sysproperty key="jboss.aop.class.path" value="${build.tests.classes}"/>
+         <classpath>
+            <path refid="test15.classpath"/>
+            <pathelement location="${build.tests.classes}"/>
+            <pathelement location="docs"/>
+         </classpath>
+         <formatter usefile="true" type="plain" extension="-jdk15-precompiled-tests.txt"/>
+         <formatter usefile="true" type="xml" extension="-jdk15-precompiled-tests.xml"/>
+         <test todir="${report.dir}" name="org.jboss.test.aop.jdk15.regression.jbaop316annotationsinwrapperonly.AnnotationsInWrapperMethodOnlyTestCase" />
+      </junit>
+   	
       <mkdir dir="${build.tests.classes}/org/jboss/test/aop/jdk15/dynamic/common/scenario"/>
         <!-- process jdk15/dynamic/common/scenario with prepareAll jboss-aop.xml file -->
       <unjar src="${build.tests.classes}/org/jboss/test/aop/jdk15/dynamic/common/scenario.jar"
@@ -1432,32 +1492,7 @@
            basedir="${build.tests.classes}/org/jboss/test/aop/jdk15/dynamic/common/scenario/"/>
       <delete dir="${build.tests.classes}/org/jboss/test/aop/jdk15/dynamic/common/scenario"/>
 
-        <junit printsummary="yes" fork="yes" haltonfailure="no">
-         <sysproperty key="jboss.aop.path" value="${source.res}/test/jdk15/jboss-aop.xml"/>
-         <sysproperty key="jboss.aop.class.path" value="${build.tests.classes}"/>
-         <classpath>
-            <path refid="test15.classpath"/>
-            <pathelement location="${build.tests.classes}"/>
-            <pathelement location="docs"/>
-         </classpath>
-         <formatter usefile="true" type="plain" extension="-jdk15-precompiled-tests.txt"/>
-         <formatter usefile="true" type="xml" extension="-jdk15-precompiled-tests.xml"/>
-         <test todir="${report.dir}" name="org.jboss.test.aop.jdk15.AOPTester"/>
-         <test todir="${report.dir}" name="org.jboss.test.aop.jdk15.annotated.AnnotatedTestCase"/>
-      </junit>
       <junit printsummary="yes" fork="yes" haltonfailure="no">
-         <sysproperty key="jboss.aop.path" value="${source.res}/test/basic/jboss-aop.xml"/>
-         <sysproperty key="jboss.aop.class.path" value="${build.tests.classes}"/>
-         <classpath>
-            <path refid="test15.classpath"/>
-            <pathelement location="${build.tests.classes}"/>
-            <pathelement location="docs"/>
-         </classpath>
-         <formatter usefile="true" type="plain" extension="-jdk15-precompiled-tests.txt"/>
-         <formatter usefile="true" type="xml" extension="-jdk15-precompiled-tests.xml"/>
-         <test todir="${report.dir}" name="org.jboss.test.aop.basic.AOPTester"/>
-      </junit>
-      <junit printsummary="yes" fork="yes" haltonfailure="no">
          <sysproperty key="jboss.aop.path" value="${source.res}/test/jdk15/dynamic/prepareAll/jboss-aop.xml"/>
          <sysproperty key="scenario.jar"
             value="${build.tests.classes}/org/jboss/test/aop/jdk15/dynamic/common/scenarioAopcPrepareAll.jar"/>
@@ -1639,7 +1674,6 @@
          <classpath path="${build.tests.classes}"/>
          <src path="${source.tests.java}"/>
          <include name="org/jboss/test/aop/annotationc/*.java"/>
-         <include name="org/jboss/test/aop/regression/jbaop316annotationsinwrapperonly/*.java"/>
       </annotationc>
 
       <junit printsummary="yes" fork="yes" haltonfailure="no" jvm="${jrockit.home}/bin/java">

Added: branches/Branch_AOP_1_5/aop/src/resources/test/jdk15/regression/jboss-aop.xml
===================================================================
--- branches/Branch_AOP_1_5/aop/src/resources/test/jdk15/regression/jboss-aop.xml	2007-01-10 18:31:00 UTC (rev 59491)
+++ branches/Branch_AOP_1_5/aop/src/resources/test/jdk15/regression/jboss-aop.xml	2007-01-10 18:57:06 UTC (rev 59492)
@@ -0,0 +1,3 @@
+<aop>
+   <prepare expr="all(org.jboss.test.aop.jdk15.regression.jbaop316annotationsinwrapperonly.POJO)"/>
+</aop>
\ No newline at end of file

Added: branches/Branch_AOP_1_5/aop/src/test/org/jboss/test/aop/jdk15/regression/jbaop316annotationsinwrapperonly/AnnotationsInWrapperMethodOnlyTestCase.java
===================================================================
--- branches/Branch_AOP_1_5/aop/src/test/org/jboss/test/aop/jdk15/regression/jbaop316annotationsinwrapperonly/AnnotationsInWrapperMethodOnlyTestCase.java	2007-01-10 18:31:00 UTC (rev 59491)
+++ branches/Branch_AOP_1_5/aop/src/test/org/jboss/test/aop/jdk15/regression/jbaop316annotationsinwrapperonly/AnnotationsInWrapperMethodOnlyTestCase.java	2007-01-10 18:57:06 UTC (rev 59492)
@@ -0,0 +1,95 @@
+/*
+  * 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.jdk15.regression.jbaop316annotationsinwrapperonly;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+
+import javassist.CtMethod;
+import javassist.NotFoundException;
+
+import org.jboss.aop.Advised;
+import org.jboss.aop.annotation.PortableAnnotationElement;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+
+/**
+ * http://jira.jboss.com/jira/browse/JBAOP-316
+ * 
+ * @author <a href="mailto:kabir.khan at jboss.org">Kabir Khan</a>
+ * @version $Revision: 45977 $
+ */
+public class AnnotationsInWrapperMethodOnlyTestCase extends junit.framework.TestCase 
+{
+   public static void main(String[] args)
+   {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite()
+   {
+      TestSuite suite = new TestSuite("AnnotationsInWrapperMethodOnlyTestCase");
+      suite.addTestSuite(AnnotationsInWrapperMethodOnlyTestCase.class);
+      return suite;
+   }
+
+   public AnnotationsInWrapperMethodOnlyTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testAnnotationNotInInternalCopy()throws Exception
+   {
+      Method[] methods = POJO.class.getMethods();
+      
+      ArrayList hasAnnotation = new ArrayList();
+      ArrayList hasParameterAnnotation = new ArrayList();
+      for (int i = 0 ; i < methods.length ; i++)
+      {
+         if (PortableAnnotationElement.isAnyAnnotationPresent(methods[i], TestAnnotation.class))
+         {
+            hasAnnotation.add(methods[i].getName());
+         }
+         
+         Annotation[][] paramAnnotations = methods[i].getParameterAnnotations();
+         for (int p = 0 ; p < paramAnnotations.length ; p++)
+         {
+            if (paramAnnotations[p].length > 0)
+            {
+               hasParameterAnnotation.add(methods[i].getName() + "1");
+            }
+         }
+      }
+      
+      assertFalse("Expected to find annotation for 'method'", hasAnnotation.size() == 0);
+      assertFalse("Expected to find parameter annotation for 'method'", hasParameterAnnotation.size() == 0);
+      assertTrue("Expected to find annotation for 'method' only, it was found for " + hasAnnotation, hasAnnotation.size() == 1);
+      assertTrue("Expected to find parameter annotation for 'method' only, it was found for " + hasParameterAnnotation, hasAnnotation.size() == 1);
+      assertEquals("method", hasAnnotation.get(0));
+      assertEquals("method1", hasParameterAnnotation.get(0));
+      assertTrue("Class was not woven", Advised.class.isAssignableFrom(POJO.class));
+   }
+}

Added: branches/Branch_AOP_1_5/aop/src/test/org/jboss/test/aop/jdk15/regression/jbaop316annotationsinwrapperonly/POJO.java
===================================================================
--- branches/Branch_AOP_1_5/aop/src/test/org/jboss/test/aop/jdk15/regression/jbaop316annotationsinwrapperonly/POJO.java	2007-01-10 18:31:00 UTC (rev 59491)
+++ branches/Branch_AOP_1_5/aop/src/test/org/jboss/test/aop/jdk15/regression/jbaop316annotationsinwrapperonly/POJO.java	2007-01-10 18:57:06 UTC (rev 59492)
@@ -0,0 +1,36 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file 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.jdk15.regression.jbaop316annotationsinwrapperonly;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class POJO
+{
+   @TestAnnotation 
+   public void method(int i, @TestAnnotation String s)
+   {
+      
+   }
+}

Added: branches/Branch_AOP_1_5/aop/src/test/org/jboss/test/aop/jdk15/regression/jbaop316annotationsinwrapperonly/TestAnnotation.java
===================================================================
--- branches/Branch_AOP_1_5/aop/src/test/org/jboss/test/aop/jdk15/regression/jbaop316annotationsinwrapperonly/TestAnnotation.java	2007-01-10 18:31:00 UTC (rev 59491)
+++ branches/Branch_AOP_1_5/aop/src/test/org/jboss/test/aop/jdk15/regression/jbaop316annotationsinwrapperonly/TestAnnotation.java	2007-01-10 18:57:06 UTC (rev 59492)
@@ -0,0 +1,35 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file 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.jdk15.regression.jbaop316annotationsinwrapperonly;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface TestAnnotation {
+
+}

Modified: branches/Branch_AOP_1_5/aop/src/test/org/jboss/test/aop/regression/jbaop316annotationsinwrapperonly/AnnotationsInWrapperMethodOnlyTestCase.java
===================================================================
--- branches/Branch_AOP_1_5/aop/src/test/org/jboss/test/aop/regression/jbaop316annotationsinwrapperonly/AnnotationsInWrapperMethodOnlyTestCase.java	2007-01-10 18:31:00 UTC (rev 59491)
+++ branches/Branch_AOP_1_5/aop/src/test/org/jboss/test/aop/regression/jbaop316annotationsinwrapperonly/AnnotationsInWrapperMethodOnlyTestCase.java	2007-01-10 18:57:06 UTC (rev 59492)
@@ -24,12 +24,8 @@
 import java.lang.reflect.Method;
 import java.util.ArrayList;
 
-import javassist.CtMethod;
-import javassist.NotFoundException;
-
 import org.jboss.aop.Advised;
 import org.jboss.aop.Advisor;
-import org.jboss.aop.util.ReflectToJavassist;
 
 import junit.framework.Test;
 import junit.framework.TestSuite;

Modified: branches/Branch_AOP_1_5/aop/src/test/org/jboss/test/aop/regression/jbaop316annotationsinwrapperonly/TestAnnotation.java
===================================================================
--- branches/Branch_AOP_1_5/aop/src/test/org/jboss/test/aop/regression/jbaop316annotationsinwrapperonly/TestAnnotation.java	2007-01-10 18:31:00 UTC (rev 59491)
+++ branches/Branch_AOP_1_5/aop/src/test/org/jboss/test/aop/regression/jbaop316annotationsinwrapperonly/TestAnnotation.java	2007-01-10 18:57:06 UTC (rev 59492)
@@ -21,9 +21,6 @@
 */ 
 package org.jboss.test.aop.regression.jbaop316annotationsinwrapperonly;
 
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
 /**
  * 
  * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>




More information about the jboss-cvs-commits mailing list