[jboss-cvs] JBossAS SVN: r66806 - in branches/Branch_4_2/ejb3: src/main/org/jboss/ejb3 and 5 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Nov 6 21:39:18 EST 2007


Author: bdecoste
Date: 2007-11-06 21:39:17 -0500 (Tue, 06 Nov 2007)
New Revision: 66806

Added:
   branches/Branch_4_2/ejb3/src/resources/test/ejbthree1090/
   branches/Branch_4_2/ejb3/src/resources/test/ejbthree1090/ejbthree1090-ejb3-interceptors-aop.xml
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree1090/
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree1090/AopInterceptor.java
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree1090/Ejb3Interceptor.java
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree1090/StatefulBean.java
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree1090/StatefulRemote.java
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree1090/unit/
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree1090/unit/InterceptorsUnitTestCase.java
Modified:
   branches/Branch_4_2/ejb3/build-test.xml
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/EJBContainer.java
Log:
[EJBTHREE-1090] fix and test for NPE introducing @Interceptors in ejb2-interceptors-aop.xml

Modified: branches/Branch_4_2/ejb3/build-test.xml
===================================================================
--- branches/Branch_4_2/ejb3/build-test.xml	2007-11-07 01:01:36 UTC (rev 66805)
+++ branches/Branch_4_2/ejb3/build-test.xml	2007-11-07 02:39:17 UTC (rev 66806)
@@ -622,6 +622,7 @@
       <jar jarfile="${build.lib}/ear-session.jar">
          <fileset dir="${build.classes}">
             <include name="org/jboss/ejb3/test/ear/Facade*.class"/>
+	        <include name="org/jboss/ejb3/test/ear/Stateless*.class"/>
          </fileset>
          <fileset dir="${resources}/test/ear/ejbref">
             <include name="META-INF/persistence.xml"/>
@@ -847,6 +848,7 @@
          </fileset>
          <fileset dir="${resources}/test/webservices">
          	<include name="META-INF/ejb-jar.xml"/>
+         	<include name="META-INF/jboss.xml"/>
             <!-- TODO: Wolf: This is plain silly. I have to include the wsdl the container is about to generate to get injection to work. -->
             <include name="META-INF/wsdl/*.wsdl"/>
          </fileset>
@@ -2248,6 +2250,81 @@
          </fileset>
       </jar>
    </target>
+	
+   <target name="commonentity"
+      description="Builds all jar files."
+      depends="compile-classes">
+
+      <mkdir dir="${build.lib}"/>
+	
+	 <jar jarfile="${build.lib}/commonentity-common.jar">
+         <fileset dir="${build.classes}">
+            <include name="org/jboss/ejb3/test/commonentity/TestEntity.class"/>
+         </fileset>
+         <fileset dir="${resources}/test/commonentity">
+            <include name="META-INF/persistence.xml"/>
+         </fileset>
+      </jar>
+	
+	  <ear earfile="${build.lib}/commonentity-common.ear" appxml="${resources}/test/commonentity/applicationc.xml">
+         <zipfileset dir="${build.lib}">
+            <include name="commonentity-common.jar"/>
+         </zipfileset>
+      </ear>
+
+      <jar jarfile="${build.lib}/commonentity-test1.jar">
+         <fileset dir="${build.classes}">
+            <include name="org/jboss/ejb3/test/commonentity/*.class"/>
+	        <!--include name="org/jboss/ejb3/test/commonentity/*EntityTest*.class"/-->
+         </fileset>
+         <fileset dir="${resources}/test/commonentity">
+            <include name="META-INF/persistence.xml"/>
+         </fileset>
+      </jar>
+	
+	  <copy file="${resources}/test/commonentity/META-INF/jboss-app1.xml" tofile="${resources}/test/commonentity/META-INF/jboss-app.xml"/>
+	
+	  <ear earfile="${build.lib}/commonentity-test1.ear" appxml="${resources}/test/commonentity/application1.xml">
+         <zipfileset dir="${build.lib}">
+            <include name="commonentity-test1.jar"/>
+         </zipfileset>
+		 <fileset dir="${resources}/test/commonentity">
+	       <include name="META-INF/jboss-app.xml"/>
+	     </fileset>
+      </ear>
+	
+	  <jar jarfile="${build.lib}/commonentity-test2.jar">
+         <fileset dir="${build.classes}">
+            <include name="org/jboss/ejb3/test/commonentity/*.class"/>
+	        <!--include name="org/jboss/ejb3/test/commonentity/*EntityTest*.class"/-->
+         </fileset>
+         <fileset dir="${resources}/test/commonentity">
+            <include name="META-INF/persistence.xml"/>
+         </fileset>
+      </jar>
+	
+	  <delete file="${resources}/test/commonentity/META-INF/jboss-app.xml"/>
+	  <copy file="${resources}/test/commonentity/META-INF/jboss-app2.xml" tofile="${resources}/test/commonentity/META-INF/jboss-app.xml"/>
+	
+	  <ear earfile="${build.lib}/commonentity-test2.ear" appxml="${resources}/test/commonentity/application2.xml">
+         <zipfileset dir="${build.lib}">
+            <include name="commonentity-test2.jar"/>
+         </zipfileset>
+	     <fileset dir="${resources}/test/commonentity">
+	       <include name="META-INF/jboss-app.xml"/>
+	     </fileset>
+      </ear>
+	
+	  <delete file="${resources}/test/commonentity/META-INF/jboss-app.xml"/>
+	
+	  <ear earfile="${build.lib}/commonentity-test.ear" appxml="${resources}/test/commonentity/application.xml">
+         <zipfileset dir="${build.lib}">
+            <include name="commonentity-test1.Jar"/>
+	        <include name="commonentity-test2.jar"/>
+	        <include name="commonentity-common.jar"/>
+         </zipfileset>
+      </ear>
+   </target>
    
    <target name="entityoptimisticlocking"
       description="Builds all jar files."
@@ -2662,7 +2739,24 @@
          </fileset>
       </jar>
    </target>
+	
+   <target name="runasprincipal"
+      description="Builds all jar files."
+      depends="compile-classes">
 
+      <mkdir dir="${build.lib}"/>
+
+      <jar jarfile="${build.lib}/runasprincipal-test.jar">
+         <fileset dir="${build.classes}">
+            <include name="org/jboss/ejb3/test/runasprincipal/**/*.class"/>
+         </fileset>
+		 <fileset dir="${resources}/test/runasprincipal">
+		     <include name="*.properties"/>
+	         <include name="META-INF/*.xml"/>
+	      </fileset>
+      </jar>
+   </target>
+
    <target name="stateful"
       description="Builds all jar files."
       depends="compile-classes">
@@ -2717,7 +2811,23 @@
          </fileset>
       </jar>
    </target>
+	
+   <target name="ejbthree1090"
+      description="Builds all jar files."
+      depends="compile-classes">
 
+      <mkdir dir="${build.lib}"/>
+
+      <jar jarfile="${build.lib}/ejbthree1090-test.jar">
+         <fileset dir="${build.classes}">
+            <include name="org/jboss/ejb3/test/ejbthree1090/*.class"/>
+         </fileset>
+         <fileset dir="${resources}/test/ejbthree1090">
+            <include name="*.xml"/>
+         </fileset>
+      </jar>
+   </target>
+
    <target name="ejbcontext"
       description="Builds all jar files."
       depends="compile-classes">
@@ -3431,7 +3541,7 @@
 	  </copy>
    </target>
 
-   <target name="jars" depends="mdbsessionpoolclear, ejbthree1092, removedislocal, statelesscreation, defaultremotebindings, localfromremote, clusteredjms, entityoptimisticlocking, concurrentnaming, propertyreplacement, persistenceunits, invalidtxmdb, descriptortypo, libdeployment, homeinterface, servicexmbean, arjuna, mdbtransactions, unauthenticatedprincipal, clusteredservice, invoker, classloader, 
+   <target name="jars" depends="ejbthree1090, mdbsessionpoolclear, ejbthree1092, removedislocal, statelesscreation, defaultremotebindings, localfromremote, clusteredjms, entityoptimisticlocking, concurrentnaming, propertyreplacement, persistenceunits, invalidtxmdb, descriptortypo, libdeployment, homeinterface, servicexmbean, arjuna, mdbtransactions, unauthenticatedprincipal, clusteredservice, invoker, classloader, 
       circulardependency, jsp, timerdependency, servicedependency, servlet, stateless14, webservices, ear, ejbthree440, 
       ejbthree454, ejbthree653, ejbthree670, ejbthree712, ejbthree724, ejbthree751, ejbthree785, ejbthree786, ejbthree832, ejbthree921,
       ejbthree959, ejbthree963, ejbthree986, ejbthree994, ejbthree1023, ejbthree1025, ejbthree1057, ejbthree1062,
@@ -3775,6 +3885,12 @@
 
 
    <target name="no-start-jboss-ejb-tests" depends="init" description="Execute all tests">
+	  <antcall target="test" inheritRefs="true">
+         <param name="test" value="runasprincipal"/>
+      </antcall>
+	  <antcall target="test" inheritRefs="true">
+         <param name="test" value="ejbthree1090"/>
+      </antcall>
       <antcall target="test" inheritRefs="true">
          <param name="test" value="arjuna"/>
       </antcall>
@@ -4172,7 +4288,7 @@
       <antcall target="tests-clustering-startup"/>
       <antcall target="tests-clustering-wait"/>
 
-      <antcall target="test-clustered-entity"/>
+      <!--antcall target="test-clustered-entity"/-->
       <antcall target="test-cluster-session"/>
 
       <antcall target="tests-clustering-shutdown"/>

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/EJBContainer.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/EJBContainer.java	2007-11-07 01:01:36 UTC (rev 66805)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/EJBContainer.java	2007-11-07 02:39:17 UTC (rev 66806)
@@ -337,6 +337,9 @@
    {
       this.dependencyPolicy = dependencyPolicy;
       // XML must be done first so that any annotation overrides are initialized
+      
+      // EJBTHREE-1090 moved from create()
+      initializeClassContainer();
 
       // todo injection handlers should be pluggable from XML
       Collection<InjectionHandler> handlers = new ArrayList<InjectionHandler>();
@@ -545,7 +548,8 @@
    public void create() throws Exception
    {
       // EJBTHREE-655: we need an instance after create
-      initializeClassContainer();
+      // initializeClassContainer();
+      // EJBTHREE-1090 moved to processMetaData()
       for (int i = 0; i < constructors.length; i++)
       {
          if (constructors[i].getParameterTypes().length == 0)

Added: branches/Branch_4_2/ejb3/src/resources/test/ejbthree1090/ejbthree1090-ejb3-interceptors-aop.xml
===================================================================
--- branches/Branch_4_2/ejb3/src/resources/test/ejbthree1090/ejbthree1090-ejb3-interceptors-aop.xml	                        (rev 0)
+++ branches/Branch_4_2/ejb3/src/resources/test/ejbthree1090/ejbthree1090-ejb3-interceptors-aop.xml	2007-11-07 02:39:17 UTC (rev 66806)
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE aop PUBLIC
+   "-//JBoss//DTD JBOSS AOP 1.0//EN"
+   "http://labs.jboss.com/portal/jbossaop/dtd/jboss-aop_1_0.dtd">
+
+<aop>
+   <interceptor class="org.jboss.ejb3.test.ejbthree1090.AopInterceptor" scope="PER_VM"/>
+
+   <domain name="Test Base Stateful Bean">
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.asynchronous.AsynchronousInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory"/>
+      </bind>
+      <bind pointcut="execution(public * @org.jboss.annotation.security.SecurityDomain->*(..))">
+         <interceptor-ref name="Basic Authorization"/>
+      </bind>
+      <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
+      </bind>
+      <bind pointcut="execution(public * @org.jboss.annotation.ejb.Clustered->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory"/>
+      </bind>
+      <bind pointcut="execution(public * *->@javax.ejb.Remove(..))">
+         <interceptor-ref name="org.jboss.ejb3.stateful.StatefulRemoveFactory"/>
+      </bind>
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.stateful.StatefulInstanceInterceptor"/>
+         <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
+         <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
+      </bind>
+      <bind pointcut="execution(public * $instanceof{javax.ejb.SessionSynchronization}->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.stateful.SessionSynchronizationInterceptor"/>
+      </bind>
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
+         <interceptor-ref name="org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor"/>
+      </bind>
+
+      <bind pointcut="execution(public * @org.jboss.annotation.ejb.Clustered->*(..)) AND !execution(public * *->@javax.ejb.Remove(..))">
+         <interceptor-ref name="org.jboss.ejb3.cache.StatefulReplicationInterceptor"/>
+      </bind>
+
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/>
+      </bind>
+
+      <annotation expr="!class(@org.jboss.annotation.ejb.PoolClass)">
+         @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.ThreadlocalPool.class, maxSize=30, timeout=10000)
+      </annotation>
+      
+   </domain>
+
+   <domain name="Test Stateful Bean" extends="Base Stateful Bean" inheritBindings="true">
+   
+      <bind pointcut="execution(public * *->*(..))">
+         <interceptor-ref name="org.jboss.ejb3.test.ejbthree1090.AopInterceptor"/>
+      </bind> 
+      
+      <!-- NON Clustered cache configuration -->
+      <annotation expr="!class(@org.jboss.annotation.ejb.cache.Cache) AND !class(@org.jboss.annotation.ejb.Clustered)">
+         @org.jboss.annotation.ejb.cache.Cache (org.jboss.ejb3.cache.simple.SimpleStatefulCache.class)
+      </annotation>
+      <annotation expr="!class(@org.jboss.annotation.ejb.cache.simple.PersistenceManager) AND !class(@org.jboss.annotation.ejb.Clustered)">
+         @org.jboss.annotation.ejb.cache.simple.PersistenceManager (org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.class)
+      </annotation>
+      <annotation expr="!class(@org.jboss.annotation.ejb.cache.simple.CacheConfig) AND !class(@org.jboss.annotation.ejb.Clustered)">
+         @org.jboss.annotation.ejb.cache.simple.CacheConfig (maxSize=100000, idleTimeoutSeconds=300, removalTimeoutSeconds=0)
+      </annotation>
+
+      <!-- Clustered cache configuration -->
+      <annotation expr="!class(@org.jboss.annotation.ejb.cache.Cache) AND class(@org.jboss.annotation.ejb.Clustered)">
+         @org.jboss.annotation.ejb.cache.Cache (org.jboss.ejb3.cache.tree.StatefulTreeCache.class)
+      </annotation>
+      <annotation expr="!class(@org.jboss.annotation.ejb.cache.tree.CacheConfig) AND class(@org.jboss.annotation.ejb.Clustered)">
+         @org.jboss.annotation.ejb.cache.tree.CacheConfig (name="jboss.cache:service=EJB3SFSBClusteredCache", maxSize=100000, idleTimeoutSeconds=300, removalTimeoutSeconds=0)
+      </annotation>
+      
+      <annotation expr="!class(@javax.interceptors.Interceptors)">
+         @javax.interceptor.Interceptors (value={org.jboss.ejb3.test.ejbthree1090.Ejb3Interceptor.class})
+      </annotation>
+   </domain>
+
+</aop>
\ No newline at end of file

Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree1090/AopInterceptor.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree1090/AopInterceptor.java	                        (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree1090/AopInterceptor.java	2007-11-07 02:39:17 UTC (rev 66806)
@@ -0,0 +1,58 @@
+/*
+ * 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.ejb3.test.ejbthree1090;
+
+import org.jboss.aop.advice.Interceptor;
+import org.jboss.aop.joinpoint.Invocation;
+import org.jboss.logging.Logger;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+public class AopInterceptor implements Interceptor, java.io.Serializable
+{
+   private static final Logger log = Logger.getLogger(AopInterceptor.class);
+   
+   public AopInterceptor()
+   {
+   }
+
+   public String getName()
+   {
+      return "AopInterceptor";
+   }
+
+   public Object invoke(Invocation invocation) throws Throwable
+   {
+      try 
+      {
+         log.info("*** Intercepting in AopInterceptor" );
+         invocation.invokeNext();
+         return ":Aop Intercepted";
+      } 
+      finally
+      {
+      }
+   }
+}

Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree1090/Ejb3Interceptor.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree1090/Ejb3Interceptor.java	                        (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree1090/Ejb3Interceptor.java	2007-11-07 02:39:17 UTC (rev 66806)
@@ -0,0 +1,66 @@
+/*
+ * 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.ejb3.test.ejbthree1090;
+
+import java.io.Serializable;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+
+import org.jboss.logging.Logger;
+
+/**
+ * @author <a href="mailto:kabir.khan at jboss.org">Kabir Khan</a>
+ * @version $Revision: 57207 $
+ */
+public class Ejb3Interceptor implements Serializable
+{
+   private static final Logger log = Logger.getLogger(Ejb3Interceptor.class);
+   
+   private static boolean called = false;
+   
+   public Ejb3Interceptor()
+   {
+   }
+   
+   @AroundInvoke
+   public Object intercept(InvocationContext ctx) throws Exception
+   {
+      try
+      {
+         log.info("*** Intercepting in Ejb3Interceptor");
+         // This is to skip the second instance of the interceptor due to @Interceptors being TYPE and METHOD
+         if (called)
+         {
+            return ctx.proceed();
+         }
+         else
+         {
+            called = true;
+            return "Ejb3 Intercepted" + ctx.proceed();
+         }
+      }
+      finally
+      {
+      }
+   }
+}

Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree1090/StatefulBean.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree1090/StatefulBean.java	                        (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree1090/StatefulBean.java	2007-11-07 02:39:17 UTC (rev 66806)
@@ -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.ejb3.test.ejbthree1090;
+
+import javax.ejb.Remote;
+import javax.ejb.Stateful;
+
+import org.jboss.annotation.ejb.AspectDomain;
+import org.jboss.logging.Logger;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @version $Revision: 60233 $
+ */
+ at Stateful
+ at Remote(StatefulRemote.class)
+ at AspectDomain("Test Stateful Bean")
+//@javax.interceptor.Interceptors(value={org.jboss.ejb3.test.ejbthree1090.Ejb3Interceptor.class})
+public class StatefulBean
+   implements StatefulRemote
+{
+   private static final Logger log = Logger.getLogger(StatefulBean.class);
+   
+   public String test() throws Exception
+   {
+      return "Not intercepted";
+   }
+}

Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree1090/StatefulRemote.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree1090/StatefulRemote.java	                        (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree1090/StatefulRemote.java	2007-11-07 02:39:17 UTC (rev 66806)
@@ -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.ejb3.test.ejbthree1090;
+
+
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+public interface StatefulRemote
+{
+   public String test() throws Exception;
+
+}

Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree1090/unit/InterceptorsUnitTestCase.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree1090/unit/InterceptorsUnitTestCase.java	                        (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree1090/unit/InterceptorsUnitTestCase.java	2007-11-07 02:39:17 UTC (rev 66806)
@@ -0,0 +1,59 @@
+/*
+ * 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.ejb3.test.ejbthree1090.unit;
+
+import org.jboss.ejb3.test.ejbthree1090.StatefulRemote;
+
+import org.jboss.logging.Logger;
+import org.jboss.test.JBossTestCase;
+import junit.framework.Test;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @version $Revision: 60233 $
+ */
+public class InterceptorsUnitTestCase
+extends JBossTestCase
+{
+   private static final Logger log = Logger.getLogger(InterceptorsUnitTestCase.class);
+
+   public InterceptorsUnitTestCase(String name)
+   {
+      super(name);
+   }
+   
+   public void testAspectDomain() throws Exception
+   {
+      StatefulRemote stateful = (StatefulRemote)getInitialContext().lookup("StatefulBean/remote");
+      String result = stateful.test();
+      System.out.println(result);
+      assertEquals("Ejb3 Intercepted:Aop Intercepted", result);
+   }
+
+   public static Test suite() throws Exception
+   {
+      return getDeploySetup(InterceptorsUnitTestCase.class, "ejbthree1090-test.jar");
+   }
+
+}




More information about the jboss-cvs-commits mailing list