[jboss-cvs] JBossAS SVN: r58346 - in trunk: aspects build system/src/main/org/jboss/system/server testsuite/imports/sections testsuite/src/main/org/jboss/test/aop testsuite/src/main/org/jboss/test/aop/mcdefaultannotation testsuite/src/main/org/jboss/test/aop/test testsuite/src/resources/aop testsuite/src/resources/aop/mcdefaultannotation testsuite/src/resources/aop/mcdefaultannotation/META-INF

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Nov 14 12:27:09 EST 2006


Author: kabir.khan at jboss.com
Date: 2006-11-14 12:27:00 -0500 (Tue, 14 Nov 2006)
New Revision: 58346

Added:
   trunk/testsuite/src/main/org/jboss/test/aop/mcdefaultannotation/
   trunk/testsuite/src/main/org/jboss/test/aop/mcdefaultannotation/AnnotationReaderInterceptor.java
   trunk/testsuite/src/main/org/jboss/test/aop/mcdefaultannotation/BeanInterface.java
   trunk/testsuite/src/main/org/jboss/test/aop/mcdefaultannotation/MyBean.java
   trunk/testsuite/src/main/org/jboss/test/aop/mcdefaultannotation/TestAnnotation.java
   trunk/testsuite/src/main/org/jboss/test/aop/test/MicrocontainerDefaultAnnotationUnitTestCase.java
   trunk/testsuite/src/resources/aop/mcdefaultannotation/
   trunk/testsuite/src/resources/aop/mcdefaultannotation/META-INF/
   trunk/testsuite/src/resources/aop/mcdefaultannotation/META-INF/jboss-beans.xml
Modified:
   trunk/aspects/build.xml
   trunk/build/build-distr.xml
   trunk/system/src/main/org/jboss/system/server/ServerLoader.java
   trunk/testsuite/imports/sections/aop.xml
Log:
[JBAOP-308] Move javassist.jar into jboss/lib so that the mc annotation creator can use default values for annotations

Modified: trunk/aspects/build.xml
===================================================================
--- trunk/aspects/build.xml	2006-11-14 17:09:24 UTC (rev 58345)
+++ trunk/aspects/build.xml	2006-11-14 17:27:00 UTC (rev 58346)
@@ -308,7 +308,7 @@
          <fileset file="${build.lib}/jboss-aspect-library-jdk50.jar"/>
          <fileset file="${jboss.aop.lib}/jboss-aop-jdk50.jar"/>
          <fileset file="${project.root}/aspects/src/etc/base-aop.xml"/>
-         <fileset file="${javassist.lib}/javassist.jar"/>
+         <!-- fileset file="${javassist.lib}/javassist.jar"/-->
          <fileset file="${trove.lib}/trove.jar"/>
          <fileset dir="${module.output}">
             <include name="META-INF/jboss-service.xml"/>

Modified: trunk/build/build-distr.xml
===================================================================
--- trunk/build/build-distr.xml	2006-11-14 17:09:24 UTC (rev 58345)
+++ trunk/build/build-distr.xml	2006-11-14 17:27:00 UTC (rev 58346)
@@ -1727,9 +1727,6 @@
         <fileset dir="${jboss.cache.lib}">
            <include name="jboss-cache-jdk50.jar"/>
         </fileset>
-       <fileset dir="${javassist.javassist.lib}">
-         <include name="javassist.jar"/>
-       </fileset>
        <fileset dir="${jboss.backport.concurrent.lib}">
          <include name="jboss-backport-concurrent.jar"/>
        </fileset>
@@ -1749,6 +1746,9 @@
     <!-- Copy the generated libraries -->
     <mkdir dir="${install.lib}"/>
     <copy todir="${install.lib}" filtering="no">
+       <fileset dir="${javassist.javassist.lib}">
+         <include name="javassist.jar"/>
+       </fileset>
       <fileset dir="${jboss.common.core.lib}">
         <exclude name="*-sources.jar"/>
       </fileset>

Modified: trunk/system/src/main/org/jboss/system/server/ServerLoader.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/ServerLoader.java	2006-11-14 17:09:24 UTC (rev 58345)
+++ trunk/system/src/main/org/jboss/system/server/ServerLoader.java	2006-11-14 17:27:00 UTC (rev 58346)
@@ -78,7 +78,7 @@
     * TODO: use vfs to list the root directory
     */
    public static final String DEFAULT_BOOT_LIBRARY_LIST =
-      "log4j-boot.jar,jboss-common-core.jar,jboss-logging-spi.jar,jboss-logging-log4j.jar,jboss-logging-jdk.jar,jboss-system.jar,jboss-xml-binding.jar,jboss-aop-mc-int-boot.jar,jboss-container.jar,jboss-dependency.jar,jboss-microcontainer.jar,jboss-deployers.jar,dom4j.jar,jboss-j2se.jar,jboss-mbeans.jar,jboss-jmx.jar,jboss-system-jmx.jar";
+      "log4j-boot.jar,jboss-common-core.jar,jboss-logging-spi.jar,jboss-logging-log4j.jar,jboss-logging-jdk.jar,jboss-system.jar,jboss-xml-binding.jar,javassist.jar,jboss-aop-mc-int-boot.jar,jboss-container.jar,jboss-dependency.jar,jboss-microcontainer.jar,jboss-deployers.jar,dom4j.jar,jboss-j2se.jar,jboss-mbeans.jar,jboss-jmx.jar,jboss-system-jmx.jar";
 
    /** The default server type. */
    public static final String DEFAULT_SERVER_TYPE = "org.jboss.system.server.profileservice.ServerImpl";

Modified: trunk/testsuite/imports/sections/aop.xml
===================================================================
--- trunk/testsuite/imports/sections/aop.xml	2006-11-14 17:09:24 UTC (rev 58345)
+++ trunk/testsuite/imports/sections/aop.xml	2006-11-14 17:27:00 UTC (rev 58346)
@@ -243,6 +243,16 @@
 			</fileset>
 		</jar>
 
+	   <!-- Create jars for the default annotation test -->
+		<jar destfile="${build.lib}/aop-mc-defaultannotationtest.jar">
+			<fileset dir="${build.classes}">
+				<include name="org/jboss/test/aop/mcdefaultannotation/*.class"/>
+			</fileset>
+         <fileset dir="${build.resources}/aop/mcdefaultannotation">
+				<include name="META-INF/jboss-beans.xml"/>
+			</fileset>
+		</jar>
+		
       <!-- jars for scoped test -->
       <jar destfile="${build.lib}/aop-scopedtest1.aop">
          <fileset dir="${build.classes}">

Added: trunk/testsuite/src/main/org/jboss/test/aop/mcdefaultannotation/AnnotationReaderInterceptor.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/mcdefaultannotation/AnnotationReaderInterceptor.java	2006-11-14 17:09:24 UTC (rev 58345)
+++ trunk/testsuite/src/main/org/jboss/test/aop/mcdefaultannotation/AnnotationReaderInterceptor.java	2006-11-14 17:27:00 UTC (rev 58346)
@@ -0,0 +1,49 @@
+/*
+* 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.mcdefaultannotation;
+
+import org.jboss.aop.advice.Interceptor;
+import org.jboss.aop.joinpoint.Invocation;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class AnnotationReaderInterceptor implements Interceptor
+{
+
+   public String getName()
+   {
+      return this.getClass().getName();
+   }
+
+   public Object invoke(Invocation invocation) throws Throwable
+   {
+      TestAnnotation annotation = (TestAnnotation)invocation.resolveClassAnnotation(TestAnnotation.class);
+      String property = annotation.property();
+      MyBean bean = (MyBean)invocation.getTargetObject();
+      bean.annValue = property;
+      return invocation.invokeNext();
+   }
+
+}

Added: trunk/testsuite/src/main/org/jboss/test/aop/mcdefaultannotation/BeanInterface.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/mcdefaultannotation/BeanInterface.java	2006-11-14 17:09:24 UTC (rev 58345)
+++ trunk/testsuite/src/main/org/jboss/test/aop/mcdefaultannotation/BeanInterface.java	2006-11-14 17:27:00 UTC (rev 58346)
@@ -0,0 +1,32 @@
+/*
+* 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.mcdefaultannotation;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public interface BeanInterface
+{
+   String getAnnotationValue();
+}

Added: trunk/testsuite/src/main/org/jboss/test/aop/mcdefaultannotation/MyBean.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/mcdefaultannotation/MyBean.java	2006-11-14 17:09:24 UTC (rev 58345)
+++ trunk/testsuite/src/main/org/jboss/test/aop/mcdefaultannotation/MyBean.java	2006-11-14 17:27:00 UTC (rev 58346)
@@ -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.mcdefaultannotation;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class MyBean implements BeanInterface
+{
+   public String annValue;
+   public String getAnnotationValue()
+   {
+      return annValue;
+   }
+}

Added: trunk/testsuite/src/main/org/jboss/test/aop/mcdefaultannotation/TestAnnotation.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/mcdefaultannotation/TestAnnotation.java	2006-11-14 17:09:24 UTC (rev 58345)
+++ trunk/testsuite/src/main/org/jboss/test/aop/mcdefaultannotation/TestAnnotation.java	2006-11-14 17:27:00 UTC (rev 58346)
@@ -0,0 +1,38 @@
+/*
+* 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.mcdefaultannotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.TYPE)
+public @interface TestAnnotation {
+   String property() default "Default";
+}

Added: trunk/testsuite/src/main/org/jboss/test/aop/test/MicrocontainerDefaultAnnotationUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/test/MicrocontainerDefaultAnnotationUnitTestCase.java	2006-11-14 17:09:24 UTC (rev 58345)
+++ trunk/testsuite/src/main/org/jboss/test/aop/test/MicrocontainerDefaultAnnotationUnitTestCase.java	2006-11-14 17:27:00 UTC (rev 58346)
@@ -0,0 +1,82 @@
+/*
+  * 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.test;
+
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+
+import org.jboss.test.JBossTestCase;
+
+/**
+ * Sample client for the jboss container.
+ *
+ * @author <a href="mailto:bill at burkecentral.com">Bill Burke</a>
+ * @version $Id: JMXUnitTestCase.java 58115 2006-11-04 08:42:14Z scott.stark at jboss.org $
+ */
+
+public class MicrocontainerDefaultAnnotationUnitTestCase
+        extends JBossTestCase
+{
+   static boolean deployed = false;
+   static int test = 0;
+
+   public MicrocontainerDefaultAnnotationUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testDefault() throws Exception
+   {
+      ObjectName testerName = new ObjectName("jboss.aop:name=Bean");
+      checkAnnotation(testerName, "Default");
+   }
+
+   public void testOverridden() throws Exception
+   {
+      ObjectName testerName = new ObjectName("jboss.aop:name=Bean2");
+      checkAnnotation(testerName, "Overridden");
+   }
+
+   private void checkAnnotation(ObjectName on, String expectedValue) throws Exception
+   {
+      MBeanServerConnection server = getServer();
+      String value = (String)server.getAttribute(on, "AnnotationValue");
+      assertNotNull(value);
+      assertEquals(expectedValue, value);
+   }
+
+
+   public static Test suite() throws Exception
+   {
+      TestSuite suite = new TestSuite();
+      suite.addTest(new TestSuite(MicrocontainerDefaultAnnotationUnitTestCase.class));
+
+      AOPTestSetup setup = new AOPTestSetup(suite, "aop-mc-defaultannotationtest.jar");
+      return setup;
+   }
+
+}

Added: trunk/testsuite/src/resources/aop/mcdefaultannotation/META-INF/jboss-beans.xml
===================================================================
--- trunk/testsuite/src/resources/aop/mcdefaultannotation/META-INF/jboss-beans.xml	2006-11-14 17:09:24 UTC (rev 58345)
+++ trunk/testsuite/src/resources/aop/mcdefaultannotation/META-INF/jboss-beans.xml	2006-11-14 17:27:00 UTC (rev 58346)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <aop:aspect xmlns:aop="urn:jboss:aop-beans:1.0"
+               name="DependencyAdvice"
+               class="org.jboss.test.aop.mcdefaultannotation.AnnotationReaderInterceptor"
+               manager-bean="AspectManager"
+               manager-property="aspectManager"
+               pointcut="execution(* @org.jboss.test.aop.mcdefaultannotation.TestAnnotation->getAnnotationValue())">
+   </aop:aspect>
+
+   <bean name="jboss.aop:name=Bean" class="org.jboss.test.aop.mcdefaultannotation.MyBean">
+      <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(exposedInterface=org.jboss.test.aop.mcdefaultannotation.BeanInterface.class)</annotation>
+      <annotation>@org.jboss.test.aop.mcdefaultannotation.TestAnnotation</annotation>
+   </bean>
+   <bean name="jboss.aop:name=Bean2" class="org.jboss.test.aop.mcdefaultannotation.MyBean">
+      <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.aop:name=Bean2", exposedInterface=org.jboss.test.aop.mcdefaultannotation.BeanInterface.class)</annotation>
+      <annotation>@org.jboss.test.aop.mcdefaultannotation.TestAnnotation(property="Overridden")</annotation>
+   </bean>
+</deployment>
\ No newline at end of file




More information about the jboss-cvs-commits mailing list