[jboss-cvs] JBossAS SVN: r83969 - in branches/JBPAPP_4_3_0_GA_JBPAPP-1671/ejb3/src: test/org/jboss/ejb3/test/ejbthree1549/unit and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Feb 6 11:45:40 EST 2009


Author: galder.zamarreno at jboss.com
Date: 2009-02-06 11:45:40 -0500 (Fri, 06 Feb 2009)
New Revision: 83969

Added:
   branches/JBPAPP_4_3_0_GA_JBPAPP-1671/ejb3/src/resources/test/ejbthree1549/jar/my-interceptors-aop.xml
   branches/JBPAPP_4_3_0_GA_JBPAPP-1671/ejb3/src/test/org/jboss/ejb3/test/ejbthree1549/unit/PassivationDoesNotPreventNewActivityUnitTestCase.java
Log:
[JBPAPP-1671] Add missing files.

Added: branches/JBPAPP_4_3_0_GA_JBPAPP-1671/ejb3/src/resources/test/ejbthree1549/jar/my-interceptors-aop.xml
===================================================================
--- branches/JBPAPP_4_3_0_GA_JBPAPP-1671/ejb3/src/resources/test/ejbthree1549/jar/my-interceptors-aop.xml	                        (rev 0)
+++ branches/JBPAPP_4_3_0_GA_JBPAPP-1671/ejb3/src/resources/test/ejbthree1549/jar/my-interceptors-aop.xml	2009-02-06 16:45:40 UTC (rev 83969)
@@ -0,0 +1,76 @@
+<?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.ejbthree1549.ContainerAccessInterceptor" scope="PER_VM"/>
+   
+   <domain name="My 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.test.ejbthree1549.ContainerAccessInterceptor"/>
+         <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="My Stateful Bean" extends="My Base Stateful Bean" inheritBindings="true">
+      <!-- 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>
+   </domain>
+   
+</aop>
\ No newline at end of file

Added: branches/JBPAPP_4_3_0_GA_JBPAPP-1671/ejb3/src/test/org/jboss/ejb3/test/ejbthree1549/unit/PassivationDoesNotPreventNewActivityUnitTestCase.java
===================================================================
--- branches/JBPAPP_4_3_0_GA_JBPAPP-1671/ejb3/src/test/org/jboss/ejb3/test/ejbthree1549/unit/PassivationDoesNotPreventNewActivityUnitTestCase.java	                        (rev 0)
+++ branches/JBPAPP_4_3_0_GA_JBPAPP-1671/ejb3/src/test/org/jboss/ejb3/test/ejbthree1549/unit/PassivationDoesNotPreventNewActivityUnitTestCase.java	2009-02-06 16:45:40 UTC (rev 83969)
@@ -0,0 +1,95 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.ejbthree1549.unit;
+
+import junit.framework.Test;
+
+import org.jboss.ejb3.test.ejbthree1549.MyStatefulCacheProxyRemote;
+import org.jboss.test.JBossTestCase;
+
+/**
+ * PassivationDoesNotPreventNewActivityUnitTestCase
+ * 
+ * Contains tests to ensure that performing passivation does not 
+ * block either new session creation or invocation in other sessions
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @author <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
+ * @version $Revision: $
+ */
+public class PassivationDoesNotPreventNewActivityUnitTestCase extends JBossTestCase
+{
+   // --------------------------------------------------------------------------------||
+   // Tests --------------------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   public PassivationDoesNotPreventNewActivityUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public static Test suite() throws Exception
+   {
+      return getDeploySetup(PassivationDoesNotPreventNewActivityUnitTestCase.class, "ejbthree1549.ear");
+   }
+
+   /**
+    * Tests that removal may take place during the course 
+    * of passivation
+    */
+   public void testSessionRemovalDuringPassivation() throws Throwable
+   {
+      MyStatefulCacheProxyRemote cache = (MyStatefulCacheProxyRemote) getInitialContext().lookup(MyStatefulCacheProxyRemote.JNDI_NAME);
+      cache.testSessionRemovalDuringPassivation();      
+   }
+
+   public void testInvokeSameSessionDuringPassivation() throws Throwable
+   {
+      MyStatefulCacheProxyRemote cache = (MyStatefulCacheProxyRemote) getInitialContext().lookup(MyStatefulCacheProxyRemote.JNDI_NAME);
+      cache.testInvokeSameSessionDuringPassivation();
+   }
+
+   public void testInvokeSameSessionDuringPrePassivation() throws Throwable
+   {
+      MyStatefulCacheProxyRemote cache = (MyStatefulCacheProxyRemote) getInitialContext().lookup(MyStatefulCacheProxyRemote.JNDI_NAME);
+      cache.testInvokeSameSessionDuringPrePassivation();
+   }
+
+   /**
+    * Tests that a new session may be created while another is being passivated
+    */
+   public void testNewSessionMayBeCreatedDuringPassivation() throws Throwable
+   {
+      MyStatefulCacheProxyRemote cache = (MyStatefulCacheProxyRemote) getInitialContext().lookup(MyStatefulCacheProxyRemote.JNDI_NAME);
+      cache.testNewSessionMayBeCreatedDuringPassivation();
+   }
+
+   /**
+    * Tests that a one session may carry out an invocation while another session
+    * is undergoing passivation
+    */
+   public void testSessionMayBeInvokedWhileAnotherIsPassivating() throws Throwable
+   {
+      MyStatefulCacheProxyRemote cache = (MyStatefulCacheProxyRemote) getInitialContext().lookup(MyStatefulCacheProxyRemote.JNDI_NAME);
+      cache.testSessionMayBeInvokedWhileAnotherIsPassivating();
+   }
+}
\ No newline at end of file




More information about the jboss-cvs-commits mailing list