[jboss-cvs] JBossAS SVN: r60840 - in branches/Branch_4_2/ejb3/src: test/org/jboss/ejb3/test/interceptors2 and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Feb 23 10:06:44 EST 2007


Author: wolfc
Date: 2007-02-23 10:06:44 -0500 (Fri, 23 Feb 2007)
New Revision: 60840

Modified:
   branches/Branch_4_2/ejb3/src/resources/test/interceptors2/META-INF/jboss.xml
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/interceptors2/AnnotatedClassInterceptor3.java
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/interceptors2/AnnotatedOnlySLSB.java
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/interceptors2/unit/InterceptorsTestCase.java
Log:
Fixed 2 interceptors2 test cases

Modified: branches/Branch_4_2/ejb3/src/resources/test/interceptors2/META-INF/jboss.xml
===================================================================
--- branches/Branch_4_2/ejb3/src/resources/test/interceptors2/META-INF/jboss.xml	2007-02-23 14:07:05 UTC (rev 60839)
+++ branches/Branch_4_2/ejb3/src/resources/test/interceptors2/META-INF/jboss.xml	2007-02-23 15:06:44 UTC (rev 60840)
@@ -8,6 +8,12 @@
         <session>
             <ejb-name>XMLOnlySLSB</ejb-name>
             <jndi-name>org.jboss.ejb3.test.interceptors2.XMLOnlySLSBRemote</jndi-name>
+            
+            <!-- The default is ThreadlocalPool, which could lead to new constructs. Same goes for maxSize. -->
+            <pool-config>
+            	<pool-class>org.jboss.ejb3.StrictMaxPool</pool-class>
+            	<pool-max-size>1</pool-max-size>
+            </pool-config>
         </session>
    </enterprise-beans>
 </jboss>

Modified: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/interceptors2/AnnotatedClassInterceptor3.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/interceptors2/AnnotatedClassInterceptor3.java	2007-02-23 14:07:05 UTC (rev 60839)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/interceptors2/AnnotatedClassInterceptor3.java	2007-02-23 15:06:44 UTC (rev 60840)
@@ -44,7 +44,7 @@
    @Resource
    EJBContext ejbCtx;
 
-   static int currentInstance;
+   private static int currentInstance = 0;
    int instance = ++currentInstance;
 
    @AroundInvoke

Modified: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/interceptors2/AnnotatedOnlySLSB.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/interceptors2/AnnotatedOnlySLSB.java	2007-02-23 14:07:05 UTC (rev 60839)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/interceptors2/AnnotatedOnlySLSB.java	2007-02-23 15:06:44 UTC (rev 60840)
@@ -32,6 +32,9 @@
 import javax.ejb.Remote;
 import javax.ejb.Stateless;
 
+import org.jboss.annotation.ejb.PoolClass;
+import org.jboss.ejb3.StrictMaxPool;
+
 /**
  * 
  * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
@@ -41,6 +44,8 @@
 @Remote(AnnotatedOnlySLSBRemote.class)
 @Interceptors(AnnotatedClassInterceptor.class)
 @ExcludeDefaultInterceptors
+// The default is ThreadlocalPool, which could lead to new constructs. Same goes for maxSize.
+ at PoolClass(value=StrictMaxPool.class, maxSize=1)
 public class AnnotatedOnlySLSB implements AnnotatedOnlySLSBRemote
 {
    @EJB
@@ -81,14 +86,14 @@
    @PostConstruct
    void postConstruct()
    {
-      System.out.println("AnnotatedOnlySLSB postConstruct");
+      System.out.println("AnnotatedOnlySLSB postConstruct " + this);
       StatusBean.addPostConstruct(new Interception(this, "postConstruct"));
    }
 
    @PreDestroy()
    void preDestroy()
    {
-      System.out.println("AnnotatedOnlySLSB preDestroy!");
+      System.out.println("AnnotatedOnlySLSB preDestroy! " + this);
       StatusBean.addPreDestroy(new Interception(this, "preDestroy"));
    }
 }

Modified: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/interceptors2/unit/InterceptorsTestCase.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/interceptors2/unit/InterceptorsTestCase.java	2007-02-23 14:07:05 UTC (rev 60839)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/interceptors2/unit/InterceptorsTestCase.java	2007-02-23 15:06:44 UTC (rev 60840)
@@ -115,6 +115,7 @@
             new Interception(AnnotatedMethodInterceptor.class, "intercept2"), 
             new Interception(AnnotatedMethodInterceptor.class, "intercept"), 
             new Interception(AnnotatedOnlySLSB.class, "intercept")}, interceptions);
+      //System.err.println(status.getPostConstructs());
       checkLifecycle(status, false, false, false, false);
       
       status.clear();
@@ -125,6 +126,7 @@
             new Interception(AnnotatedMethodInterceptor.class, "intercept2"), 
             new Interception(AnnotatedMethodInterceptor.class, "intercept"), 
             new Interception(AnnotatedOnlySLSB.class, "intercept")}, interceptions);
+      //System.err.println(status.getPostConstructs());
       checkLifecycle(status, false, false, false, false);
       
    }
@@ -690,7 +692,7 @@
       }
       else
       {
-         assertEquals(0, status.getPostConstructs().size());
+         assertEquals("Number of post constructs", 0, status.getPostConstructs().size());
       }
 
       if (expectPostActivate)




More information about the jboss-cvs-commits mailing list