[jboss-cvs] jbosstest/src/main/org/jboss/test/aop/bean ...

Kabir Khan kkhan at jboss.com
Tue Jul 18 12:38:10 EDT 2006


  User: kkhan   
  Date: 06/07/18 12:38:10

  Modified:    src/main/org/jboss/test/aop/bean      AOPTesterMBean.java
                        POJO.java AOPTester.java
  Added:       src/main/org/jboss/test/aop/bean     
                        OverriddenAnnotation.java
                        OverriddenAnnotationInterceptor.java
  Log:
  Add some tests to capture the move of the annotation creator from aop to the container module
  
  Revision  Changes    Path
  1.16      +2 -1      jbosstest/src/main/org/jboss/test/aop/bean/AOPTesterMBean.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: AOPTesterMBean.java
  ===================================================================
  RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/aop/bean/AOPTesterMBean.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -b -r1.15 -r1.16
  --- AOPTesterMBean.java	29 Oct 2005 23:41:14 -0000	1.15
  +++ AOPTesterMBean.java	18 Jul 2006 16:38:10 -0000	1.16
  @@ -27,7 +27,7 @@
    * Basic testing of AOP
    * 
    * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
  - * @version $Revision: 1.15 $
  + * @version $Revision: 1.16 $
    */
   public interface AOPTesterMBean   
      extends org.jboss.system.ServiceMBean
  @@ -43,4 +43,5 @@
      public void testConstructorInterception();
      public void testMixin();
      public void testCallerPointcut();
  +   public void testIntroducedAnnotation();
   }
  
  
  
  1.14      +6 -1      jbosstest/src/main/org/jboss/test/aop/bean/POJO.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: POJO.java
  ===================================================================
  RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/aop/bean/POJO.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -b -r1.13 -r1.14
  --- POJO.java	29 Oct 2005 23:41:14 -0000	1.13
  +++ POJO.java	18 Jul 2006 16:38:10 -0000	1.14
  @@ -24,7 +24,7 @@
   /**
    *
    * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
  - * @version $Revision: 1.13 $
  + * @version $Revision: 1.14 $
    */
   public class POJO
   {
  @@ -82,5 +82,10 @@
      {
         throw new SomeException();
      }
  +   
  +   public void overriddenAnnotatedMethod()
  +   {
  +     
  +   }
   }
   
  
  
  
  1.37      +11 -1     jbosstest/src/main/org/jboss/test/aop/bean/AOPTester.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: AOPTester.java
  ===================================================================
  RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/aop/bean/AOPTester.java,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -b -r1.36 -r1.37
  --- AOPTester.java	29 Oct 2005 23:41:14 -0000	1.36
  +++ AOPTester.java	18 Jul 2006 16:38:10 -0000	1.37
  @@ -34,7 +34,7 @@
   /**
    *
    * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
  - * @version $Revision: 1.36 $
  + * @version $Revision: 1.37 $
    */
   public class AOPTester
           extends ServiceMBeanSupport
  @@ -524,6 +524,16 @@
         callingPOJO.callUnadvised();
      }
   
  +   public void testIntroducedAnnotation()
  +   {
  +      OverriddenAnnotationInterceptor.intercepted = false;
  +      OverriddenAnnotationInterceptor.overriddenAnnotation = null;
  +      
  +      POJO pojo = new POJO();
  +      pojo.overriddenAnnotatedMethod();
  +      if (!OverriddenAnnotationInterceptor.intercepted) throw new RuntimeException("!IntroducedAnnotationInterceptor.intercepted");
  +      if (OverriddenAnnotationInterceptor.overriddenAnnotation == null) throw new RuntimeException("IntroducedAnnotationInterceptor.overriddenAnnotation == null");
  +   }
      // Inner classes -------------------------------------------------
   }
   
  
  
  
  1.1      date: 2006/07/18 16:38:10;  author: kkhan;  state: Exp;jbosstest/src/main/org/jboss/test/aop/bean/OverriddenAnnotation.java
  
  Index: OverriddenAnnotation.java
  ===================================================================
  /*
  * 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.bean;
  
  /**
   * 
   * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
   * @version $Revision: 1.1 $
   */
  public interface OverriddenAnnotation 
  {
  
     String data();
  }
  
  
  
  1.1      date: 2006/07/18 16:38:10;  author: kkhan;  state: Exp;jbosstest/src/main/org/jboss/test/aop/bean/OverriddenAnnotationInterceptor.java
  
  Index: OverriddenAnnotationInterceptor.java
  ===================================================================
  /*
  * 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.bean;
  
  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 OverriddenAnnotationInterceptor implements Interceptor
  {
     public static boolean intercepted;
     public static OverriddenAnnotation overriddenAnnotation;
     
     public String getName()
     {
        return this.getClass().getName();
     }
  
     public Object invoke(Invocation invocation) throws Throwable
     {
        intercepted = true;
        overriddenAnnotation = (OverriddenAnnotation)invocation.resolveClassAnnotation(OverriddenAnnotation.class);
        System.out.println("overridden " + overriddenAnnotation);
        return invocation.invokeNext();
     }
  
  }
  
  
  



More information about the jboss-cvs-commits mailing list