[Jboss-cvs] JBossAS SVN: r56622 - in branches/Branch_4_0/ejb3/src: resources resources/schema resources/security resources/standalone resources/test resources/test/bank/META-INF resources/test/cache resources/test/circulardependency/META-INF resources/test/clusteredservice resources/test/clusteredservice/WEB-INF resources/test/dd/mdb/META-INF resources/test/dd/web/META-INF resources/test/dd/web/WEB-INF resources/test/iiop resources/test/mdb resources/test/mdb/META-INF resources/test/naming-errors resources/test/seam resources/test/seam/META-INF resources/test/seam/META-INF/maven resources/test/seam/META-INF/maven/com.adapt.crm resources/test/seam/META-INF/maven/com.adapt.crm/crm-ejb resources/test/servlet/META-INF resources/test/servlet/WEB-INF resources/test/ssladvanced resources/test/ssladvanced/META-INF resources/test/stateful/META-INF resources/test/unauthenticatedprincipal resources/test/unauthenticatedprincipal/META-INF resources/test-configs resources/test-configs/ejb3-! jacc/deploy resources/test-configs/invoker resources/test-configs/invoker/deploy resources/test-configs/invoker/deploy/ejb3.deployer resources/test-configs/invoker/deploy/ejb3.deployer/META-INF resources/test-configs/invoker/deploy/servlet-invoker.war resources/test-configs/invoker/deploy/servlet-invoker.war/WEB-INF resources/test-configs/invoker/deploy/servlet-invoker.war/WEB-INF/classes resources/test-configs/invoker/deploy/servlet-invoker.war/WEB-INF/classes/org resources/test-configs/invoker/deploy/servlet-invoker.war/WEB-INF/classes/org/jboss resources/test-configs/invoker/deploy/servlet-invoker.war/WEB-INF/classes/org/jboss/remoting resources/test-configs/invoker/deploy/servlet-invoker.war/WEB-INF/classes/org/jboss/remoting/transport resources/test-configs/invoker/deploy/servlet-invoker.war/WEB-INF/classes/org/jboss/remoting/transport/servlet resources/test-configs/invoker/deploy/servlet-invoker.war/WEB-INF/classes/org/jboss/remoting/transport/servlet/web test/org/jbo! ss/ejb3/test test/org/jboss/ejb3/test/asynchronous test/org/jboss/ejb3/test/bank test/org/jboss/ejb3/test/bank/unit test/org/jboss/ejb3/test/cache test/org/jboss/ejb3/test/clusteredservice test/org/jboss/ejb3/test/clusteredservice/servlets test/org/jboss/ejb3/test/clusteredservice/unit test/org/jboss/ejb3/test/concurrent tes

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Sep 7 22:24:55 EDT 2006


Author: bill.burke at jboss.com
Date: 2006-09-07 22:24:08 -0400 (Thu, 07 Sep 2006)
New Revision: 56622

Added:
   branches/Branch_4_0/ejb3/src/resources/ejb3-timer-service.xml
   branches/Branch_4_0/ejb3/src/resources/security/
   branches/Branch_4_0/ejb3/src/resources/security/tst.policy
   branches/Branch_4_0/ejb3/src/resources/test-configs/invoker/
   branches/Branch_4_0/ejb3/src/resources/test-configs/invoker/deploy/
   branches/Branch_4_0/ejb3/src/resources/test-configs/invoker/deploy/ejb3.deployer/
   branches/Branch_4_0/ejb3/src/resources/test-configs/invoker/deploy/ejb3.deployer/META-INF/
   branches/Branch_4_0/ejb3/src/resources/test-configs/invoker/deploy/ejb3.deployer/META-INF/jboss-service.xml
   branches/Branch_4_0/ejb3/src/resources/test-configs/invoker/deploy/servlet-invoker.war/
   branches/Branch_4_0/ejb3/src/resources/test-configs/invoker/deploy/servlet-invoker.war/WEB-INF/
   branches/Branch_4_0/ejb3/src/resources/test-configs/invoker/deploy/servlet-invoker.war/WEB-INF/classes/
   branches/Branch_4_0/ejb3/src/resources/test-configs/invoker/deploy/servlet-invoker.war/WEB-INF/classes/org/
   branches/Branch_4_0/ejb3/src/resources/test-configs/invoker/deploy/servlet-invoker.war/WEB-INF/classes/org/jboss/
   branches/Branch_4_0/ejb3/src/resources/test-configs/invoker/deploy/servlet-invoker.war/WEB-INF/classes/org/jboss/remoting/
   branches/Branch_4_0/ejb3/src/resources/test-configs/invoker/deploy/servlet-invoker.war/WEB-INF/classes/org/jboss/remoting/transport/
   branches/Branch_4_0/ejb3/src/resources/test-configs/invoker/deploy/servlet-invoker.war/WEB-INF/classes/org/jboss/remoting/transport/servlet/
   branches/Branch_4_0/ejb3/src/resources/test-configs/invoker/deploy/servlet-invoker.war/WEB-INF/classes/org/jboss/remoting/transport/servlet/web/
   branches/Branch_4_0/ejb3/src/resources/test-configs/invoker/deploy/servlet-invoker.war/WEB-INF/classes/org/jboss/remoting/transport/servlet/web/ServerInvokerServlet.class
   branches/Branch_4_0/ejb3/src/resources/test-configs/invoker/deploy/servlet-invoker.war/WEB-INF/web.xml
   branches/Branch_4_0/ejb3/src/resources/test/clusteredservice/
   branches/Branch_4_0/ejb3/src/resources/test/clusteredservice/WEB-INF/
   branches/Branch_4_0/ejb3/src/resources/test/clusteredservice/WEB-INF/web.xml
   branches/Branch_4_0/ejb3/src/resources/test/iiop/
   branches/Branch_4_0/ejb3/src/resources/test/iiop/custom.jndi.properties
   branches/Branch_4_0/ejb3/src/resources/test/iiop/jndi.properties
   branches/Branch_4_0/ejb3/src/resources/test/seam/
   branches/Branch_4_0/ejb3/src/resources/test/seam/META-INF/
   branches/Branch_4_0/ejb3/src/resources/test/seam/META-INF/ejb-jar.xml
   branches/Branch_4_0/ejb3/src/resources/test/seam/META-INF/maven/
   branches/Branch_4_0/ejb3/src/resources/test/seam/META-INF/maven/com.adapt.crm/
   branches/Branch_4_0/ejb3/src/resources/test/seam/META-INF/maven/com.adapt.crm/crm-ejb/
   branches/Branch_4_0/ejb3/src/resources/test/seam/META-INF/maven/com.adapt.crm/crm-ejb/pom.properties
   branches/Branch_4_0/ejb3/src/resources/test/seam/META-INF/maven/com.adapt.crm/crm-ejb/pom.xml
   branches/Branch_4_0/ejb3/src/resources/test/seam/jboss-seam.jar
   branches/Branch_4_0/ejb3/src/resources/test/seam/seam.properties
   branches/Branch_4_0/ejb3/src/resources/test/ssladvanced/
   branches/Branch_4_0/ejb3/src/resources/test/ssladvanced/META-INF/
   branches/Branch_4_0/ejb3/src/resources/test/ssladvanced/META-INF/jboss.xml
   branches/Branch_4_0/ejb3/src/resources/test/stateful/META-INF/jboss.xml
   branches/Branch_4_0/ejb3/src/resources/test/unauthenticatedprincipal/
   branches/Branch_4_0/ejb3/src/resources/test/unauthenticatedprincipal/META-INF/
   branches/Branch_4_0/ejb3/src/resources/test/unauthenticatedprincipal/META-INF/ejb-jar.xml
   branches/Branch_4_0/ejb3/src/resources/test/unauthenticatedprincipal/META-INF/jboss.xml
   branches/Branch_4_0/ejb3/src/resources/test/unauthenticatedprincipal/roles.properties
   branches/Branch_4_0/ejb3/src/resources/test/unauthenticatedprincipal/users.properties
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/CustomJNDIJBossTestCase.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/CustomJNDIJBossTestServices.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/CustomJNDIJBossTestSetup.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/ServiceBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/ServiceLocal.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/ServiceManagement.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/ServiceRemote.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/ServiceWeb.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/servlets/
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/servlets/EJBServlet.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/unit/
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/unit/HttpUtils.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/unit/ServiceTestCase.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/concurrent/
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/concurrent/MyStateful.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/concurrent/MyStatefulBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/concurrent/unit/
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/concurrent/unit/ConcurrentUnitTestCase.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/HomedStatelessBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/HomedStatelessHome.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/MyServiceBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/MySession.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/MySessionBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/MyStateful.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/MyStatefulBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/MyStatefulHome.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/TxTester.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/TxTesterBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/unit/
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/unit/IiopRemoteUnitTestCase.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/invoker/
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/invoker/StatelessBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/invoker/StatelessRemote.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/invoker/unit/
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/invoker/unit/InvokerTestCase.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/Entity.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/QueueBean21.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/QueueTestMDB.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/RollbackQueueTestMDB.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/StatelessFacade.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/StatelessFacadeBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/TestStatus.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/TestStatusBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/unit/
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/unit/MDBUnitTestCase.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/unauthenticatedprincipal/
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/unauthenticatedprincipal/StatelessBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/unauthenticatedprincipal/StatelessRemote.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/unauthenticatedprincipal/unit/
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/unauthenticatedprincipal/unit/UnauthenticatedPrincipalTestCase.java
Removed:
   branches/Branch_4_0/ejb3/src/resources/schema/application-client_5.xsd
   branches/Branch_4_0/ejb3/src/resources/schema/application_5.xsd
   branches/Branch_4_0/ejb3/src/resources/schema/ejb-jar_3_0a.xsd
   branches/Branch_4_0/ejb3/src/resources/schema/javaee_5.xsd
   branches/Branch_4_0/ejb3/src/resources/schema/javaee_web_services_1_2.xsd
   branches/Branch_4_0/ejb3/src/resources/schema/javaee_web_services_client_1_2.xsd
   branches/Branch_4_0/ejb3/src/resources/schema/sun-ejb-jar_3_0.xsd
Modified:
   branches/Branch_4_0/ejb3/src/resources/ejb3-interceptors-aop.xml
   branches/Branch_4_0/ejb3/src/resources/schema/jboss_5_0.xsd
   branches/Branch_4_0/ejb3/src/resources/standalone/embedded-jboss-beans.xml
   branches/Branch_4_0/ejb3/src/resources/standalone/jboss-jms-beans.xml
   branches/Branch_4_0/ejb3/src/resources/standalone/jndi.properties
   branches/Branch_4_0/ejb3/src/resources/test-configs/ejb3-jacc/deploy/jacc-service.xml
   branches/Branch_4_0/ejb3/src/resources/test/bank/META-INF/ejb-jar.xml
   branches/Branch_4_0/ejb3/src/resources/test/bank/META-INF/jboss.xml
   branches/Branch_4_0/ejb3/src/resources/test/cache/testejb3-cache-service.xml
   branches/Branch_4_0/ejb3/src/resources/test/cache/testejb3-statefulcache-service.xml
   branches/Branch_4_0/ejb3/src/resources/test/circulardependency/META-INF/jboss.xml
   branches/Branch_4_0/ejb3/src/resources/test/dd/mdb/META-INF/ejb-jar.xml
   branches/Branch_4_0/ejb3/src/resources/test/dd/mdb/META-INF/jboss.xml
   branches/Branch_4_0/ejb3/src/resources/test/dd/web/META-INF/application.xml
   branches/Branch_4_0/ejb3/src/resources/test/dd/web/WEB-INF/jbosstest-web.xml
   branches/Branch_4_0/ejb3/src/resources/test/mdb/META-INF/ejb-jar.xml
   branches/Branch_4_0/ejb3/src/resources/test/mdb/META-INF/jboss.xml
   branches/Branch_4_0/ejb3/src/resources/test/mdb/mdbtest-service.xml
   branches/Branch_4_0/ejb3/src/resources/test/naming-errors/ejb-jar-method-field.xml
   branches/Branch_4_0/ejb3/src/resources/test/servlet/META-INF/application.xml
   branches/Branch_4_0/ejb3/src/resources/test/servlet/META-INF/jboss.xml
   branches/Branch_4_0/ejb3/src/resources/test/servlet/WEB-INF/jboss-web.xml
   branches/Branch_4_0/ejb3/src/resources/test/servlet/WEB-INF/test-web.xml
   branches/Branch_4_0/ejb3/src/resources/test/stateful/META-INF/ejb-jar.xml
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/asynchronous/SecuredStatelessBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/Account.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/AccountBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/AccountBeanCMP.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/AccountData.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/AccountHome.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/Bank.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/BankBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/BankBean21.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/BankException.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/BankHome.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/Customer.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/CustomerBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/CustomerHome.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/Teller.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/TellerBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/TellerHome.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/unit/BankDeploymentDescriptorTestCase.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/cache/Tester.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/consumer/QueueTestConsumer.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/dd/mdb/unit/MDBUnitTestCase.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/dd/unit/EjbJarXmlTestCase.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/dd/web/servlets/EJBServlet.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/dd/web/unit/WebIntegrationUnitTestCase.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/Stateful.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/StatefulBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/StatefulRemote.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/Stateless.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/StatelessBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/StatelessLocal.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/unit/EjbContextUnitTestCase.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/initial/ClassInjectedBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/interceptors2/InheritingSFSB.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/jacc/StatefulBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/jacc/StatelessBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/jca/inflowmdb/DeploymentDescriptorTestMDBMessageListener.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/jca/inflowmdb/TestMDBMessageListener.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/jca/inflowmdb/unit/DeploymentDescriptorInflowUnitTestCase.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/jca/inflowmdb/unit/InflowUnitTestCase.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/longlived/HibernateShoppingCartBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/longlived/ShoppingCartBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/BMTQueueTestMDB.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/DefaultedQueueTestMDB.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/NondurableQueueTestMDB.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/OverrideTestMDB.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/QueueTestMDB.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/StatelessBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/TestStatus.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/TestStatusBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/TopicTestMDB.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/unit/MDBUnitTestCase.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/naming/bad/BadFieldMethodBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/naming/bad/BadInjector.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/naming/unit/BadInjectionsUnitTestCase.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/naming/unit/BindFailureTestCase.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/reference21_30/Session30Bean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/schema/unit/SchemaTestCase.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/CalledSession.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/CallerBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/CallerBean2.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/CallerFacadeBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/FacadeTargetBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/Level1CallerBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/PublicSessionBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/PublicSessionFacade.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/SecurityContextBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/StatelessSessionBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/StatelessSessionBean2.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/StatelessSessionBean3.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/StatelessSessionBeanInDomain.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/StatelessSessionBean_test.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/TimerTesterBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/UnsecuredStatelessSessionBean2.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/unit/EJBSpecUnitTestCase.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/service/unit/ServiceUnitTestCase.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/servlet/Session30.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/servlet/Session30Bean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/servlet/servlets/EJBServlet.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/servlet/unit/ServletUnitTestCase.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/ssladvanced/unit/SSLUnitTestCase.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/stateful/Stateful.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/stateful/StatefulBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/stateful/StatefulTx.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/stateful/StatefulTxBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/stateful/unit/RemoteUnitTestCase.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/stateless/CheckedStatelessBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/stateless/unit/StatelessTestCase.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/strictpool/MDBInvoker.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/strictpool/StrictlyPooledMDB.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/timer/TimerTester.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/timer/TimerTesterBean.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/timer/TimerTesterBean21.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/timer/unit/RemoteUnitTestCase.java
   branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/wls/embeddedwar/CustomerDAOBean.java
Log:


Modified: branches/Branch_4_0/ejb3/src/resources/ejb3-interceptors-aop.xml
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/ejb3-interceptors-aop.xml	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/ejb3-interceptors-aop.xml	2006-09-08 02:24:08 UTC (rev 56622)
@@ -281,26 +281,10 @@
          <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)
+         @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.StrictMaxPool.class, maxSize=30, timeout=10000)
       </annotation>
    </domain>
-
-   <domain name="Message Inflow Driven Bean">
-      <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
-         <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
-      </bind>
-      <bind pointcut="execution(public * *->*(..))">
-         <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor"/>
-         <interceptor-ref name="org.jboss.ejb3.tx.TxInterceptorFactory"/>
-         <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor"/>
-         <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor"/>
-         <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="Consumer Bean">
       <bind pointcut="execution(public * @javax.annotation.security.RunAs->*(..))">
          <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory"/>
@@ -318,7 +302,7 @@
          <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)
+         @org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.StrictMaxPool.class, maxSize=30, timeout=10000)
       </annotation>
    </domain>
 

Added: branches/Branch_4_0/ejb3/src/resources/ejb3-timer-service.xml
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/ejb3-timer-service.xml	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/ejb3-timer-service.xml	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+	<!-- TODO: the ejb deployer must depend on this -->
+	
+	<!--  ================================================ -->
+	<!--  Defines the Quartz configuration for             -->
+	<!--  the EJB3 Timer Service                           -->
+	<!--  ================================================ -->
+	<mbean code="org.jboss.ejb3.timerservice.quartz.jmx.EJB3TimerService" name="jboss.ejb:service=EJB3TimerService">
+		<depends>jboss:service=Naming</depends>
+		<depends>jboss:service=TransactionManager</depends>
+		<depends optional-attribute-name="DataSource">jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
+		
+		<attribute name="Properties">
+        	org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreCMT
+            org.quartz.jobStore.nonManagedTXDataSource=myDS
+            org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.HSQLDBDelegate
+            org.quartz.jobStore.tablePrefix=QRTZ_
+            org.quartz.jobStore.dataSource=myDS
+         
+	        # To get it to work with hypersonic
+	        # FIXME: this doesn't lock the row
+            org.quartz.jobStore.selectWithLockSQL=SELECT * FROM qrtz_locks WHERE lock_name = ?
+         
+        	# from quartz.properties
+            org.quartz.scheduler.instanceName=JBossEJB3QuartzScheduler
+            org.quartz.scheduler.rmi.export=false
+            org.quartz.scheduler.rmi.proxy=false
+            org.quartz.scheduler.wrapJobExecutionInUserTransaction=false
+   
+            org.quartz.threadPool.class=org.quartz.simpl.SimpleThreadPool
+            org.quartz.threadPool.threadCount=10
+            org.quartz.threadPool.threadPriority=5
+            org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread=true
+   
+        	org.quartz.jobStore.misfireThreshold=60000
+		</attribute>
+		<attribute name="SqlProperties">
+			CREATE_DB_ON_STARTUP = TRUE
+			
+			CREATE_TABLE_JOB_DETAILS = CREATE TABLE qrtz_job_details(JOB_NAME VARCHAR(80) NOT NULL, JOB_GROUP VARCHAR(80) NOT NULL, \
+			   DESCRIPTION VARCHAR(120) NULL, JOB_CLASS_NAME VARCHAR(128) NOT NULL, IS_DURABLE VARCHAR(1) NOT NULL, \
+			   IS_VOLATILE VARCHAR(1) NOT NULL, IS_STATEFUL VARCHAR(1) NOT NULL, REQUESTS_RECOVERY VARCHAR(1) NOT NULL, \
+			   JOB_DATA BINARY NULL, PRIMARY KEY (JOB_NAME,JOB_GROUP))
+			CREATE_TABLE_JOB_LISTENERS = CREATE TABLE qrtz_job_listeners(JOB_NAME VARCHAR(80) NOT NULL, JOB_GROUP VARCHAR(80) NOT NULL, \
+			   JOB_LISTENER VARCHAR(80) NOT NULL, PRIMARY KEY (JOB_NAME,JOB_GROUP,JOB_LISTENER), FOREIGN KEY (JOB_NAME,JOB_GROUP) \
+			   REFERENCES QRTZ_JOB_DETAILS(JOB_NAME,JOB_GROUP))
+			CREATE_TABLE_TRIGGERS = CREATE TABLE qrtz_triggers(TRIGGER_NAME VARCHAR(80) NOT NULL, TRIGGER_GROUP VARCHAR(80) NOT NULL, \
+			   JOB_NAME VARCHAR(80) NOT NULL, JOB_GROUP VARCHAR(80) NOT NULL, IS_VOLATILE VARCHAR(1) NOT NULL, DESCRIPTION VARCHAR(120) NULL, \
+			   NEXT_FIRE_TIME NUMERIC(13) NULL, PREV_FIRE_TIME NUMERIC(13) NULL, TRIGGER_STATE VARCHAR(16) NOT NULL, \
+			   TRIGGER_TYPE VARCHAR(8) NOT NULL, START_TIME NUMERIC(13) NOT NULL, END_TIME NUMERIC(13) NULL, CALENDAR_NAME VARCHAR(80) NULL, \
+			   MISFIRE_INSTR NUMERIC(2) NULL, JOB_DATA BINARY NULL, PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP), FOREIGN KEY (JOB_NAME,JOB_GROUP) \
+			   REFERENCES QRTZ_JOB_DETAILS(JOB_NAME,JOB_GROUP))
+			CREATE_TABLE_SIMPLE_TRIGGERS = CREATE TABLE qrtz_simple_triggers(TRIGGER_NAME VARCHAR(80) NOT NULL, \
+			   TRIGGER_GROUP VARCHAR(80) NOT NULL, REPEAT_COUNT NUMERIC(7) NOT NULL, REPEAT_INTERVAL NUMERIC(12) NOT NULL, \
+			   TIMES_TRIGGERED NUMERIC(7) NOT NULL, PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP), FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP) \
+			   REFERENCES QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP))
+			CREATE_TABLE_CRON_TRIGGERS = CREATE TABLE qrtz_cron_triggers(TRIGGER_NAME VARCHAR(80) NOT NULL, \
+			   TRIGGER_GROUP VARCHAR(80) NOT NULL, CRON_EXPRESSION VARCHAR(80) NOT NULL, TIME_ZONE_ID VARCHAR(80), \
+			   PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP), FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP) \
+			   REFERENCES QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP))
+			CREATE_TABLE_BLOB_TRIGGERS = CREATE TABLE qrtz_blob_triggers(TRIGGER_NAME VARCHAR(80) NOT NULL, \
+			   TRIGGER_GROUP VARCHAR(80) NOT NULL, BLOB_DATA BINARY NULL, PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP), \
+			   FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP) REFERENCES QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP))
+			CREATE_TABLE_TRIGGER_LISTENERS = CREATE TABLE qrtz_trigger_listeners(TRIGGER_NAME VARCHAR(80) NOT NULL, \
+			   TRIGGER_GROUP VARCHAR(80) NOT NULL, TRIGGER_LISTENER VARCHAR(80) NOT NULL, \
+			   PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_LISTENER), FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP) \
+			   REFERENCES QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP))
+			CREATE_TABLE_CALENDARS = CREATE TABLE qrtz_calendars(CALENDAR_NAME VARCHAR(80) NOT NULL, CALENDAR BINARY NOT NULL, \
+			   PRIMARY KEY (CALENDAR_NAME))
+			CREATE_TABLE_PAUSED_TRIGGER_GRPS = CREATE TABLE qrtz_paused_trigger_grps(TRIGGER_GROUP VARCHAR(80) NOT NULL, \
+			   PRIMARY KEY (TRIGGER_GROUP))
+			CREATE_TABLE_FIRED_TRIGGERS = CREATE TABLE qrtz_fired_triggers(ENTRY_ID VARCHAR(95) NOT NULL, TRIGGER_NAME VARCHAR(80) NOT NULL, \
+			   TRIGGER_GROUP VARCHAR(80) NOT NULL, IS_VOLATILE VARCHAR(1) NOT NULL, INSTANCE_NAME VARCHAR(80) NOT NULL, \
+			   FIRED_TIME NUMERIC(13) NOT NULL, STATE VARCHAR(16) NOT NULL, JOB_NAME VARCHAR(80) NULL, JOB_GROUP VARCHAR(80) NULL, \
+			   IS_STATEFUL VARCHAR(1) NULL, REQUESTS_RECOVERY VARCHAR(1) NULL, PRIMARY KEY (ENTRY_ID))
+			CREATE_TABLE_SCHEDULER_STATE = CREATE TABLE qrtz_scheduler_state(INSTANCE_NAME VARCHAR(80) NOT NULL, \
+			   LAST_CHECKIN_TIME NUMERIC(13) NOT NULL, CHECKIN_INTERVAL NUMERIC(13) NOT NULL, RECOVERER VARCHAR(80) NULL, \
+			   PRIMARY KEY (INSTANCE_NAME))
+			CREATE_TABLE_LOCKS = CREATE TABLE qrtz_locks(LOCK_NAME VARCHAR(40) NOT NULL, PRIMARY KEY (LOCK_NAME))
+			INSERT_TRIGGER_ACCESS = INSERT INTO qrtz_locks values('TRIGGER_ACCESS')
+			INSERT_JOB_ACCESS = INSERT INTO qrtz_locks values('JOB_ACCESS')
+			INSERT_CALENDAR_ACCESS = INSERT INTO qrtz_locks values('CALENDAR_ACCESS')
+			INSERT_STATE_ACCESS = INSERT INTO qrtz_locks values('STATE_ACCESS')
+			INSERT_MISFIRE_ACCESS = INSERT INTO qrtz_locks values('MISFIRE_ACCESS')
+		</attribute>
+	</mbean>
+</server>
\ No newline at end of file

Deleted: branches/Branch_4_0/ejb3/src/resources/schema/application-client_5.xsd
===================================================================
(Binary files differ)

Deleted: branches/Branch_4_0/ejb3/src/resources/schema/application_5.xsd
===================================================================
(Binary files differ)

Deleted: branches/Branch_4_0/ejb3/src/resources/schema/ejb-jar_3_0a.xsd
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/schema/ejb-jar_3_0a.xsd	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/schema/ejb-jar_3_0a.xsd	2006-09-08 02:24:08 UTC (rev 56622)
@@ -1,2418 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
-	    targetNamespace="http://java.sun.com/xml/ns/j2ee"
-	    xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
-	    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-	    elementFormDefault="qualified"
-	    attributeFormDefault="unqualified"
-	    version="3.0">
-  <xsd:annotation>
-    <xsd:documentation>
-      @(#)ejb-jar_2_1.xsds	1.23 08/01/03
-    </xsd:documentation>
-  </xsd:annotation>
-
-  <xsd:annotation>
-    <xsd:documentation>
-
-      Copyright 2003 Sun Microsystems, Inc., 901 San Antonio
-      Road, Palo Alto, California 94303, U.S.A. All rights
-      reserved.
-
-      Sun Microsystems, Inc. has intellectual property rights
-      relating to technology described in this document. In
-      particular, and without limitation, these intellectual
-      property rights may include one or more of the U.S. patents
-      listed at http://www.sun.com/patents and one or more
-      additional patents or pending patent applications in the
-      U.S. and other countries.
-
-      This document and the technology which it describes are
-      distributed under licenses restricting their use, copying,
-      distribution, and decompilation. No part of this document
-      may be reproduced in any form by any means without prior
-      written authorization of Sun and its licensors, if any.
-
-      Third-party software, including font technology, is
-      copyrighted and licensed from Sun suppliers.
-
-      Sun, Sun Microsystems, the Sun logo, Solaris, Java, J2EE,
-      JavaServer Pages, Enterprise JavaBeans and the Java Coffee
-      Cup logo are trademarks or registered trademarks of Sun
-      Microsystems, Inc. in the U.S. and other countries.
-
-      Federal Acquisitions: Commercial Software - Government Users
-      Subject to Standard License Terms and Conditions.
-
-    </xsd:documentation>
-  </xsd:annotation>
-
-  <xsd:annotation>
-    <xsd:documentation>
-      <![CDATA[
-
-	This is the XML Schema for the EJB 3.0 deployment descriptor.
-	The deployment descriptor must be named "META-INF/ejb-jar.xml" in
-	the EJB's jar file.  All EJB deployment descriptors must indicate
-	the ejb-jar schema by using the J2EE namespace:
-
-	http://java.sun.com/xml/ns/j2ee
-
-	and by indicating the version of the schema by
-	using the version element as shown below:
-
-	    <ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee"
-	      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
-		  http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd"
-	      version="3.0">
-	      ...
-	    </ejb-jar>
-
-	The instance documents may indicate the published version of
-	the schema using the xsi:schemaLocation attribute for the
-	J2EE namespace with the following location:
-
-	http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd
-
-	]]>
-    </xsd:documentation>
-  </xsd:annotation>
-
-  <xsd:annotation>
-    <xsd:documentation>
-
-      The following conventions apply to all J2EE
-      deployment descriptor elements unless indicated otherwise.
-
-      - In elements that specify a pathname to a file within the
-	same JAR file, relative filenames (i.e., those not
-	starting with "/") are considered relative to the root of
-	the JAR file's namespace.  Absolute filenames (i.e., those
-	starting with "/") also specify names in the root of the
-	JAR file's namespace.  In general, relative names are
-	preferred.  The exception is .war files where absolute
-	names are preferred for consistency with the Servlet API.
-
-    </xsd:documentation>
-  </xsd:annotation>
-
-  <xsd:include schemaLocation="file:///C:/eclipse3.1M6/workspace/xml-test/j2ee_5_0a.xsd"/>
-
-<!-- **************************************************** -->
-
-
-  <xsd:element name="ejb-jar" type="j2ee:ejb-jarType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	This is the root of the ejb-jar deployment descriptor.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:key name="ejb-name-key">
-      <xsd:annotation>
-	<xsd:documentation>
-
-	  The ejb-name element contains the name of an enterprise
-	  bean. The name must be unique within the ejb-jar file.
-
-	</xsd:documentation>
-      </xsd:annotation>
-      <xsd:selector xpath="j2ee:enterprise-beans/*"/>
-      <xsd:field    xpath="j2ee:ejb-name"/>
-    </xsd:key>
-
-    <xsd:keyref name="ejb-name-references"
-		refer="j2ee:ejb-name-key">
-      <xsd:annotation>
-	<xsd:documentation>
-
-	  The keyref indicates the references from
-	  relationship-role-source must be to a specific ejb-name
-	  defined within the scope of enterprise-beans element.
-
-	</xsd:documentation>
-      </xsd:annotation>
-      <xsd:selector
-	   xpath=".//j2ee:ejb-relationship-role/j2ee:relationship-role-source"/>
-      <xsd:field
-	   xpath="j2ee:ejb-name"/>
-    </xsd:keyref>
-
-    <xsd:key name="role-name-key">
-      <xsd:annotation>
-	<xsd:documentation>
-
-	  A role-name-key is specified to allow the references
-	  from the security-role-refs.
-
-	</xsd:documentation>
-      </xsd:annotation>
-      <xsd:selector xpath="j2ee:assembly-descriptor/j2ee:security-role"/>
-      <xsd:field    xpath="j2ee:role-name"/>
-    </xsd:key>
-
-    <xsd:keyref name="role-name-references"
-		refer="j2ee:role-name-key">
-      <xsd:annotation>
-	<xsd:documentation>
-
-	  The keyref indicates the references from
-	  security-role-ref to a specified role-name.
-
-	</xsd:documentation>
-      </xsd:annotation>
-      <xsd:selector xpath="j2ee:enterprise-beans/*/j2ee:security-role-ref"/>
-      <xsd:field    xpath="j2ee:role-link"/>
-    </xsd:keyref>
-  </xsd:element>
-
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="activation-config-propertyType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The activation-config-propertyType contains a name/value
-	configuration property pair for a message-driven bean.
-
-	The properties that are recognized for a particular
-	message-driven bean are determined by the messaging type.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="activation-config-property-name"
-		   type="j2ee:xsdStringType">
-	<xsd:annotation>
-	  <xsd:documentation>
-
-	    The activation-config-property-name element contains
-	    the name for an activation configuration property of
-	    a message-driven bean.
-
-	    For JMS message-driven beans, the following property
-	    names are recognized: acknowledgeMode,
-	    messageSelector, destinationType, subscriptionDurability
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-      <xsd:element name="activation-config-property-value"
-		   type="j2ee:xsdStringType">
-	<xsd:annotation>
-	  <xsd:documentation>
-
-	    The activation-config-property-value element
-	    contains the value for an activation configuration
-	    property of a message-driven bean.
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="activation-configType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The activation-configType defines information about the
-	expected configuration properties of the message-driven bean
-	in its operational environment. This may include information
-	about message acknowledgement, message selector, expected
-	destination type, etc.
-
-	The configuration information is expressed in terms of
-	name/value configuration properties.
-
-	The properties that are recognized for a particular
-	message-driven bean are determined by the messaging type.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="description"
-		   type="j2ee:descriptionType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="activation-config-property"
-		   type="j2ee:activation-config-propertyType"
-		   maxOccurs="unbounded"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="assembly-descriptorType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The assembly-descriptorType defines
-	application-assembly information.
-
-	The application-assembly information consists of the
-	following parts: the definition of security roles, the
-	definition of method permissions, the definition of
-	transaction attributes for enterprise beans with
-	container-managed transaction demarcation and a list of
-	methods to be excluded from being invoked.
-
-	All the parts are optional in the sense that they are
-	omitted if the lists represented by them are empty.
-
-	Providing an assembly-descriptor in the deployment
-	descriptor is optional for the ejb-jar file producer.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="callback"
-		   type="j2ee:callbackType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="remove-list"
-		   type="j2ee:remove-listType"
-		   minOccurs="0"/>
-      <xsd:element name="init-list"
-		   type="j2ee:init-listType"
-		   minOccurs="0"/>
-      <xsd:element name="security-role"
-		   type="j2ee:security-roleType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="method-permission"
-		   type="j2ee:method-permissionType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="container-transaction"
-		   type="j2ee:container-transactionType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="message-destination"
-		   type="j2ee:message-destinationType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="exclude-list"
-		   type="j2ee:exclude-listType"
-		   minOccurs="0"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="cmp-fieldType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The cmp-fieldType describes a container-managed field. The
-	cmp-fieldType contains an optional description of the field,
-	and the name of the field.
-
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:sequence>
-      <xsd:element name="description"
-		   type="j2ee:descriptionType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="field-name"
-		   type="j2ee:java-identifierType">
-	<xsd:annotation>
-	  <xsd:documentation>
-
-	    The field-name element specifies the name of a
-	    container managed field.
-
-	    The name of the cmp-field of an entity bean with
-	    cmp-version 2.x must begin with a lowercase
-	    letter. This field is accessed by methods whose
-	    names consists of the name of the field specified by
-	    field-name in which the first letter is uppercased,
-	    prefixed by "get" or "set".
-
-	    The name of the cmp-field of an entity bean with
-	    cmp-version 1.x must denote a public field of the
-	    enterprise bean class or one of its superclasses.
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="cmp-versionType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The cmp-versionType specifies the version of an entity bean
-	with container-managed persistence. It is used by
-	cmp-version elements.
-
-	The value must be one of the two following:
-
-	    1.x
-	    2.x
-
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:simpleContent>
-      <xsd:restriction base="j2ee:string">
-	<xsd:enumeration value="1.x"/>
-	<xsd:enumeration value="2.x"/>
-      </xsd:restriction>
-    </xsd:simpleContent>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="cmr-field-typeType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The cmr-field-type element specifies the class of a
-	collection-valued logical relationship field in the entity
-	bean class. The value of an element using cmr-field-typeType
-	must be either: java.util.Collection or java.util.Set.
-
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:simpleContent>
-      <xsd:restriction base="j2ee:string">
-	<xsd:enumeration value="java.util.Collection"/>
-	<xsd:enumeration value="java.util.Set"/>
-      </xsd:restriction>
-    </xsd:simpleContent>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="cmr-fieldType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The cmr-fieldType describes the bean provider's view of
-	a relationship. It consists of an optional description, and
-	the name and the class type of a field in the source of a
-	role of a relationship. The cmr-field-name element
-	corresponds to the name used for the get and set accessor
-	methods for the relationship. The cmr-field-type element is
-	used only for collection-valued cmr-fields. It specifies the
-	type of the collection that is used.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="description"
-		   type="j2ee:descriptionType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="cmr-field-name"
-		   type="j2ee:string">
-	<xsd:annotation>
-	  <xsd:documentation>
-
-	    The cmr-field-name element specifies the name of a
-	    logical relationship field in the entity bean
-	    class. The name of the cmr-field must begin with a
-	    lowercase letter. This field is accessed by methods
-	    whose names consist of the name of the field
-	    specified by cmr-field-name in which the first
-	    letter is uppercased, prefixed by "get" or "set".
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-      <xsd:element name="cmr-field-type"
-		   type="j2ee:cmr-field-typeType"
-		   minOccurs="0"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="container-transactionType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The container-transactionType specifies how the container
-	must manage transaction scopes for the enterprise bean's
-	method invocations. It defines an optional description, a
-	list of method elements, and a transaction attribute. The
-	transaction attribute is to be applied to all the specified
-	methods.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="description"
-		   type="j2ee:descriptionType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="method"
-		   type="j2ee:methodType"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="trans-attribute"
-		   type="j2ee:trans-attributeType"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="ejb-classType">
-    <xsd:annotation>
-      <xsd:documentation>
-	<![CDATA[
-
-	  The ejb-classType contains the fully-qualified name of the
-	  enterprise bean's class. It is used by ejb-class elements.
-
-	  Example:
-
-	      <ejb-class>com.wombat.empl.EmployeeServiceBean</ejb-class>
-
-	  ]]>
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:simpleContent>
-      <xsd:restriction base="j2ee:fully-qualified-classType"/>
-    </xsd:simpleContent>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="callback-listenerType">
-    <xsd:annotation>
-      <xsd:documentation>
-	<![CDATA[
-
-	  The ejb-classType contains the fully-qualified name of the
-	  enterprise bean's callback listener. 
-
-	  Example:
-
-	      <callback-listener>com.wombat.empl.EmployeeCallbackListener</callback-listener>
-
-	  ]]>
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:simpleContent>
-      <xsd:restriction base="j2ee:fully-qualified-classType"/>
-    </xsd:simpleContent>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="interceptorType">
-    <xsd:annotation>
-      <xsd:documentation>
-	<![CDATA[
-
-	  The ejb-interceptorType contains the fully-qualified name of an
-	  interceptor for the enterprise bean. 
-
-	  Example:
-
-	      <interceptor>com.wombat.empl.Interceptor</interceptor>
-
-	  ]]>
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:simpleContent>
-      <xsd:restriction base="j2ee:fully-qualified-classType"/>
-    </xsd:simpleContent>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="interceptorsType">
-    <xsd:annotation>
-      <xsd:documentation>
-	<![CDATA[
-
-	  The ejb-interceptorsType contains a comma separated list of fully-qualified
-	  names of a interceptors for the enterprise bean. 
-
-	  Example:
-
-	      <interceptors>com.wombat.empl.Interceptor1,com.wombat.empl.Interceptor2</interceptors>
-
-	  ]]>
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:simpleContent>
-      <xsd:restriction base="j2ee:fully-qualified-classType"/>
-    </xsd:simpleContent>
-  </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="ejb-jarType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The ejb-jarType defines the root element of the EJB
-	deployment descriptor. It contains
-
-	    - an optional description of the ejb-jar file
-	    - an optional display name
-	    - an optional icon that contains a small and a large
-	      icon file name
-	    - mandatory structural information about all included
-	      enterprise beans
-	    - a descriptor for container managed relationships,
-	      if any
-	    - an optional application-assembly descriptor
-	    - an optional name of an ejb-client-jar file for the
-	      ejb-jar.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:group ref="j2ee:descriptionGroup"/>
-      <xsd:element name="enterprise-beans"
-		   type="j2ee:enterprise-beansType"
-		   minOccurs="0"/>
-      <xsd:element name="relationships"
-		   type="j2ee:relationshipsType"
-		   minOccurs="0">
-	<xsd:unique name="relationship-name-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The ejb-relation-name contains the name of a
-	      relation. The name must be unique within
-	      relationships.
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:ejb-relation"/>
-	  <xsd:field    xpath="j2ee:ejb-relation-name"/>
-	</xsd:unique>
-      </xsd:element>
-      <xsd:element name="assembly-descriptor"
-		   type="j2ee:assembly-descriptorType"
-		   minOccurs="0">
-	<xsd:annotation>
-	  <xsd:documentation>
-
-	    Providing an assembly-descriptor in the deployment
-	    descriptor is optional for the ejb-jar file
-	    producer.
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-      <xsd:element name="ejb-client-jar"
-		   type="j2ee:pathType"
-		   minOccurs="0">
-	<xsd:annotation>
-	  <xsd:documentation>
-	    <![CDATA[
-
-	      The optional ejb-client-jar element specifies a JAR
-	      file that contains the class files necessary for a
-	      client program to access the
-	      enterprise beans in the ejb-jar file.
-
-	      Example:
-
-		  <ejb-client-jar>employee_service_client.jar
-		  </ejb-client-jar>
-
-	      ]]>
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-    </xsd:sequence>
-    <xsd:attribute name="version"
-		   type="j2ee:dewey-versionType"
-		   fixed="3.0"
-		   use="required">
-      <xsd:annotation>
-	<xsd:documentation>
-
-	  The version specifies the version of the
-	  EJB specification that the instance document must
-	  comply with. This information enables deployment tools
-	  to validate a particular EJB Deployment
-	  Descriptor with respect to a specific version of the EJB
-	  schema.
-
-	</xsd:documentation>
-      </xsd:annotation>
-    </xsd:attribute>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="ejb-nameType">
-    <xsd:annotation>
-      <xsd:documentation>
-	<![CDATA[
-
-	  The ejb-nameType specifies an enterprise bean's name. It is
-	  used by ejb-name elements. This name is assigned by the
-	  ejb-jar file producer to name the enterprise bean in the
-	  ejb-jar file's deployment descriptor. The name must be
-	  unique among the names of the enterprise beans in the same
-	  ejb-jar file.
-
-	  There is no architected relationship between the used
-	  ejb-name in the deployment descriptor and the JNDI name that
-	  the Deployer will assign to the enterprise bean's home.
-
-	  The name for an entity bean must conform to the lexical
-	  rules for an NMTOKEN.
-
-	  Example:
-
-	  <ejb-name>EmployeeService</ejb-name>
-
-	  ]]>
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:simpleContent>
-      <xsd:restriction base="j2ee:xsdNMTOKENType"/>
-    </xsd:simpleContent>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="ejb-relationType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The ejb-relationType describes a relationship between two
-	entity beans with container-managed persistence.  It is used
-	by ejb-relation elements. It contains a description; an
-	optional ejb-relation-name element; and exactly two
-	relationship role declarations, defined by the
-	ejb-relationship-role elements. The name of the
-	relationship, if specified, is unique within the ejb-jar
-	file.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="description"
-		   type="j2ee:descriptionType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="ejb-relation-name"
-		   type="j2ee:string"
-		   minOccurs="0">
-	<xsd:annotation>
-	  <xsd:documentation>
-
-	    The ejb-relation-name element provides a unique name
-	    within the ejb-jar file for a relationship.
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-      <xsd:element name="ejb-relationship-role"
-		   type="j2ee:ejb-relationship-roleType"/>
-      <xsd:element name="ejb-relationship-role"
-		   type="j2ee:ejb-relationship-roleType"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="ejb-relationship-roleType">
-    <xsd:annotation>
-      <xsd:documentation>
-	<![CDATA[
-
-	  The ejb-relationship-roleType describes a role within a
-	  relationship. There are two roles in each relationship.
-
-	  The ejb-relationship-roleType contains an optional
-	  description; an optional name for the relationship role; a
-	  specification of the multiplicity of the role; an optional
-	  specification of cascade-delete functionality for the role;
-	  the role source; and a declaration of the cmr-field, if any,
-	  by means of which the other side of the relationship is
-	  accessed from the perspective of the role source.
-
-	  The multiplicity and role-source element are mandatory.
-
-	  The relationship-role-source element designates an entity
-	  bean by means of an ejb-name element. For bidirectional
-	  relationships, both roles of a relationship must declare a
-	  relationship-role-source element that specifies a cmr-field
-	  in terms of which the relationship is accessed. The lack of
-	  a cmr-field element in an ejb-relationship-role specifies
-	  that the relationship is unidirectional in navigability and
-	  the entity bean that participates in the relationship is
-	  "not aware" of the relationship.
-
-	  Example:
-
-	  <ejb-relation>
-	      <ejb-relation-name>Product-LineItem</ejb-relation-name>
-	      <ejb-relationship-role>
-		  <ejb-relationship-role-name>product-has-lineitems
-		  </ejb-relationship-role-name>
-		  <multiplicity>One</multiplicity>
-		  <relationship-role-source>
-		  <ejb-name>ProductEJB</ejb-name>
-		  </relationship-role-source>
-	       </ejb-relationship-role>
-	  </ejb-relation>
-
-	  ]]>
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="description"
-		   type="j2ee:descriptionType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="ejb-relationship-role-name"
-		   type="j2ee:string"
-		   minOccurs="0">
-	<xsd:annotation>
-	  <xsd:documentation>
-
-	    The ejb-relationship-role-name element defines a
-	    name for a role that is unique within an
-	    ejb-relation. Different relationships can use the
-	    same name for a role.
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-      <xsd:element name="multiplicity"
-		   type="j2ee:multiplicityType"/>
-      <xsd:element name="cascade-delete"
-		   type="j2ee:emptyType"
-		   minOccurs="0">
-	<xsd:annotation>
-	  <xsd:documentation>
-
-	    The cascade-delete element specifies that, within a
-	    particular relationship, the lifetime of one or more
-	    entity beans is dependent upon the lifetime of
-	    another entity bean. The cascade-delete element can
-	    only be specified for an ejb-relationship-role
-	    element contained in an ejb-relation element in
-	    which the other ejb-relationship-role
-	    element specifies a multiplicity of One.
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-      <xsd:element name="relationship-role-source"
-		   type="j2ee:relationship-role-sourceType"/>
-      <xsd:element name="cmr-field"
-		   type="j2ee:cmr-fieldType"
-		   minOccurs="0"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="enterprise-beansType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The enterprise-beansType declares one or more enterprise
-	beans. Each bean can be a session, entity or message-driven
-	bean.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:choice maxOccurs="unbounded">
-      <xsd:element name="session"
-		   type="j2ee:session-beanType">
-	<xsd:unique name="session-ejb-local-ref-name-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The ejb-ref-name element contains the name of
-	      an EJB reference. The EJB reference is an entry in
-	      the component's environment and is relative to the
-	      java:comp/env context.  The name must be unique within
-	      the component.
-
-	      It is recommended that name be prefixed with "ejb/".
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:ejb-local-ref"/>
-	  <xsd:field    xpath="j2ee:ejb-ref-name"/>
-	</xsd:unique>
-
-	<xsd:unique name="session-ejb-ref-name-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The ejb-ref-name element contains the name of an EJB
-	      reference. The EJB reference is an entry in the
-	      component's environment and is relative to the
-	      java:comp/env context. The name must be unique
-	      within the component.
-
-	      It is recommended that name is prefixed with "ejb/".
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:ejb-ref"/>
-	  <xsd:field    xpath="j2ee:ejb-ref-name"/>
-	</xsd:unique>
-
-	<xsd:unique name="session-resource-env-ref-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The resource-env-ref-name element specifies the name
-	      of a resource environment reference; its value is
-	      the environment entry name used in the component
-	      code. The name is a JNDI name relative to the
-	      java:comp/env context and must be unique within an
-	      component.
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:resource-env-ref"/>
-	  <xsd:field    xpath="j2ee:resource-env-ref-name"/>
-	</xsd:unique>
-
-	<xsd:unique name="session-message-destination-ref-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The message-destination-ref-name element specifies the name
-	      of a message destination reference; its value is
-	      the message destination reference name used in the component
-	      code. The name is a JNDI name relative to the
-	      java:comp/env context and must be unique within an
-	      component.
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:message-destination-ref"/>
-	  <xsd:field    xpath="j2ee:message-destination-ref-name"/>
-	</xsd:unique>
-
-	<xsd:unique name="session-res-ref-name-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The res-ref-name element specifies the name of a
-	      resource manager connection factory reference.  The name
-	      is a JNDI name relative to the java:comp/env context.
-	      The name must be unique within an component.
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:resource-ref"/>
-	  <xsd:field    xpath="j2ee:res-ref-name"/>
-	</xsd:unique>
-
-	<xsd:unique name="session-env-entry-name-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The env-entry-name element contains the name of a
-	      component's environment entry.  The name is a JNDI
-	      name relative to the java:comp/env context.  The
-	      name must be unique within an component.
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:env-entry"/>
-	  <xsd:field    xpath="j2ee:env-entry-name"/>
-	</xsd:unique>
-      </xsd:element>
-
-      <xsd:element name="entity"
-		   type="j2ee:entity-beanType">
-	<xsd:unique name="entity-ejb-local-ref-name-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The ejb-ref-name element contains the name of
-	      an EJB reference. The EJB reference is an entry in
-	      the component's environment and is relative to the
-	      java:comp/env context.  The name must be unique within
-	      the component.
-
-	      It is recommended that name be prefixed with "ejb/".
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:ejb-local-ref"/>
-	  <xsd:field    xpath="j2ee:ejb-ref-name"/>
-	</xsd:unique>
-
-	<xsd:unique name="entity-ejb-ref-name-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The ejb-ref-name element contains the name of an EJB
-	      reference. The EJB reference is an entry in the
-	      component's environment and is relative to the
-	      java:comp/env context. The name must be unique
-	      within the component.
-
-	      It is recommended that name is prefixed with "ejb/".
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:ejb-ref"/>
-	  <xsd:field    xpath="j2ee:ejb-ref-name"/>
-	</xsd:unique>
-
-	<xsd:unique name="entity-resource-env-ref-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The resource-env-ref-name element specifies the name
-	      of a resource environment reference; its value is
-	      the environment entry name used in the component
-	      code. The name is a JNDI name relative to the
-	      java:comp/env context and must be unique within an
-	      component.
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:resource-env-ref"/>
-	  <xsd:field    xpath="j2ee:resource-env-ref-name"/>
-	</xsd:unique>
-
-	<xsd:unique name="entity-message-destination-ref-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The message-destination-ref-name element specifies the name
-	      of a message destination reference; its value is
-	      the message destination reference name used in the component
-	      code. The name is a JNDI name relative to the
-	      java:comp/env context and must be unique within an
-	      component.
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:message-destination-ref"/>
-	  <xsd:field    xpath="j2ee:message-destination-ref-name"/>
-	</xsd:unique>
-
-	<xsd:unique name="entity-res-ref-name-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The res-ref-name element specifies the name of a
-	      resource manager connection factory reference.  The name
-	      is a JNDI name relative to the java:comp/env context.
-	      The name must be unique within an component.
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:resource-ref"/>
-	  <xsd:field    xpath="j2ee:res-ref-name"/>
-	</xsd:unique>
-
-	<xsd:unique name="entity-env-entry-name-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The env-entry-name element contains the name of a
-	      component's environment entry.  The name is a JNDI
-	      name relative to the java:comp/env context.  The
-	      name must be unique within an component.
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:env-entry"/>
-	  <xsd:field    xpath="j2ee:env-entry-name"/>
-	</xsd:unique>
-      </xsd:element>
-
-      <xsd:element name="message-driven"
-		   type="j2ee:message-driven-beanType">
-	<xsd:unique name="messaged-ejb-local-ref-name-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The ejb-ref-name element contains the name of
-	      an EJB reference. The EJB reference is an entry in
-	      the component's environment and is relative to the
-	      java:comp/env context.  The name must be unique within
-	      the component.
-
-	      It is recommended that name be prefixed with "ejb/".
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:ejb-local-ref"/>
-	  <xsd:field    xpath="j2ee:ejb-ref-name"/>
-	</xsd:unique>
-
-	<xsd:unique name="messaged-ejb-ref-name-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The ejb-ref-name element contains the name of an EJB
-	      reference. The EJB reference is an entry in the
-	      component's environment and is relative to the
-	      java:comp/env context. The name must be unique
-	      within the component.
-
-	      It is recommended that name is prefixed with "ejb/".
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:ejb-ref"/>
-	  <xsd:field    xpath="j2ee:ejb-ref-name"/>
-	</xsd:unique>
-
-	<xsd:unique name="messaged-resource-env-ref-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The resource-env-ref-name element specifies the name
-	      of a resource environment reference; its value is
-	      the environment entry name used in the component
-	      code. The name is a JNDI name relative to the
-	      java:comp/env context and must be unique within an
-	      component.
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:resource-env-ref"/>
-	  <xsd:field    xpath="j2ee:resource-env-ref-name"/>
-	</xsd:unique>
-
-	<xsd:unique name="messaged-message-destination-ref-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The message-destination-ref-name element specifies the name
-	      of a message destination reference; its value is
-	      the message destination reference name used in the component
-	      code. The name is a JNDI name relative to the
-	      java:comp/env context and must be unique within an
-	      component.
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:message-destination-ref"/>
-	  <xsd:field    xpath="j2ee:message-destination-ref-name"/>
-	</xsd:unique>
-
-	<xsd:unique name="messaged-res-ref-name-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The res-ref-name element specifies the name of a
-	      resource manager connection factory reference.  The name
-	      is a JNDI name relative to the java:comp/env context.
-	      The name must be unique within an component.
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:resource-ref"/>
-	  <xsd:field    xpath="j2ee:res-ref-name"/>
-	</xsd:unique>
-
-	<xsd:unique name="messaged-env-entry-name-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The env-entry-name element contains the name of a
-	      component's environment entry.  The name is a JNDI
-	      name relative to the java:comp/env context.  The
-	      name must be unique within an component.
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:env-entry"/>
-	  <xsd:field    xpath="j2ee:env-entry-name"/>
-	</xsd:unique>
-      </xsd:element>
-
-    </xsd:choice>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="entity-beanType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The entity-beanType declares an entity bean. The declaration
-	consists of:
-
-	    - an optional description
-	    - an optional display name
-	    - an optional icon element that contains a small and a large
-	      icon file name
-	    - a unique name assigned to the enterprise bean
-	      in the deployment descriptor
-	    - the names of the entity bean's remote home
-	      and remote interfaces, if any
-	    - the names of the entity bean's local home and local
-	      interfaces, if any
-	    - the entity bean's implementation class
-	    - the entity bean's persistence management type
-	    - the entity bean's primary key class name
-	    - an indication of the entity bean's reentrancy
-	    - an optional specification of the
-	      entity bean's cmp-version
-	    - an optional specification of the entity bean's
-	      abstract schema name
-	    - an optional list of container-managed fields
-	    - an optional specification of the primary key
-	      field
-	    - an optional declaration of the bean's environment
-	      entries
-	    - an optional declaration of the bean's EJB
-	      references
-	    - an optional declaration of the bean's local
-	      EJB references
-	    - an optional declaration of the bean's web
-	      service references
-	    - an optional declaration of the security role
-	      references
-	    - an optional declaration of the security identity
-	      to be used for the execution of the bean's methods
-	    - an optional declaration of the bean's
-	      resource manager connection factory references
-	    - an optional declaration of the bean's
-	      resource environment references
-	    - an optional declaration of the bean's message
-	      destination references
-	    - an optional set of query declarations
-	      for finder and select methods for an entity
-	      bean with cmp-version 2.x.
-
-	The optional abstract-schema-name element must be specified
-	for an entity bean with container-managed persistence and
-	cmp-version 2.x.
-
-	The optional primkey-field may be present in the descriptor
-	if the entity's persistence-type is Container.
-
-	The optional cmp-version element may be present in the
-	descriptor if the entity's persistence-type is Container. If
-	the persistence-type is Container and the cmp-version
-	element is not specified, its value defaults to 2.x.
-
-	The optional home and remote elements must be specified if
-	the entity bean cmp-version is 1.x.
-
-	The optional home and remote elements must be specified if
-	the entity bean has a remote home and remote interface.
-
-	The optional local-home and local elements must be specified
-	if the entity bean has a local home and local interface.
-
-	Either both the local-home and the local elements or both
-	the home and the remote elements must be specified.
-
-	The optional query elements must be present if the
-	persistence-type is Container and the cmp-version is 2.x and
-	query methods other than findByPrimaryKey have been defined
-	for the entity bean.
-
-	The other elements that are optional are "optional" in the
-	sense that they are omitted if the lists represented by them
-	are empty.
-
-	At least one cmp-field element must be present in the
-	descriptor if the entity's persistence-type is Container and
-	the cmp-version is 1.x, and none must not be present if the
-	entity's persistence-type is Bean.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:group ref="j2ee:descriptionGroup"/>
-      <xsd:element name="ejb-name"
-		   type="j2ee:ejb-nameType"/>
-      <xsd:element name="home"
-		   type="j2ee:homeType"
-		   minOccurs="0"/>
-      <xsd:element name="remote"
-		   type="j2ee:remoteType"
-		   minOccurs="0"/>
-      <xsd:element name="local-home"
-		   type="j2ee:local-homeType"
-		   minOccurs="0"/>
-      <xsd:element name="local"
-		   type="j2ee:localType"
-		   minOccurs="0"/>
-      <xsd:element name="ejb-class"
-		   type="j2ee:ejb-classType"
-                   minOccurs="0"/>
-      <xsd:element name="persistence-type"
-		   type="j2ee:persistence-typeType"
-                   minOccurs="0"/>
-      <xsd:element name="callback-listener"
-		   type="j2ee:callback-listenerType"
-		   minOccurs="0"/>
-      <xsd:element name="interceptor"
-		   type="j2ee:interceptorType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="interceptors"
-		   type="j2ee:interceptorsType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="prim-key-class"
-		   type="j2ee:fully-qualified-classType">
-	<xsd:annotation>
-	  <xsd:documentation>
-
-	    The prim-key-class element contains the
-	    fully-qualified name of an
-	    entity bean's primary key class.
-
-	    If the definition of the primary key class is
-	    deferred to deployment time, the prim-key-class
-	    element should specify java.lang.Object.
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-      <xsd:element name="reentrant"
-		   type="j2ee:true-falseType">
-	<xsd:annotation>
-	  <xsd:documentation>
-
-	    The reentrant element specifies whether an entity
-	    bean is reentrant or not.
-
-	    The reentrant element must be one of the two
-	    following: true or false
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-      <xsd:element name="cmp-version"
-		   type="j2ee:cmp-versionType"
-		   minOccurs="0"/>
-      <xsd:element name="abstract-schema-name"
-		   type="j2ee:java-identifierType"
-		   minOccurs="0">
-	<xsd:annotation>
-	  <xsd:documentation>
-
-	    The abstract-schema-name element specifies the name
-	    of the abstract schema type of an entity bean with
-	    cmp-version 2.x. It is used in EJB QL queries.
-
-	    For example, the abstract-schema-name for an entity
-	    bean whose local interface is
-	    com.acme.commerce.Order might be Order.
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-      <xsd:element name="cmp-field"
-		   type="j2ee:cmp-fieldType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="primkey-field"
-		   type="j2ee:string"
-		   minOccurs="0">
-	<xsd:annotation>
-	  <xsd:documentation>
-
-	    The primkey-field element is used to specify the
-	    name of the primary key field for an entity with
-	    container-managed persistence.
-
-	    The primkey-field must be one of the fields declared
-	    in the cmp-field element, and the type of the field
-	    must be the same as the primary key type.
-
-	    The primkey-field element is not used if the primary
-	    key maps to multiple container-managed fields
-	    (i.e. the key is a compound key). In this case, the
-	    fields of the primary key class must be public, and
-	    their names must correspond to the field names of
-	    the entity bean class that comprise the key.
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-      <xsd:group ref="j2ee:jndiEnvironmentRefsGroup"/>
-      <xsd:element name="security-role-ref"
-		   type="j2ee:security-role-refType"
-		   minOccurs="0" maxOccurs="unbounded"/>
-      <xsd:element name="security-identity"
-		   type="j2ee:security-identityType"
-		   minOccurs="0"/>
-      <xsd:element name="query"
-		   type="j2ee:queryType"
-		   minOccurs="0" maxOccurs="unbounded"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="exclude-listType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The exclude-listType specifies one or more methods which
-	the Assembler marks to be uncallable.
-
-	If the method permission relation contains methods that are
-	in the exclude list, the Deployer should consider those
-	methods to be uncallable.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="description"
-		   type="j2ee:descriptionType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="method"
-		   type="j2ee:methodType"
-		   maxOccurs="unbounded"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="remove-listType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The remove-listType specifies one or more methods which
-	the Assembler marks to remove a stateful session.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="description"
-		   type="j2ee:descriptionType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="method"
-		   type="j2ee:methodType"
-		   maxOccurs="unbounded"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="init-listType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The remove-listType specifies one or more methods which
-	the Assembler marks to initialize a stateful session.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="description"
-		   type="j2ee:descriptionType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="method"
-		   type="j2ee:methodType"
-		   maxOccurs="unbounded"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="message-driven-beanType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The message-driven element declares a message-driven
-	bean. The declaration consists of:
-
-	    - an optional description
-	    - an optional display name
-	    - an optional icon element that contains a small and a large
-	      icon file name.
-	    - a name assigned to the enterprise bean in
-	      the deployment descriptor
-	    - the message-driven bean's implementation class
-	    - an optional declaration of the bean's messaging
-	      type
-	    - the message-driven bean's transaction management type
-	    - an optional declaration of the bean's
-	      message-destination-type
-	    - an optional declaration of the bean's
-	      message-destination-link
-	    - an optional declaration of the message-driven bean's
-	      activation configuration properties
-	    - an optional declaration of the bean's environment
-	      entries
-	    - an optional declaration of the bean's EJB references
-	    - an optional declaration of the bean's local EJB
-	      references
-	    - an optional declaration of the bean's web service
-	      references
-	    - an optional declaration of the security
-	      identity to be used for the execution of the bean's
-	      methods
-	    - an optional declaration of the bean's
-	      resource manager connection factory
-	      references
-	    - an optional declaration of the bean's resource
-	      environment references.
-	    - an optional declaration of the bean's message
-	      destination references
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:group ref="j2ee:descriptionGroup"/>
-      <xsd:element name="ejb-name"
-		   type="j2ee:ejb-nameType"/>
-      <xsd:element name="ejb-class"
-		   type="j2ee:ejb-classType"
-                   minOccurs="0"/>
-      <xsd:element name="messaging-type"
-		   type="j2ee:fully-qualified-classType"
-		   minOccurs="0">
-	<xsd:annotation>
-	  <xsd:documentation>
-
-	    The messaging-type element specifies the message
-	    listener interface of the message-driven bean. If
-	    the messaging-type element is not specified, it is
-	    assumed to be javax.jms.MessageListener.
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-      <xsd:element name="transaction-type"
-		   type="j2ee:transaction-typeType"/>
-      <xsd:element name="callback-listener"
-		   type="j2ee:callback-listenerType"
-		   minOccurs="0"/>
-      <xsd:element name="interceptor"
-		   type="j2ee:interceptorType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="interceptors"
-		   type="j2ee:interceptorsType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="message-destination-type"
-		   type="j2ee:message-destination-typeType"
-		   minOccurs="0"/>
-      <xsd:element name="message-destination-link"
-		   type="j2ee:message-destination-linkType"
-		   minOccurs="0"/>
-      <xsd:element name="activation-config"
-		   type="j2ee:activation-configType"
-		   minOccurs="0"/>
-      <xsd:group ref="j2ee:jndiEnvironmentRefsGroup"/>
-      <xsd:element name="security-identity"
-		   type="j2ee:security-identityType"
-		   minOccurs="0"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="method-intfType">
-
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The method-intf element allows a method element to
-	differentiate between the methods with the same name and
-	signature that are multiply defined across the home and
-	component interfaces (e.g, in both an enterprise bean's
-	remote and local interfaces or in both an enterprise bean's
-	home and remote interfaces, etc.); the component and web
-	service endpoint interfaces, and so on.
-
-	The method-intf element must be one of the following:
-
-	    Home
-	    Remote
-	    LocalHome
-	    Local
-	    ServiceEndpoint
-
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:simpleContent>
-      <xsd:restriction base="j2ee:string">
-	<xsd:enumeration value="Home"/>
-	<xsd:enumeration value="Remote"/>
-	<xsd:enumeration value="LocalHome"/>
-	<xsd:enumeration value="Local"/>
-	<xsd:enumeration value="ServiceEndpoint"/>
-      </xsd:restriction>
-    </xsd:simpleContent>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="method-nameType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The method-nameType contains a name of an enterprise
-	bean method or the asterisk (*) character. The asterisk is
-	used when the element denotes all the methods of an
-	enterprise bean's client view interfaces.
-
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:simpleContent>
-      <xsd:restriction base="j2ee:string"/>
-    </xsd:simpleContent>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="method-paramsType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The method-paramsType defines a list of the
-	fully-qualified Java type names of the method parameters.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="method-param"
-		   type="j2ee:java-typeType"
-		   minOccurs="0"
-		   maxOccurs="unbounded">
-	<xsd:annotation>
-	  <xsd:documentation>
-
-	    The method-param element contains a primitive
-	    or a fully-qualified Java type name of a method
-	    parameter.
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="callbackType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The callbackType specifies one or more methods as enterprise
-	bean callbacks (i.e. PostConstruct, PostActivate, PrePassivate,
-	or PreDestroy)
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="description"
-		   type="j2ee:descriptionType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="annotation"
-		   type="j2ee:annotationType"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="method"
-		   type="j2ee:methodType"
-		   maxOccurs="unbounded"/>
-    </xsd:sequence>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="annotationType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The annotationType designates the name of a callback
-	annotation.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:simpleContent>
-      <xsd:restriction base="j2ee:string">
-	<xsd:pattern value="(PostConstruct|PostActivate|PrePassivate|PreDestroy)"/>
-      </xsd:restriction>
-    </xsd:simpleContent>
-  </xsd:complexType>
-
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="method-permissionType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The method-permissionType specifies that one or more
-	security roles are allowed to invoke one or more enterprise
-	bean methods. The method-permissionType consists of an
-	optional description, a list of security role names or an
-	indicator to state that the method is unchecked for
-	authorization, and a list of method elements.
-
-	The security roles used in the method-permissionType
-	must be defined in the security-role elements of the
-	deployment descriptor, and the methods must be methods
-	defined in the enterprise bean's home, component and/or web
-	service endpoint interfaces.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="description"
-		   type="j2ee:descriptionType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:choice>
-	<xsd:element name="role-name"
-		     type="j2ee:role-nameType"
-		     maxOccurs="unbounded"/>
-	<xsd:element name="unchecked"
-		     type="j2ee:emptyType">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The unchecked element specifies that a method is
-	      not checked for authorization by the container
-	      prior to invocation of the method.
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	</xsd:element>
-      </xsd:choice>
-      <xsd:element name="method"
-		   type="j2ee:methodType"
-		   maxOccurs="unbounded"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="methodType">
-    <xsd:annotation>
-      <xsd:documentation>
-	<![CDATA[
-
-	  The methodType is used to denote a method of an enterprise
-	  bean's home, component, and/or web service endpoint
-	  interface, or, in the case of a message-driven bean, the
-	  bean's message listener method, or a set of such
-	  methods. The ejb-name element must be the name of one of the
-	  enterprise beans declared in the deployment descriptor; the
-	  optional method-intf element allows to distinguish between a
-	  method with the same signature that is multiply defined
-	  across the home, component, and/or web service endpoint
-	  interfaces; the method-name element specifies the method
-	  name; and the optional method-params elements identify a
-	  single method among multiple methods with an overloaded
-	  method name.
-
-	  There are three possible styles of using methodType element
-	  within a method element:
-
-	  1.
-	  <method>
-	      <ejb-name>EJBNAME</ejb-name>
-	      <method-name>*</method-name>
-	  </method>
-
-	     This style is used to refer to all the methods of the
-	     specified enterprise bean's home, component, and/or web
-	     service endpoint interfaces.
-
-	  2.
-	  <method>
-	      <ejb-name>EJBNAME</ejb-name>
-	      <method-name>METHOD</method-name>
-	  </method>
-
-	     This style is used to refer to the specified method of
-	     the specified enterprise bean. If there are multiple
-	     methods with the same overloaded name, the element of
-	     this style refers to all the methods with the overloaded
-	     name.
-
-	  3.
-	  <method>
-	      <ejb-name>EJBNAME</ejb-name>
-	      <method-name>METHOD</method-name>
-	      <method-params>
-		  <method-param>PARAM-1</method-param>
-		  <method-param>PARAM-2</method-param>
-		  ...
-		  <method-param>PARAM-n</method-param>
-	      </method-params>
-	  </method>
-
-	     This style is used to refer to a single method within a
-	     set of methods with an overloaded name. PARAM-1 through
-	     PARAM-n are the fully-qualified Java types of the
-	     method's input parameters (if the method has no input
-	     arguments, the method-params element contains no
-	     method-param elements). Arrays are specified by the
-	     array element's type, followed by one or more pair of
-	     square brackets (e.g. int[][]). If there are multiple
-	     methods with the same overloaded name, this style refers
-	     to all of the overloaded methods.
-
-	  Examples:
-
-	  Style 1: The following method element refers to all the
-	  methods of the EmployeeService bean's home, component,
-	  and/or web service endpoint interfaces:
-
-	  <method>
-	      <ejb-name>EmployeeService</ejb-name>
-	      <method-name>*</method-name>
-	  </method>
-
-	  Style 2: The following method element refers to all the
-	  create methods of the EmployeeService bean's home
-	  interface(s).
-
-	  <method>
-	      <ejb-name>EmployeeService</ejb-name>
-	      <method-name>create</method-name>
-	  </method>
-
-	  Style 3: The following method element refers to the
-	  create(String firstName, String LastName) method of the
-	  EmployeeService bean's home interface(s).
-
-	  <method>
-	      <ejb-name>EmployeeService</ejb-name>
-	      <method-name>create</method-name>
-	      <method-params>
-		  <method-param>java.lang.String</method-param>
-		  <method-param>java.lang.String</method-param>
-	      </method-params>
-	  </method>
-
-	  The following example illustrates a Style 3 element with
-	  more complex parameter types. The method
-	  foobar(char s, int i, int[] iar, mypackage.MyClass mycl,
-	  mypackage.MyClass[][] myclaar) would be specified as:
-
-	  <method>
-	      <ejb-name>EmployeeService</ejb-name>
-	      <method-name>foobar</method-name>
-	      <method-params>
-		  <method-param>char</method-param>
-		  <method-param>int</method-param>
-		  <method-param>int[]</method-param>
-		  <method-param>mypackage.MyClass</method-param>
-		  <method-param>mypackage.MyClass[][]</method-param>
-	      </method-params>
-	  </method>
-
-	  The optional method-intf element can be used when it becomes
-	  necessary to differentiate between a method that is multiply
-	  defined across the enterprise bean's home, component, and/or
-	  web service endpoint interfaces with the same name and
-	  signature.
-
-	  For example, the method element
-
-	  <method>
-	      <ejb-name>EmployeeService</ejb-name>
-	      <method-intf>Remote</method-intf>
-	      <method-name>create</method-name>
-	      <method-params>
-		  <method-param>java.lang.String</method-param>
-		  <method-param>java.lang.String</method-param>
-	      </method-params>
-	  </method>
-
-	  can be used to differentiate the create(String, String)
-	  method defined in the remote interface from the
-	  create(String, String) method defined in the remote home
-	  interface, which would be defined as
-
-	  <method>
-	      <ejb-name>EmployeeService</ejb-name>
-	      <method-intf>Home</method-intf>
-	      <method-name>create</method-name>
-	      <method-params>
-		  <method-param>java.lang.String</method-param>
-		  <method-param>java.lang.String</method-param>
-	      </method-params>
-	  </method>
-
-	  and the create method that is defined in the local home
-	  interface which would be defined as
-
-	  <method>
-	      <ejb-name>EmployeeService</ejb-name>
-	      <method-intf>LocalHome</method-intf>
-	      <method-name>create</method-name>
-	      <method-params>
-		  <method-param>java.lang.String</method-param>
-		  <method-param>java.lang.String</method-param>
-	      </method-params>
-	  </method>
-
-	  The method-intf element can be used with all th ree Styles
-	  of the method element usage. For example, the following
-	  method element example could be used to refer to all the
-	  methods of the EmployeeService bean's remote home interface.
-
-	  <method>
-	      <ejb-name>EmployeeService</ejb-name>
-	      <method-intf>Home</method-intf>
-	      <method-name>*</method-name>
-	  </method>
-
-	  ]]>
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="description"
-		   type="j2ee:descriptionType"
-		   minOccurs="0" maxOccurs="unbounded"/>
-      <xsd:element name="ejb-name"
-		   type="j2ee:ejb-nameType"/>
-      <xsd:element name="method-intf"
-		   type="j2ee:method-intfType"
-		   minOccurs="0">
-      </xsd:element>
-      <xsd:element name="method-name"
-		   type="j2ee:method-nameType"/>
-      <xsd:element name="method-params"
-		   type="j2ee:method-paramsType"
-		   minOccurs="0"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="multiplicityType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The multiplicityType describes the multiplicity of the
-	role that participates in a relation.
-
-	The value must be one of the two following:
-
-	    One
-	    Many
-
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:simpleContent>
-      <xsd:restriction base="j2ee:string">
-	<xsd:enumeration value="One"/>
-	<xsd:enumeration value="Many"/>
-      </xsd:restriction>
-    </xsd:simpleContent>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="persistence-typeType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The persistence-typeType specifies an entity bean's persistence
-	management type.
-
-	The persistence-type element must be one of the two following:
-
-	    Bean
-	    Container
-
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:simpleContent>
-      <xsd:restriction base="j2ee:string">
-	<xsd:enumeration value="Bean"/>
-	<xsd:enumeration value="Container"/>
-      </xsd:restriction>
-    </xsd:simpleContent>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="query-methodType">
-    <xsd:annotation>
-      <xsd:documentation>
-	<![CDATA[
-
-	  The query-method specifies the method for a finder or select
-	  query.
-
-	  The method-name element specifies the name of a finder or select
-	  method in the entity bean's implementation class.
-
-	  Each method-param must be defined for a query-method using the
-	  method-params element.
-
-	  It is used by the query-method element.
-
-	  Example:
-
-	  <query>
-	      <description>Method finds large orders</description>
-	      <query-method>
-		  <method-name>findLargeOrders</method-name>
-		  <method-params></method-params>
-	      </query-method>
-	      <ejb-ql>
-		SELECT OBJECT(o) FROM Order o
-		  WHERE o.amount &gt; 1000
-	      </ejb-ql>
-	  </query>
-
-	  ]]>
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="method-name"
-		   type="j2ee:method-nameType"/>
-      <xsd:element name="method-params"
-		   type="j2ee:method-paramsType"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="queryType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The queryType defines a finder or select
-	query. It contains
-	    - an optional description of the query
-	    - the specification of the finder or select
-	      method it is used by
-		- an optional specification of the result type
-		  mapping, if the query is for a select method
-		  and entity objects are returned.
-		- the EJB QL query string that defines the query.
-
-	Queries that are expressible in EJB QL must use the ejb-ql
-	element to specify the query. If a query is not expressible
-	in EJB QL, the description element should be used to
-	describe the semantics of the query and the ejb-ql element
-	should be empty.
-
-	The result-type-mapping is an optional element. It can only
-	be present if the query-method specifies a select method
-	that returns entity objects.  The default value for the
-	result-type-mapping element is "Local".
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="description"
-		   type="j2ee:descriptionType" minOccurs="0"/>
-      <xsd:element name="query-method"
-		   type="j2ee:query-methodType"/>
-      <xsd:element name="result-type-mapping"
-		   type="j2ee:result-type-mappingType"
-		   minOccurs="0"/>
-      <xsd:element name="ejb-ql"
-		   type="j2ee:xsdStringType"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="relationship-role-sourceType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The relationship-role-sourceType designates the source of a
-	role that participates in a relationship. A
-	relationship-role-sourceType is used by
-	relationship-role-source elements to uniquely identify an
-	entity bean.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="description"
-		   type="j2ee:descriptionType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="ejb-name"
-		   type="j2ee:ejb-nameType"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="relationshipsType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The relationshipsType describes the relationships in
-	which entity beans with container-managed persistence
-	participate. The relationshipsType contains an optional
-	description; and a list of ejb-relation elements, which
-	specify the container managed relationships.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="description"
-		   type="j2ee:descriptionType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="ejb-relation"
-		   type="j2ee:ejb-relationType"
-		   maxOccurs="unbounded">
-
-	<xsd:unique name="role-name-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The ejb-relationship-role-name contains the name of a
-	      relationship role. The name must be unique within
-	      a relationship, but can be reused in different
-	      relationships.
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector
-	       xpath=".//j2ee:ejb-relationship-role-name"/>
-	  <xsd:field
-	       xpath="."/>
-	</xsd:unique>
-      </xsd:element>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="result-type-mappingType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The result-type-mappingType is used in the query element to
-	specify whether an abstract schema type returned by a query
-	for a select method is to be mapped to an EJBLocalObject or
-	EJBObject type.
-
-	The value must be one of the following:
-
-	    Local
-	    Remote
-
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:simpleContent>
-      <xsd:restriction base="j2ee:string">
-	<xsd:enumeration value="Local"/>
-	<xsd:enumeration value="Remote"/>
-      </xsd:restriction>
-    </xsd:simpleContent>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="security-identityType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The security-identityType specifies whether the caller's
-	security identity is to be used for the execution of the
-	methods of the enterprise bean or whether a specific run-as
-	identity is to be used. It contains an optional description
-	and a specification of the security identity to be used.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="description"
-		   type="j2ee:descriptionType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:choice>
-	<xsd:element name="use-caller-identity"
-		     type="j2ee:emptyType">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The use-caller-identity element specifies that
-	      the caller's security identity be used as the
-	      security identity for the execution of the
-	      enterprise bean's methods.
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	</xsd:element>
-	<xsd:element name="run-as"
-		     type="j2ee:run-asType"/>
-      </xsd:choice>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="session-beanType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The session-beanType declares an session bean. The
-	declaration consists of:
-
-	    - an optional description
-	    - an optional display name
-	    - an optional icon element that contains a small and a large
-	      icon file name
-	    - a name assigned to the enterprise bean
-	      in the deployment description
-	    - the names of the session bean's remote home and
-	      remote interfaces, if any
-	    - the names of the session bean's local home and
-	      local interfaces, if any
-	    - the name of the session bean's web service endpoint
-	      interface, if any
-	    - the session bean's implementation class
-	    - the session bean's state management type
-	    - the session bean's transaction management type
-	    - an optional declaration of the bean's
-	      environment entries
-	    - an optional declaration of the bean's EJB references
-	    - an optional declaration of the bean's local
-	      EJB references
-	    - an optional declaration of the bean's web
-	      service references
-	    - an optional declaration of the security role
-	      references
-	    - an optional declaration of the security identity
-	      to be used for the execution of the bean's methods
-	    - an optional declaration of the bean's resource
-	      manager connection factory references
-	    - an optional declaration of the bean's resource
-	      environment references.
-	    - an optional declaration of the bean's message
-	      destination references
-
-	The elements that are optional are "optional" in the sense
-	that they are omitted when if lists represented by them are
-	empty.
-
-	Either both the local-home and the local elements or both
-	the home and the remote elements must be specified for the
-	session bean.
-
-	The service-endpoint element may only be specified if the
-	bean is a stateless session bean.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:group ref="j2ee:descriptionGroup"/>
-      <xsd:element name="ejb-name"
-		   type="j2ee:ejb-nameType"/>
-      <xsd:element name="home"
-		   type="j2ee:homeType"
-		   minOccurs="0"/>
-      <xsd:element name="remote"
-		   type="j2ee:remoteType"
-		   minOccurs="0"/>
-      <xsd:element name="local-home"
-		   type="j2ee:local-homeType"
-		   minOccurs="0"/>
-      <xsd:element name="local"
-		   type="j2ee:localType"
-		   minOccurs="0"/>
-      <xsd:element name="service-endpoint"
-		   type="j2ee:fully-qualified-classType"
-		   minOccurs="0">
-	<xsd:annotation>
-	  <xsd:documentation>
-
-	    The service-endpoint element contains the
-	    fully-qualified name of the enterprise bean's web
-	    service endpoint interface. The service-endpoint
-	    element may only be specified for a stateless
-	    session bean. The specified interface must be a
-	    valid JAX-RPC service endpoint interface.
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-      <xsd:element name="ejb-class"
-		   type="j2ee:ejb-classType"
-                   minOccurs="0"/>
-      <xsd:element name="session-type"
-		   type="j2ee:session-typeType"
-                   minOccurs="0"/>
-      <xsd:element name="transaction-type"
-		   type="j2ee:transaction-typeType"
-                   minOccurs="0"/>
-      <xsd:element name="callback-listener"
-		   type="j2ee:callback-listenerType"
-		   minOccurs="0"/>
-      <xsd:element name="interceptor"
-		   type="j2ee:interceptorType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="interceptors"
-		   type="j2ee:interceptorsType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:group ref="j2ee:jndiEnvironmentRefsGroup"/>
-      <xsd:element name="security-role-ref"
-		   type="j2ee:security-role-refType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="security-identity"
-		   type="j2ee:security-identityType"
-		   minOccurs="0"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="session-typeType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The session-typeType describes whether the session bean is a
-	stateful session or stateless session. It is used by
-	session-type elements.
-
-	The value must be one of the two following:
-
-	    Stateful
-	    Stateless
-
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:simpleContent>
-      <xsd:restriction base="j2ee:string">
-	<xsd:enumeration value="Stateful"/>
-	<xsd:enumeration value="Stateless"/>
-      </xsd:restriction>
-    </xsd:simpleContent>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="trans-attributeType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The trans-attributeType specifies how the container must
-	manage the transaction boundaries when delegating a method
-	invocation to an enterprise bean's business method.
-
-	The value must be one of the following:
-
-	    NotSupported
-	    Supports
-	    Required
-	    RequiresNew
-	    Mandatory
-	    Never
-
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:simpleContent>
-      <xsd:restriction base="j2ee:string">
-	<xsd:enumeration value="NotSupported"/>
-	<xsd:enumeration value="Supports"/>
-	<xsd:enumeration value="Required"/>
-	<xsd:enumeration value="RequiresNew"/>
-	<xsd:enumeration value="Mandatory"/>
-	<xsd:enumeration value="Never"/>
-      </xsd:restriction>
-    </xsd:simpleContent>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="transaction-typeType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The transaction-typeType specifies an enterprise bean's
-	transaction management type.
-
-	The transaction-type must be one of the two following:
-
-	    Bean
-	    Container
-
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:simpleContent>
-      <xsd:restriction base="j2ee:string">
-	<xsd:enumeration value="Bean"/>
-	<xsd:enumeration value="Container"/>
-      </xsd:restriction>
-    </xsd:simpleContent>
-  </xsd:complexType>
-
-</xsd:schema>
-

Deleted: branches/Branch_4_0/ejb3/src/resources/schema/javaee_5.xsd
===================================================================
(Binary files differ)

Deleted: branches/Branch_4_0/ejb3/src/resources/schema/javaee_web_services_1_2.xsd
===================================================================
(Binary files differ)

Deleted: branches/Branch_4_0/ejb3/src/resources/schema/javaee_web_services_client_1_2.xsd
===================================================================
(Binary files differ)

Modified: branches/Branch_4_0/ejb3/src/resources/schema/jboss_5_0.xsd
===================================================================
(Binary files differ)

Deleted: branches/Branch_4_0/ejb3/src/resources/schema/sun-ejb-jar_3_0.xsd
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/schema/sun-ejb-jar_3_0.xsd	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/schema/sun-ejb-jar_3_0.xsd	2006-09-08 02:24:08 UTC (rev 56622)
@@ -1,2403 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
-	    targetNamespace="http://java.sun.com/xml/ns/j2ee"
-	    xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
-	    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-	    elementFormDefault="qualified"
-	    attributeFormDefault="unqualified"
-	    version="3.0">
-  <xsd:annotation>
-    <xsd:documentation>
-      @(#)ejb-jar_3_0.xsds	1.44 06/07/05
-    </xsd:documentation>
-  </xsd:annotation>
-
-  <xsd:annotation>
-    <xsd:documentation>
-
-	This is the XML Schema for the EJB 3.0 deployment descriptor.
-	The deployment descriptor must be named "META-INF/ejb-jar.xml" in
-	the EJB's jar file.  All EJB deployment descriptors must indicate
-	the ejb-jar schema by using the J2EE namespace:
-
-	http://java.sun.com/xml/ns/j2ee
-
-	and by indicating the version of the schema by
-	using the version element as shown below:
-
-	    <ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee"
-	      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
-		  http://java.sun.com/xml/ns/j2ee/ejb-jar_3_0.xsd"
-	      version="3.0">
-	      ...
-	    </ejb-jar>
-
-	The instance documents may indicate the published version of
-	the schema using the xsi:schemaLocation attribute for the
-	J2EE namespace with the following location:
-
-	http://java.sun.com/xml/ns/j2ee/ejb-jar_3_0.xsd
-
-    </xsd:documentation>
-  </xsd:annotation>
-
-  <xsd:annotation>
-    <xsd:documentation>
-
-      The following conventions apply to all J2EE
-      deployment descriptor elements unless indicated otherwise.
-
-      - In elements that specify a pathname to a file within the
-	same JAR file, relative filenames (i.e., those not
-	starting with "/") are considered relative to the root of
-	the JAR file's namespace.  Absolute filenames (i.e., those
-	starting with "/") also specify names in the root of the
-	JAR file's namespace.  In general, relative names are
-	preferred.  The exception is .war files where absolute
-	names are preferred for consistency with the Servlet API.
-
-    </xsd:documentation>
-  </xsd:annotation>
-
-  <xsd:include schemaLocation="j2ee_5_0.xsd"/>
-
-
-<!-- **************************************************** -->
-
-
-  <xsd:element name="ejb-jar" type="j2ee:ejb-jarType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	This is the root of the ejb-jar deployment descriptor.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:key name="ejb-name-key">
-      <xsd:annotation>
-	<xsd:documentation>
-
-	  The ejb-name element contains the name of an enterprise
-	  bean. The name must be unique within the ejb-jar file.
-
-	</xsd:documentation>
-      </xsd:annotation>
-      <xsd:selector xpath="j2ee:enterprise-beans/*"/>
-      <xsd:field    xpath="j2ee:ejb-name"/>
-    </xsd:key>
-
-    <xsd:keyref name="ejb-name-references"
-		refer="j2ee:ejb-name-key">
-      <xsd:annotation>
-	<xsd:documentation>
-
-	  The keyref indicates the references from
-	  relationship-role-source must be to a specific ejb-name
-	  defined within the scope of enterprise-beans element.
-
-	</xsd:documentation>
-      </xsd:annotation>
-      <xsd:selector
-	   xpath=".//j2ee:ejb-relationship-role/j2ee:relationship-role-source"/>
-      <xsd:field
-	   xpath="j2ee:ejb-name"/>
-    </xsd:keyref>
-
-    <xsd:key name="role-name-key">
-      <xsd:annotation>
-	<xsd:documentation>
-
-	  A role-name-key is specified to allow the references
-	  from the security-role-refs.
-
-	</xsd:documentation>
-      </xsd:annotation>
-      <xsd:selector xpath="j2ee:assembly-descriptor/j2ee:security-role"/>
-      <xsd:field    xpath="j2ee:role-name"/>
-    </xsd:key>
-
-    <xsd:keyref name="role-name-references"
-		refer="j2ee:role-name-key">
-      <xsd:annotation>
-	<xsd:documentation>
-
-	  The keyref indicates the references from
-	  security-role-ref to a specified role-name.
-
-	</xsd:documentation>
-      </xsd:annotation>
-      <xsd:selector xpath="j2ee:enterprise-beans/*/j2ee:security-role-ref"/>
-      <xsd:field    xpath="j2ee:role-link"/>
-    </xsd:keyref>
-  </xsd:element>
-
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="activation-config-propertyType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The activation-config-propertyType contains a name/value
-	configuration property pair for a message-driven bean.
-
-	The properties that are recognized for a particular
-	message-driven bean are determined by the messaging type.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="activation-config-property-name"
-		   type="j2ee:xsdStringType">
-	<xsd:annotation>
-	  <xsd:documentation>
-
-	    The activation-config-property-name element contains
-	    the name for an activation configuration property of
-	    a message-driven bean.
-
-	    For JMS message-driven beans, the following property
-	    names are recognized: acknowledgeMode,
-	    messageSelector, destinationType, subscriptionDurability
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-      <xsd:element name="activation-config-property-value"
-		   type="j2ee:xsdStringType">
-	<xsd:annotation>
-	  <xsd:documentation>
-
-	    The activation-config-property-value element
-	    contains the value for an activation configuration
-	    property of a message-driven bean.
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="activation-configType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The activation-configType defines information about the
-	expected configuration properties of the message-driven bean
-	in its operational environment. This may include information
-	about message acknowledgement, message selector, expected
-	destination type, etc.
-
-	The configuration information is expressed in terms of
-	name/value configuration properties.
-
-	The properties that are recognized for a particular
-	message-driven bean are determined by the messaging type.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="description"
-		   type="j2ee:descriptionType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="activation-config-property"
-		   type="j2ee:activation-config-propertyType"
-		   maxOccurs="unbounded"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="application-exceptionType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-        The application-exceptionType declares an application
-        exception. The declaration consists of:
-
-            - the exception class. When the container receives
-              an exception of this type, it is required to
-              forward this exception as an applcation exception
-              to the client regardless of whether it is a checked
-              or unchecked exception.
-            - an optional rollback element. If this element is
-              present, the container must rollback the current
-              transaction before forwarding the exception to the
-              client.
-
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:sequence>
-      <xsd:element name="exception-class"
-		   type="j2ee:fully-qualified-classType"/>
-      <xsd:element name="rollback"
-                   type="j2ee:emptyType"
-                   minOccurs="0"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="assembly-descriptorType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The assembly-descriptorType defines
-	application-assembly information.
-
-	The application-assembly information consists of the
-	following parts: the definition of security roles, the
-	definition of method permissions, the definition of
-	transaction attributes for enterprise beans with
-	container-managed transaction demarcation and a list of
-	methods to be excluded from being invoked.
-
-	All the parts are optional in the sense that they are
-	omitted if the lists represented by them are empty.
-
-	Providing an assembly-descriptor in the deployment
-	descriptor is optional for the ejb-jar file producer.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="security-role"
-		   type="j2ee:security-roleType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="method-permission"
-		   type="j2ee:method-permissionType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="container-transaction"
-		   type="j2ee:container-transactionType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="message-destination"
-		   type="j2ee:message-destinationType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="exclude-list"
-		   type="j2ee:exclude-listType"
-		   minOccurs="0"/>
-      <xsd:element name="application-exception"
-                   type="j2ee:application-exceptionType"
-                   minOccurs="0"
-                   maxOccurs="unbounded"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="callback-listenerType">
-    <xsd:sequence>
-      <xsd:element name="callback-listener-class"
-		   type="j2ee:fully-qualified-classType"/>
-      <xsd:element name="post-construct-method"
-                   type="j2ee:named-methodType"
-                   minOccurs="0"/>
-      <xsd:element name="pre-destroy-method"
-                   type="j2ee:named-methodType"
-                   minOccurs="0"/>
-      <xsd:element name="post-activate-method"
-                   type="j2ee:named-methodType"
-                   minOccurs="0"/>
-      <xsd:element name="pre-passivate-method"
-                   type="j2ee:named-methodType"
-                   minOccurs="0"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="cmp-fieldType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The cmp-fieldType describes a container-managed field. The
-	cmp-fieldType contains an optional description of the field,
-	and the name of the field.
-
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:sequence>
-      <xsd:element name="description"
-		   type="j2ee:descriptionType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="field-name"
-		   type="j2ee:java-identifierType">
-	<xsd:annotation>
-	  <xsd:documentation>
-
-	    The field-name element specifies the name of a
-	    container managed field.
-
-	    The name of the cmp-field of an entity bean with
-	    cmp-version 2.x must begin with a lowercase
-	    letter. This field is accessed by methods whose
-	    names consists of the name of the field specified by
-	    field-name in which the first letter is uppercased,
-	    prefixed by "get" or "set".
-
-	    The name of the cmp-field of an entity bean with
-	    cmp-version 1.x must denote a public field of the
-	    enterprise bean class or one of its superclasses.
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="cmp-versionType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The cmp-versionType specifies the version of an entity bean
-	with container-managed persistence. It is used by
-	cmp-version elements.
-
-	The value must be one of the two following:
-
-	    1.x
-	    2.x
-
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:simpleContent>
-      <xsd:restriction base="j2ee:string">
-	<xsd:enumeration value="1.x"/>
-	<xsd:enumeration value="2.x"/>
-      </xsd:restriction>
-    </xsd:simpleContent>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="cmr-field-typeType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The cmr-field-type element specifies the class of a
-	collection-valued logical relationship field in the entity
-	bean class. The value of an element using cmr-field-typeType
-	must be either: java.util.Collection or java.util.Set.
-
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:simpleContent>
-      <xsd:restriction base="j2ee:string">
-	<xsd:enumeration value="java.util.Collection"/>
-	<xsd:enumeration value="java.util.Set"/>
-      </xsd:restriction>
-    </xsd:simpleContent>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="cmr-fieldType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The cmr-fieldType describes the bean provider's view of
-	a relationship. It consists of an optional description, and
-	the name and the class type of a field in the source of a
-	role of a relationship. The cmr-field-name element
-	corresponds to the name used for the get and set accessor
-	methods for the relationship. The cmr-field-type element is
-	used only for collection-valued cmr-fields. It specifies the
-	type of the collection that is used.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="description"
-		   type="j2ee:descriptionType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="cmr-field-name"
-		   type="j2ee:string">
-	<xsd:annotation>
-	  <xsd:documentation>
-
-	    The cmr-field-name element specifies the name of a
-	    logical relationship field in the entity bean
-	    class. The name of the cmr-field must begin with a
-	    lowercase letter. This field is accessed by methods
-	    whose names consist of the name of the field
-	    specified by cmr-field-name in which the first
-	    letter is uppercased, prefixed by "get" or "set".
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-      <xsd:element name="cmr-field-type"
-		   type="j2ee:cmr-field-typeType"
-		   minOccurs="0"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="container-transactionType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The container-transactionType specifies how the container
-	must manage transaction scopes for the enterprise bean's
-	method invocations. It defines an optional description, a
-	list of method elements, and a transaction attribute. The
-	transaction attribute is to be applied to all the specified
-	methods.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="description"
-		   type="j2ee:descriptionType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="method"
-		   type="j2ee:methodType"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="trans-attribute"
-		   type="j2ee:trans-attributeType"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="ejb-classType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	  The ejb-classType contains the fully-qualified name of the
-	  enterprise bean's class. It is used by ejb-class elements.
-
-	  Example:
-
-	      <ejb-class>com.wombat.empl.EmployeeServiceBean</ejb-class>
-
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:simpleContent>
-      <xsd:restriction base="j2ee:fully-qualified-classType"/>
-    </xsd:simpleContent>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="ejb-jarType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The ejb-jarType defines the root element of the EJB
-	deployment descriptor. It contains
-
-	    - an optional description of the ejb-jar file
-	    - an optional display name
-	    - an optional icon that contains a small and a large
-	      icon file name
-	    - structural information about all included
-	      enterprise beans that is not specified through annotations
-	    - a descriptor for container managed relationships,
-	      if any.
-	    - an optional application-assembly descriptor
-	    - an optional name of an ejb-client-jar file for the
-	      ejb-jar.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:group ref="j2ee:descriptionGroup"/>
-      <xsd:element name="enterprise-beans"
-		   type="j2ee:enterprise-beansType"
-                   minOccurs="0"/>
-      <xsd:element name="relationships"
-		   type="j2ee:relationshipsType"
-		   minOccurs="0">
-	<xsd:unique name="relationship-name-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The ejb-relation-name contains the name of a
-	      relation. The name must be unique within
-	      relationships.
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:ejb-relation"/>
-	  <xsd:field    xpath="j2ee:ejb-relation-name"/>
-	</xsd:unique>
-      </xsd:element>
-      <xsd:element name="assembly-descriptor"
-		   type="j2ee:assembly-descriptorType"
-		   minOccurs="0">
-	<xsd:annotation>
-	  <xsd:documentation>
-
-	    Providing an assembly-descriptor in the deployment
-	    descriptor is optional for the ejb-jar file
-	    producer.
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-      <xsd:element name="ejb-client-jar"
-		   type="j2ee:pathType"
-		   minOccurs="0">
-	<xsd:annotation>
-	  <xsd:documentation>
-
-	      The optional ejb-client-jar element specifies a JAR
-	      file that contains the class files necessary for a
-	      client program to access the
-	      enterprise beans in the ejb-jar file.
-
-	      Example:
-
-		  <ejb-client-jar>employee_service_client.jar
-		  </ejb-client-jar>
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-    </xsd:sequence>
-    <xsd:attribute name="version"
-		   type="j2ee:dewey-versionType"
-		   fixed="3.0"
-		   use="required">
-      <xsd:annotation>
-	<xsd:documentation>
-
-	  The version specifies the version of the
-	  EJB specification that the instance document must
-	  comply with. This information enables deployment tools
-	  to validate a particular EJB Deployment
-	  Descriptor with respect to a specific version of the EJB
-	  schema.
-
-	</xsd:documentation>
-      </xsd:annotation>
-    </xsd:attribute>
-    <xsd:attribute name="full" type="xsd:boolean">
-      <xsd:annotation>
-	<xsd:documentation>
-
-	  The full attribute defines whether this deployment
-	  descriptor is complete, or whether the class files
-	  of the jar file should be examined for annotations
-	  that specify deployment information.
-
-	  If full is set to "true", the deployment tool
-	  must ignore any EJB annotations present in the
-	  class files of the application.
-
-	  If full is not specified or is set to "false", the
-	  deployment tool must examine the class files of the
-	  application for annotations, as specified by the EJB
-	  specifications.
-
-	</xsd:documentation>
-      </xsd:annotation>
-
-    </xsd:attribute>
-
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="ejb-nameType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	  The ejb-nameType specifies an enterprise bean's name. It is
-	  used by ejb-name elements. This name is assigned by the
-	  ejb-jar file producer to name the enterprise bean in the
-	  ejb-jar file's deployment descriptor. The name must be
-	  unique among the names of the enterprise beans in the same
-	  ejb-jar file.
-
-	  There is no architected relationship between the used
-	  ejb-name in the deployment descriptor and the JNDI name that
-	  the Deployer will assign to the enterprise bean's home.
-
-	  The name for an entity bean must conform to the lexical
-	  rules for an NMTOKEN.
-
-	  Example:
-
-	  <ejb-name>EmployeeService</ejb-name>
-
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:simpleContent>
-      <xsd:restriction base="j2ee:xsdNMTOKENType"/>
-    </xsd:simpleContent>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="ejb-relationType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The ejb-relationType describes a relationship between two
-	entity beans with container-managed persistence.  It is used
-	by ejb-relation elements. It contains a description; an
-	optional ejb-relation-name element; and exactly two
-	relationship role declarations, defined by the
-	ejb-relationship-role elements. The name of the
-	relationship, if specified, is unique within the ejb-jar
-	file.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="description"
-		   type="j2ee:descriptionType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="ejb-relation-name"
-		   type="j2ee:string"
-		   minOccurs="0">
-	<xsd:annotation>
-	  <xsd:documentation>
-
-	    The ejb-relation-name element provides a unique name
-	    within the ejb-jar file for a relationship.
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-      <xsd:element name="ejb-relationship-role"
-		   type="j2ee:ejb-relationship-roleType"/>
-      <xsd:element name="ejb-relationship-role"
-		   type="j2ee:ejb-relationship-roleType"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="ejb-relationship-roleType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	  The ejb-relationship-roleType describes a role within a
-	  relationship. There are two roles in each relationship.
-
-	  The ejb-relationship-roleType contains an optional
-	  description; an optional name for the relationship role; a
-	  specification of the multiplicity of the role; an optional
-	  specification of cascade-delete functionality for the role;
-	  the role source; and a declaration of the cmr-field, if any,
-	  by means of which the other side of the relationship is
-	  accessed from the perspective of the role source.
-
-	  The multiplicity and role-source element are mandatory.
-
-	  The relationship-role-source element designates an entity
-	  bean by means of an ejb-name element. For bidirectional
-	  relationships, both roles of a relationship must declare a
-	  relationship-role-source element that specifies a cmr-field
-	  in terms of which the relationship is accessed. The lack of
-	  a cmr-field element in an ejb-relationship-role specifies
-	  that the relationship is unidirectional in navigability and
-	  the entity bean that participates in the relationship is
-	  "not aware" of the relationship.
-
-	  Example:
-
-	  <ejb-relation>
-	      <ejb-relation-name>Product-LineItem</ejb-relation-name>
-	      <ejb-relationship-role>
-		  <ejb-relationship-role-name>product-has-lineitems
-		  </ejb-relationship-role-name>
-		  <multiplicity>One</multiplicity>
-		  <relationship-role-source>
-		  <ejb-name>ProductEJB</ejb-name>
-		  </relationship-role-source>
-	       </ejb-relationship-role>
-	  </ejb-relation>
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="description"
-		   type="j2ee:descriptionType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="ejb-relationship-role-name"
-		   type="j2ee:string"
-		   minOccurs="0">
-	<xsd:annotation>
-	  <xsd:documentation>
-
-	    The ejb-relationship-role-name element defines a
-	    name for a role that is unique within an
-	    ejb-relation. Different relationships can use the
-	    same name for a role.
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-      <xsd:element name="multiplicity"
-		   type="j2ee:multiplicityType"/>
-      <xsd:element name="cascade-delete"
-		   type="j2ee:emptyType"
-		   minOccurs="0">
-	<xsd:annotation>
-	  <xsd:documentation>
-
-	    The cascade-delete element specifies that, within a
-	    particular relationship, the lifetime of one or more
-	    entity beans is dependent upon the lifetime of
-	    another entity bean. The cascade-delete element can
-	    only be specified for an ejb-relationship-role
-	    element contained in an ejb-relation element in
-	    which the other ejb-relationship-role
-	    element specifies a multiplicity of One.
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-      <xsd:element name="relationship-role-source"
-		   type="j2ee:relationship-role-sourceType"/>
-      <xsd:element name="cmr-field"
-		   type="j2ee:cmr-fieldType"
-		   minOccurs="0"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="enterprise-beansType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The enterprise-beansType declares one or more enterprise
-	beans. Each bean can be a session, entity or message-driven
-	bean.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:choice maxOccurs="unbounded">
-      <xsd:element name="session"
-		   type="j2ee:session-beanType">
-	<xsd:unique name="session-ejb-local-ref-name-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The ejb-ref-name element contains the name of
-	      an EJB reference. The EJB reference is an entry in
-	      the component's environment and is relative to the
-	      java:comp/env context.  The name must be unique within
-	      the component.
-
-	      It is recommended that name be prefixed with "ejb/".
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:ejb-local-ref"/>
-	  <xsd:field    xpath="j2ee:ejb-ref-name"/>
-	</xsd:unique>
-
-	<xsd:unique name="session-ejb-ref-name-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The ejb-ref-name element contains the name of an EJB
-	      reference. The EJB reference is an entry in the
-	      component's environment and is relative to the
-	      java:comp/env context. The name must be unique
-	      within the component.
-
-	      It is recommended that name is prefixed with "ejb/".
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:ejb-ref"/>
-	  <xsd:field    xpath="j2ee:ejb-ref-name"/>
-	</xsd:unique>
-
-	<xsd:unique name="session-resource-env-ref-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The resource-env-ref-name element specifies the name
-	      of a resource environment reference; its value is
-	      the environment entry name used in the component
-	      code. The name is a JNDI name relative to the
-	      java:comp/env context and must be unique within an
-	      component.
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:resource-env-ref"/>
-	  <xsd:field    xpath="j2ee:resource-env-ref-name"/>
-	</xsd:unique>
-
-	<xsd:unique name="session-message-destination-ref-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The message-destination-ref-name element specifies the name
-	      of a message destination reference; its value is
-	      the message destination reference name used in the component
-	      code. The name is a JNDI name relative to the
-	      java:comp/env context and must be unique within an
-	      component.
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:message-destination-ref"/>
-	  <xsd:field    xpath="j2ee:message-destination-ref-name"/>
-	</xsd:unique>
-
-	<xsd:unique name="session-res-ref-name-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The res-ref-name element specifies the name of a
-	      resource manager connection factory reference.  The name
-	      is a JNDI name relative to the java:comp/env context.
-	      The name must be unique within an component.
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:resource-ref"/>
-	  <xsd:field    xpath="j2ee:res-ref-name"/>
-	</xsd:unique>
-
-	<xsd:unique name="session-env-entry-name-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The env-entry-name element contains the name of a
-	      component's environment entry.  The name is a JNDI
-	      name relative to the java:comp/env context.  The
-	      name must be unique within an component.
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:env-entry"/>
-	  <xsd:field    xpath="j2ee:env-entry-name"/>
-	</xsd:unique>
-      </xsd:element>
-
-      <xsd:element name="entity"
-		   type="j2ee:entity-beanType">
-	<xsd:unique name="entity-ejb-local-ref-name-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The ejb-ref-name element contains the name of
-	      an EJB reference. The EJB reference is an entry in
-	      the component's environment and is relative to the
-	      java:comp/env context.  The name must be unique within
-	      the component.
-
-	      It is recommended that name be prefixed with "ejb/".
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:ejb-local-ref"/>
-	  <xsd:field    xpath="j2ee:ejb-ref-name"/>
-	</xsd:unique>
-
-	<xsd:unique name="entity-ejb-ref-name-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The ejb-ref-name element contains the name of an EJB
-	      reference. The EJB reference is an entry in the
-	      component's environment and is relative to the
-	      java:comp/env context. The name must be unique
-	      within the component.
-
-	      It is recommended that name is prefixed with "ejb/".
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:ejb-ref"/>
-	  <xsd:field    xpath="j2ee:ejb-ref-name"/>
-	</xsd:unique>
-
-	<xsd:unique name="entity-resource-env-ref-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The resource-env-ref-name element specifies the name
-	      of a resource environment reference; its value is
-	      the environment entry name used in the component
-	      code. The name is a JNDI name relative to the
-	      java:comp/env context and must be unique within an
-	      component.
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:resource-env-ref"/>
-	  <xsd:field    xpath="j2ee:resource-env-ref-name"/>
-	</xsd:unique>
-
-	<xsd:unique name="entity-message-destination-ref-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The message-destination-ref-name element specifies the name
-	      of a message destination reference; its value is
-	      the message destination reference name used in the component
-	      code. The name is a JNDI name relative to the
-	      java:comp/env context and must be unique within an
-	      component.
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:message-destination-ref"/>
-	  <xsd:field    xpath="j2ee:message-destination-ref-name"/>
-	</xsd:unique>
-
-	<xsd:unique name="entity-res-ref-name-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The res-ref-name element specifies the name of a
-	      resource manager connection factory reference.  The name
-	      is a JNDI name relative to the java:comp/env context.
-	      The name must be unique within an component.
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:resource-ref"/>
-	  <xsd:field    xpath="j2ee:res-ref-name"/>
-	</xsd:unique>
-
-	<xsd:unique name="entity-env-entry-name-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The env-entry-name element contains the name of a
-	      component's environment entry.  The name is a JNDI
-	      name relative to the java:comp/env context.  The
-	      name must be unique within an component.
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:env-entry"/>
-	  <xsd:field    xpath="j2ee:env-entry-name"/>
-	</xsd:unique>
-      </xsd:element>
-
-      <xsd:element name="message-driven"
-		   type="j2ee:message-driven-beanType">
-	<xsd:unique name="messaged-ejb-local-ref-name-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The ejb-ref-name element contains the name of
-	      an EJB reference. The EJB reference is an entry in
-	      the component's environment and is relative to the
-	      java:comp/env context.  The name must be unique within
-	      the component.
-
-	      It is recommended that name be prefixed with "ejb/".
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:ejb-local-ref"/>
-	  <xsd:field    xpath="j2ee:ejb-ref-name"/>
-	</xsd:unique>
-
-	<xsd:unique name="messaged-ejb-ref-name-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The ejb-ref-name element contains the name of an EJB
-	      reference. The EJB reference is an entry in the
-	      component's environment and is relative to the
-	      java:comp/env context. The name must be unique
-	      within the component.
-
-	      It is recommended that name is prefixed with "ejb/".
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:ejb-ref"/>
-	  <xsd:field    xpath="j2ee:ejb-ref-name"/>
-	</xsd:unique>
-
-	<xsd:unique name="messaged-resource-env-ref-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The resource-env-ref-name element specifies the name
-	      of a resource environment reference; its value is
-	      the environment entry name used in the component
-	      code. The name is a JNDI name relative to the
-	      java:comp/env context and must be unique within an
-	      component.
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:resource-env-ref"/>
-	  <xsd:field    xpath="j2ee:resource-env-ref-name"/>
-	</xsd:unique>
-
-	<xsd:unique name="messaged-message-destination-ref-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The message-destination-ref-name element specifies the name
-	      of a message destination reference; its value is
-	      the message destination reference name used in the component
-	      code. The name is a JNDI name relative to the
-	      java:comp/env context and must be unique within an
-	      component.
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:message-destination-ref"/>
-	  <xsd:field    xpath="j2ee:message-destination-ref-name"/>
-	</xsd:unique>
-
-	<xsd:unique name="messaged-res-ref-name-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The res-ref-name element specifies the name of a
-	      resource manager connection factory reference.  The name
-	      is a JNDI name relative to the java:comp/env context.
-	      The name must be unique within an component.
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:resource-ref"/>
-	  <xsd:field    xpath="j2ee:res-ref-name"/>
-	</xsd:unique>
-
-	<xsd:unique name="messaged-env-entry-name-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The env-entry-name element contains the name of a
-	      component's environment entry.  The name is a JNDI
-	      name relative to the java:comp/env context.  The
-	      name must be unique within an component.
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector xpath="j2ee:env-entry"/>
-	  <xsd:field    xpath="j2ee:env-entry-name"/>
-	</xsd:unique>
-      </xsd:element>
-
-    </xsd:choice>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="entity-beanType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The entity-beanType declares an entity bean. The declaration
-	consists of:
-
-	    - an optional description
-	    - an optional display name
-	    - an optional icon element that contains a small and a large
-	      icon file name
-	    - a unique name assigned to the enterprise bean
-	      in the deployment descriptor
-	    - the names of the entity bean's remote home
-	      and remote interfaces, if any
-	    - the names of the entity bean's local home and local
-	      interfaces, if any
-	    - the entity bean's implementation class
-	    - the optional entity bean's persistence management type. If
-              this element is not specified it is defaulted to Container.
-	    - the entity bean's primary key class name
-	    - an indication of the entity bean's reentrancy
-	    - an optional specification of the
-	      entity bean's cmp-version
-	    - an optional specification of the entity bean's
-	      abstract schema name
-	    - an optional list of container-managed fields
-	    - an optional specification of the primary key
-	      field
-	    - an optional declaration of the bean's environment
-	      entries
-	    - an optional declaration of the bean's EJB
-	      references
-	    - an optional declaration of the bean's local
-	      EJB references
-	    - an optional declaration of the bean's web
-	      service references
-	    - an optional declaration of the security role
-	      references
-	    - an optional declaration of the security identity
-	      to be used for the execution of the bean's methods
-	    - an optional declaration of the bean's
-	      resource manager connection factory references
-	    - an optional declaration of the bean's
-	      resource environment references
-	    - an optional declaration of the bean's message
-	      destination references
-	    - an optional set of query declarations
-	      for finder and select methods for an entity
-	      bean with cmp-version 2.x.
-
-	The optional abstract-schema-name element must be specified
-	for an entity bean with container-managed persistence and
-	cmp-version 2.x.
-
-	The optional primkey-field may be present in the descriptor
-	if the entity's persistence-type is Container.
-
-	The optional cmp-version element may be present in the
-	descriptor if the entity's persistence-type is Container. If
-	the persistence-type is Container and the cmp-version
-	element is not specified, its value defaults to 2.x.
-
-	The optional home and remote elements must be specified if
-	the entity bean cmp-version is 1.x.
-
-	The optional home and remote elements must be specified if
-	the entity bean has a remote home and remote interface.
-
-	The optional local-home and local elements must be specified
-	if the entity bean has a local home and local interface.
-
-	Either both the local-home and the local elements or both
-	the home and the remote elements must be specified.
-
-	The optional query elements must be present if the
-	persistence-type is Container and the cmp-version is 2.x and
-	query methods other than findByPrimaryKey have been defined
-	for the entity bean.
-
-	The other elements that are optional are "optional" in the
-	sense that they are omitted if the lists represented by them
-	are empty.
-
-	At least one cmp-field element must be present in the
-	descriptor if the entity's persistence-type is Container and
-	the cmp-version is 1.x, and none must not be present if the
-	entity's persistence-type is Bean.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:group ref="j2ee:descriptionGroup"/>
-      <xsd:element name="ejb-name"
-		   type="j2ee:ejb-nameType"/>
-      <xsd:element name="home"
-		   type="j2ee:homeType"
-		   minOccurs="0"/>
-      <xsd:element name="remote"
-		   type="j2ee:remoteType"
-		   minOccurs="0"/>
-      <xsd:element name="local-home"
-		   type="j2ee:local-homeType"
-		   minOccurs="0"/>
-      <xsd:element name="local"
-		   type="j2ee:localType"
-		   minOccurs="0"/>
-      <xsd:element name="ejb-class"
-		   type="j2ee:ejb-classType"/>
-      <xsd:element name="persistence-type"
-		   type="j2ee:persistence-typeType"
-                   minOccurs="0"/>
-      <xsd:element name="prim-key-class"
-		   type="j2ee:fully-qualified-classType">
-	<xsd:annotation>
-	  <xsd:documentation>
-
-	    The prim-key-class element contains the
-	    fully-qualified name of an
-	    entity bean's primary key class.
-
-	    If the definition of the primary key class is
-	    deferred to deployment time, the prim-key-class
-	    element should specify java.lang.Object.
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-      <xsd:element name="reentrant"
-		   type="j2ee:true-falseType">
-	<xsd:annotation>
-	  <xsd:documentation>
-
-	    The reentrant element specifies whether an entity
-	    bean is reentrant or not.
-
-	    The reentrant element must be one of the two
-	    following: true or false
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-      <xsd:element name="cmp-version"
-		   type="j2ee:cmp-versionType"
-		   minOccurs="0"/>
-      <xsd:element name="abstract-schema-name"
-		   type="j2ee:java-identifierType"
-		   minOccurs="0">
-	<xsd:annotation>
-	  <xsd:documentation>
-
-	    The abstract-schema-name element specifies the name
-	    of the abstract schema type of an entity bean with
-	    cmp-version 2.x. It is used in EJB QL queries.
-
-	    For example, the abstract-schema-name for an entity
-	    bean whose local interface is
-	    com.acme.commerce.Order might be Order.
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-      <xsd:element name="cmp-field"
-		   type="j2ee:cmp-fieldType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="primkey-field"
-		   type="j2ee:string"
-		   minOccurs="0">
-	<xsd:annotation>
-	  <xsd:documentation>
-
-	    The primkey-field element is used to specify the
-	    name of the primary key field for an entity with
-	    container-managed persistence.
-
-	    The primkey-field must be one of the fields declared
-	    in the cmp-field element, and the type of the field
-	    must be the same as the primary key type.
-
-	    The primkey-field element is not used if the primary
-	    key maps to multiple container-managed fields
-	    (i.e. the key is a compound key). In this case, the
-	    fields of the primary key class must be public, and
-	    their names must correspond to the field names of
-	    the entity bean class that comprise the key.
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-      <xsd:group ref="j2ee:jndiEnvironmentRefsGroup"/>
-      <xsd:element name="security-role-ref"
-		   type="j2ee:security-role-refType"
-		   minOccurs="0" maxOccurs="unbounded"/>
-      <xsd:element name="security-identity"
-		   type="j2ee:security-identityType"
-		   minOccurs="0"/>
-      <xsd:element name="query"
-		   type="j2ee:queryType"
-		   minOccurs="0" maxOccurs="unbounded"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="exclude-listType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The exclude-listType specifies one or more methods which
-	the Assembler marks to be uncallable.
-
-	If the method permission relation contains methods that are
-	in the exclude list, the Deployer should consider those
-	methods to be uncallable.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="description"
-		   type="j2ee:descriptionType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="method"
-		   type="j2ee:methodType"
-		   maxOccurs="unbounded"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="init-methodType">
-    <xsd:sequence>
-      <xsd:element name="create-method"
-		   type="j2ee:named-methodType"/>
-      <xsd:element name="bean-method"
-		   type="j2ee:named-methodType"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="interceptorType">
-    <xsd:sequence>
-      <xsd:element name="interceptor-class"
-		   type="j2ee:fully-qualified-classType"/>
-      <xsd:element name="around-invoke-method"
-                   type="j2ee:named-methodType"
-                   minOccurs="0"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="message-driven-beanType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The message-driven element declares a message-driven
-	bean. The declaration consists of:
-
-	    - an optional description
-	    - an optional display name
-	    - an optional icon element that contains a small and a large
-	      icon file name.
-	    - an optional declaration of the enterprise bean's name
-	    - an optional declaration of the message-driven bean's 
-	      implementation class
-	    - an optional declaration of the bean's messaging
-	      type
-	    - the optional message-driven bean's transaction management
-              type. If it is not defined, it is defaulted to Container.
-	    - an optional declaration of the bean's
-	      message-destination-type
-	    - an optional declaration of the bean's
-	      message-destination-link
-	    - an optional declaration of the message-driven bean's
-	      activation configuration properties
-	    - an optional declaration of the bean's environment
-	      entries
-	    - an optional declaration of the bean's EJB references
-	    - an optional declaration of the bean's local EJB
-	      references
-	    - an optional declaration of the bean's web service
-	      references
-	    - an optional declaration of the security
-	      identity to be used for the execution of the bean's
-	      methods
-	    - an optional declaration of the bean's
-	      resource manager connection factory
-	      references
-	    - an optional declaration of the bean's resource
-	      environment references.
-	    - an optional declaration of the bean's message
-	      destination references
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:group ref="j2ee:descriptionGroup"/>
-      <xsd:element name="ejb-name"
-		   type="j2ee:ejb-nameType"
-		   minOccurs="0"/>
-      <xsd:element name="ejb-class"
-		   type="j2ee:ejb-classType"
-		   minOccurs="0"/>
-      <xsd:element name="messaging-type"
-		   type="j2ee:fully-qualified-classType"
-		   minOccurs="0">
-	<xsd:annotation>
-	  <xsd:documentation>
-
-	    The messaging-type element specifies the message
-	    listener interface of the message-driven bean. If
-	    the messaging-type element is not specified, it is
-	    assumed to be javax.jms.MessageListener.
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-      <xsd:element name="interceptor"
-                   type="j2ee:interceptorType"
-                   minOccurs="0"
-                   maxOccurs="unbounded"/>
-      <xsd:element name="around-invoke-method"
-                   type="j2ee:named-methodType"
-                   minOccurs="0"/>
-      <xsd:element name="callback-listener"
-                   type="j2ee:callback-listenerType"
-                   minOccurs="0"/>
-      <xsd:element name="post-construct-method"
-                   type="j2ee:named-methodType"
-                   minOccurs="0"/>
-      <xsd:element name="pre-destroy-method"
-                   type="j2ee:named-methodType"
-                   minOccurs="0"/>
-      <xsd:element name="post-activate-method"
-                   type="j2ee:named-methodType"
-                   minOccurs="0"/>
-      <xsd:element name="pre-passivate-method"
-                   type="j2ee:named-methodType"
-                   minOccurs="0"/>
-      <xsd:element name="timeout-method"
-                   type="j2ee:named-methodType"
-                   minOccurs="0"/>
-      <xsd:element name="transaction-type"
-		   type="j2ee:transaction-typeType"
-                   minOccurs="0"/>
-      <xsd:element name="message-destination-type"
-		   type="j2ee:message-destination-typeType"
-		   minOccurs="0"/>
-      <xsd:element name="message-destination-link"
-		   type="j2ee:message-destination-linkType"
-		   minOccurs="0"/>
-      <xsd:element name="activation-config"
-		   type="j2ee:activation-configType"
-		   minOccurs="0"/>
-      <xsd:group ref="j2ee:jndiEnvironmentRefsGroup"/>
-      <xsd:element name="security-identity"
-		   type="j2ee:security-identityType"
-		   minOccurs="0"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="method-intfType">
-
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The method-intf element allows a method element to
-	differentiate between the methods with the same name and
-	signature that are multiply defined across the home and
-	component interfaces (e.g, in both an enterprise bean's
-	remote and local interfaces or in both an enterprise bean's
-	home and remote interfaces, etc.); the component and web
-	service endpoint interfaces, and so on. The Local applies to
-        both local component interface and local business interface.
-        Similarly, Remote applies to both remote component interface
-        and the remote business interface.
-
-	The method-intf element must be one of the following:
-
-	    Home
-	    Remote
-	    LocalHome
-	    Local
-	    ServiceEndpoint
-
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:simpleContent>
-      <xsd:restriction base="j2ee:string">
-	<xsd:enumeration value="Home"/>
-	<xsd:enumeration value="Remote"/>
-	<xsd:enumeration value="LocalHome"/>
-	<xsd:enumeration value="Local"/>
-	<xsd:enumeration value="ServiceEndpoint"/>
-      </xsd:restriction>
-    </xsd:simpleContent>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="method-nameType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The method-nameType contains a name of an enterprise
-	bean method or the asterisk (*) character. The asterisk is
-	used when the element denotes all the methods of an
-	enterprise bean's client view interfaces.
-
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:simpleContent>
-      <xsd:restriction base="j2ee:string"/>
-    </xsd:simpleContent>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="method-paramsType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The method-paramsType defines a list of the
-	fully-qualified Java type names of the method parameters.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="method-param"
-		   type="j2ee:java-typeType"
-		   minOccurs="0"
-		   maxOccurs="unbounded">
-	<xsd:annotation>
-	  <xsd:documentation>
-
-	    The method-param element contains a primitive
-	    or a fully-qualified Java type name of a method
-	    parameter.
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="method-permissionType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The method-permissionType specifies that one or more
-	security roles are allowed to invoke one or more enterprise
-	bean methods. The method-permissionType consists of an
-	optional description, a list of security role names or an
-	indicator to state that the method is unchecked for
-	authorization, and a list of method elements.
-
-	The security roles used in the method-permissionType
-	must be defined in the security-role elements of the
-	deployment descriptor, and the methods must be methods
-	defined in the enterprise bean's business, home, component
-        and/or web service endpoint interfaces.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="description"
-		   type="j2ee:descriptionType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:choice>
-	<xsd:element name="role-name"
-		     type="j2ee:role-nameType"
-		     maxOccurs="unbounded"/>
-	<xsd:element name="unchecked"
-		     type="j2ee:emptyType">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The unchecked element specifies that a method is
-	      not checked for authorization by the container
-	      prior to invocation of the method.
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	</xsd:element>
-      </xsd:choice>
-      <xsd:element name="method"
-		   type="j2ee:methodType"
-		   maxOccurs="unbounded"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="methodType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	  The methodType is used to denote a method of an enterprise
-	  bean's business, home, component, and/or web service endpoint
-	  interface, or, in the case of a message-driven bean, the
-	  bean's message listener method, or a set of such
-	  methods. The ejb-name element must be the name of one of the
-	  enterprise beans declared in the deployment descriptor; the
-	  optional method-intf element allows to distinguish between a
-	  method with the same signature that is multiply defined
-	  across the business, home, component, and/or web service
-          endpoint nterfaces; the method-name element specifies the
-          method name; and the optional method-params elements identify
-          a single method among multiple methods with an overloaded
-	  method name.
-
-	  There are three possible styles of using methodType element
-	  within a method element:
-
-	  1.
-	  <method>
-	      <ejb-name>EJBNAME</ejb-name>
-	      <method-name>*</method-name>
-	  </method>
-
-	     This style is used to refer to all the methods of the
-	     specified enterprise bean's business, home, component,
-             and/or web service endpoint interfaces.
-
-	  2.
-	  <method>
-	      <ejb-name>EJBNAME</ejb-name>
-	      <method-name>METHOD</method-name>
-	  </method>
-
-	     This style is used to refer to the specified method of
-	     the specified enterprise bean. If there are multiple
-	     methods with the same overloaded name, the element of
-	     this style refers to all the methods with the overloaded
-	     name.
-
-	  3.
-	  <method>
-	      <ejb-name>EJBNAME</ejb-name>
-	      <method-name>METHOD</method-name>
-	      <method-params>
-		  <method-param>PARAM-1</method-param>
-		  <method-param>PARAM-2</method-param>
-		  ...
-		  <method-param>PARAM-n</method-param>
-	      </method-params>
-	  </method>
-
-	     This style is used to refer to a single method within a
-	     set of methods with an overloaded name. PARAM-1 through
-	     PARAM-n are the fully-qualified Java types of the
-	     method's input parameters (if the method has no input
-	     arguments, the method-params element contains no
-	     method-param elements). Arrays are specified by the
-	     array element's type, followed by one or more pair of
-	     square brackets (e.g. int[][]). If there are multiple
-	     methods with the same overloaded name, this style refers
-	     to all of the overloaded methods.
-
-	  Examples:
-
-	  Style 1: The following method element refers to all the
-	  methods of the EmployeeService bean's business, home,
-          component, and/or web service endpoint interfaces:
-
-	  <method>
-	      <ejb-name>EmployeeService</ejb-name>
-	      <method-name>*</method-name>
-	  </method>
-
-	  Style 2: The following method element refers to all the
-	  create methods of the EmployeeService bean's home
-	  interface(s).
-
-	  <method>
-	      <ejb-name>EmployeeService</ejb-name>
-	      <method-name>create</method-name>
-	  </method>
-
-	  Style 3: The following method element refers to the
-	  create(String firstName, String LastName) method of the
-	  EmployeeService bean's home interface(s).
-
-	  <method>
-	      <ejb-name>EmployeeService</ejb-name>
-	      <method-name>create</method-name>
-	      <method-params>
-		  <method-param>java.lang.String</method-param>
-		  <method-param>java.lang.String</method-param>
-	      </method-params>
-	  </method>
-
-	  The following example illustrates a Style 3 element with
-	  more complex parameter types. The method
-	  foobar(char s, int i, int[] iar, mypackage.MyClass mycl,
-	  mypackage.MyClass[][] myclaar) would be specified as:
-
-	  <method>
-	      <ejb-name>EmployeeService</ejb-name>
-	      <method-name>foobar</method-name>
-	      <method-params>
-		  <method-param>char</method-param>
-		  <method-param>int</method-param>
-		  <method-param>int[]</method-param>
-		  <method-param>mypackage.MyClass</method-param>
-		  <method-param>mypackage.MyClass[][]</method-param>
-	      </method-params>
-	  </method>
-
-	  The optional method-intf element can be used when it becomes
-	  necessary to differentiate between a method that is multiply
-	  defined across the enterprise bean's business, home, component,
-          and/or web service endpoint interfaces with the same name and
-	  signature. However, if the same method is a method of both the
-          local business interface, and the local component interface,
-          the same attribute applies to the method for both interfaces.
-          Likewise, if the same method is a method of both the remote
-          business interface and the remote component interface, the same
-          attribute applies to the method for both interfaces.
-
-	  For example, the method element
-
-	  <method>
-	      <ejb-name>EmployeeService</ejb-name>
-	      <method-intf>Remote</method-intf>
-	      <method-name>create</method-name>
-	      <method-params>
-		  <method-param>java.lang.String</method-param>
-		  <method-param>java.lang.String</method-param>
-	      </method-params>
-	  </method>
-
-	  can be used to differentiate the create(String, String)
-	  method defined in the remote interface from the
-	  create(String, String) method defined in the remote home
-	  interface, which would be defined as
-
-	  <method>
-	      <ejb-name>EmployeeService</ejb-name>
-	      <method-intf>Home</method-intf>
-	      <method-name>create</method-name>
-	      <method-params>
-		  <method-param>java.lang.String</method-param>
-		  <method-param>java.lang.String</method-param>
-	      </method-params>
-	  </method>
-
-	  and the create method that is defined in the local home
-	  interface which would be defined as
-
-	  <method>
-	      <ejb-name>EmployeeService</ejb-name>
-	      <method-intf>LocalHome</method-intf>
-	      <method-name>create</method-name>
-	      <method-params>
-		  <method-param>java.lang.String</method-param>
-		  <method-param>java.lang.String</method-param>
-	      </method-params>
-	  </method>
-
-	  The method-intf element can be used with all three Styles
-	  of the method element usage. For example, the following
-	  method element example could be used to refer to all the
-	  methods of the EmployeeService bean's remote home interface
-          and the remote business interface.
-
-	  <method>
-	      <ejb-name>EmployeeService</ejb-name>
-	      <method-intf>Home</method-intf>
-	      <method-name>*</method-name>
-	  </method>
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="description"
-		   type="j2ee:descriptionType"
-		   minOccurs="0" maxOccurs="unbounded"/>
-      <xsd:element name="ejb-name"
-		   type="j2ee:ejb-nameType"/>
-      <xsd:element name="method-intf"
-		   type="j2ee:method-intfType"
-		   minOccurs="0">
-      </xsd:element>
-      <xsd:element name="method-name"
-		   type="j2ee:method-nameType"/>
-      <xsd:element name="method-params"
-		   type="j2ee:method-paramsType"
-		   minOccurs="0"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="multiplicityType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The multiplicityType describes the multiplicity of the
-	role that participates in a relation.
-
-	The value must be one of the two following:
-
-	    One
-	    Many
-
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:simpleContent>
-      <xsd:restriction base="j2ee:string">
-	<xsd:enumeration value="One"/>
-	<xsd:enumeration value="Many"/>
-      </xsd:restriction>
-    </xsd:simpleContent>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="named-methodType">
-    <xsd:sequence>
-      <xsd:element name="method-name"
-		   type="j2ee:string"/>
-      <xsd:element name="method-params"
-		   type="j2ee:method-paramsType"
-		   minOccurs="0"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="persistence-typeType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The persistence-typeType specifies an entity bean's persistence
-	management type.
-
-	The persistence-type element must be one of the two following:
-
-	    Bean
-	    Container
-
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:simpleContent>
-      <xsd:restriction base="j2ee:string">
-	<xsd:enumeration value="Bean"/>
-	<xsd:enumeration value="Container"/>
-      </xsd:restriction>
-    </xsd:simpleContent>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="query-methodType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	  The query-method specifies the method for a finder or select
-	  query.
-
-	  The method-name element specifies the name of a finder or select
-	  method in the entity bean's implementation class.
-
-	  Each method-param must be defined for a query-method using the
-	  method-params element.
-
-	  It is used by the query-method element.
-
-	  Example:
-
-	  <query>
-	      <description>Method finds large orders</description>
-	      <query-method>
-		  <method-name>findLargeOrders</method-name>
-		  <method-params></method-params>
-	      </query-method>
-	      <ejb-ql>
-		SELECT OBJECT(o) FROM Order o
-		  WHERE o.amount &gt; 1000
-	      </ejb-ql>
-	  </query>
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="method-name"
-		   type="j2ee:method-nameType"/>
-      <xsd:element name="method-params"
-		   type="j2ee:method-paramsType"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="queryType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The queryType defines a finder or select
-	query. It contains
-	    - an optional description of the query
-	    - the specification of the finder or select
-	      method it is used by
-		- an optional specification of the result type
-		  mapping, if the query is for a select method
-		  and entity objects are returned.
-		- the EJB QL query string that defines the query.
-
-	Queries that are expressible in EJB QL must use the ejb-ql
-	element to specify the query. If a query is not expressible
-	in EJB QL, the description element should be used to
-	describe the semantics of the query and the ejb-ql element
-	should be empty.
-
-	The result-type-mapping is an optional element. It can only
-	be present if the query-method specifies a select method
-	that returns entity objects.  The default value for the
-	result-type-mapping element is "Local".
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="description"
-		   type="j2ee:descriptionType" minOccurs="0"/>
-      <xsd:element name="query-method"
-		   type="j2ee:query-methodType"/>
-      <xsd:element name="result-type-mapping"
-		   type="j2ee:result-type-mappingType"
-		   minOccurs="0"/>
-      <xsd:element name="ejb-ql"
-		   type="j2ee:xsdStringType"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="relationship-role-sourceType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The relationship-role-sourceType designates the source of a
-	role that participates in a relationship. A
-	relationship-role-sourceType is used by
-	relationship-role-source elements to uniquely identify an
-	entity bean.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="description"
-		   type="j2ee:descriptionType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="ejb-name"
-		   type="j2ee:ejb-nameType"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="relationshipsType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The relationshipsType describes the relationships in
-	which entity beans with container-managed persistence
-	participate. The relationshipsType contains an optional
-	description; and a list of ejb-relation elements, which
-	specify the container managed relationships.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="description"
-		   type="j2ee:descriptionType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:element name="ejb-relation"
-		   type="j2ee:ejb-relationType"
-		   maxOccurs="unbounded">
-
-	<xsd:unique name="role-name-uniqueness">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The ejb-relationship-role-name contains the name of a
-	      relationship role. The name must be unique within
-	      a relationship, but can be reused in different
-	      relationships.
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	  <xsd:selector
-	       xpath=".//j2ee:ejb-relationship-role-name"/>
-	  <xsd:field
-	       xpath="."/>
-	</xsd:unique>
-      </xsd:element>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="remove-methodType">
-    <xsd:sequence>
-      <xsd:element name="bean-method"
-		   type="j2ee:named-methodType"/>
-      <xsd:element name="retain-if-exception"
-		   type="j2ee:emptyType"
-		   minOccurs="0"/>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="result-type-mappingType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The result-type-mappingType is used in the query element to
-	specify whether an abstract schema type returned by a query
-	for a select method is to be mapped to an EJBLocalObject or
-	EJBObject type.
-
-	The value must be one of the following:
-
-	    Local
-	    Remote
-
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:simpleContent>
-      <xsd:restriction base="j2ee:string">
-	<xsd:enumeration value="Local"/>
-	<xsd:enumeration value="Remote"/>
-      </xsd:restriction>
-    </xsd:simpleContent>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="security-identityType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The security-identityType specifies whether the caller's
-	security identity is to be used for the execution of the
-	methods of the enterprise bean or whether a specific run-as
-	identity is to be used. It contains an optional description
-	and a specification of the security identity to be used.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:element name="description"
-		   type="j2ee:descriptionType"
-		   minOccurs="0"
-		   maxOccurs="unbounded"/>
-      <xsd:choice>
-	<xsd:element name="use-caller-identity"
-		     type="j2ee:emptyType">
-	  <xsd:annotation>
-	    <xsd:documentation>
-
-	      The use-caller-identity element specifies that
-	      the caller's security identity be used as the
-	      security identity for the execution of the
-	      enterprise bean's methods.
-
-	    </xsd:documentation>
-	  </xsd:annotation>
-	</xsd:element>
-	<xsd:element name="run-as"
-		     type="j2ee:run-asType"/>
-      </xsd:choice>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="session-beanType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The session-beanType declares an session bean. The
-	declaration consists of:
-
-	    - an optional description
-	    - an optional display name
-	    - an optional icon element that contains a small and a large
-	      icon file name
-	    - an optional declaration of the enterprise bean's name
-            - the names of all the remote or local business interfaces,
-              if any
-	    - the names of the session bean's remote home and
-	      remote interfaces, if any
-	    - the names of the session bean's local home and
-	      local interfaces, if any
-	    - the name of the session bean's web service endpoint
-	      interface, if any
-	    - an optional declaration of the message-driven bean's 
-	      implementation class
-	    - the session bean's state management type
-	    - the optional session bean's transaction management type.
-              If it is not present, it is defaulted to Container.
-	    - an optional declaration of the bean's
-	      environment entries
-	    - an optional declaration of the bean's EJB references
-	    - an optional declaration of the bean's local
-	      EJB references
-	    - an optional declaration of the bean's web
-	      service references
-	    - an optional declaration of the security role
-	      references
-	    - an optional declaration of the security identity
-	      to be used for the execution of the bean's methods
-	    - an optional declaration of the bean's resource
-	      manager connection factory references
-	    - an optional declaration of the bean's resource
-	      environment references.
-	    - an optional declaration of the bean's message
-	      destination references
-
-	The elements that are optional are "optional" in the sense
-	that they are omitted when if lists represented by them are
-	empty.
-
-	Either both the local-home and the local elements or both
-	the home and the remote elements must be specified for the
-	session bean.
-
-	The service-endpoint element may only be specified if the
-	bean is a stateless session bean.
-
-      </xsd:documentation>
-    </xsd:annotation>
-
-    <xsd:sequence>
-      <xsd:group ref="j2ee:descriptionGroup"/>
-      <xsd:element name="ejb-name"
-		   type="j2ee:ejb-nameType"
-		   minOccurs="0"/>
-      <xsd:element name="home"
-		   type="j2ee:homeType"
-		   minOccurs="0"/>
-      <xsd:element name="remote"
-		   type="j2ee:remoteType"
-		   minOccurs="0"/>
-      <xsd:element name="local-home"
-		   type="j2ee:local-homeType"
-		   minOccurs="0"/>
-      <xsd:element name="local"
-		   type="j2ee:localType"
-		   minOccurs="0"/>
-      <xsd:element name="business-local"
-		   type="j2ee:fully-qualified-classType"
-		   minOccurs="0"
-                   maxOccurs="unbounded"/>
-      <xsd:element name="business-remote"
-		   type="j2ee:fully-qualified-classType"
-		   minOccurs="0"
-                   maxOccurs="unbounded"/>
-      <xsd:element name="service-endpoint"
-		   type="j2ee:fully-qualified-classType"
-		   minOccurs="0">
-	<xsd:annotation>
-	  <xsd:documentation>
-
-	    The service-endpoint element contains the
-	    fully-qualified name of the enterprise bean's web
-	    service endpoint interface. The service-endpoint
-	    element may only be specified for a stateless
-	    session bean. The specified interface must be a
-	    valid JAX-RPC service endpoint interface.
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-      <xsd:element name="ejb-class"
-		   type="j2ee:ejb-classType"
-		   minOccurs="0"/>
-      <xsd:element name="session-type"
-		   type="j2ee:session-typeType"
-                   minOccurs="0"/>
-      <xsd:element name="interceptor"
-                   type="j2ee:interceptorType"
-                   minOccurs="0"
-                   maxOccurs="unbounded"/>
-      <xsd:element name="around-invoke-method"
-                   type="j2ee:named-methodType"
-                   minOccurs="0"/>
-      <xsd:element name="callback-listener"
-                   type="j2ee:callback-listenerType"
-                   minOccurs="0"/>
-      <xsd:element name="post-construct-method"
-                   type="j2ee:named-methodType"
-                   minOccurs="0"/>
-      <xsd:element name="pre-destroy-method"
-                   type="j2ee:named-methodType"
-                   minOccurs="0"/>
-      <xsd:element name="post-activate-method"
-                   type="j2ee:named-methodType"
-                   minOccurs="0"/>
-      <xsd:element name="pre-passivate-method"
-                   type="j2ee:named-methodType"
-                   minOccurs="0"/>
-      <xsd:element name="timeout-method"
-                   type="j2ee:named-methodType"
-                   minOccurs="0"/>
-      <xsd:element name="init-method"
-                   type="j2ee:init-methodType"
-                   minOccurs="0"
-                   maxOccurs="unbounded">
-        <xsd:annotation>
-	  <xsd:documentation>
-
-	    The init-method element specifies the mappings for
-	    EJB 2.x style create methods for an EJB 3.0 bean.
-	    This element can only be specified for stateful
-            session beans.
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-      <xsd:element name="remove-method"
-                   type="j2ee:remove-methodType"
-                   minOccurs="0"
-                   maxOccurs="unbounded">
-        <xsd:annotation>
-	  <xsd:documentation>
-
-	    The remove-method element specifies the mappings for
-	    EJB 2.x style remove methods for an EJB 3.0 bean.
-	    This element can only be specified for stateful
-            session beans.
-
-	  </xsd:documentation>
-	</xsd:annotation>
-      </xsd:element>
-      <xsd:element name="transaction-type"
-		   type="j2ee:transaction-typeType"
-                   minOccurs="0"/>
-      <xsd:group ref="j2ee:jndiEnvironmentRefsGroup"/>
-      <xsd:element name="security-role-ref"
-		   type="j2ee:security-role-refType"
-		   minOccurs="0"
-		   maxOccurs="unbounded">
-      </xsd:element>
-      <xsd:element name="security-identity"
-		   type="j2ee:security-identityType"
-		   minOccurs="0">
-      </xsd:element>
-    </xsd:sequence>
-    <xsd:attribute name="id" type="xsd:ID"/>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="session-typeType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The session-typeType describes whether the session bean is a
-	stateful session or stateless session. It is used by
-	session-type elements.
-
-	The value must be one of the two following:
-
-	    Stateful
-	    Stateless
-
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:simpleContent>
-      <xsd:restriction base="j2ee:string">
-	<xsd:enumeration value="Stateful"/>
-	<xsd:enumeration value="Stateless"/>
-      </xsd:restriction>
-    </xsd:simpleContent>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="trans-attributeType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The trans-attributeType specifies how the container must
-	manage the transaction boundaries when delegating a method
-	invocation to an enterprise bean's business method.
-
-	The value must be one of the following:
-
-	    NotSupported
-	    Supports
-	    Required
-	    RequiresNew
-	    Mandatory
-	    Never
-
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:simpleContent>
-      <xsd:restriction base="j2ee:string">
-	<xsd:enumeration value="NotSupported"/>
-	<xsd:enumeration value="Supports"/>
-	<xsd:enumeration value="Required"/>
-	<xsd:enumeration value="RequiresNew"/>
-	<xsd:enumeration value="Mandatory"/>
-	<xsd:enumeration value="Never"/>
-      </xsd:restriction>
-    </xsd:simpleContent>
-  </xsd:complexType>
-
-<!-- **************************************************** -->
-
-  <xsd:complexType name="transaction-typeType">
-    <xsd:annotation>
-      <xsd:documentation>
-
-	The transaction-typeType specifies an enterprise bean's
-	transaction management type.
-
-	The transaction-type must be one of the two following:
-
-	    Bean
-	    Container
-
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:simpleContent>
-      <xsd:restriction base="j2ee:string">
-	<xsd:enumeration value="Bean"/>
-	<xsd:enumeration value="Container"/>
-      </xsd:restriction>
-    </xsd:simpleContent>
-  </xsd:complexType>
-
-</xsd:schema>
-
-

Added: branches/Branch_4_0/ejb3/src/resources/security/tst.policy
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/security/tst.policy	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/security/tst.policy	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,3 @@
+grant {
+        permission java.security.AllPermission;
+};

Modified: branches/Branch_4_0/ejb3/src/resources/standalone/embedded-jboss-beans.xml
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/standalone/embedded-jboss-beans.xml	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/standalone/embedded-jboss-beans.xml	2006-09-08 02:24:08 UTC (rev 56622)
@@ -92,5 +92,80 @@
       </constructor>
    </bean>
 
-
+   <bean name="TimerServiceFactory" class="org.jboss.ejb3.timerservice.quartz.QuartzTimerServiceFactory">
+      <property name="properties">
+        	org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreCMT
+            org.quartz.jobStore.nonManagedTXDataSource=myDS
+            org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.HSQLDBDelegate
+            org.quartz.jobStore.tablePrefix=QRTZ_
+            org.quartz.jobStore.dataSource=myDS
+         
+	        # To get it to work with hypersonic
+	        # FIXME: this doesn't lock the row
+            org.quartz.jobStore.selectWithLockSQL=SELECT * FROM qrtz_locks WHERE lock_name = ?
+         
+        	# from quartz.properties
+            org.quartz.scheduler.instanceName=JBossEJB3QuartzScheduler
+            org.quartz.scheduler.rmi.export=false
+            org.quartz.scheduler.rmi.proxy=false
+            org.quartz.scheduler.wrapJobExecutionInUserTransaction=false
+   
+            org.quartz.threadPool.class=org.quartz.simpl.SimpleThreadPool
+            org.quartz.threadPool.threadCount=10
+            org.quartz.threadPool.threadPriority=5
+            org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread=true
+   
+        	org.quartz.jobStore.misfireThreshold=60000
+      </property>
+      <property name="dataSource">java:/DefaultDS</property>
+      <property name="sqlProperties">
+         CREATE_DB_ON_STARTUP = TRUE
+         
+         CREATE_TABLE_JOB_DETAILS = CREATE TABLE qrtz_job_details(JOB_NAME VARCHAR(80) NOT NULL, JOB_GROUP VARCHAR(80) NOT NULL, \
+            DESCRIPTION VARCHAR(120) NULL, JOB_CLASS_NAME VARCHAR(128) NOT NULL, IS_DURABLE VARCHAR(1) NOT NULL, \
+            IS_VOLATILE VARCHAR(1) NOT NULL, IS_STATEFUL VARCHAR(1) NOT NULL, REQUESTS_RECOVERY VARCHAR(1) NOT NULL, \
+            JOB_DATA BINARY NULL, PRIMARY KEY (JOB_NAME,JOB_GROUP))
+         CREATE_TABLE_JOB_LISTENERS = CREATE TABLE qrtz_job_listeners(JOB_NAME VARCHAR(80) NOT NULL, JOB_GROUP VARCHAR(80) NOT NULL, \
+            JOB_LISTENER VARCHAR(80) NOT NULL, PRIMARY KEY (JOB_NAME,JOB_GROUP,JOB_LISTENER), FOREIGN KEY (JOB_NAME,JOB_GROUP) \
+            REFERENCES QRTZ_JOB_DETAILS(JOB_NAME,JOB_GROUP))
+         CREATE_TABLE_TRIGGERS = CREATE TABLE qrtz_triggers(TRIGGER_NAME VARCHAR(80) NOT NULL, TRIGGER_GROUP VARCHAR(80) NOT NULL, \
+            JOB_NAME VARCHAR(80) NOT NULL, JOB_GROUP VARCHAR(80) NOT NULL, IS_VOLATILE VARCHAR(1) NOT NULL, DESCRIPTION VARCHAR(120) NULL, \
+            NEXT_FIRE_TIME NUMERIC(13) NULL, PREV_FIRE_TIME NUMERIC(13) NULL, TRIGGER_STATE VARCHAR(16) NOT NULL, \
+            TRIGGER_TYPE VARCHAR(8) NOT NULL, START_TIME NUMERIC(13) NOT NULL, END_TIME NUMERIC(13) NULL, CALENDAR_NAME VARCHAR(80) NULL, \
+            MISFIRE_INSTR NUMERIC(2) NULL, JOB_DATA BINARY NULL, PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP), FOREIGN KEY (JOB_NAME,JOB_GROUP) \
+            REFERENCES QRTZ_JOB_DETAILS(JOB_NAME,JOB_GROUP))
+         CREATE_TABLE_SIMPLE_TRIGGERS = CREATE TABLE qrtz_simple_triggers(TRIGGER_NAME VARCHAR(80) NOT NULL, \
+            TRIGGER_GROUP VARCHAR(80) NOT NULL, REPEAT_COUNT NUMERIC(7) NOT NULL, REPEAT_INTERVAL NUMERIC(12) NOT NULL, \
+            TIMES_TRIGGERED NUMERIC(7) NOT NULL, PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP), FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP) \
+            REFERENCES QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP))
+         CREATE_TABLE_CRON_TRIGGERS = CREATE TABLE qrtz_cron_triggers(TRIGGER_NAME VARCHAR(80) NOT NULL, \
+            TRIGGER_GROUP VARCHAR(80) NOT NULL, CRON_EXPRESSION VARCHAR(80) NOT NULL, TIME_ZONE_ID VARCHAR(80), \
+            PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP), FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP) \
+            REFERENCES QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP))
+         CREATE_TABLE_BLOB_TRIGGERS = CREATE TABLE qrtz_blob_triggers(TRIGGER_NAME VARCHAR(80) NOT NULL, \
+            TRIGGER_GROUP VARCHAR(80) NOT NULL, BLOB_DATA BINARY NULL, PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP), \
+            FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP) REFERENCES QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP))
+         CREATE_TABLE_TRIGGER_LISTENERS = CREATE TABLE qrtz_trigger_listeners(TRIGGER_NAME VARCHAR(80) NOT NULL, \
+            TRIGGER_GROUP VARCHAR(80) NOT NULL, TRIGGER_LISTENER VARCHAR(80) NOT NULL, \
+            PRIMARY KEY (TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_LISTENER), FOREIGN KEY (TRIGGER_NAME,TRIGGER_GROUP) \
+            REFERENCES QRTZ_TRIGGERS(TRIGGER_NAME,TRIGGER_GROUP))
+         CREATE_TABLE_CALENDARS = CREATE TABLE qrtz_calendars(CALENDAR_NAME VARCHAR(80) NOT NULL, CALENDAR BINARY NOT NULL, \
+            PRIMARY KEY (CALENDAR_NAME))
+         CREATE_TABLE_PAUSED_TRIGGER_GRPS = CREATE TABLE qrtz_paused_trigger_grps(TRIGGER_GROUP VARCHAR(80) NOT NULL, \
+            PRIMARY KEY (TRIGGER_GROUP))
+         CREATE_TABLE_FIRED_TRIGGERS = CREATE TABLE qrtz_fired_triggers(ENTRY_ID VARCHAR(95) NOT NULL, TRIGGER_NAME VARCHAR(80) NOT NULL, \
+            TRIGGER_GROUP VARCHAR(80) NOT NULL, IS_VOLATILE VARCHAR(1) NOT NULL, INSTANCE_NAME VARCHAR(80) NOT NULL, \
+            FIRED_TIME NUMERIC(13) NOT NULL, STATE VARCHAR(16) NOT NULL, JOB_NAME VARCHAR(80) NULL, JOB_GROUP VARCHAR(80) NULL, \
+            IS_STATEFUL VARCHAR(1) NULL, REQUESTS_RECOVERY VARCHAR(1) NULL, PRIMARY KEY (ENTRY_ID))
+         CREATE_TABLE_SCHEDULER_STATE = CREATE TABLE qrtz_scheduler_state(INSTANCE_NAME VARCHAR(80) NOT NULL, \
+            LAST_CHECKIN_TIME NUMERIC(13) NOT NULL, CHECKIN_INTERVAL NUMERIC(13) NOT NULL, RECOVERER VARCHAR(80) NULL, \
+            PRIMARY KEY (INSTANCE_NAME))
+         CREATE_TABLE_LOCKS = CREATE TABLE qrtz_locks(LOCK_NAME VARCHAR(40) NOT NULL, PRIMARY KEY (LOCK_NAME))
+         INSERT_TRIGGER_ACCESS = INSERT INTO qrtz_locks values('TRIGGER_ACCESS')
+         INSERT_JOB_ACCESS = INSERT INTO qrtz_locks values('JOB_ACCESS')
+         INSERT_CALENDAR_ACCESS = INSERT INTO qrtz_locks values('CALENDAR_ACCESS')
+         INSERT_STATE_ACCESS = INSERT INTO qrtz_locks values('STATE_ACCESS')
+         INSERT_MISFIRE_ACCESS = INSERT INTO qrtz_locks values('MISFIRE_ACCESS')
+      </property>
+   </bean>
 </deployment>
\ No newline at end of file

Modified: branches/Branch_4_0/ejb3/src/resources/standalone/jboss-jms-beans.xml
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/standalone/jboss-jms-beans.xml	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/standalone/jboss-jms-beans.xml	2006-09-08 02:24:08 UTC (rev 56622)
@@ -84,6 +84,26 @@
       <property name="maxMemoryMark">60</property>
    </bean>
 
+   <bean name="jms-rar-WorkManager" class="org.jboss.ejb3.embedded.resource.JBossWorkManager">
+   </bean>
+
+   <bean name="jms-rar-DeploymentInfo" class="org.jboss.ejb3.embedded.resource.Ejb3DeploymentInfo">
+      <constructor>
+         <parameter class="java.lang.String">jms-ra.rar</parameter>
+         <parameter class="java.lang.String">javax.jms.MessageListener</parameter>
+         <parameter class="java.lang.String">org.jboss.resource.adapter.jms.inflow.JmsActivationSpec</parameter>
+      </constructor>
+   </bean>
+
+   <bean name="jboss.jca:name='jms-ra.rar',service=RARDeployment" class="org.jboss.ejb3.embedded.resource.RARDeployment">
+   	<constructor>
+         <parameter class="org.jboss.deployment.DeploymentInfo">
+            <inject bean="jms-rar-DeploymentInfo"/>
+         </parameter>
+      </constructor>
+      <property name="workManager"><inject bean="jms-rar-WorkManager"/></property>
+   </bean>
+
    <bean name="jboss.mq:service=StateManager" class="org.jboss.mq.kernel.JDBCStateManager">
       <property name="transactionManager">
          <inject bean="TransactionManager"/>
@@ -147,8 +167,8 @@
       -->
       <property name="blockingModeString">run</property>
    </bean>
-   
-   <!--bean name="jboss.mq:service=DestinationManager" class="org.jboss.mq.server.JMSDestinationManager">
+
+   <bean name="jboss.mq:service=DestinationManager" class="org.jboss.mq.server.JMSDestinationManager">
       <constructor>
          <parameter class="org.jboss.mq.server.BasicQueueParameters">
             <inject bean="BasicQueueParameters"/>
@@ -161,40 +181,22 @@
       <property name="threadGroup"><inject bean="jboss.mq:service=ThreadPool" property="threadGroup"/></property>
       <start method="startServer"/>
       <stop method="stopServer"/>
-   </bean-->
-   
-   <bean name="jboss.mq:service=DestinationManager" class="org.jboss.mq.server.jmx.DestinationManager">
-      <property name="persistenceManager">jboss.mq:service=PersistenceManager</property>
-      <property name="messageCache">jboss.mq:service=MessageCache</property>
-      <property name="stateManager">jboss.mq:service=StateManager</property>
-      <property name="threadPool">jboss.mq:service=ThreadPool</property>
-      <start method="startServer"/>
-      <stop method="stopServer"/>
    </bean>
 
-   <!--bean name="jboss.mq.destination:service=Queue,name=DLQ" class="org.jboss.mq.kernel.Queue">
+   <bean name="jboss.mq.destination:service=Queue,name=DLQ" class="org.jboss.mq.kernel.Queue">
      <property name="destinationManagerPojo"><inject bean="jboss.mq:service=DestinationManager"/></property>
      <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property>
       <property name="destinationName">DLQ</property>
-   </bean-->
-   
-   <bean name="jboss.mq.destination:service=Queue,name=DLQ" class="org.jboss.mq.server.jmx.Queue">
-      <property name="destinationManager">jboss.mq:service=DestinationManager</property>
-      <property name="queueName">DLQ</property>
    </bean>
 
-   <!--bean name="jboss.mq:service=Invoker" class="org.jboss.mq.server.JMSServerInvoker">
+   <bean name="jboss.mq:service=Invoker" class="org.jboss.mq.server.JMSServerInvoker">
       <property name="next"><inject bean="jboss.mq:service=DestinationManager"/></property>
-   </bean-->
-   
-   <bean name="jboss.mq:service=Invoker" class="org.jboss.mq.server.jmx.Invoker">
-      <property name="nextInterceptor">jboss.mq:service=DestinationManager</property>
    </bean>
-   
-   <bean name="jboss.mq:service=InvocationLayer,type=JVM" class="org.jboss.mq.kernel.JVMIL">
+
+   <bean name="jboss.mq:service=invocationlayer,type=JVM" class="org.jboss.mq.kernel.JVMIL">
       <property name="jmsInvoker"><inject bean="jboss.mq:service=Invoker"/></property>
      <property name="connectionFactoryJNDIRef">java:/ConnectionFactory</property>
-     <property name="xAConnectionFactoryJNDIRef">java:/XAConnectionFactory</property>
+     <property name="XAConnectionFactoryJNDIRef">java:/XAConnectionFactory</property>
      <property name="pingPeriod">0</property>
       <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property>
    </bean>

Modified: branches/Branch_4_0/ejb3/src/resources/standalone/jndi.properties
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/standalone/jndi.properties	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/standalone/jndi.properties	2006-09-08 02:24:08 UTC (rev 56622)
@@ -1,2 +1,2 @@
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
+java.naming.factory.initial=org.jnp.interfaces.LocalOnlyContextFactory
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
\ No newline at end of file

Modified: branches/Branch_4_0/ejb3/src/resources/test/bank/META-INF/ejb-jar.xml
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test/bank/META-INF/ejb-jar.xml	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test/bank/META-INF/ejb-jar.xml	2006-09-08 02:24:08 UTC (rev 56622)
@@ -66,7 +66,7 @@
             <res-type>javax.sql.DataSource</res-type>
             <res-auth>Container</res-auth>
             <res-sharing-scope>Shareable</res-sharing-scope>
-            <mapped-name>java:/DefaultDS</mapped-name>
+            <mapped-name>${test.datasource.jndi}</mapped-name>
             <injection-target>
                <injection-target-class>org.jboss.ejb3.test.bank.BankBean</injection-target-class>
                <injection-target-name>customerDb</injection-target-name>
@@ -84,7 +84,7 @@
             <res-type>javax.sql.DataSource</res-type>
             <res-auth>Container</res-auth>
             <res-sharing-scope>Shareable</res-sharing-scope>
-            <mapped-name>java:/DefaultDS</mapped-name>
+            <mapped-name>${test.datasource.jndi}</mapped-name>
             <injection-target>
                <injection-target-class>org.jboss.ejb3.test.bank.BankBean21</injection-target-class>
                <injection-target-name>customerDb</injection-target-name>

Modified: branches/Branch_4_0/ejb3/src/resources/test/bank/META-INF/jboss.xml
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test/bank/META-INF/jboss.xml	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test/bank/META-INF/jboss.xml	2006-09-08 02:24:08 UTC (rev 56622)
@@ -29,9 +29,11 @@
       </session>
       <session>
          <ejb-name>Teller</ejb-name>
-         <jndi-name>bank/Teller</jndi-name>
-         <interceptor-stack>TellerClientInterceptors</interceptor-stack>
-         <proxy-factory>org.jboss.ejb3.test.bank.TellerRemoteProxyFactory</proxy-factory>
+         <remote-binding>
+            <jndi-name>bank/Teller</jndi-name>
+            <interceptor-stack>TellerClientInterceptors</interceptor-stack>
+            <proxy-factory>org.jboss.ejb3.test.bank.TellerRemoteProxyFactory</proxy-factory>
+         </remote-binding>
          <security-identity>
             <run-as-principal>teller</run-as-principal>
          </security-identity> 
@@ -42,6 +44,14 @@
                <transaction-timeout>1</transaction-timeout>
              </method>
           </method-attributes>
+         <jndi-ref>
+            <jndi-ref-name>TellerTM</jndi-ref-name>
+            <mapped-name>${test.transactionmanager.jndi}</mapped-name>
+            <injection-target>
+               <injection-target-class>org.jboss.ejb3.test.bank.TellerBean</injection-target-class>
+               <injection-target-name>tm</injection-target-name>
+            </injection-target>
+         </jndi-ref>
       </session>
    </enterprise-beans>
 </jboss>

Modified: branches/Branch_4_0/ejb3/src/resources/test/cache/testejb3-cache-service.xml
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test/cache/testejb3-cache-service.xml	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test/cache/testejb3-cache-service.xml	2006-09-08 02:24:08 UTC (rev 56622)
@@ -36,13 +36,34 @@
                <attribute name="maxNodes">5000</attribute>
                <attribute name="timeToIdleSeconds">1000</attribute>
             </region>
-
          </config>
       </attribute>
 
+      <attribute name="CacheLoaderConfiguration">
+            <config>
+                <!-- if passivation is true, only the first cache loader is used; the rest are ignored -->
+                <passivation>true</passivation>
+                <preload>/</preload>
+                <shared>false</shared>
 
-      <attribute name="CacheLoaderClass">org.jboss.ejb3.cache.tree.PassivationCacheLoader</attribute>
-      <attribute name="CacheLoaderConfig">location=stateful</attribute>
+                <!-- we can now have multiple cache loaders, which get chained -->
+                <cacheloader>
+                    <class>org.jboss.ejb3.cache.tree.PassivationCacheLoader</class>
+                    <!-- same as the old CacheLoaderConfig attribute -->
+                    <properties>
+                        location=server/all/tmp/stateful
+                    </properties>
+                    <!-- whether the cache loader writes are asynchronous -->
+                    <async>false</async>
+                    <!-- only one cache loader in the chain may set fetchPersistentState to true.
+                        An exception is thrown if more than one cache loader sets this to true. -->
+                    <fetchPersistentState>true</fetchPersistentState>
+                    <!-- determines whether this cache loader ignores writes - defaults to false. -->
+                    <ignoreModifications>false</ignoreModifications>
+                </cacheloader>
+
+            </config>
+        </attribute>
    </mbean>
 
 </server>

Modified: branches/Branch_4_0/ejb3/src/resources/test/cache/testejb3-statefulcache-service.xml
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test/cache/testejb3-statefulcache-service.xml	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test/cache/testejb3-statefulcache-service.xml	2006-09-08 02:24:08 UTC (rev 56622)
@@ -40,9 +40,31 @@
          </config>
       </attribute>
 
+      <attribute name="CacheLoaderConfiguration">
+            <config>
+                <!-- if passivation is true, only the first cache loader is used; the rest are ignored -->
+                <passivation>true</passivation>
+                <preload>/</preload>
+                <shared>false</shared>
 
-      <attribute name="CacheLoaderClass">org.jboss.ejb3.cache.tree.StatefulCacheLoader</attribute>
-      <attribute name="CacheLoaderConfig">location=stateful</attribute>
+                <!-- we can now have multiple cache loaders, which get chained -->
+                <cacheloader>
+                    <class>org.jboss.ejb3.cache.tree.StatefulCacheLoader</class>
+                    <!-- same as the old CacheLoaderConfig attribute -->
+                    <properties>
+                        location=server/all/tmp/stateful
+                    </properties>
+                    <!-- whether the cache loader writes are asynchronous -->
+                    <async>false</async>
+                    <!-- only one cache loader in the chain may set fetchPersistentState to true.
+                        An exception is thrown if more than one cache loader sets this to true. -->
+                    <fetchPersistentState>true</fetchPersistentState>
+                    <!-- determines whether this cache loader ignores writes - defaults to false. -->
+                    <ignoreModifications>false</ignoreModifications>
+                </cacheloader>
+
+            </config>
+        </attribute>
    </mbean>
 
 </server>

Modified: branches/Branch_4_0/ejb3/src/resources/test/circulardependency/META-INF/jboss.xml
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test/circulardependency/META-INF/jboss.xml	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test/circulardependency/META-INF/jboss.xml	2006-09-08 02:24:08 UTC (rev 56622)
@@ -8,12 +8,14 @@
    <enterprise-beans>
       <session>
          <ejb-name>StatelessBean2</ejb-name>
-         <ignore-dependency>
+         <annotation>
+            <annotation-class>org.jboss.annotation.IgnoreDependency</annotation-class>
+            <annotation-implementation-class>org.jboss.annotation.IgnoreDependencyImpl</annotation-implementation-class>
             <injection-target>
                <injection-target-class>org.jboss.ejb3.test.circulardependecy.StatelessBean2</injection-target-class>
                <injection-target-name>stateless</injection-target-name>
             </injection-target>
-         </ignore-dependency>
+         </annotation>
       </session>
    </enterprise-beans>
 </jboss>

Added: branches/Branch_4_0/ejb3/src/resources/test/clusteredservice/WEB-INF/web.xml
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test/clusteredservice/WEB-INF/web.xml	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test/clusteredservice/WEB-INF/web.xml	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app version="2.4"
+   xmlns="http://java.sun.com/xml/ns/j2ee"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+   http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+   <description>EJB3 Servlet Access Test</description>
+
+   <servlet>
+      <servlet-name>EJBServlet</servlet-name>
+      <servlet-class>org.jboss.ejb3.test.clusteredservice.servlets.EJBServlet</servlet-class>
+   </servlet>
+
+   <!-- The servlet and jsp page mappings -->
+   <servlet-mapping>
+      <servlet-name>EJBServlet</servlet-name>
+      <url-pattern>/EJBServlet</url-pattern>
+   </servlet-mapping>
+</web-app>
+

Modified: branches/Branch_4_0/ejb3/src/resources/test/dd/mdb/META-INF/ejb-jar.xml
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test/dd/mdb/META-INF/ejb-jar.xml	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test/dd/mdb/META-INF/ejb-jar.xml	2006-09-08 02:24:08 UTC (rev 56622)
@@ -121,6 +121,14 @@
           	<activation-config-property-name>subscriptionDurability</activation-config-property-name>
           	<activation-config-property-value>Durable</activation-config-property-value>
           </activation-config-property>
+          <activation-config-property>
+          	<activation-config-property-name>subscriptionName</activation-config-property-name>
+          	<activation-config-property-value>DurableTopicTest</activation-config-property-value>
+          </activation-config-property>
+          <!--activation-config-property>
+          	<activation-config-property-name>clientId</activation-config-property-name>
+          	<activation-config-property-value>DurableTopicTest</activation-config-property-value>
+          </activation-config-property-->
         </activation-config>
       </message-driven>
 
@@ -129,6 +137,12 @@
 	    <ejb-class>org.jboss.ejb3.test.dd.mdb.ExQueueBean</ejb-class>
         <transaction-type>Container</transaction-type>
         <message-destination-type>javax.jms.Queue</message-destination-type>
+        <activation-config>   
+          <activation-config-property>
+          	<activation-config-property-name>dLQMaxResent</activation-config-property-name>
+          	<activation-config-property-value>10</activation-config-property-value>
+          </activation-config-property>
+        </activation-config>
       </message-driven>
 
       <message-driven>

Modified: branches/Branch_4_0/ejb3/src/resources/test/dd/mdb/META-INF/jboss.xml
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test/dd/mdb/META-INF/jboss.xml	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test/dd/mdb/META-INF/jboss.xml	2006-09-08 02:24:08 UTC (rev 56622)
@@ -42,9 +42,9 @@
       <message-driven>
          <ejb-name>DurableTopicBean</ejb-name>
          <destination-jndi-name>topic/testDurableTopic</destination-jndi-name>
-         <mdb-user>john</mdb-user>
-         <mdb-passwd>needle</mdb-passwd>
-         <mdb-subscription-id>DurableSubscriberExample</mdb-subscription-id>
+         <mdb-user>dynsub</mdb-user>
+         <mdb-passwd>dynsub</mdb-passwd>
+         <mdb-subscription-id>DurableTopicTest</mdb-subscription-id>
       </message-driven>
       <message-driven>
          <ejb-name>ExQueueBean</ejb-name>

Modified: branches/Branch_4_0/ejb3/src/resources/test/dd/web/META-INF/application.xml
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test/dd/web/META-INF/application.xml	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test/dd/web/META-INF/application.xml	2006-09-08 02:24:08 UTC (rev 56622)
@@ -3,6 +3,10 @@
 <application>
     <display-name>EJB3 Web Container Testsuite</display-name>
 
+   <module>
+       <ejb>dd-web-ejbs.jar</ejb>
+   </module>
+
     <module>
     <web>
         <description>The testsuite war</description>
@@ -11,8 +15,5 @@
     </web>
     </module>
  
-    <module>
-        <ejb>dd-web-ejbs.jar</ejb>
-    </module>
 </application>
 

Modified: branches/Branch_4_0/ejb3/src/resources/test/dd/web/WEB-INF/jbosstest-web.xml
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test/dd/web/WEB-INF/jbosstest-web.xml	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test/dd/web/WEB-INF/jbosstest-web.xml	2006-09-08 02:24:08 UTC (rev 56622)
@@ -394,12 +394,17 @@
       <env-entry-value>com.sun.model.dao.CatalogDAOImpl</env-entry-value>
    </env-entry>
 
+   <env-entry>
+      <env-entry-name>overridenConstant</env-entry-name>
+      <env-entry-type>java.lang.Integer</env-entry-type>
+      <env-entry-value>42</env-entry-value>
+   </env-entry>
    <!-- ### EJB References (java:comp/env/ejb) -->
    <ejb-ref>
       <ejb-ref-name>ejb/OptimizedEJB</ejb-ref-name>
       <ejb-ref-type>Session</ejb-ref-type>
       <home>org.jboss.ejb3.test.dd.web.interfaces.StatelessSessionHome</home>
-      <remote>org.jboss.ejb3.test.dd.web.interfaces.StatelessSession</remote>\
+      <remote>org.jboss.ejb3.test.dd.web.interfaces.StatelessSession</remote>
       <ejb-link>OptimizedEJB</ejb-link>
    </ejb-ref>
 

Added: branches/Branch_4_0/ejb3/src/resources/test/iiop/custom.jndi.properties
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test/iiop/custom.jndi.properties	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test/iiop/custom.jndi.properties	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,3 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
+java.naming.provider.url=jnp://localhost:1099
\ No newline at end of file

Added: branches/Branch_4_0/ejb3/src/resources/test/iiop/jndi.properties
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test/iiop/jndi.properties	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test/iiop/jndi.properties	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,8 @@
+java.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory
+java.naming.provider.url=corbaloc::localhost:3528/NameService
+#java.naming.provider.url=corbaloc::localhost:3528/JBoss/Naming/root
+java.naming.factory.object=org.jboss.tm.iiop.client.IIOPClientUserTransactionObjectFactory
+# use java: client namespace
+java.naming.factory.url.pkgs=org.jboss.ejb3.naming.client:org.jnp.interfaces
+# hack to get java: client namespace up
+j2ee.clientName=iiop-unit-test

Modified: branches/Branch_4_0/ejb3/src/resources/test/mdb/META-INF/ejb-jar.xml
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test/mdb/META-INF/ejb-jar.xml	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test/mdb/META-INF/ejb-jar.xml	2006-09-08 02:24:08 UTC (rev 56622)
@@ -8,8 +8,23 @@
 
     <enterprise-beans>
       <message-driven>
+        <ejb-name>QueueTestMDB</ejb-name>
+        <activation-config>
+          <activation-config-property>
+            <activation-config-property-name>maxSession</activation-config-property-name>
+              <activation-config-property-value>1</activation-config-property-value>
+          </activation-config-property>
+        </activation-config>
+      </message-driven>
+      <message-driven>
         <ejb-name>OverrideTestMDB</ejb-name>
         <message-destination-type>javax.jms.Queue</message-destination-type>
+          <activation-config>
+            <activation-config-property>
+              <activation-config-property-name>maxSession</activation-config-property-name>
+              <activation-config-property-value>100</activation-config-property-value>
+            </activation-config-property>
+          </activation-config>
       </message-driven>
     </enterprise-beans>
   </ejb-jar>

Modified: branches/Branch_4_0/ejb3/src/resources/test/mdb/META-INF/jboss.xml
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test/mdb/META-INF/jboss.xml	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test/mdb/META-INF/jboss.xml	2006-09-08 02:24:08 UTC (rev 56622)
@@ -11,5 +11,14 @@
          <ejb-name>OverrideTestMDB</ejb-name>
          <destination-jndi-name>queue/overridequeuetest</destination-jndi-name>
       </message-driven>
+      <message-driven>
+         <ejb-name>OverrideDefaultedQueueTestMDB</ejb-name>
+         <default-activation-config>
+            <default-activation-config-property>
+               <activation-config-property-name>destinationType</activation-config-property-name>
+               <activation-config-property-value>javax.jms.Queue</activation-config-property-value>
+            </default-activation-config-property>
+         </default-activation-config>
+      </message-driven>
    </enterprise-beans>
 </jboss>

Modified: branches/Branch_4_0/ejb3/src/resources/test/mdb/mdbtest-service.xml
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test/mdb/mdbtest-service.xml	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test/mdb/mdbtest-service.xml	2006-09-08 02:24:08 UTC (rev 56622)
@@ -11,6 +11,12 @@
       <attribute name="JNDIName">queue/defaultedmdbtest</attribute>
       <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
    </mbean>
+   
+   <mbean code="org.jboss.mq.server.jmx.Queue"
+      name="jboss.mq.destination:service=Queue,name=overridedefaultedqueuetest">
+      <attribute name="JNDIName">queue/overridedefaultedmdbtest</attribute>
+      <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+   </mbean>
 
    <mbean code="org.jboss.mq.server.jmx.Queue"
       name="jboss.mq.destination:service=Queue,name=nondurablequeuetest">
@@ -36,4 +42,18 @@
       <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
    </mbean>
 
+   <mbean code="org.jboss.mq.server.jmx.Queue"
+      name="jboss.mq.destination:service=Queue,name=expirytest">
+      <attribute name="JNDIName">queue/expirytest</attribute>
+      <attribute name="ExpiryDestination">jboss.mq.destination:service=Queue,name=DLQ</attribute>
+      <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+   </mbean>
+   
+   <mbean code="org.jboss.mq.server.jmx.Queue"
+      name="jboss.mq.destination:service=Queue,name=dlqtest">
+      <attribute name="JNDIName">queue/dlqtest</attribute>
+      <attribute name="ExpiryDestination">jboss.mq.destination:service=Queue,name=DLQ</attribute>
+      <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+   </mbean>
+
 </server>

Modified: branches/Branch_4_0/ejb3/src/resources/test/naming-errors/ejb-jar-method-field.xml
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test/naming-errors/ejb-jar-method-field.xml	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test/naming-errors/ejb-jar-method-field.xml	2006-09-08 02:24:08 UTC (rev 56622)
@@ -11,13 +11,15 @@
       <session>
          <description>A session bean on looks up stuff in the ENC</description>
          <ejb-name>BadFieldMethodBean</ejb-name>
-         <ejb-class>org.jboss.ejb3.test.naming.bad.BadFieldMethodBean</ejb-class>
-
          <env-entry>
             <description>A flag indicating if the bean should perform the full ENC testsuite</description>
             <env-entry-name>key</env-entry-name>
             <env-entry-type>java.lang.String</env-entry-type>
             <env-entry-value>BadFieldMethodBean</env-entry-value>
+            <injection-target>
+               <injection-target-class>org.jboss.ejb3.test.naming.bad.BadFieldMethodBean</injection-target-class>
+               <injection-target-name>key</injection-target-name>
+            </injection-target>
          </env-entry>
       </session>
    </enterprise-beans>

Added: branches/Branch_4_0/ejb3/src/resources/test/seam/META-INF/ejb-jar.xml
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test/seam/META-INF/ejb-jar.xml	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test/seam/META-INF/ejb-jar.xml	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" version="3.0">
+	<assembly-descriptor>
+		<interceptor-binding>
+			<ejb-name>*</ejb-name>
+			<interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
+		</interceptor-binding>
+	</assembly-descriptor>
+</ejb-jar>

Added: branches/Branch_4_0/ejb3/src/resources/test/seam/META-INF/maven/com.adapt.crm/crm-ejb/pom.properties
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test/seam/META-INF/maven/com.adapt.crm/crm-ejb/pom.properties	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test/seam/META-INF/maven/com.adapt.crm/crm-ejb/pom.properties	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,5 @@
+#Generated by Maven
+#Fri May 12 18:10:37 PDT 2006
+version=2.0-SNAPSHOT
+groupId=com.adapt.crm
+artifactId=crm-ejb

Added: branches/Branch_4_0/ejb3/src/resources/test/seam/META-INF/maven/com.adapt.crm/crm-ejb/pom.xml
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test/seam/META-INF/maven/com.adapt.crm/crm-ejb/pom.xml	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test/seam/META-INF/maven/com.adapt.crm/crm-ejb/pom.xml	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,20 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+		xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<parent>
+		<groupId>com.adapt.crm</groupId>
+		<artifactId>crm-shared</artifactId>
+		<version>2.0-SNAPSHOT</version>
+	</parent>
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>crm-ejb</artifactId>
+	<packaging>ejb</packaging>
+	<name>MarketFinder CRM EJBs</name>
+	<dependencies>
+		<dependency>
+			<groupId>org.apache.maven.plugins</groupId>
+			<artifactId>maven-ejb-plugin</artifactId>
+			<version>2.0-adapt</version>
+			<scope>provided</scope>
+		</dependency>
+	</dependencies>
+</project>

Added: branches/Branch_4_0/ejb3/src/resources/test/seam/jboss-seam.jar
===================================================================
(Binary files differ)


Property changes on: branches/Branch_4_0/ejb3/src/resources/test/seam/jboss-seam.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/Branch_4_0/ejb3/src/resources/test/seam/seam.properties
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test/seam/seam.properties	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test/seam/seam.properties	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1 @@
+org.jboss.seam.core.init.jndiPattern=seam-test/#{ejbName}/remote

Modified: branches/Branch_4_0/ejb3/src/resources/test/servlet/META-INF/application.xml
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test/servlet/META-INF/application.xml	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test/servlet/META-INF/application.xml	2006-09-08 02:24:08 UTC (rev 56622)
@@ -11,6 +11,10 @@
     </web>
     </module>
  
+   <module>
+       <ejb>servlet-client.jar</ejb>
+   </module>
+
     <module>
         <ejb>servlet-ejbs.jar</ejb>
     </module>

Modified: branches/Branch_4_0/ejb3/src/resources/test/servlet/META-INF/jboss.xml
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test/servlet/META-INF/jboss.xml	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test/servlet/META-INF/jboss.xml	2006-09-08 02:24:08 UTC (rev 56622)
@@ -5,10 +5,10 @@
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
                             http://www.jboss.org/j2ee/schema/jboss_5_0.xsd"
         version="3.0">
-   <loader-repository>
+   <!--loader-repository>
       jboss.test:war=servlet.war
       <loader-repository-config>
          java2ParentDelegaton=false
       </loader-repository-config>
-   </loader-repository>
+   </loader-repository-->
 </jboss>

Modified: branches/Branch_4_0/ejb3/src/resources/test/servlet/WEB-INF/jboss-web.xml
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test/servlet/WEB-INF/jboss-web.xml	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test/servlet/WEB-INF/jboss-web.xml	2006-09-08 02:24:08 UTC (rev 56622)
@@ -5,18 +5,23 @@
     "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
 
 <jboss-web>
-   <class-loading>
+   <!--class-loading>
       <loader-repository>
          jboss.test:war=servlet.war
          <loader-repository-config>
             java2ParentDelegation=false
          </loader-repository-config>
       </loader-repository>
-   </class-loading>
+   </class-loading-->
    
    <ejb-ref>
-      <ejb-ref-name>ejb/Session30</ejb-ref-name>
-      <jndi-name>Session30</jndi-name>
+      <ejb-ref-name>ejb/remote/Session30</ejb-ref-name>
+      <jndi-name>ejb/Session30Home</jndi-name>
    </ejb-ref>
+   
+   <ejb-local-ref>
+      <ejb-ref-name>ejb/local/Session30</ejb-ref-name>
+      <local-jndi-name>ejb/Session30LocalHome</local-jndi-name>
+   </ejb-local-ref>
 </jboss-web>
 

Modified: branches/Branch_4_0/ejb3/src/resources/test/servlet/WEB-INF/test-web.xml
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test/servlet/WEB-INF/test-web.xml	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test/servlet/WEB-INF/test-web.xml	2006-09-08 02:24:08 UTC (rev 56622)
@@ -20,11 +20,17 @@
    </servlet-mapping>
    
    <ejb-ref>
-      <ejb-ref-name>ejb/Session30</ejb-ref-name>
+      <ejb-ref-name>ejb/remote/Session30</ejb-ref-name>
       <ejb-ref-type>Session</ejb-ref-type>
       <home>org.jboss.ejb3.test.servlet.Session30Home</home>
       <remote>org.jboss.ejb3.test.servlet.Session30</remote>
-      <ejb-link>servlet-ejb2.jar#Session30</ejb-link>
    </ejb-ref>
+   
+   <ejb-local-ref>
+      <ejb-ref-name>ejb/local/Session30</ejb-ref-name>
+      <ejb-ref-type>Session</ejb-ref-type>
+      <local-home>org.jboss.ejb3.test.servlet.Session30LocalHome</local-home>
+      <local>org.jboss.ejb3.test.servlet.Session30</local>
+   </ejb-local-ref>
 </web-app>
 

Added: branches/Branch_4_0/ejb3/src/resources/test/ssladvanced/META-INF/jboss.xml
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test/ssladvanced/META-INF/jboss.xml	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test/ssladvanced/META-INF/jboss.xml	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<jboss
+   xmlns="http://java.sun.com/xml/ns/javaee"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+   http://www.jboss.org/j2ee/schema/jboss_5_0.xsd"
+   version="3.0">
+   <enterprise-beans>
+      <session>
+         <ejb-name>OverrideStatefulClusteredBean</ejb-name>
+         <remote-binding>
+            <jndi-name>OverrideStatefulClusteredSSL</jndi-name>
+            <client-bind-url>sslsocket://0.0.0.0:3843</client-bind-url>
+         </remote-binding>
+         <remote-binding>
+            <jndi-name>OverrideStatefulClusteredNormal</jndi-name>
+            <client-bind-url>socket://0.0.0.0:3873</client-bind-url>
+         </remote-binding>
+      </session>
+   </enterprise-beans>
+</jboss>

Modified: branches/Branch_4_0/ejb3/src/resources/test/stateful/META-INF/ejb-jar.xml
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test/stateful/META-INF/ejb-jar.xml	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test/stateful/META-INF/ejb-jar.xml	2006-09-08 02:24:08 UTC (rev 56622)
@@ -19,5 +19,21 @@
             <retain-if-exception>false</retain-if-exception>
          </remove-method>
       </session>
+      <session>
+         <ejb-name>CustomRemoveBean</ejb-name>
+         <remove-method>
+            <bean-method>
+               <method-name>destroy</method-name>
+            </bean-method>
+            <retain-if-exception>false</retain-if-exception>
+         </remove-method>
+      </session>
+      <session>
+         <ejb-name>OverrideConcurrentStateful</ejb-name>
+         <remote>org.jboss.ejb3.test.stateful.ConcurrentStateful</remote>
+         <ejb-class>org.jboss.ejb3.test.stateful.ConcurrentStatefulBean</ejb-class>
+         <session-type>Stateful</session-type>
+         <transaction-type>Container</transaction-type>
+      </session>
    </enterprise-beans>
 </ejb-jar>

Added: branches/Branch_4_0/ejb3/src/resources/test/stateful/META-INF/jboss.xml
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test/stateful/META-INF/jboss.xml	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test/stateful/META-INF/jboss.xml	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<jboss
+        xmlns="http://java.sun.com/xml/ns/javaee"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+                            http://www.jboss.org/j2ee/schema/jboss_5_0.xsd"
+        version="3.0">
+   <enterprise-beans>
+      <session>
+         <ejb-name>OverrideConcurrentStateful</ejb-name>
+         <jndi-name>OverrideConcurrentStateful</jndi-name>
+         <concurrent>false</concurrent>
+      </session>
+   </enterprise-beans>
+</jboss>

Added: branches/Branch_4_0/ejb3/src/resources/test/unauthenticatedprincipal/META-INF/ejb-jar.xml
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test/unauthenticatedprincipal/META-INF/ejb-jar.xml	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test/unauthenticatedprincipal/META-INF/ejb-jar.xml	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,16 @@
+<ejb-jar
+        xmlns="http://java.sun.com/xml/ns/javaee"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+                            http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
+        version="3.0">
+  <enterprise-beans>
+    <session>
+      <ejb-name>StatelessBean</ejb-name>
+      <remote>org.jboss.ejb3.test.unauthenticatedprincipal.StatelessRemote</remote>
+      <ejb-class>org.jboss.ejb3.test.unauthenticatedprincipal.StatelessBean</ejb-class>
+      <session-type>Stateless</session-type>
+      <transaction-type>Container</transaction-type>
+    </session>
+  </enterprise-beans>
+</ejb-jar>

Added: branches/Branch_4_0/ejb3/src/resources/test/unauthenticatedprincipal/META-INF/jboss.xml
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test/unauthenticatedprincipal/META-INF/jboss.xml	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test/unauthenticatedprincipal/META-INF/jboss.xml	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jboss
+        xmlns="http://java.sun.com/xml/ns/javaee"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+                            http://www.jboss.org/j2ee/schema/jboss_5_0.xsd"
+        version="3.0">
+   <security-domain>java:/jaas/other</security-domain>
+   <unauthenticated-principal>somebody</unauthenticated-principal>
+</jboss>

Added: branches/Branch_4_0/ejb3/src/resources/test/unauthenticatedprincipal/roles.properties
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test/unauthenticatedprincipal/roles.properties	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test/unauthenticatedprincipal/roles.properties	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1 @@
+somebody=allowed
\ No newline at end of file

Added: branches/Branch_4_0/ejb3/src/resources/test/unauthenticatedprincipal/users.properties
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test/unauthenticatedprincipal/users.properties	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test/unauthenticatedprincipal/users.properties	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1 @@
+somebody=password

Modified: branches/Branch_4_0/ejb3/src/resources/test-configs/ejb3-jacc/deploy/jacc-service.xml
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test-configs/ejb3-jacc/deploy/jacc-service.xml	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test-configs/ejb3-jacc/deploy/jacc-service.xml	2006-09-08 02:24:08 UTC (rev 56622)
@@ -32,7 +32,7 @@
       <xmbean>
          <descriptors>
             <injection id="MBeanServerType" setMethod="setMBeanServer" />
-            <injection id="ObjectNameType" setMethod="setObjectName" />
+            <!--injection id="ObjectNameType" setMethod="setObjectName" /-->
          </descriptors>
          <attribute access="read-write" getMethod="getPolicyName" setMethod="setPolicyName">
             <description>The policy provider MBean name</description>

Added: branches/Branch_4_0/ejb3/src/resources/test-configs/invoker/deploy/ejb3.deployer/META-INF/jboss-service.xml
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test-configs/invoker/deploy/ejb3.deployer/META-INF/jboss-service.xml	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test-configs/invoker/deploy/ejb3.deployer/META-INF/jboss-service.xml	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,299 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   JBoss EJB3Deployer
+   
+   $Id: jboss-service.xml 41488 2006-02-25 00:14:09Z dimitris $
+-->
+<server>
+
+   <mbean code="org.jboss.remoting.transport.Connector"
+          xmbean-dd="org/jboss/remoting/transport/Connector.xml"
+          name="jboss.remoting:type=Connector,name=DefaultEjb3Connector,handler=ejb3">
+      <depends>jboss.aop:service=AspectDeployer</depends>
+      <attribute name="InvokerLocator">socket://${jboss.bind.address}:3873</attribute>
+      <attribute name="Configuration">
+         <handlers>
+            <handler subsystem="AOP">org.jboss.aspects.remoting.AOPRemotingInvocationHandler</handler>
+         </handlers>
+      </attribute>
+   </mbean>
+  
+   <mbean code="org.jboss.ejb3.JarsIgnoredForScanning" name="jboss.ejb3:service=JarsIgnoredForScanning">
+      <attribute name="IgnoredJars">
+         snmp-adaptor.jar,
+         otherimages.jar,
+         applet.jar,
+         jcommon.jar,
+         console-mgr-classes.jar,
+         jfreechart.jar,
+         juddi-service.jar,
+         wsdl4j.jar,
+         commons-collections.jar,
+         commons-pool.jar,
+         juddi.jar,
+         commons-discovery.jar,
+         uddi4j.jar,
+         axis.jar,
+         commons-dbcp.jar,
+         jboss-juddiaxis.jar,
+         trove.jar,
+         javassist.jar,
+         jboss-aop-jdk50.jar,
+         jboss-aspect-library-jdk50.jar,
+         ejb3-persistence.jar,
+         commons-validator-1.1.3.jar,
+         commons-collections.jar,
+         commons-fileupload.jar,
+         commons-pool.jar,
+         hibernate-entitymanager.jar,
+         jboss-ejb3x.jar,
+         commons-digester-1.6.jar,
+         cglib-2.1.1.jar,
+         commons-discovery.jar,
+         jboss-annotations-ejb3.jar,
+         jaxen-1.1-beta-4.jar,
+         hibernate-annotations.jar,
+         commons-httpclient.jar,
+         commons-logging.jar,
+         commons-vfs.jar,
+         hibernate3.jar,
+         commons-logging-api.jar,
+         asm.jar,
+         asm-attrs.jar,
+         commons-lang-2.0.jar,
+         commons-beanutils.jar,
+         jboss-ejb3.jar,
+         dom4j.jar,
+         commons-codec-1.2.jar,
+         wsdl4j.jar,
+         xmlsec.jar,
+         jbossws.jar,
+         jboss-bean-deployer.jar,
+         jboss-microcontainer.jar,
+         jboss-dependency.jar,
+         jboss-container.jar,
+         tomcat-coyote.jar,
+         commons-collections.jar,
+         myfaces.jar,
+         jstl.jar,
+         commons-digester-1.6.jar,
+         myfaces-impl.jar,
+         commons-beanutils.jar,
+         myfaces-jsf-api.jar,
+         commons-codec-1.2.jar,
+         catalina-optional.jar,
+         tomcat-util.jar,
+         jasper-compiler.jar,
+         commons-el.jar,
+         jasper-compiler-jdt.jar,
+         tomcat-http.jar,
+         catalina-manager.jar,
+         jasper-runtime.jar,
+         tomcat55-service.jar,
+         servlets-invoker.jar,
+         catalina.jar,
+         naming-resources.jar,
+         servlets-default.jar,
+         tomcat-ajp.jar,
+         commons-modeler.jar,
+         tomcat-apr.jar,
+         servlets-webdav.jar
+      </attribute>
+   </mbean>
+
+   <mbean code="org.jboss.ejb3.EJB3Deployer" name="jboss.ejb3:service=EJB3Deployer" xmbean-dd="">
+
+      <!-- Inline XMBean Descriptor BEGIN -->
+      <xmbean>
+         <description>The EJB3Deployer responsible for ejb3 deployment</description>
+         <descriptors>
+            <interceptors>
+               <!-- comment out DynamicInterceptor to disable dynamic addition of interceptors -->
+               <interceptor code="org.jboss.mx.interceptor.DynamicInterceptor"/>
+            </interceptors>
+         </descriptors>
+         <class>org.jboss.ejb3.EJB3Deployer</class>
+
+         <!-- ServiceMBean attributes -->
+         <attribute access="read-only" getMethod="getName">
+            <description>The class name of the MBean</description>
+            <name>Name</name>
+            <type>java.lang.String</type>
+         </attribute>
+
+         <attribute access="read-only" getMethod="getState">
+            <description>The status of the MBean</description>
+            <name>State</name>
+            <type>int</type>
+         </attribute>
+
+         <attribute access="read-only" getMethod="getStateString">
+            <description>The status of the MBean in text form</description>
+            <name>StateString</name>
+            <type>java.lang.String</type>
+         </attribute>
+
+         <!-- SubDeployerMBean attributes -->
+         <attribute access="read-only" getMethod="getServiceName">
+            <description>The ObjectName of the Subdeployer</description>
+            <name>ServiceName</name>
+            <type>javax.management.ObjectName</type>
+         </attribute>
+
+         <attribute access="read-write" getMethod="getSuffixes" setMethod="setSuffixes">
+            <description>The suffixes of interest to this deployer</description>
+            <name>Suffixes</name>
+            <type>[Ljava.lang.String;</type>
+         </attribute>
+
+         <attribute access="read-write" getMethod="getRelativeOrder" setMethod="setRelativeOrder">
+            <description>The relative order of the suffixes in the global suffixes list</description>
+            <name>RelativeOrder</name>
+            <type>int</type>
+         </attribute>
+
+         <!-- EJB3DeployerMBean attributes -->
+         <attribute access="read-only" getMethod="getDefaultProperties">
+            <name>DefaultProperties</name>
+            <type>java.util.Properties</type>
+         </attribute>
+
+         <attribute access="write-only" setMethod="setJarsIgnoredForScanning">
+            <description>mbean that has list of jars to ignore</description>
+            <name>JarsIgnoredForScanning</name>
+            <type>org.jboss.ejb3.JarsIgnoredForScanningMBean</type>
+         </attribute>
+
+         <!-- ServiceMBean operations -->
+         <operation>
+            <description>Standard MBean lifecycle method</description>
+            <name>create</name>
+         </operation>
+
+         <operation>
+            <description>The start lifecycle operation</description>
+            <name>start</name>
+         </operation>
+
+         <operation>
+            <description>The stop lifecycle operation</description>
+            <name>stop</name>
+         </operation>
+
+         <operation>
+            <description>The destroy lifecycle operation</description>
+            <name>destroy</name>
+         </operation>
+
+         <operation>
+            <description>The detyped lifecycle operation (for internal use only)</description>
+            <name>jbossInternalLifecycle</name>
+            <parameter>
+               <description>The lifecycle operation</description>
+               <name>method</name>
+               <type>java.lang.String</type>
+            </parameter>
+            <return-type>void</return-type>
+         </operation>
+
+         <!-- SubDeployerMBean operations -->
+         <operation>
+            <description>Accept a module for deployment</description>
+            <name>accepts</name>
+            <parameter>
+               <name>info</name>
+               <type>org.jboss.deployment.DeploymentInfo</type>
+            </parameter>
+            <return-type>boolean</return-type>
+         </operation>
+
+         <operation>
+            <description>Initialize deployment step</description>
+            <name>init</name>
+            <parameter>
+               <name>info</name>
+               <type>org.jboss.deployment.DeploymentInfo</type>
+            </parameter>
+         </operation>
+
+         <operation>
+            <description>Create deployment step</description>
+            <name>create</name>
+            <parameter>
+               <name>info</name>
+               <type>org.jboss.deployment.DeploymentInfo</type>
+            </parameter>
+         </operation>
+
+         <operation>
+            <description>Start deployment step</description>
+            <name>start</name>
+            <parameter>
+               <name>info</name>
+               <type>org.jboss.deployment.DeploymentInfo</type>
+            </parameter>
+         </operation>
+
+         <operation>
+            <description>Stop deployment step</description>
+            <name>stop</name>
+            <parameter>
+               <name>info</name>
+               <type>org.jboss.deployment.DeploymentInfo</type>
+            </parameter>
+         </operation>
+
+         <operation>
+            <description>Destroy deployment step</description>
+            <name>destroy</name>
+            <parameter>
+               <name>info</name>
+               <type>org.jboss.deployment.DeploymentInfo</type>
+            </parameter>
+         </operation>
+
+         <!-- Interceptable operations -->
+         <operation>
+            <description>Add dynamically an operation interceptor</description>
+            <name>addOperationInterceptor</name>
+            <parameter>
+               <description>The Interceptor</description>
+               <name>interceptor</name>
+               <type>org.jboss.mx.interceptor.Interceptor</type>
+            </parameter>
+         </operation>
+
+         <operation>
+            <description>Remove dynamically an operation interceptor</description>
+            <name>removeOperationInterceptor</name>
+            <parameter>
+               <description>The Interceptor</description>
+               <name>interceptor</name>
+               <type>org.jboss.mx.interceptor.Interceptor</type>
+            </parameter>
+         </operation>
+      </xmbean>
+      <!-- Inline XMBean Descriptor END -->
+
+      <depends>jboss.aop:service=AspectDeployer</depends>
+      <depends>jboss.ejb:service=EJBDeployer</depends>
+      <depends optional-attribute-name="JarsIgnoredForScanning" proxy-type="org.jboss.ejb3.JarsIgnoredForScanningMBean">jboss.ejb3:service=JarsIgnoredForScanning</depends>
+   </mbean>
+
+   <mbean code="org.jboss.remoting.transport.Connector"
+      xmbean-dd="org/jboss/remoting/transport/Connector.xml"
+      name="jboss.remoting:service=Connector,transport=Servlet"
+      display-name="Servlet transport Connector">
+      <depends>jboss.aop:service=AspectDeployer</depends>
+      <attribute name="InvokerLocator">
+         servlet://${jboss.bind.address}:8080/servlet-invoker/ServerInvokerServlet
+      </attribute>
+      
+      <attribute name="Configuration">
+         <handlers>
+            <handler subsystem="AOP">org.jboss.aspects.remoting.AOPRemotingInvocationHandler</handler>
+         </handlers>
+      </attribute>
+   </mbean>
+
+</server>

Added: branches/Branch_4_0/ejb3/src/resources/test-configs/invoker/deploy/servlet-invoker.war/WEB-INF/classes/org/jboss/remoting/transport/servlet/web/ServerInvokerServlet.class
===================================================================
(Binary files differ)


Property changes on: branches/Branch_4_0/ejb3/src/resources/test-configs/invoker/deploy/servlet-invoker.war/WEB-INF/classes/org/jboss/remoting/transport/servlet/web/ServerInvokerServlet.class
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/Branch_4_0/ejb3/src/resources/test-configs/invoker/deploy/servlet-invoker.war/WEB-INF/web.xml
===================================================================
--- branches/Branch_4_0/ejb3/src/resources/test-configs/invoker/deploy/servlet-invoker.war/WEB-INF/web.xml	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/resources/test-configs/invoker/deploy/servlet-invoker.war/WEB-INF/web.xml	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE web-app PUBLIC
+   "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+   "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<!-- The the JBossRemoting server invoker servlet web.xml descriptor
+$Id: web.xml,v 1.1 2005/06/16 21:12:48 telrod Exp $
+-->
+<web-app>
+    <servlet>
+        <servlet-name>ServerInvokerServlet</servlet-name>
+        <description>The ServerInvokerServlet receives requests via HTTP
+           protocol from within a web container and passes it onto the
+           ServletServerInvoker for processing.
+        </description>
+        <servlet-class>org.jboss.remoting.transport.servlet.web.ServerInvokerServlet</servlet-class>
+        <init-param>
+            <param-name>invokerName</param-name>
+            <param-value>jboss.remoting:service=invoker,transport=servlet</param-value>
+            <description>The servlet server invoker</description>
+        </init-param>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+    <servlet-mapping>
+        <servlet-name>ServerInvokerServlet</servlet-name>
+        <url-pattern>/ServerInvokerServlet/*</url-pattern>
+    </servlet-mapping>
+</web-app>
+

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/CustomJNDIJBossTestCase.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/CustomJNDIJBossTestCase.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/CustomJNDIJBossTestCase.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,128 @@
+/*
+ * 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.ejb3.test;
+
+import java.util.StringTokenizer;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jboss.test.JBossTestCase;
+
+/**
+ * This test case will use custom.jndi.properties to find the deployer.
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class CustomJNDIJBossTestCase extends JBossTestCase
+{
+
+   public CustomJNDIJBossTestCase(String name)
+   {
+      super(name);
+   }
+
+   @Override
+   public void initDelegate()
+   {
+      delegate = new CustomJNDIJBossTestServices(getClass().getName());
+      try
+      {
+         delegate.init();
+      }
+      catch (Exception e)
+      {
+         log.error("Failed to init delegate", e);
+      }
+   }
+   
+   /**
+    * Get a JBossTestSetup that does login and deployment in setUp/tearDown
+    *
+    * @param test a Test
+    * @param jarNames is a comma seperated list of deployments
+    */
+   public static Test getDeploySetup(final Test test, final String jarNames)
+      throws Exception
+   {
+      CustomJNDIJBossTestSetup wrapper = new CustomJNDIJBossTestSetup(test)
+      {
+         protected void setUp() throws Exception
+         {
+            deploymentException = null;
+            try
+            {
+               this.delegate.init();
+
+               if (this.getDelegate().isSecureTest())
+                  this.delegate.login();
+
+               if (jarNames == null) return;
+
+               // deploy the comma seperated list of jars
+               StringTokenizer st = new StringTokenizer(jarNames, ", ");
+               while (st != null && st.hasMoreTokens())
+               {
+                  String jarName = st.nextToken();
+                  this.redeploy(jarName);
+                  this.getLog().debug("deployed package: " + jarName);
+               }
+            }
+            catch (Exception ex)
+            {
+               // Throw this in testServerFound() instead.
+               deploymentException = ex;
+            }
+         }
+
+         protected void tearDown() throws Exception
+         {
+            if (jarNames == null) return; //Nothing to Undeploy
+             
+            // undeploy the comma seperated list of jars
+            StringTokenizer st = new StringTokenizer(jarNames, ", ");
+            String[] depoyments = new String[st.countTokens()];
+            for (int i = depoyments.length - 1; i >= 0; i--)
+               depoyments[i] = st.nextToken();
+            for (int i = 0; i < depoyments.length; i++)
+            {
+               String jarName = depoyments[i];
+               this.undeploy(jarName);
+               this.getLog().debug("undeployed package: " + jarName);
+            }
+
+            if (this.getDelegate().isSecureTest())
+               this.delegate.logout();
+         }
+      };
+      return wrapper;
+   }
+
+   public static Test getDeploySetup(final Class clazz, final String jarName)
+      throws Exception
+   {
+      TestSuite suite = new TestSuite();
+      suite.addTest(new TestSuite(clazz));
+      return getDeploySetup(suite, jarName);
+   }
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/CustomJNDIJBossTestServices.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/CustomJNDIJBossTestServices.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/CustomJNDIJBossTestServices.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,79 @@
+/*
+ * 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.ejb3.test;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import javax.naming.InitialContext;
+
+import org.jboss.test.JBossTestServices;
+
+/**
+ * This class provides services for JBoss unit tests.
+ * If found it uses custom.jndi.properties to establish a connection with
+ * the Main Deployer.
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class CustomJNDIJBossTestServices extends JBossTestServices
+{
+
+   public CustomJNDIJBossTestServices(String className)
+   {
+      super(className);
+   }
+
+   protected Properties getCustomJNDIProperties() throws IOException
+   {
+      InputStream in = getClass().getClassLoader().getResourceAsStream("custom.jndi.properties");
+      if(in == null)
+      {
+         log.debug("no custom.jndi.properties found using defaults");
+         return null;
+      }
+      Properties props = new Properties();
+      props.load(in);
+      in.close();
+      return props;
+   }
+   
+   @Override
+   public void init() throws Exception
+   {
+      if(initialContext == null)
+      {
+         initialContext = new InitialContext(getCustomJNDIProperties());
+         log.debug("initialContext.getEnvironment()=" + initialContext.getEnvironment());
+         jndiEnv = initialContext.getEnvironment();
+         
+         log.debug("server = " + getServer());
+      }
+   }
+      
+   protected boolean isSecureTest()
+   {
+      return Boolean.getBoolean("jbosstest.secure");
+   }
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/CustomJNDIJBossTestSetup.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/CustomJNDIJBossTestSetup.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/CustomJNDIJBossTestSetup.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,53 @@
+/*
+ * 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.ejb3.test;
+
+import junit.framework.Test;
+
+import org.jboss.test.JBossTestServices;
+import org.jboss.test.JBossTestSetup;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class CustomJNDIJBossTestSetup extends JBossTestSetup
+{
+
+   public CustomJNDIJBossTestSetup(Test test) throws Exception
+   {
+      super(test);
+   }
+
+   @Override
+   protected JBossTestServices createTestServices()
+   {
+      return new CustomJNDIJBossTestServices(getClass().getName());
+   }
+   
+   protected CustomJNDIJBossTestServices getDelegate()
+   {
+      return (CustomJNDIJBossTestServices) this.delegate;
+   }
+}

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/asynchronous/SecuredStatelessBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/asynchronous/SecuredStatelessBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/asynchronous/SecuredStatelessBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -26,8 +26,10 @@
 import javax.annotation.security.DenyAll;
 import javax.annotation.security.PermitAll;
 import javax.annotation.security.RolesAllowed;
-import javax.ejb.*;
-
+import javax.ejb.EJBAccessException;
+import javax.ejb.Local;
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
 import org.jboss.annotation.security.SecurityDomain;
 import org.jboss.aspects.asynch.Future;
 import org.jboss.ejb3.asynchronous.Asynch;

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/Account.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/Account.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/Account.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -56,12 +56,9 @@
 /*
  * $Id$ Currently locked
  * by:$Locker$ Revision: $Log$
- * by:$Locker:  $ Revision: Revision 1.2.2.9  2006/05/11 04:18:08  bill
- * by:$Locker:  $ Revision: merge from head
+ * by:$Locker:  $ Revision: Revision 1.3  2005/10/30 00:06:46  starksm
+ * by:$Locker:  $ Revision: Update the jboss LGPL headers
  * by:$Locker:  $ Revision:
- * by:$Locker$ Revision: Revision 1.3  2005/10/30 00:06:46  starksm
- * by:$Locker$ Revision: Update the jboss LGPL headers
- * by:$Locker$ Revision:
  * by:$Locker$ Revision: Revision 1.2  2005/05/03 23:51:01  bdecoste
  * by:$Locker$ Revision: fixed formatting
  * by:$Locker$ Revision: Revision 1.1 2005/05/03

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/AccountBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/AccountBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/AccountBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -55,12 +55,9 @@
 /*
  * $Id$ Currently
  * locked by:$Locker$ Revision: $Log$
- * locked by:$Locker:  $ Revision: Revision 1.3.2.9  2006/05/11 04:18:08  bill
- * locked by:$Locker:  $ Revision: merge from head
+ * locked by:$Locker:  $ Revision: Revision 1.4  2005/10/30 00:06:46  starksm
+ * locked by:$Locker:  $ Revision: Update the jboss LGPL headers
  * locked by:$Locker:  $ Revision:
- * locked by:$Locker$ Revision: Revision 1.4  2005/10/30 00:06:46  starksm
- * locked by:$Locker$ Revision: Update the jboss LGPL headers
- * locked by:$Locker$ Revision:
  * locked by:$Locker$ Revision: Revision 1.3  2005/05/17 22:37:42  bdecoste
  * locked by:$Locker$ Revision: remove ejb2.1 rules
  * locked by:$Locker$ Revision:

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/AccountBeanCMP.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/AccountBeanCMP.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/AccountBeanCMP.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -124,12 +124,9 @@
 /*
  * $Id$ Currently
  * locked by:$Locker$ Revision: $Log$
- * locked by:$Locker:  $ Revision: Revision 1.3.2.9  2006/05/11 04:18:08  bill
- * locked by:$Locker:  $ Revision: merge from head
+ * locked by:$Locker:  $ Revision: Revision 1.5  2006/03/09 05:12:58  starksm
+ * locked by:$Locker:  $ Revision: cleanup unused imports
  * locked by:$Locker:  $ Revision:
- * locked by:$Locker$ Revision: Revision 1.5  2006/03/09 05:12:58  starksm
- * locked by:$Locker$ Revision: cleanup unused imports
- * locked by:$Locker$ Revision:
  * locked by:$Locker$ Revision: Revision 1.4  2005/10/30 00:06:46  starksm
  * locked by:$Locker$ Revision: Update the jboss LGPL headers
  * locked by:$Locker$ Revision:

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/AccountData.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/AccountData.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/AccountData.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -76,12 +76,9 @@
 /*
  * $Id$ Currently
  * locked by:$Locker$ Revision: $Log$
- * locked by:$Locker:  $ Revision: Revision 1.2.2.9  2006/05/11 04:18:08  bill
- * locked by:$Locker:  $ Revision: merge from head
+ * locked by:$Locker:  $ Revision: Revision 1.4  2006/03/09 05:12:58  starksm
+ * locked by:$Locker:  $ Revision: cleanup unused imports
  * locked by:$Locker:  $ Revision:
- * locked by:$Locker$ Revision: Revision 1.4  2006/03/09 05:12:58  starksm
- * locked by:$Locker$ Revision: cleanup unused imports
- * locked by:$Locker$ Revision:
  * locked by:$Locker$ Revision: Revision 1.3  2005/10/30 00:06:46  starksm
  * locked by:$Locker$ Revision: Update the jboss LGPL headers
  * locked by:$Locker$ Revision:

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/AccountHome.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/AccountHome.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/AccountHome.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -62,12 +62,9 @@
 /*
  * $Id$ Currently
  * locked by:$Locker$ Revision: $Log$
- * locked by:$Locker:  $ Revision: Revision 1.2.2.9  2006/05/11 04:18:08  bill
- * locked by:$Locker:  $ Revision: merge from head
+ * locked by:$Locker:  $ Revision: Revision 1.3  2005/10/30 00:06:46  starksm
+ * locked by:$Locker:  $ Revision: Update the jboss LGPL headers
  * locked by:$Locker:  $ Revision:
- * locked by:$Locker$ Revision: Revision 1.3  2005/10/30 00:06:46  starksm
- * locked by:$Locker$ Revision: Update the jboss LGPL headers
- * locked by:$Locker$ Revision:
  * locked by:$Locker$ Revision: Revision 1.2  2005/05/03 23:51:01  bdecoste
  * locked by:$Locker$ Revision: fixed formatting
  * locked by:$Locker$ Revision: Revision 1.1

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/Bank.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/Bank.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/Bank.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -62,12 +62,9 @@
 /*
  * $Id$ Currently locked
  * by:$Locker$ Revision: $Log$
- * by:$Locker:  $ Revision: Revision 1.8.2.9  2006/05/11 04:18:08  bill
- * by:$Locker:  $ Revision: merge from head
+ * by:$Locker:  $ Revision: Revision 1.11  2005/10/30 00:06:46  starksm
+ * by:$Locker:  $ Revision: Update the jboss LGPL headers
  * by:$Locker:  $ Revision:
- * by:$Locker$ Revision: Revision 1.11  2005/10/30 00:06:46  starksm
- * by:$Locker$ Revision: Update the jboss LGPL headers
- * by:$Locker$ Revision:
  * by:$Locker$ Revision: Revision 1.10  2005/10/13 19:14:42  bdecoste
  * by:$Locker$ Revision: added transaction timeouts via annotation or jboss.xml
  * by:$Locker$ Revision:

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/BankBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/BankBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/BankBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -172,12 +172,9 @@
 /*
  * $Id$ Currently locked
  * by:$Locker$ Revision: $Log$
- * by:$Locker:  $ Revision: Revision 1.9.2.9  2006/05/11 04:18:08  bill
- * by:$Locker:  $ Revision: merge from head
+ * by:$Locker:  $ Revision: Revision 1.17  2006/03/29 19:19:29  bdecoste
+ * by:$Locker:  $ Revision: removed logging
  * by:$Locker:  $ Revision:
- * by:$Locker$ Revision: Revision 1.17  2006/03/29 19:19:29  bdecoste
- * by:$Locker$ Revision: removed logging
- * by:$Locker$ Revision:
  * by:$Locker$ Revision: Revision 1.16  2006/03/29 02:03:35  bdecoste
  * by:$Locker$ Revision: injection for all bean types
  * by:$Locker$ Revision:

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/BankBean21.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/BankBean21.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/BankBean21.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -148,12 +148,9 @@
 /*
  * $Id$ Currently locked
  * by:$Locker$ Revision: $Log$
- * by:$Locker:  $ Revision: Revision 1.1.2.9  2006/05/11 04:18:08  bill
- * by:$Locker:  $ Revision: merge from head
+ * by:$Locker:  $ Revision: Revision 1.2  2005/10/30 00:06:46  starksm
+ * by:$Locker:  $ Revision: Update the jboss LGPL headers
  * by:$Locker:  $ Revision:
- * by:$Locker$ Revision: Revision 1.2  2005/10/30 00:06:46  starksm
- * by:$Locker$ Revision: Update the jboss LGPL headers
- * by:$Locker$ Revision:
  * by:$Locker$ Revision: Revision 1.1  2005/06/02 23:25:14  bdecoste
  * by:$Locker$ Revision: ejb3 jboss.xml support
  * by:$Locker$ Revision:

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/BankException.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/BankException.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/BankException.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -63,12 +63,9 @@
 /*
  * $Id$ Currently
  * locked by:$Locker$ Revision: $Log$
- * locked by:$Locker:  $ Revision: Revision 1.2.2.9  2006/05/11 04:18:08  bill
- * locked by:$Locker:  $ Revision: merge from head
+ * locked by:$Locker:  $ Revision: Revision 1.4  2006/03/09 05:12:58  starksm
+ * locked by:$Locker:  $ Revision: cleanup unused imports
  * locked by:$Locker:  $ Revision:
- * locked by:$Locker$ Revision: Revision 1.4  2006/03/09 05:12:58  starksm
- * locked by:$Locker$ Revision: cleanup unused imports
- * locked by:$Locker$ Revision:
  * locked by:$Locker$ Revision: Revision 1.3  2005/10/30 00:06:46  starksm
  * locked by:$Locker$ Revision: Update the jboss LGPL headers
  * locked by:$Locker$ Revision:

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/BankHome.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/BankHome.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/BankHome.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -50,12 +50,9 @@
 /*
  * $Id$ Currently locked
  * by:$Locker$ Revision: $Log$
- * by:$Locker:  $ Revision: Revision 1.2.2.9  2006/05/11 04:18:08  bill
- * by:$Locker:  $ Revision: merge from head
+ * by:$Locker:  $ Revision: Revision 1.3  2005/10/30 00:06:46  starksm
+ * by:$Locker:  $ Revision: Update the jboss LGPL headers
  * by:$Locker:  $ Revision:
- * by:$Locker$ Revision: Revision 1.3  2005/10/30 00:06:46  starksm
- * by:$Locker$ Revision: Update the jboss LGPL headers
- * by:$Locker$ Revision:
  * by:$Locker$ Revision: Revision 1.2  2005/05/03 23:51:01  bdecoste
  * by:$Locker$ Revision: fixed formatting
  * by:$Locker$ Revision: Revision 1.1 2005/05/03

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/Customer.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/Customer.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/Customer.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -55,12 +55,9 @@
 /*
  * $Id$ Currently locked
  * by:$Locker$ Revision: $Log$
- * by:$Locker:  $ Revision: Revision 1.2.2.9  2006/05/11 04:18:08  bill
- * by:$Locker:  $ Revision: merge from head
+ * by:$Locker:  $ Revision: Revision 1.3  2005/10/30 00:06:46  starksm
+ * by:$Locker:  $ Revision: Update the jboss LGPL headers
  * by:$Locker:  $ Revision:
- * by:$Locker$ Revision: Revision 1.3  2005/10/30 00:06:46  starksm
- * by:$Locker$ Revision: Update the jboss LGPL headers
- * by:$Locker$ Revision:
  * by:$Locker$ Revision: Revision 1.2  2005/05/03 23:51:01  bdecoste
  * by:$Locker$ Revision: fixed formatting
  * by:$Locker$ Revision: Revision 1.1 2005/05/03

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/CustomerBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/CustomerBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/CustomerBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -102,12 +102,9 @@
 /*
  * $Id$ Currently
  * locked by:$Locker$ Revision: $Log$
- * locked by:$Locker:  $ Revision: Revision 1.3.2.9  2006/05/11 04:18:08  bill
- * locked by:$Locker:  $ Revision: merge from head
+ * locked by:$Locker:  $ Revision: Revision 1.4  2005/10/30 00:06:46  starksm
+ * locked by:$Locker:  $ Revision: Update the jboss LGPL headers
  * locked by:$Locker:  $ Revision:
- * locked by:$Locker$ Revision: Revision 1.4  2005/10/30 00:06:46  starksm
- * locked by:$Locker$ Revision: Update the jboss LGPL headers
- * locked by:$Locker$ Revision:
  * locked by:$Locker$ Revision: Revision 1.3  2005/05/17 22:37:42  bdecoste
  * locked by:$Locker$ Revision: remove ejb2.1 rules
  * locked by:$Locker$ Revision:

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/CustomerHome.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/CustomerHome.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/CustomerHome.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -56,12 +56,9 @@
 /*
  * $Id$ Currently
  * locked by:$Locker$ Revision: $Log$
- * locked by:$Locker:  $ Revision: Revision 1.2.2.9  2006/05/11 04:18:08  bill
- * locked by:$Locker:  $ Revision: merge from head
+ * locked by:$Locker:  $ Revision: Revision 1.3  2005/10/30 00:06:46  starksm
+ * locked by:$Locker:  $ Revision: Update the jboss LGPL headers
  * locked by:$Locker:  $ Revision:
- * locked by:$Locker$ Revision: Revision 1.3  2005/10/30 00:06:46  starksm
- * locked by:$Locker$ Revision: Update the jboss LGPL headers
- * locked by:$Locker$ Revision:
  * locked by:$Locker$ Revision: Revision 1.2  2005/05/03 23:51:01  bdecoste
  * locked by:$Locker$ Revision: fixed formatting
  * locked by:$Locker$ Revision: Revision 1.1

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/Teller.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/Teller.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/Teller.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -74,12 +74,9 @@
 /*
  * $Id$ Currently locked
  * by:$Locker$ Revision: $Log$
- * by:$Locker:  $ Revision: Revision 1.8.2.9  2006/05/11 04:18:08  bill
- * by:$Locker:  $ Revision: merge from head
+ * by:$Locker:  $ Revision: Revision 1.10  2005/10/30 00:06:46  starksm
+ * by:$Locker:  $ Revision: Update the jboss LGPL headers
  * by:$Locker:  $ Revision:
- * by:$Locker$ Revision: Revision 1.10  2005/10/30 00:06:46  starksm
- * by:$Locker$ Revision: Update the jboss LGPL headers
- * by:$Locker$ Revision:
  * by:$Locker$ Revision: Revision 1.9  2005/10/13 19:14:42  bdecoste
  * by:$Locker$ Revision: added transaction timeouts via annotation or jboss.xml
  * by:$Locker$ Revision:

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/TellerBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/TellerBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/TellerBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -28,7 +28,6 @@
 import javax.naming.InitialContext;
 import javax.transaction.TransactionManager;
 import org.jboss.logging.Logger;
-import org.jboss.annotation.JndiInject;
 
 /**
  * @see <related>
@@ -40,7 +39,7 @@
    private static final Logger log = Logger.getLogger(TellerBean.class);
 
    @Resource private TimerService ts;
-   @JndiInject(jndiName="java:/TransactionManager") private TransactionManager tm;
+   private TransactionManager tm;
    private Bank bank;
    private boolean constructed = false;
    private String defaultValue = "original";

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/TellerHome.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/TellerHome.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/TellerHome.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -50,12 +50,9 @@
 /*
  * $Id$ Currently
  * locked by:$Locker$ Revision: $Log$
- * locked by:$Locker:  $ Revision: Revision 1.2.2.9  2006/05/11 04:18:08  bill
- * locked by:$Locker:  $ Revision: merge from head
+ * locked by:$Locker:  $ Revision: Revision 1.3  2005/10/30 00:06:46  starksm
+ * locked by:$Locker:  $ Revision: Update the jboss LGPL headers
  * locked by:$Locker:  $ Revision:
- * locked by:$Locker$ Revision: Revision 1.3  2005/10/30 00:06:46  starksm
- * locked by:$Locker$ Revision: Update the jboss LGPL headers
- * locked by:$Locker$ Revision:
  * locked by:$Locker$ Revision: Revision 1.2  2005/05/03 23:51:01  bdecoste
  * locked by:$Locker$ Revision: fixed formatting
  * locked by:$Locker$ Revision: Revision 1.1

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/unit/BankDeploymentDescriptorTestCase.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/unit/BankDeploymentDescriptorTestCase.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/bank/unit/BankDeploymentDescriptorTestCase.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -23,7 +23,11 @@
 
 import javax.ejb.EJBAccessException;
 import javax.ejb.EJBException;
+import javax.management.ObjectName;
 import javax.naming.InitialContext;
+
+import org.jboss.ejb3.ClientKernelAbstraction;
+import org.jboss.ejb3.KernelAbstractionFactory;
 import org.jboss.ejb3.test.bank.Bank;
 import org.jboss.ejb3.test.bank.ProxyFactoryInterface;
 import org.jboss.ejb3.test.bank.Teller;
@@ -345,10 +349,29 @@
    protected void setUp() throws Exception
    {
    }
+   
+   protected void tearDown() throws Exception
+   {
+   }
 
    public static Test suite() throws Exception
    {
-   //   return new TestSuite(BankDeploymentDescriptorTestCase.class);
+      ClientKernelAbstraction kernel = KernelAbstractionFactory.getClientInstance();
+      ObjectName propertiesServiceON = new ObjectName("jboss:type=Service,name=SystemProperties");
+      kernel.invoke(
+            propertiesServiceON,
+            "set",
+            new Object[]{"test.datasource.jndi","java:/DefaultDS"},
+            new String[]{"java.lang.String", "java.lang.String"}
+      );
+      
+      kernel.invoke(
+            propertiesServiceON,
+            "set",
+            new Object[]{"test.transactionmanager.jndi","java:/TransactionManager"},
+            new String[]{"java.lang.String", "java.lang.String"}
+      );
+      
       return getDeploySetup(BankDeploymentDescriptorTestCase.class, "bank.jar");
    }
 

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/cache/Tester.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/cache/Tester.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/cache/Tester.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -26,7 +26,7 @@
 import javax.naming.InitialContext;
 import org.jboss.cache.TreeCacheMBean;
 import org.jboss.cache.loader.FileCacheLoader;
-import org.jboss.ejb3.cache.tree.PassivationEvictionPolicy;
+//import org.jboss.ejb3.cache.tree.PassivationEvictionPolicy;
 import org.jboss.ejb3.cache.tree.PassivationTreeCache;
 import org.jboss.mx.util.MBeanProxy;
 import org.jboss.system.ServiceMBeanSupport;

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/ServiceBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/ServiceBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/ServiceBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,77 @@
+/*
+  * 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.ejb3.test.clusteredservice;
+import javax.ejb.Remote;
+import javax.ejb.Local;
+
+import org.jboss.annotation.ejb.Clustered;
+import org.jboss.annotation.ejb.Depends;
+import org.jboss.annotation.ejb.Management;
+import org.jboss.annotation.ejb.Service;
+import org.jboss.logging.Logger;
+
+/**
+ * @version <tt>$Revision: 45712 $</tt>
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+ at Service(objectName = "default:service=service")
+ at Clustered(partition = "HASingletonPartition") 
+ at Remote(ServiceRemote.class)
+ at Local(ServiceLocal.class)
+ at Management(ServiceManagement.class)
+ at Depends("jboss.ha:service=HASingletonDeployer,type=Barrier")
+public class ServiceBean implements ServiceLocal, ServiceRemote, ServiceManagement
+{
+   private static final Logger log = Logger.getLogger(ServiceBean.class);
+   
+   private int remoteAccessed = 0;
+   
+   public synchronized void localMethod()
+   {
+   }
+
+   public synchronized void remoteMethod()
+   {
+      log.info("ACESSSED " + ++remoteAccessed);
+   }
+
+   public void create() throws Exception
+   {
+      log.info("CREATE");
+   }
+
+   public void start() throws Exception
+   {
+      log.info("START");
+   }
+
+   public void stop()
+   {
+      log.info("STOP");
+   }
+
+   public void destroy()
+   {
+      log.info("DESTROY");
+   }
+
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/ServiceLocal.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/ServiceLocal.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/ServiceLocal.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,31 @@
+/*
+  * 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.ejb3.test.clusteredservice;
+
+/**
+ * @version <tt>$Revision: 45712 $</tt>
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+public interface ServiceLocal
+{
+   void localMethod();
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/ServiceManagement.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/ServiceManagement.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/ServiceManagement.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,34 @@
+/*
+  * 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.ejb3.test.clusteredservice;
+
+/**
+ * @version <tt>$Revision: 45712 $</tt>
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+public interface ServiceManagement
+{
+   void create() throws Exception;
+   void start() throws Exception;
+   void stop();
+   void destroy();
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/ServiceRemote.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/ServiceRemote.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/ServiceRemote.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,31 @@
+/*
+  * 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.ejb3.test.clusteredservice;
+
+/**
+ * @version <tt>$Revision: 45712 $</tt>
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+public interface ServiceRemote
+{
+   void remoteMethod();
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/ServiceWeb.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/ServiceWeb.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/ServiceWeb.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -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.ejb3.test.clusteredservice;
+
+import javax.jws.WebMethod; 
+import javax.jws.WebService; 
+import javax.jws.soap.SOAPBinding; 
+import javax.naming.InitialContext; 
+import javax.naming.NamingException; 
+import javax.naming.Context; 
+import javax.xml.rpc.ServiceException; 
+import javax.xml.rpc.server.ServiceLifecycle; 
+import javax.rmi.PortableRemoteObject; 
+import java.util.Properties; 
+
+/**
+ * @version <tt>$Revision: 45712 $</tt>
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+ at WebService 
+ at SOAPBinding(style = SOAPBinding.Style.RPC) 
+public class ServiceWeb implements ServiceLifecycle
+{ 
+   ServiceRemote service; 
+
+   public ServiceWeb() {} 
+
+   @WebMethod(operationName = "RemoteMethod") 
+   public void remoteMethod() { 
+      System.out.println("ServiceWeb.remoteMethod"); 
+      try
+      { 
+         service.remoteMethod(); 
+      } catch (Exception e)
+      {
+         e.printStackTrace(); 
+      } 
+   } 
+
+   private InitialContext getContext() throws NamingException{ 
+      Properties p = new Properties(); 
+      p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); 
+      p.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces"); 
+      p.put("jnp.partitionName", "HASingletonPartition"); 
+      return new InitialContext(p); 
+   } 
+
+   public void init(Object object) throws ServiceException { 
+      try
+      { 
+         service = (ServiceRemote) PortableRemoteObject.narrow( 
+               getContext().lookup("ServiceBean/remote"), ServiceRemote.class); 
+      } catch (NamingException e)
+      { 
+         e.printStackTrace(); 
+         throw new ServiceException("Could not find Service in JNDI service", e); 
+      } 
+   } 
+
+   public void destroy() { 
+   } 
+
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/servlets/EJBServlet.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/servlets/EJBServlet.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/servlets/EJBServlet.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,98 @@
+/*
+  * 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.ejb3.test.clusteredservice.servlets;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import java.util.Properties;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.jboss.ejb3.test.clusteredservice.ServiceRemote;
+import org.jboss.logging.Logger;
+
+/**
+ * @version <tt>$Revision: 45712 $</tt>
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+public class EJBServlet extends HttpServlet
+{
+   private static final Logger log = Logger.getLogger(EJBServlet.class);
+   
+   protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+         throws ServletException, IOException
+   {
+      try
+      {
+         ServiceRemote test = (ServiceRemote) getInitialContext().lookup("ServiceBean/remote");
+         test.remoteMethod();
+         
+  /*       MBeanServer server = org.jboss.mx.util.MBeanServerLocator.locateJBoss();
+         ObjectName testerName = new ObjectName("default:service=service");
+         Object[] params = {};
+         String[] sig = {};
+         server.invoke(testerName, "", params, sig);*/
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+        
+         throw new ServletException("Failed to call ServiceBean through remote or local interfaces", e);
+      }
+      response.setContentType("text/html");
+      PrintWriter out = response.getWriter();
+      out.println("<html>");
+      out.println("<head><title>EJBServlet</title></head>");
+      out.println("<body>Tests passed<br></body>");
+      out.println("</html>");
+      out.close();
+   }
+   
+   protected InitialContext getInitialContext() throws Exception
+   {
+      Properties p = new Properties();
+      p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
+      p.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");
+      p.put(Context.PROVIDER_URL, "localhost:1100"); 
+      return new InitialContext(p);
+   }
+
+   protected void doGet(HttpServletRequest request, HttpServletResponse response)
+         throws ServletException, IOException
+   {
+      processRequest(request, response);
+   }
+
+   protected void doPost(HttpServletRequest request, HttpServletResponse response)
+         throws ServletException, IOException
+   {
+      processRequest(request, response);
+   }
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/unit/HttpUtils.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/unit/HttpUtils.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/unit/HttpUtils.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,180 @@
+/*
+  * 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.ejb3.test.clusteredservice.unit;
+
+import java.net.URL;
+import java.net.HttpURLConnection;
+import java.io.IOException;
+import java.lang.System;
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.UsernamePasswordCredentials;
+import org.apache.commons.httpclient.HttpMethodBase;
+import org.apache.commons.httpclient.Header;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.methods.HeadMethod;
+import org.apache.commons.httpclient.methods.OptionsMethod;
+import org.apache.commons.httpclient.methods.PutMethod;
+import org.apache.commons.httpclient.methods.DeleteMethod;
+import org.apache.commons.httpclient.methods.TraceMethod;
+import org.jboss.logging.Logger;
+
+/** Utilities for client http requests
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision: 45712 $
+ */
+public class HttpUtils
+{
+   private static Logger log = Logger.getLogger(HttpUtils.class);
+   private static String baseURL = "http://jduke:theduke@localhost:" + Integer.getInteger("web.port", 8080) + "/";
+   private static String baseURLNoAuth = "http://localhost:" + Integer.getInteger("web.port", 8080) + "/";
+
+   public static final int GET = 1;
+   public static final int POST = 2;
+   public static final int HEAD = 3;
+   public static final int OPTIONS = 4;
+   public static final int PUT = 5;
+   public static final int DELETE = 6;
+   public static final int TRACE = 7;
+   
+   public static String getBaseURL()
+   {
+      return baseURL;
+   }
+   public static String getBaseURL(String username, String password)
+   {
+      String url = "http://"+username+":"+password+"@"+ System.getProperty("jboss.bind.address") + ":"
+         + Integer.getInteger("web.port", 8080) + "/";
+      return url;
+   }
+   public static String getBaseURLNoAuth()
+   {
+      return baseURLNoAuth;
+   }
+
+   /** Perform a get on the indicated URL and assert an HTTP_OK response code
+    *
+    * @param url
+    * @return The commons HttpClient used to perform the get
+    * @throws Exception on any failure
+    */
+   public static HttpMethodBase accessURL(URL url) throws Exception
+   {
+      return accessURL(url, "JBossTest Servlets", HttpURLConnection.HTTP_OK);
+   }
+   /** Perform a get on the indicated URL and assert that the response code
+    * matches the expectedHttpCode argument.
+    *
+    * @param url
+    * @param expectedHttpCode the http response code expected
+    * @return The commons HttpClient used to perform the get
+    * @throws Exception on any failure
+    */
+   public static HttpMethodBase accessURL(URL url, String realm,
+      int expectedHttpCode)
+      throws Exception
+   {
+      return accessURL(url, realm, expectedHttpCode, null);
+   }
+   public static HttpMethodBase accessURL(URL url, String realm,
+      int expectedHttpCode, int type)
+      throws Exception
+   {
+      return accessURL(url, realm, expectedHttpCode, null, type);
+   }
+   public static HttpMethodBase accessURL(URL url, String realm,
+      int expectedHttpCode, Header[] hdrs)
+      throws Exception
+   {
+      return accessURL(url, realm, expectedHttpCode, hdrs, GET);
+   }
+   public static HttpMethodBase accessURL(URL url, String realm,
+      int expectedHttpCode, Header[] hdrs, int type)
+      throws Exception
+   {
+      HttpClient httpConn = new HttpClient();
+      HttpMethodBase request = createMethod(url, type);
+
+      int hdrCount = hdrs != null ? hdrs.length : 0;
+      for(int n = 0; n < hdrCount; n ++)
+         request.addRequestHeader(hdrs[n]);
+      try
+      {
+         log.debug("Connecting to: "+url);
+         String userInfo = url.getUserInfo();
+
+         if( userInfo != null )
+         {
+            UsernamePasswordCredentials auth = new UsernamePasswordCredentials(userInfo);
+            httpConn.getState().setCredentials(realm, url.getHost(), auth);
+         }
+         log.debug("RequestURI: "+request.getURI());
+         int responseCode = httpConn.executeMethod(request);
+         String response = request.getStatusText();
+         log.debug("responseCode="+responseCode+", response="+response);
+         String content = request.getResponseBodyAsString();
+         log.debug(content);
+         // Validate that we are seeing the requested response code
+         if( responseCode != expectedHttpCode )
+         {
+            throw new IOException("Expected reply code:"+expectedHttpCode
+               +", actual="+responseCode);
+         }
+      }
+      catch(IOException e)
+      {
+         throw e;
+      }
+      return request;
+   }
+
+   public static HttpMethodBase createMethod(URL url, int type)
+   {
+      HttpMethodBase request = null;
+      switch( type )
+      {
+         case GET:
+            request = new GetMethod(url.toString());
+            break;
+         case POST:
+            request = new PostMethod(url.toString());
+            break;
+         case HEAD:
+            request = new HeadMethod(url.toString());
+            break;
+         case OPTIONS:
+            request = new OptionsMethod(url.toString());
+            break;
+         case PUT:
+            request = new PutMethod(url.toString());
+            break;
+         case DELETE:
+            request = new DeleteMethod(url.toString());
+            break;
+         case TRACE:
+            request = new TraceMethod(url.toString());
+            break;
+      }
+      return request;
+   }
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/unit/ServiceTestCase.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/unit/ServiceTestCase.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/clusteredservice/unit/ServiceTestCase.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,94 @@
+/*
+  * 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.ejb3.test.clusteredservice.unit;
+
+import java.net.URL;
+
+import javax.management.Attribute;
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+
+import junit.framework.Test;
+
+import org.jboss.test.JBossTestCase;
+
+/** 
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @version <tt>$Revision: 45712 $</tt>
+ */
+public class ServiceTestCase extends JBossTestCase
+{
+   private static String REALM = "JBossTest Servlets";
+   private String node1URL = "http://jduke:theduke@localhost:8080/"; 
+   private String node2URL = "http://jduke:theduke@localhost:8180/"; 
+  
+   private static final String USE_JBOSS = "UseJBossWebLoader";
+   
+   public ServiceTestCase(String name)
+   {
+      super(name);
+   }
+   
+   public void testEJBServlet() throws Exception
+   {
+      MBeanServerConnection server = getServer();
+      ObjectName tomcat = new ObjectName("jboss.web:service=WebServer");
+      
+      try {
+         server.setAttribute(tomcat, new Attribute(USE_JBOSS, true));
+         
+         assertTrue((Boolean)server.getAttribute(tomcat, USE_JBOSS));
+         
+         try 
+         {
+            URL url = new URL(node1URL+"clusteredservice/EJBServlet");
+            HttpUtils.accessURL(url);
+            HttpUtils.accessURL(url);
+         } catch (Exception e)
+         {
+         }
+         
+         try 
+         {
+            URL url = new URL(node2URL+"clusteredservice/EJBServlet");
+            HttpUtils.accessURL(url);
+            HttpUtils.accessURL(url);
+         } catch (Exception e)
+         {
+         }
+      }
+      finally
+      {
+         server.setAttribute(tomcat, new Attribute(USE_JBOSS, false));
+      }
+   }
+   
+   /**
+    * Setup the test suite.
+    */
+   public static Test suite() throws Exception
+   {
+      return getDeploySetup(ServiceTestCase.class, "");
+   }
+
+
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/concurrent/MyStateful.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/concurrent/MyStateful.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/concurrent/MyStateful.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,35 @@
+/*
+ * 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.ejb3.test.concurrent;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public interface MyStateful
+{
+   void doNothing();
+   
+   void waitAndSee();
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/concurrent/MyStatefulBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/concurrent/MyStatefulBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/concurrent/MyStatefulBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,56 @@
+/*
+ * 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.ejb3.test.concurrent;
+
+import javax.ejb.EJBException;
+import javax.ejb.Remote;
+import javax.ejb.Stateful;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+ at Stateful
+ at Remote(MyStateful.class)
+public class MyStatefulBean
+{
+   public void doNothing()
+   {
+      
+   }
+   
+   public void waitAndSee()
+   {
+      try
+      {
+         System.out.println("sleep " + this);
+         Thread.sleep(1000);
+         System.out.println("done");
+      }
+      catch(InterruptedException e)
+      {
+         throw new EJBException("I was interrupted");
+      }
+   }
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/concurrent/unit/ConcurrentUnitTestCase.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/concurrent/unit/ConcurrentUnitTestCase.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/concurrent/unit/ConcurrentUnitTestCase.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,137 @@
+/*
+  * 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.ejb3.test.concurrent.unit;
+
+import java.lang.Thread.UncaughtExceptionHandler;
+
+import javax.ejb.ConcurrentAccessException;
+
+import org.jboss.ejb3.test.concurrent.MyStateful;
+import org.jboss.test.JBossTestCase;
+import junit.framework.Test;
+
+/**
+ * Test concurrent access on a stateful bean (EJB3 4.3.13 3rd paragraph / EJBTHREE-666)
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class ConcurrentUnitTestCase
+   extends JBossTestCase
+{
+   public ConcurrentUnitTestCase(String name)
+   {
+      super(name);
+   }
+   
+   private static class MyUncaughtExceptionHandler implements UncaughtExceptionHandler
+   {
+      private Throwable uncaught;
+      
+      Throwable getUncaughtException()
+      {
+         return uncaught;
+      }
+      
+      public void uncaughtException(Thread t, Throwable e)
+      {
+         this.uncaught = e;
+      }
+   }
+   
+   public void testConcurrentAccess() throws Exception
+   {
+      final MyStateful session = (MyStateful) getInitialContext().lookup("MyStatefulBean/remote");
+      
+      Runnable r = new Runnable()
+      {
+         public void run()
+         {
+            session.waitAndSee();
+         }
+      };
+
+      // do a call first (see EJBTHREE-697)
+      session.doNothing();
+      
+      // just use one 1 handler, the exception will be in there.
+      MyUncaughtExceptionHandler eh = new MyUncaughtExceptionHandler();
+      
+      Thread t1 = new Thread(r);
+      t1.setUncaughtExceptionHandler(eh);
+      Thread t2 = new Thread(r);
+      t2.setUncaughtExceptionHandler(eh);
+      
+      t1.start();
+      t2.start();
+      
+      t1.join();
+      t2.join();
+      
+      Throwable t = eh.getUncaughtException();
+      assertNotNull(t);
+      assertTrue("Expected a javax.ejb.ConcurrentAccessException", t instanceof ConcurrentAccessException);
+   }
+   
+   /**
+    * EJBTHREE-697: concurrency on proxies doesn't work
+    */
+   public void testConcurrentProxyAccess() throws Exception
+   {
+      final MyStateful session = (MyStateful) getInitialContext().lookup("MyStatefulBean/remote");
+      
+      Runnable r = new Runnable()
+      {
+         public void run()
+         {
+            session.waitAndSee();
+         }
+      };
+
+      // don't call proxy yet
+      //session.doNothing();
+      
+      // just use one 1 handler, the exception will be in there.
+      MyUncaughtExceptionHandler eh = new MyUncaughtExceptionHandler();
+      
+      Thread t1 = new Thread(r);
+      t1.setUncaughtExceptionHandler(eh);
+      Thread t2 = new Thread(r);
+      t2.setUncaughtExceptionHandler(eh);
+      
+      t1.start();
+      t2.start();
+      
+      t1.join();
+      t2.join();
+  
+      Throwable t = eh.getUncaughtException();
+      assertNotNull("No exception occured during a concurrent call", t);
+      fail("never comes here");
+   }
+   
+   public static Test suite() throws Exception
+   {
+      return getDeploySetup(ConcurrentUnitTestCase.class, "concurrent.jar");
+   }
+
+}

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/consumer/QueueTestConsumer.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/consumer/QueueTestConsumer.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/consumer/QueueTestConsumer.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -22,7 +22,6 @@
 package org.jboss.ejb3.test.consumer;
 
 import javax.ejb.ActivationConfigProperty;
-import javax.ejb.EJB;
 import javax.interceptor.AroundInvoke;
 import javax.interceptor.InvocationContext;
 import javax.annotation.PostConstruct;
@@ -46,8 +45,6 @@
 {
    @CurrentMessage Message currentMessage;
 
-   @EJB TestStatus ejbref;
-
    private Message setterMessage;
 
    @CurrentMessage void setMessage(Message msg)
@@ -57,7 +54,6 @@
 
    public void method1(String msg, int num)
    {
-      ejbref.postConstruct(); // test injection
       TestStatusBean.queueRan = "method1";
       TestStatusBean.fieldMessage = currentMessage != null;
       TestStatusBean.setterMessage = setterMessage != null;
@@ -67,7 +63,6 @@
 
    public void method2(String msg, float num)
    {
-      ejbref.postConstruct(); // test injection
       TestStatusBean.queueRan = "method2";
 
       TestStatusBean.fieldMessage = currentMessage != null;

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/dd/mdb/unit/MDBUnitTestCase.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/dd/mdb/unit/MDBUnitTestCase.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/dd/mdb/unit/MDBUnitTestCase.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -238,7 +238,7 @@
    }
 
 
-   public void testWaitForCompleation() throws Exception {
+   public void testWaitForCompletion() throws Exception {
       try { Thread.currentThread().sleep(1000*20);
       } catch ( InterruptedException e ) {}
    }
@@ -282,7 +282,7 @@
       suite.addTest(new MDBUnitTestCase("testTopic","topic/testDurableTopic"));
       suite.addTest(new MDBUnitTestCase("testQueue","queue/ex"));
       suite.addTest(new MDBUnitTestCase("testQueue","queue/A"));
-      suite.addTest(new MDBUnitTestCase("testWaitForCompleation",""));
+      suite.addTest(new MDBUnitTestCase("testWaitForCompletion",""));
       suite.addTest(new MDBUnitTestCase("testQueue","queue/B"));
 
      return new JBossTestSetup(getDeploySetup(suite, "dd-mdb-service.xml, dd-mdb.jar"));

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/dd/unit/EjbJarXmlTestCase.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/dd/unit/EjbJarXmlTestCase.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/dd/unit/EjbJarXmlTestCase.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -25,30 +25,26 @@
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
-import org.jboss.ejb3.dd.ActivationConfigProperty;
-import org.jboss.ejb3.dd.AssemblyDescriptor;
-import org.jboss.ejb3.dd.CmrField;
-import org.jboss.ejb3.dd.ContainerTransaction;
-import org.jboss.ejb3.dd.EjbJarDD;
-import org.jboss.ejb3.dd.EjbJarDDObjectFactory;
-import org.jboss.ejb3.dd.EjbLocalRef;
-import org.jboss.ejb3.dd.EjbRelation;
-import org.jboss.ejb3.dd.EjbRelationshipRole;
-import org.jboss.ejb3.dd.EnterpriseBean;
-import org.jboss.ejb3.dd.EnterpriseBeans;
-import org.jboss.ejb3.dd.EntityEnterpriseBean;
-import org.jboss.ejb3.dd.JBossDDObjectFactory;
-import org.jboss.ejb3.dd.MessageDrivenBean;
-import org.jboss.ejb3.dd.MessageDrivenDestination;
-import org.jboss.ejb3.dd.Method;
-import org.jboss.ejb3.dd.MethodPermission;
-import org.jboss.ejb3.dd.RelationshipRoleSource;
-import org.jboss.ejb3.dd.Relationships;
-import org.jboss.ejb3.dd.ResourceRef;
-import org.jboss.ejb3.dd.SecurityIdentity;
-import org.jboss.ejb3.dd.SecurityRole;
-import org.jboss.ejb3.dd.Service;
-import org.jboss.ejb3.dd.SessionEnterpriseBean;
+import org.jboss.ejb3.metamodel.AssemblyDescriptor;
+import org.jboss.ejb3.metamodel.CmrField;
+import org.jboss.ejb3.metamodel.ContainerTransaction;
+import org.jboss.ejb3.metamodel.EjbJarDD;
+import org.jboss.ejb3.metamodel.EjbJarDDObjectFactory;
+import org.jboss.ejb3.metamodel.EjbRelation;
+import org.jboss.ejb3.metamodel.EjbRelationshipRole;
+import org.jboss.ejb3.metamodel.EnterpriseBean;
+import org.jboss.ejb3.metamodel.EnterpriseBeans;
+import org.jboss.ejb3.metamodel.EntityEnterpriseBean;
+import org.jboss.ejb3.metamodel.JBossDDObjectFactory;
+import org.jboss.ejb3.metamodel.MessageDrivenBean;
+import org.jboss.ejb3.metamodel.MessageDrivenDestination;
+import org.jboss.ejb3.metamodel.Method;
+import org.jboss.ejb3.metamodel.MethodPermission;
+import org.jboss.ejb3.metamodel.RelationshipRoleSource;
+import org.jboss.ejb3.metamodel.Relationships;
+import org.jboss.ejb3.metamodel.SecurityIdentity;
+import org.jboss.ejb3.metamodel.Service;
+import org.jboss.ejb3.metamodel.SessionEnterpriseBean;
 import org.jboss.logging.Logger;
 import org.jboss.xb.binding.ObjectModelFactory;
 import org.jboss.xb.binding.Unmarshaller;
@@ -57,6 +53,11 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
+import org.jboss.metamodel.descriptor.EjbLocalRef;
+import org.jboss.metamodel.descriptor.NameValuePair;
+import org.jboss.metamodel.descriptor.ResourceRef;
+import org.jboss.metamodel.descriptor.SecurityRole;
+
 /**
  * JUnit TestCase for JbossXB usage for ejb-jar.xml deployment descriptor for
  * version 1.4 schema
@@ -262,7 +263,7 @@
       assertEquals("org.jboss.ejb3.test.dd.mdb.ObjectMessageBean",ejb.getEjbClass());
       assertTrue(ejb instanceof MessageDrivenBean);
       MessageDrivenBean mdb = (MessageDrivenBean) ejb;
-      ActivationConfigProperty property = (ActivationConfigProperty)mdb.getActivationConfig().getActivationConfigProperties().get(0);
+      NameValuePair property = (NameValuePair)mdb.getActivationConfig().getActivationConfigProperties().get(0);
       assertEquals("AUTO_ACKNOWLEDGE", property.getValue());
       assertEquals("Bean", mdb.getTransactionType());
       MessageDrivenDestination destination = mdb.getMessageDrivenDestination();

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/dd/web/servlets/EJBServlet.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/dd/web/servlets/EJBServlet.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/dd/web/servlets/EJBServlet.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -27,12 +27,18 @@
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceUnit;
+import javax.persistence.EntityManagerFactory;
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.transaction.UserTransaction;
+import javax.ejb.EJB;
+import javax.annotation.Resource;
+
 import org.jboss.ejb3.test.dd.web.ejb.Address;
 import org.jboss.ejb3.test.dd.web.interfaces.ReferenceTest;
 import org.jboss.ejb3.test.dd.web.interfaces.Session30;
@@ -43,8 +49,9 @@
 import org.jboss.security.SecurityAssociation;
 import org.jboss.security.SimplePrincipal;
 
-/** A servlet that accesses an EJB and tests whether the call argument
- is serialized.
+/**
+ *
+ * tests injection annotations of @EJB, @PersistenceContext, @PersistenceUnit, etc...
 
  @author  Scott.Stark at jboss.org
  @version $Revision$
@@ -52,7 +59,7 @@
 public class EJBServlet extends HttpServlet
 {
    private static final Logger log = Logger.getLogger(EJBServlet.class);
-   
+
    public void init(ServletConfig config) throws ServletException
    {
        String param = config.getInitParameter("failOnError");
@@ -85,7 +92,6 @@
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException
    {
-      UserTransaction tx = null;
       try
       {
          SecurityAssociation.setPrincipal(new SimplePrincipal("jduke"));
@@ -101,7 +107,7 @@
          
          Session30 session30 = (Session30)ctx.lookup("java:comp/env/ejb/Session30");
          String access = session30.access();
-               
+
          //TODO EMPTYSTRING can't be right - correct lookup when fixed
          EntityManager entityManager = (EntityManager)ctx.lookup("java:/WebDDEntityManager");
          
@@ -111,21 +117,21 @@
          address.setState("MA");
          address.setZip("02116");
          
-         tx = (UserTransaction)ctx.lookup("UserTransaction");
-         tx.begin();
-         entityManager.persist(address);
-         tx.commit();
+         Address address2 = new Address();
+         address.setStreet("Clarendon Street");
+         address.setCity("Boston");
+         address.setState("MA");
+         address.setZip("02116");
+
+         Address address3 = new Address();
+         address.setStreet("Clarendon Street");
+         address.setCity("Boston");
+         address.setState("MA");
+         address.setZip("02116");
+
       }
       catch (Exception e)
       {
-         if (tx != null)
-         {
-            try {
-               tx.rollback();
-            } catch (Exception e1){
-              
-            }
-         }
          throw new ServletException("Failed to call OptimizedEJB/Session30 through remote and local interfaces", e);
       }
       response.setContentType("text/html");

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/dd/web/unit/WebIntegrationUnitTestCase.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/dd/web/unit/WebIntegrationUnitTestCase.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/dd/web/unit/WebIntegrationUnitTestCase.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -62,8 +62,22 @@
          throw e;
       }
    }
-   
-/* 
+
+
+   /*
+   public void testInjectionJsp() throws Exception
+   {
+      try {
+         URL url = new URL(baseURL+"dd/InjectionTest.jsp");
+         HttpUtils.accessURL(url);
+      } catch (Exception e){
+         e.printStackTrace();
+         throw e;
+      }
+   }
+   */
+
+/*
    public void testRealPath() throws Exception
    {
       URL url = new URL(baseURL+"dd/APIServlet?op=testGetRealPath");

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/Stateful.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/Stateful.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/Stateful.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -21,6 +21,7 @@
   */
 package org.jboss.ejb3.test.ejbcontext;
 
+import javax.ejb.Remote;
 
 
 /**
@@ -29,14 +30,21 @@
  * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
  * @version $Revision$
  */
+ at Remote
 public interface Stateful
 {
    public void testEjbContext() throws Exception;
-   
+
    public void test();
-   
-   public Object testInvokedBusinessInterface() throws Exception;
-   
-   public Object testLocalInvokedBusinessInterface() throws Exception;
 
+   public Class testInvokedBusinessInterface() throws Exception;
+
+   public Class testLocalInvokedBusinessInterface() throws Exception;
+
+   public Object getBusinessObject() throws Exception;
+
+
+   String getState();
+
+   void setState(String state);
 }

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/StatefulBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/StatefulBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/StatefulBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -41,7 +41,6 @@
  * @version $Revision$
  */
 @Stateful(name="Stateful")
- at Remote({org.jboss.ejb3.test.ejbcontext.Stateful.class, StatefulRemote.class})
 @RemoteBindings({@RemoteBinding(jndiBinding = "Stateful"), @RemoteBinding(jndiBinding = "StatefulRemote")})
 public class StatefulBean
    implements org.jboss.ejb3.test.ejbcontext.Stateful, StatefulRemote
@@ -53,6 +52,8 @@
    
    @EJB(mappedName="StatefulRemote")
    StatefulRemote statefulRemote = null;
+
+   String state = "";
    
    public void testEjbContext() throws Exception
    {
@@ -65,18 +66,34 @@
    {
       
    }
-   
-   public Object testInvokedBusinessInterface() throws Exception
+
+   public String getState()
    {
+      return state;
+   }
+
+   public void setState(String state)
+   {
+      this.state = state;
+   }
+
+   public Object getBusinessObject() throws Exception
+   {
+      return sessionContext.getBusinessObject(org.jboss.ejb3.test.ejbcontext.Stateful.class);
+   }
+
+
+   public Class testInvokedBusinessInterface() throws Exception
+   {
       return sessionContext.getInvokedBusinessInterface();
    }
    
-   public Object testInvokedBusinessInterface2() throws Exception
+   public Class testInvokedBusinessInterface2() throws Exception
    {
       return sessionContext.getInvokedBusinessInterface();
    }
    
-   public Object testLocalInvokedBusinessInterface() throws Exception
+   public Class testLocalInvokedBusinessInterface() throws Exception
    {
       return statefulRemote.testInvokedBusinessInterface2();
    }

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/StatefulRemote.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/StatefulRemote.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/StatefulRemote.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -21,6 +21,7 @@
   */
 package org.jboss.ejb3.test.ejbcontext;
 
+import javax.ejb.Remote;
 
 
 /**
@@ -29,8 +30,8 @@
  * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
  * @version $Revision$
  */
+ at Remote
 public interface StatefulRemote
 {
-   public Object testInvokedBusinessInterface2() throws Exception;
-
+   public Class testInvokedBusinessInterface2() throws Exception;
 }

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/Stateless.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/Stateless.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/Stateless.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -33,11 +33,13 @@
 {
    public void testEjbContextLookup() throws Exception;
    
-   public Object testInvokedBusinessInterface() throws Exception;
+   public Class testInvokedBusinessInterface() throws Exception;
    
    public Object testBusinessObject(Class businessInterface) throws Exception;
    
    public void testEjbObject() throws Exception;
 
    public void testEjbLocalObject() throws Exception;
+
+   public void noop();
 }

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/StatelessBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/StatelessBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/StatelessBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -49,6 +49,11 @@
    
    @Resource
    SessionContext sessionContext;
+
+   public void noop()
+   {
+      
+   }
    
    public void testEjbContextLookup() throws Exception
    {
@@ -56,7 +61,7 @@
       stateful.test();
    }
    
-   public Object testInvokedBusinessInterface() throws Exception
+   public Class testInvokedBusinessInterface() throws Exception
    {
       return sessionContext.getInvokedBusinessInterface();
    }

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/StatelessLocal.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/StatelessLocal.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/StatelessLocal.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -31,5 +31,16 @@
  */
 public interface StatelessLocal
 {
-  
+   public void testEjbContextLookup() throws Exception;
+
+   public Class testInvokedBusinessInterface() throws Exception;
+
+   public Object testBusinessObject(Class businessInterface) throws Exception;
+
+   public void testEjbObject() throws Exception;
+
+   public void testEjbLocalObject() throws Exception;
+
+   public void noop();
+   
 }

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/unit/EjbContextUnitTestCase.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/unit/EjbContextUnitTestCase.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/unit/EjbContextUnitTestCase.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -58,32 +58,54 @@
    
    public void testStatelessInvokedBusinessInterface() throws Exception
    {
-      Stateless stateless = (Stateless)getInitialContext().lookup("Stateless");
+      Stateless stateless1 = (Stateless)getInitialContext().lookup("Stateless");
+      Stateless stateless2 = (Stateless)getInitialContext().lookup("Stateless");
       
-      try
-      {
-         stateless.testInvokedBusinessInterface();
-         fail("should through exception");
-      } 
+      Class interfc = stateless1.testInvokedBusinessInterface();
+      assertEquals(interfc, Stateless.class);
+      
+      interfc = stateless2.testInvokedBusinessInterface();
+      assertEquals(interfc, Stateless.class);
+      
+      Stateless stateless = (Stateless)stateless1.testBusinessObject(Stateless.class);
+      stateless.noop();
+
+      assertEquals(interfc, Stateless.class);
+      
+      try{
+         stateless1.testBusinessObject(Stateful.class);
+         fail("IllegalStateException not thrown");
+      }
       catch (javax.ejb.EJBException e)
       {
-         
+         if (!(e.getCause() instanceof IllegalStateException)) throw e;
+         assertEquals(IllegalStateException.class, e.getCause().getClass());
       }
+      
+      stateless1.testEjbObject();
+      
+      stateless1.testEjbLocalObject();
    }
    
    public void testStatefulInvokedBusinessInterface() throws Exception
    {
-      Stateful stateful = (Stateful)getInitialContext().lookup("Stateful");
-    
-      try
-      {
-         stateful.testInvokedBusinessInterface();
-         fail("should through exception");
-      } 
-      catch (javax.ejb.EJBException e)
-      {
-         
-      }
+      Stateful stateful1 = (Stateful)getInitialContext().lookup("Stateful");
+      StatefulRemote stateful2 = (StatefulRemote)getInitialContext().lookup("StatefulRemote");
+      
+      Class interfc = stateful1.testInvokedBusinessInterface();
+      assertEquals(interfc, Stateful.class);
+      
+      interfc = stateful2.testInvokedBusinessInterface2();
+      assertEquals(interfc, StatefulRemote.class);
+      
+      interfc = stateful1.testLocalInvokedBusinessInterface();
+      assertEquals(interfc, StatefulRemote.class);
+      
+      stateful1.setState("same");
+      Stateful stateful3 = (Stateful)stateful1.getBusinessObject();
+      assertEquals("same", stateful3.getState());
+
+      
    }
 
    public static Test suite() throws Exception

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/HomedStatelessBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/HomedStatelessBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/HomedStatelessBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,58 @@
+/*
+ * 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.ejb3.test.iiop;
+
+import javax.annotation.Resource;
+import javax.annotation.security.RolesAllowed;
+import javax.ejb.Remote;
+import javax.ejb.RemoteHome;
+import javax.ejb.SessionContext;
+import javax.ejb.Stateless;
+
+import org.jboss.annotation.ejb.RemoteBinding;
+import org.jboss.ejb3.iiop.IORFactory;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+ at Stateless
+ at Remote(MySession.class)
+ at RemoteHome(HomedStatelessHome.class)
+ at RemoteBinding(factory=IORFactory.class)
+public class HomedStatelessBean
+{
+   @Resource SessionContext ctx;
+   
+   @RolesAllowed({"user"})
+   public String getWhoAmI()
+   {
+      return ctx.getCallerPrincipal().getName();
+   }
+   
+   public String sayHelloTo(String name)
+   {
+      return "Hi " + name;
+   }
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/HomedStatelessHome.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/HomedStatelessHome.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/HomedStatelessHome.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,38 @@
+/*
+ * 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.ejb3.test.iiop;
+
+import java.rmi.RemoteException;
+
+import javax.ejb.CreateException;
+import javax.ejb.EJBHome;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public interface HomedStatelessHome extends EJBHome
+{
+   MySession create() throws CreateException, RemoteException;
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/MyServiceBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/MyServiceBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/MyServiceBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,61 @@
+/*
+ * 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.ejb3.test.iiop;
+
+import javax.ejb.Remote;
+
+import org.jboss.annotation.ejb.RemoteBinding;
+import org.jboss.annotation.ejb.Service;
+import org.jboss.ejb3.iiop.IORFactory;
+import org.jboss.logging.Logger;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+ at Service
+ at Remote(MyStateful.class)
+ at RemoteBinding(factory=IORFactory.class)
+public class MyServiceBean
+{
+   @SuppressWarnings("unused")
+   private static final Logger log = Logger.getLogger(MyServiceBean.class);
+   
+   private String name;
+   
+   public String getName()
+   {
+      return name;
+   }
+   
+   public String sayHello()
+   {
+      return "Hello " + name;
+   }
+   
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/MySession.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/MySession.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/MySession.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,40 @@
+/*
+  * 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.ejb3.test.iiop;
+
+import java.rmi.RemoteException;
+
+import javax.ejb.EJBObject;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: 55119 $
+ */
+//@Remote
+public interface MySession extends EJBObject
+{
+   String getWhoAmI() throws RemoteException;
+   
+   String sayHelloTo(String name) throws RemoteException;
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/MySessionBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/MySessionBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/MySessionBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,60 @@
+/*
+  * 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.ejb3.test.iiop;
+
+import javax.annotation.Resource;
+import javax.annotation.security.RolesAllowed;
+import javax.ejb.Remote;
+import javax.ejb.SessionContext;
+import javax.ejb.Stateless;
+
+import org.jboss.annotation.ejb.IIOP;
+import org.jboss.annotation.ejb.RemoteBinding;
+import org.jboss.annotation.security.SecurityDomain;
+import org.jboss.ejb3.iiop.IORFactory;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: 55119 $
+ */
+ at Stateless
+ at Remote(MySession.class)
+ at RemoteBinding(factory=IORFactory.class)
+ at IIOP(interfaceRepositorySupported=false)
+ at SecurityDomain("other")
+public class MySessionBean
+{
+   @Resource SessionContext ctx;
+   
+   @RolesAllowed({"allowed"})
+   public String getWhoAmI()
+   {
+      return ctx.getCallerPrincipal().getName();
+   }
+   
+   public String sayHelloTo(String name)
+   {
+      return "Hi " + name;
+   }
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/MyStateful.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/MyStateful.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/MyStateful.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,41 @@
+/*
+ * 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.ejb3.test.iiop;
+
+import java.rmi.RemoteException;
+
+import javax.ejb.EJBObject;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: 46552 $
+ */
+public interface MyStateful extends EJBObject
+{
+   String getName() throws RemoteException;
+   
+   String sayHello() throws RemoteException;
+   
+   void setName(String name) throws RemoteException;
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/MyStatefulBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/MyStatefulBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/MyStatefulBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,93 @@
+/*
+ * 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.ejb3.test.iiop;
+
+import java.rmi.RemoteException;
+
+import javax.annotation.PreDestroy;
+import javax.ejb.CreateException;
+import javax.ejb.Init;
+import javax.ejb.Remote;
+import javax.ejb.RemoteHome;
+import javax.ejb.Remove;
+import javax.ejb.RemoveException;
+import javax.ejb.Stateful;
+
+import org.jboss.annotation.ejb.RemoteBinding;
+import org.jboss.ejb3.iiop.IORFactory;
+import org.jboss.logging.Logger;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: 55119 $
+ */
+ at Stateful
+ at Remote(MyStateful.class)
+ at RemoteHome(MyStatefulHome.class)
+ at RemoteBinding(factory=IORFactory.class)
+public class MyStatefulBean
+{
+   private static final Logger log = Logger.getLogger(MyStatefulBean.class);
+   
+   private String name;
+   
+   @Init
+   public void ejbCreate() throws CreateException, RemoteException
+   {
+      name = "anonymous";
+   }
+   
+   @Init
+   public void ejbCreate(String name) throws CreateException, RemoteException
+   {
+      this.name = name;
+   }
+   
+   @Remove
+   public void ejbRemove() throws RemoveException, RemoteException
+   {
+      log.info("remove bean");
+   }
+   
+   public String getName() throws RemoteException
+   {
+      return name;
+   }
+   
+   @PreDestroy
+   public void preDestroy()
+   {
+      log.info("pre destroy");
+   }
+   
+   public String sayHello() throws RemoteException
+   {
+      return "Hello " + name;
+   }
+   
+   public void setName(String name) throws RemoteException
+   {
+      this.name = name;
+   }
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/MyStatefulHome.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/MyStatefulHome.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/MyStatefulHome.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,39 @@
+/*
+ * 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.ejb3.test.iiop;
+
+import java.rmi.RemoteException;
+
+import javax.ejb.CreateException;
+import javax.ejb.EJBHome;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: 46552 $
+ */
+public interface MyStatefulHome extends EJBHome
+{
+   MyStateful create() throws CreateException, RemoteException;
+   MyStateful create(String name) throws CreateException, RemoteException;
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/TxTester.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/TxTester.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/TxTester.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,37 @@
+/*
+ * 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.ejb3.test.iiop;
+
+import java.rmi.RemoteException;
+
+import javax.ejb.EJBObject;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: 46552 $
+ */
+public interface TxTester extends EJBObject
+{
+   void txMandatoryMethod() throws RemoteException;
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/TxTesterBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/TxTesterBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/TxTesterBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,78 @@
+/*
+ * 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.ejb3.test.iiop;
+
+import javax.ejb.EJBException;
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
+import javax.ejb.TransactionManagement;
+import javax.ejb.TransactionManagementType;
+import javax.transaction.Status;
+import javax.transaction.SystemException;
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
+
+import org.apache.log4j.Logger;
+import org.jboss.annotation.JndiInject;
+import org.jboss.annotation.ejb.RemoteBinding;
+import org.jboss.ejb3.iiop.IORFactory;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: 46552 $
+ */
+ at Stateless
+ at Remote(TxTester.class)
+ at RemoteBinding(factory=IORFactory.class)
+ at TransactionManagement(TransactionManagementType.CONTAINER)
+public class TxTesterBean
+{
+   private static final Logger log = Logger.getLogger(TxTesterBean.class);
+   
+   @JndiInject(jndiName="java:/TransactionManager") TransactionManager tm;
+   
+   @TransactionAttribute(TransactionAttributeType.MANDATORY)
+   public void txMandatoryMethod()
+   {
+      try
+      {
+         log.info("currentThread = " + Thread.currentThread());
+         log.info("currentTransaction = " + tm.getTransaction());
+         log.info("tm = " + tm);
+         
+         Transaction tx = tm.getTransaction();
+         if(tx == null)
+            throw new EJBException("no tx");
+         
+         if(tx.getStatus() != Status.STATUS_ACTIVE)
+            throw new EJBException("tx not active");
+      }
+      catch(SystemException e)
+      {
+         throw new EJBException(e);
+      }
+   }
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/unit/IiopRemoteUnitTestCase.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/unit/IiopRemoteUnitTestCase.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/iiop/unit/IiopRemoteUnitTestCase.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,296 @@
+/*
+  * 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.ejb3.test.iiop.unit;
+
+import java.rmi.MarshalledObject;
+import java.util.Date;
+import java.util.Properties;
+
+import javax.ejb.Handle;
+import javax.ejb.HomeHandle;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.rmi.PortableRemoteObject;
+import javax.transaction.UserTransaction;
+
+import junit.framework.Test;
+
+import org.jboss.ejb3.test.CustomJNDIJBossTestCase;
+import org.jboss.ejb3.test.iiop.HomedStatelessHome;
+import org.jboss.ejb3.test.iiop.MySession;
+import org.jboss.ejb3.test.iiop.MyStateful;
+import org.jboss.ejb3.test.iiop.MyStatefulHome;
+import org.jboss.ejb3.test.iiop.TxTester;
+import org.jboss.security.SecurityAssociation;
+import org.jboss.security.SimplePrincipal;
+
+/**
+ * TODO: use JBossIIOPTestCase
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: 56434 $
+ */
+public class IiopRemoteUnitTestCase extends CustomJNDIJBossTestCase
+{
+
+   public IiopRemoteUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   @Override
+   public InitialContext getInitialContext() throws NamingException
+   {
+      return new InitialContext(getJndiProperties());
+   }
+   
+   private Properties getJndiProperties()
+   {
+      Properties props = new Properties();
+      props.put("java.naming.factory.initial", "com.sun.jndi.cosnaming.CNCtxFactory");
+      props.put("java.naming.provider.url", "corbaloc::localhost:3528/NameService");
+      props.put("java.naming.factory.object", "org.jboss.tm.iiop.client.IIOPClientUserTransactionObjectFactory");
+      props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming.client:org.jnp.interfaces");
+      props.put("j2ee.clientName", "iiop-unit-test");
+      
+//      props.put(InitialContext.SECURITY_PRINCIPAL, "somebody");
+//      props.put(InitialContext.SECURITY_CREDENTIALS, "password");
+      
+      return props;
+//      return null;
+   }
+   
+   public void test0() throws Exception
+   {
+      System.out.println("java: " + getInitialContext().lookup("java:comp/HandleDelegate"));
+   }
+   
+   public void test1() throws Exception
+   {
+      SimplePrincipal principal = new SimplePrincipal("somebody");
+      SecurityAssociation.setPrincipal(principal);
+      SecurityAssociation.setCredential("password".toCharArray());
+      
+      InitialContext ctx = getInitialContext();
+      Object obj = ctx.lookup("MySessionBean/remote");
+      System.err.println(obj.getClass());
+      MySession session = (MySession) PortableRemoteObject.narrow(obj, MySession.class);
+      assertNotNull(session);
+      String me = new Date().toString();
+      String response = session.sayHelloTo(me);
+      assertEquals("Hi " + me, response);
+   }
+   
+   public void test2() throws Exception
+   {
+      InitialContext ctx = getInitialContext();
+      Object obj = ctx.lookup("MyStatefulBean/remoteHome");
+      MyStatefulHome home = (MyStatefulHome) PortableRemoteObject.narrow(obj, MyStatefulHome.class);
+      //MyStateful bean1 = (MyStateful) PortableRemoteObject.narrow(obj, MyStateful.class);
+      MyStateful bean1 = home.create();
+      bean1.setName("bean1");
+      String response = bean1.sayHello();
+      assertEquals("Hello bean1", response);
+      bean1.remove();
+   }
+   
+   public void testGetEJBHome() throws Exception
+   {
+      InitialContext ctx = getInitialContext();
+      Object obj = ctx.lookup("HomedStatelessBean/remoteHome");
+      HomedStatelessHome home = (HomedStatelessHome) PortableRemoteObject.narrow(obj, HomedStatelessHome.class);
+      MySession session = home.create();
+      Object o = session.getEJBHome();
+      HomedStatelessHome home2 = (HomedStatelessHome) PortableRemoteObject.narrow(o, HomedStatelessHome.class);
+      // TODO: check home2
+   }
+   
+   public void testGetHandle() throws Exception
+   {
+      InitialContext ctx = getInitialContext();
+      Object obj = ctx.lookup("HomedStatelessBean/remoteHome");
+      HomedStatelessHome home = (HomedStatelessHome) PortableRemoteObject.narrow(obj, HomedStatelessHome.class);
+      MySession session = home.create();
+      Handle h = session.getHandle();
+      MarshalledObject mo = new MarshalledObject(h);
+      Handle h2 = (Handle) mo.get();
+      Object o = h2.getEJBObject();
+      MySession session2 = (MySession) PortableRemoteObject.narrow(o, MySession.class);
+      String me = new Date().toString();
+      String response = session2.sayHelloTo(me);
+      assertEquals("Hi " + me, response);
+   }
+   
+   public void testGetHomeHandle() throws Exception
+   {
+      InitialContext ctx = getInitialContext();
+      Object obj = ctx.lookup("HomedStatelessBean/remoteHome");
+      HomedStatelessHome home = (HomedStatelessHome) PortableRemoteObject.narrow(obj, HomedStatelessHome.class);
+      HomeHandle h = home.getHomeHandle();
+      MarshalledObject mo = new MarshalledObject(h);
+      HomeHandle h2 = (HomeHandle) mo.get();
+      Object o = h2.getEJBHome();
+      HomedStatelessHome home2 = (HomedStatelessHome) PortableRemoteObject.narrow(o, HomedStatelessHome.class);
+      // TODO: check home2
+   }
+   
+   public void testGetPrimaryKeyAndRemove() throws Exception
+   {
+      InitialContext ctx = getInitialContext();
+      Object obj = ctx.lookup("MyStatefulBean/remoteHome");
+      MyStatefulHome home = (MyStatefulHome) PortableRemoteObject.narrow(obj, MyStatefulHome.class);
+      MyStateful session = home.create();
+      Object primaryKey = session.getPrimaryKey();
+      assertNotNull(primaryKey);
+      
+      home.remove(primaryKey);
+      try
+      {
+         session.sayHello();
+         fail("should throw an exception");
+      }
+      catch(Exception e)
+      {
+         // TODO: check exception (NoSuchEJBException)
+      }
+   }
+   
+   public void testHomedStateless() throws Exception
+   {
+      InitialContext ctx = getInitialContext();
+      Object obj = ctx.lookup("HomedStatelessBean/remoteHome");
+      HomedStatelessHome home = (HomedStatelessHome) PortableRemoteObject.narrow(obj, HomedStatelessHome.class);
+      MySession session = home.create();
+      String me = new Date().toString();
+      String response = session.sayHelloTo(me);
+      assertEquals("Hi " + me, response);
+   }
+   
+   public void testIsIdentical() throws Exception
+   {
+      InitialContext ctx = getInitialContext();
+      Object obj = ctx.lookup("MyStatefulBean/remoteHome");
+      MyStatefulHome home = (MyStatefulHome) PortableRemoteObject.narrow(obj, MyStatefulHome.class);
+      MyStateful session = home.create();
+      Handle h = session.getHandle();
+      MarshalledObject mo = new MarshalledObject(h);
+      Handle h2 = (Handle) mo.get();
+      Object o = h2.getEJBObject();
+      MyStateful session2 = (MyStateful) PortableRemoteObject.narrow(o, MyStateful.class);
+      assertTrue(session.isIdentical(session2));
+   }
+   
+   public void testRemoveByHandle() throws Exception
+   {
+      InitialContext ctx = getInitialContext();
+      Object obj = ctx.lookup("MyStatefulBean/remoteHome");
+      MyStatefulHome home = (MyStatefulHome) PortableRemoteObject.narrow(obj, MyStatefulHome.class);
+      MyStateful session = home.create();
+      session.setName("Me");
+      home.remove(session.getHandle());
+      try
+      {
+         session.sayHello();
+         fail("should throw an exception");
+      }
+      catch(Exception e)
+      {
+         // TODO: check exception (NoSuchEJBException)
+      }
+   }
+   
+   public void testSecurity() throws Exception
+   {
+      SimplePrincipal principal = new SimplePrincipal("somebody");
+      SecurityAssociation.setPrincipal(principal);
+      
+      InitialContext ctx = getInitialContext();
+      Object obj = ctx.lookup("MySessionBean/remote");
+      System.err.println(obj.getClass());
+      MySession session = (MySession) PortableRemoteObject.narrow(obj, MySession.class);
+      assertNotNull(session);
+      String actual = session.getWhoAmI();
+      System.err.println("whoAmI = " + actual);
+   }
+   
+   public void testService() throws Exception
+   {
+      InitialContext ctx = getInitialContext();
+      Object obj = ctx.lookup("MyServiceBean/remote");
+      MyStateful bean1 = (MyStateful) PortableRemoteObject.narrow(obj, MyStateful.class);
+      bean1.setName("bean1");
+      String response = bean1.sayHello();
+      assertEquals("Hello bean1", response);
+   }
+   
+   public void testTxPropegation() throws Exception
+   {
+      InitialContext ctx = getInitialContext();
+      Object obj = ctx.lookup("TxTesterBean/remote");
+      TxTester session = (TxTester) PortableRemoteObject.narrow(obj, TxTester.class);
+      assertNotNull(session);
+      UserTransaction tx = (UserTransaction) PortableRemoteObject.narrow(ctx.lookup("UserTransaction"), UserTransaction.class);
+      tx.begin();
+      try
+      {
+         session.txMandatoryMethod();
+      }
+      finally
+      {
+         tx.rollback();
+      }
+      // If it doesn't throw an exception everything is fine.
+   }
+
+   public void testTxRequired() throws Exception
+   {
+      InitialContext ctx = getInitialContext();
+      Object obj = ctx.lookup("TxTesterBean/remote");
+      TxTester session = (TxTester) PortableRemoteObject.narrow(obj, TxTester.class);
+      assertNotNull(session);
+      try
+      {
+         session.txMandatoryMethod();
+         fail("Expected an exception");
+      }
+      catch(Exception e)
+      {
+         //fail("TODO: check exception");
+      }
+      // TODO: throws an ugly exception, needs assertions to check
+   }
+   
+   public static Test suite() throws Exception
+   {
+      try
+      {
+         System.err.println(IiopRemoteUnitTestCase.class.getClassLoader().getResource("jacorb.properties"));
+      }
+      catch(Throwable t)
+      {
+         t.printStackTrace();
+      }
+      return getDeploySetup(IiopRemoteUnitTestCase.class, "iiop.jar");
+   }
+
+}

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/initial/ClassInjectedBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/initial/ClassInjectedBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/initial/ClassInjectedBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -34,7 +34,7 @@
  * @version $Revision$
  */
 @Stateless
- at EJBs({@EJB(name="injected", businessInterface=org.jboss.ejb3.test.initial.TestStatus.class, beanName="TestStatusBean")})
+ at EJBs({@EJB(name="injected", beanInterface=org.jboss.ejb3.test.initial.TestStatus.class, beanName="TestStatusBean")})
 @Remote(ClassInjected.class)
 public class ClassInjectedBean implements ClassInjected
 {

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/interceptors2/InheritingSFSB.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/interceptors2/InheritingSFSB.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/interceptors2/InheritingSFSB.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -26,8 +26,11 @@
 import javax.interceptor.AroundInvoke;
 import javax.interceptor.ExcludeDefaultInterceptors;
 import javax.interceptor.InvocationContext;
+import javax.ejb.PostActivate;
 import javax.annotation.PreDestroy;
-import javax.ejb.*;
+import javax.ejb.PrePassivate;
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
 
 import org.jboss.annotation.ejb.cache.simple.CacheConfig;
 

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/invoker/StatelessBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/invoker/StatelessBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/invoker/StatelessBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,46 @@
+/*
+  * 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.ejb3.test.invoker;
+
+import javax.ejb.Stateless;
+import javax.ejb.Remote;
+
+import org.jboss.annotation.ejb.RemoteBinding;
+import org.jboss.annotation.ejb.RemoteBindings;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @version $Revision: 55135 $
+ */
+ at Stateless
+ at RemoteBindings({
+  @RemoteBinding(clientBindUrl="http://localhost:8080/servlet-invoker/ServerInvokerServlet", jndiBinding="StatelessHttp")
+})
+ at Remote(StatelessRemote.class)
+public class StatelessBean implements StatelessRemote
+{
+   public String echo(String s)
+   {
+      return s;
+   }
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/invoker/StatelessRemote.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/invoker/StatelessRemote.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/invoker/StatelessRemote.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,32 @@
+/*
+  * 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.ejb3.test.invoker;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @version $Revision: 45085 $
+ */
+public interface StatelessRemote
+{
+   String echo(String s);
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/invoker/unit/InvokerTestCase.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/invoker/unit/InvokerTestCase.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/invoker/unit/InvokerTestCase.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,69 @@
+/*
+  * 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.ejb3.test.invoker.unit;
+
+import java.util.Properties;
+import javax.naming.InitialContext;
+
+import org.jboss.ejb3.test.invoker.StatelessRemote;
+import org.jboss.logging.Logger;
+import org.jboss.test.JBossTestCase;
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @version $Revision: 55135 $
+ */
+public class InvokerTestCase extends JBossTestCase
+{
+   private static final Logger log = Logger.getLogger(InvokerTestCase.class);
+
+   public InvokerTestCase(String name)
+   {
+      super(name);
+   }
+ 
+   public void testHttp() throws Exception
+   {
+      Properties props = new Properties();
+      props.put("java.naming.factory.initial", "org.jboss.naming.HttpNamingContextFactory"); 
+      props.put("java.naming.provider.url", "http://localhost:8080/invoker/JNDIFactory");
+      props.put("java.naming.factory.url.pkgs", "org.jboss.naming");
+      InitialContext jndiContext = new InitialContext(props);
+      //InitialContext jndiContext = new InitialContext();
+      
+      StatelessRemote stateless = (StatelessRemote)jndiContext.lookup("StatelessHttp");
+      assertNotNull(stateless);
+      
+      try 
+      {
+      assertEquals("echo", stateless.echo("echo"));
+      } catch (Exception e){
+         e.printStackTrace();
+      }
+   }
+
+   public static Test suite() throws Exception
+   {
+      return getDeploySetup(InvokerTestCase.class, "invoker-test.jar");
+   }
+}
\ No newline at end of file

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/jacc/StatefulBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/jacc/StatefulBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/jacc/StatefulBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -37,7 +37,7 @@
 @javax.ejb.Stateful
 @Remote (Stateful.class)
 @SecurityDomain ("other")
- at AspectDomain("JACC Stateful Bean")
+//@AspectDomain("JACC Stateful Bean")
 public class StatefulBean implements Stateful, java.io.Serializable
 {
    @PermitAll

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/jacc/StatelessBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/jacc/StatelessBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/jacc/StatelessBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -39,7 +39,7 @@
 @javax.ejb.Stateless
 @Remote (Stateless.class)
 @SecurityDomain ("other")
- at AspectDomain("JACC Stateless Bean")
+//@AspectDomain("JACC Stateless Bean")
 public class StatelessBean implements Stateless
 {
    //TODO: put this in again once we update the hibernate jars (changes already made to hibernate)

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/jca/inflowmdb/DeploymentDescriptorTestMDBMessageListener.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/jca/inflowmdb/DeploymentDescriptorTestMDBMessageListener.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/jca/inflowmdb/DeploymentDescriptorTestMDBMessageListener.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -21,15 +21,9 @@
   */
 package org.jboss.ejb3.test.jca.inflowmdb;
 
-import javax.ejb.ActivationConfigProperty;
-import javax.ejb.EJBException;
-import javax.ejb.MessageDriven;
-import javax.ejb.MessageDrivenBean;
 import javax.ejb.MessageDrivenContext;
-import javax.ejb.TransactionAttribute;
-import javax.ejb.TransactionAttributeType;
 
-import org.jboss.ejb3.mdb.MessageInflowLocalProxy;
+import org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy;
 import org.jboss.ejb3.test.jca.inflow.TestMessage;
 import org.jboss.ejb3.test.jca.inflow.TestMessageListener;
 import org.jboss.logging.Logger;

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/jca/inflowmdb/TestMDBMessageListener.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/jca/inflowmdb/TestMDBMessageListener.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/jca/inflowmdb/TestMDBMessageListener.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -22,14 +22,11 @@
 package org.jboss.ejb3.test.jca.inflowmdb;
 
 import javax.ejb.ActivationConfigProperty;
-import javax.ejb.EJBException;
 import javax.ejb.MessageDriven;
-import javax.ejb.MessageDrivenBean;
-import javax.ejb.MessageDrivenContext;
 import javax.ejb.TransactionAttribute;
 import javax.ejb.TransactionAttributeType;
 
-import org.jboss.ejb3.mdb.MessageInflowLocalProxy;
+import org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy;
 import org.jboss.ejb3.test.jca.inflow.TestMessage;
 import org.jboss.ejb3.test.jca.inflow.TestMessageListener;
 import org.jboss.logging.Logger;

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/jca/inflowmdb/unit/DeploymentDescriptorInflowUnitTestCase.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/jca/inflowmdb/unit/DeploymentDescriptorInflowUnitTestCase.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/jca/inflowmdb/unit/DeploymentDescriptorInflowUnitTestCase.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -59,8 +59,8 @@
       return t2;
    }
    
-  /* public static Test suite() throws Exception
+   /*public static Test suite() throws Exception
    {
-      return getDeploySetup(ServiceUnitTestCase.class, "jcainflowmdb.jar, jcainflow.rar");
+      return getDeploySetup(DeploymentDescriptorInflowUnitTestCase.class, "");
    } */
 }

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/jca/inflowmdb/unit/InflowUnitTestCase.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/jca/inflowmdb/unit/InflowUnitTestCase.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/jca/inflowmdb/unit/InflowUnitTestCase.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -21,9 +21,17 @@
   */
 package org.jboss.ejb3.test.jca.inflowmdb.unit;
 
+import javax.management.ObjectName;
+
+import org.jboss.ejb3.InitialContextFactory;
+import org.jboss.ejb3.ClientKernelAbstraction;
+import org.jboss.ejb3.KernelAbstractionFactory;
+
 import org.jboss.ejb3.test.jca.inflow.TestResourceAdapter;
 import org.jboss.ejb3.test.jca.inflow.TestResourceAdapterInflowResults;
 import org.jboss.ejb3.test.jca.inflowmdb.QuartzTest;
+import org.jboss.ejb3.test.jca.inflowmdb.JMSTest;
+import org.jboss.ejb3.test.jca.inflowmdb.StatelessRemote;
 import org.jboss.test.JBossTestCase;
 import junit.framework.Test;
 
@@ -42,7 +50,8 @@
 
    public void testInflow() throws Throwable
    {
-      TestResourceAdapterInflowResults results = (TestResourceAdapterInflowResults) getServer().invoke
+      ClientKernelAbstraction kernel = KernelAbstractionFactory.getClientInstance();
+      TestResourceAdapterInflowResults results = (TestResourceAdapterInflowResults)kernel.invoke
       (
           TestResourceAdapter.mbean,
           "testInflow",
@@ -55,20 +64,27 @@
 
    public void testQuartz() throws Exception
    {
-      QuartzTest test = (QuartzTest)getInitialContext().lookup("QuartzTestBean/remote");
+      QuartzTest test = (QuartzTest)InitialContextFactory.getInitialContext().lookup("QuartzTestBean/remote");
       Thread.sleep(5000); // sleep so that quartz mdb runs.
       assertTrue(test.wasCalled());
    }
    
+   public void testJMS() throws Exception
+   {
+      StatelessRemote stateless = (StatelessRemote)InitialContextFactory.getInitialContext().lookup("StatelessBean/remote");
+      assertNotNull(stateless);
+      stateless.sendMessage();
+      
+      JMSTest test = (JMSTest)InitialContextFactory.getInitialContext().lookup("JMSTestBean/remote");
+      Thread.sleep(5000); // sleep so that jms mdb runs.
+      assertTrue(test.wasCalled());
+   }
+
+   
    public static Test suite() throws Exception
    {
-      Test t1 = getDeploySetup(InflowUnitTestCase.class, "jcainflowmdb.jar, quartzmdb.jar");
+      Test t1 = getDeploySetup(InflowUnitTestCase.class, "quartzmdb.jar, jmsinflowmdb.jar, jcainflowmdb.jar"); 
       Test t2 = getDeploySetup(t1, "jcainflow.rar");
       return t2;
    }
-   
-  /* public static Test suite() throws Exception
-   {
-      return getDeploySetup(ServiceUnitTestCase.class, "jcainflowmdb.ejb3, jcainflow.rar");
-   } */
 }

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/longlived/HibernateShoppingCartBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/longlived/HibernateShoppingCartBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/longlived/HibernateShoppingCartBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -22,7 +22,11 @@
 package org.jboss.ejb3.test.longlived;
 
 import javax.ejb.EJB;
-import javax.ejb.*;
+import javax.ejb.Remote;
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
 import javax.persistence.PersistenceContext;
 import javax.persistence.PersistenceContextType;
 import org.hibernate.Session;

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/longlived/ShoppingCartBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/longlived/ShoppingCartBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/longlived/ShoppingCartBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -23,7 +23,12 @@
 
 import java.io.Serializable;
 import javax.ejb.EJB;
-import javax.ejb.*;
+import javax.ejb.Remote;
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
+import javax.ejb.PostActivate;
 import javax.persistence.EntityManager;
 import javax.persistence.PersistenceContext;
 import javax.persistence.PersistenceContextType;

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/BMTQueueTestMDB.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/BMTQueueTestMDB.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/BMTQueueTestMDB.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -25,10 +25,12 @@
 import javax.ejb.MessageDriven;
 import javax.ejb.TransactionManagement;
 import javax.ejb.TransactionManagementType;
+import javax.ejb.MessageDrivenContext;
 import javax.jms.Message;
 import javax.jms.MessageListener;
 
 import javax.annotation.security.RunAs;
+import javax.annotation.Resource;
 
 import org.jboss.annotation.security.SecurityDomain;
 import org.jboss.logging.Logger;
@@ -52,10 +54,12 @@
    private static final Logger log = Logger.getLogger(BMTQueueTestMDB.class);
    
    private static boolean thrownException = false;
-   
+   @Resource MessageDrivenContext ctx;
+
    public void onMessage(Message recvMsg)
    {
-      System.out.println("BMTQueueTestMDB onMessage " + thrownException);
+      System.out.println("*** BMTQueueTestMDB onMessage " + thrownException);
+      if (ctx == null) throw new RuntimeException("FAILED ON CTX LOOKUP");
       
       if (!thrownException)
       {

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/DefaultedQueueTestMDB.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/DefaultedQueueTestMDB.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/DefaultedQueueTestMDB.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -23,10 +23,12 @@
 
 import javax.ejb.ActivationConfigProperty;
 import javax.ejb.MessageDriven;
+import javax.ejb.MessageDrivenContext;
 import javax.jms.Message;
 import javax.jms.MessageListener;
 
 import javax.annotation.security.RunAs;
+import javax.annotation.Resource;
 
 import org.jboss.annotation.ejb.DefaultActivationSpecs;
 import org.jboss.annotation.security.SecurityDomain;
@@ -50,10 +52,13 @@
 public class DefaultedQueueTestMDB implements MessageListener
 {
    private static final Logger log = Logger.getLogger(DefaultedQueueTestMDB.class);
-   
+
+   @Resource MessageDrivenContext ctx;
+
    public void onMessage(Message recvMsg)
    {
-      System.out.println("DefaultedQueueTestMDB onMessage");
+      System.out.println("*** DefaultedQueueTestMDB onMessage");
+      if (ctx == null) throw new RuntimeException("FAILED ON CTX LOOKUP");
       TestStatusBean.defaultedQueueRan++;
    }
 }

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/NondurableQueueTestMDB.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/NondurableQueueTestMDB.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/NondurableQueueTestMDB.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -23,11 +23,13 @@
 
 import javax.ejb.ActivationConfigProperty;
 import javax.ejb.MessageDriven;
+import javax.ejb.MessageDrivenContext;
 import javax.jms.Message;
 import javax.jms.MessageListener;
 import javax.jms.DeliveryMode;
 
 import javax.annotation.security.RunAs;
+import javax.annotation.Resource;
 
 import org.jboss.annotation.security.SecurityDomain;
 import org.jboss.logging.Logger;
@@ -42,19 +44,21 @@
         {
         @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
         @ActivationConfigProperty(propertyName="destination", propertyValue="queue/nondurablemdbtest"),
-        @ActivationConfigProperty(propertyName="durability", propertyValue="NON_DURABLE")
+        @ActivationConfigProperty(propertyName="subscriptionDurability", propertyValue="NON_DURABLE")
         })
 @RunAs("TestRole")
 @SecurityDomain("other")
 public class NondurableQueueTestMDB implements MessageListener
 {
    private static final Logger log = Logger.getLogger(NondurableQueueTestMDB.class);
-   
+   @Resource MessageDrivenContext ctx;
+
    public void onMessage(Message recvMsg)
    {
+      if (ctx == null) throw new RuntimeException("FAILED ON CTX LOOKUP");
       try
       {
-         System.out.println("QueueTestMDB onMessage");
+         System.out.println("*** NondurableQueueTestMDB onMessage");
          if (recvMsg.getJMSDeliveryMode() != DeliveryMode.NON_PERSISTENT)
             log.error("Message is PERSISTENT - should be NON PERSISTENT");
          else

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/OverrideTestMDB.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/OverrideTestMDB.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/OverrideTestMDB.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -23,8 +23,10 @@
 
 import javax.ejb.ActivationConfigProperty;
 import javax.ejb.MessageDriven;
+import javax.ejb.MessageDrivenContext;
 import javax.jms.Message;
 import javax.jms.MessageListener;
+import javax.annotation.Resource;
 
 import org.jboss.logging.Logger;
 
@@ -40,10 +42,13 @@
 public class OverrideTestMDB implements MessageListener
 {
    private static final Logger log = Logger.getLogger(OverrideTestMDB.class);
-   
+   @Resource MessageDrivenContext ctx;
+
    public void onMessage(Message recvMsg)
    {
-      System.out.println("OverrideTestMDB onMessage");
+      if (ctx == null) throw new RuntimeException("FAILED ON CTX LOOKUP");
       TestStatusBean.overrideQueueRan++;
+      
+      System.out.println("*** OverrideTestMDB onMessage " + TestStatusBean.overrideQueueRan);
    }
 }

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/QueueTestMDB.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/QueueTestMDB.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/QueueTestMDB.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -25,9 +25,11 @@
 import javax.interceptor.AroundInvoke;
 import javax.interceptor.InvocationContext;
 import javax.ejb.MessageDriven;
+import javax.ejb.MessageDrivenContext;
+import javax.ejb.EJB;
 import javax.annotation.PostConstruct;
 import javax.annotation.PreDestroy;
-import javax.ejb.EJB;
+import javax.annotation.Resource;
 import javax.jms.Message;
 import javax.jms.MessageListener;
 import javax.naming.InitialContext;
@@ -53,28 +55,41 @@
 public class QueueTestMDB implements MessageListener
 {
    private static final Logger log = Logger.getLogger(QueueTestMDB.class);
+   
+   @EJB(beanName="LocalStateless")
+   Stateless localStateless;
+   
+   public int count = 0;
 
-   @EJB Stateless stateful2;
+   @Resource MessageDrivenContext ctx;
    
    public void onMessage(Message recvMsg)
    {
-      System.out.println("QueueTestMDB onMessage");
-      if (stateful2 == null) throw new RuntimeException("FAILED injected item was null!!!");
+      if (ctx == null) throw new RuntimeException("FAILED ON CTX LOOKUP");
+      ++count;
+      ++TestStatusBean.queueRan;
+      TestStatusBean.messageCount = count;
+      
+      System.out.println("+++ QueueTestMDB onMessage " + TestStatusBean.queueRan + " " + count + " " + this);
+      
+      testInjections();
 
-      stateful2.setState("hello");
-
-      TestStatusBean.queueRan++;
-      
       try {
          InitialContext jndiContext = new InitialContext();
-         Stateless stateful = (Stateless)jndiContext.lookup("Stateless");
-         stateful.setState("Set");
-         log.info("After set!!!");
+         Stateless stateless = (Stateless)jndiContext.lookup("Stateless");
+         stateless.setState("Set");
       } catch (Exception e)
       {
          e.printStackTrace();
       }
+      System.out.println("--- QueueTestMDB onMessage " + TestStatusBean.queueRan + " " + count + " " + this);
+
    }
+   
+   protected void testInjections()
+   {
+      localStateless.setState("testing");
+   }
 
    @AroundInvoke
    public Object intercept(InvocationContext ctx) throws Exception

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/StatelessBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/StatelessBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/StatelessBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -23,7 +23,7 @@
 
 import javax.annotation.security.RolesAllowed;
 import javax.ejb.Remote;
-import javax.ejb.Stateful;
+import javax.ejb.Stateless;
 
 import org.jboss.annotation.ejb.RemoteBinding;
 import org.jboss.annotation.security.SecurityDomain;
@@ -34,7 +34,7 @@
  * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
  * @version $Revision$
  */
- at Stateful(name="Stateless")
+ at Stateless(name="Stateless")
 @Remote(org.jboss.ejb3.test.mdb.Stateless.class)
 @RemoteBinding(jndiBinding = "Stateless")
 @SecurityDomain("other")

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/TestStatus.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/TestStatus.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/TestStatus.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -41,10 +41,14 @@
    int nondurableQueueFired();
    
    int defaultedQueueFired();
+   
+   int overrideDefaultedQueueFired();
 
    int topicFired();
    
    int bmtQueueRan();
+   
+   int messageCount();
 
    boolean interceptedTopic();
 

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/TestStatusBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/TestStatusBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/TestStatusBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -42,9 +42,11 @@
    public static int queueRan = 0;
    public static int overrideQueueRan = 0;
    public static int defaultedQueueRan = 0;
+   public static int overrideDefaultedQueueRan = 0;
    public static int nondurableQueueRan = 0;
    public static int topicRan = 0;
    public static int bmtQueueRan = 0;
+   public static int messageCount = 0;
    public static boolean interceptedTopic = false;
    public static boolean interceptedQueue = false;
    public static boolean postConstruct = false;
@@ -56,6 +58,10 @@
       topicRan = 0;
       bmtQueueRan = 0;
       overrideQueueRan = 0;
+      defaultedQueueRan = 0;
+      overrideDefaultedQueueRan = 0;
+      messageCount = 0;
+      nondurableQueueRan = 0;
       interceptedTopic = false;
       interceptedQueue = false;
       postConstruct = false;
@@ -72,6 +78,11 @@
       return overrideQueueRan;
    }
    
+   public int overrideDefaultedQueueFired()
+   {
+      return overrideDefaultedQueueRan;
+   }
+   
    public int defaultedQueueFired()
    {
       return defaultedQueueRan;
@@ -111,4 +122,9 @@
    {
       return preDestroy;
    }
+   
+   public int messageCount()
+   {
+      return messageCount;
+   }
 }

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/TopicTestMDB.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/TopicTestMDB.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/TopicTestMDB.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -25,8 +25,12 @@
 import javax.interceptor.AroundInvoke;
 import javax.interceptor.InvocationContext;
 import javax.ejb.MessageDriven;
+import javax.ejb.MessageDrivenContext;
 import javax.jms.Message;
 import javax.jms.MessageListener;
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.annotation.Resource;
 
 /**
  * Comment
@@ -38,15 +42,17 @@
         {
         @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Topic"),
         @ActivationConfigProperty(propertyName="destination", propertyValue="topic/mdbtest"),
-        @ActivationConfigProperty(propertyName="durability", propertyValue="Durable"),
+        @ActivationConfigProperty(propertyName="subscriptionDurability", propertyValue="Durable"),
         @ActivationConfigProperty(propertyName="subscriptionName", propertyValue="topicmdb")
         })
 public class TopicTestMDB implements MessageListener
 {
+   @Resource MessageDrivenContext ctx;
    public void onMessage(Message recvMsg)
    {
+      if (ctx == null) throw new RuntimeException("FAILED ON CTX LOOKUP");
       TestStatusBean.topicRan++;
-      System.out.println("TopicTestMDB onMessage " + TestStatusBean.topicRan + " " + recvMsg);
+      System.out.println("*** TopicTestMDB onMessage " + TestStatusBean.topicRan + " " + recvMsg);
    }
 
    @AroundInvoke

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/unit/MDBUnitTestCase.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/unit/MDBUnitTestCase.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdb/unit/MDBUnitTestCase.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -1,60 +1,74 @@
 /*
-  * 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.
-  */
+ * 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.ejb3.test.mdb.unit;
 
+import java.util.Enumeration;
+import java.util.List;
+
 import javax.jms.MessageProducer;
 import javax.jms.DeliveryMode;
 import javax.jms.Queue;
+import javax.jms.QueueBrowser;
 import javax.jms.QueueConnection;
 import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueReceiver;
 import javax.jms.QueueSender;
 import javax.jms.QueueSession;
+import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.jms.Topic;
 import javax.jms.TopicConnection;
 import javax.jms.TopicConnectionFactory;
 import javax.jms.TopicSession;
+
+import javax.management.Attribute;
+import javax.management.ObjectName;
+import javax.naming.InitialContext;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+
+import org.jboss.ejb3.InitialContextFactory;
 import org.jboss.ejb3.test.mdb.Stateless;
 import org.jboss.ejb3.test.mdb.TestStatus;
 import org.jboss.logging.Logger;
 import org.jboss.security.SecurityAssociation;
 import org.jboss.security.SimplePrincipal;
 import org.jboss.test.JBossTestCase;
+import org.jboss.util.collection.CollectionsUtil;
+
 import junit.framework.Test;
 
 /**
  * Sample client for the jboss container.
- *
+ * 
  * @author <a href="mailto:bill at burkecentral.com">Bill Burke</a>
  * @version $Id$
  */
-
-public class MDBUnitTestCase
-        extends JBossTestCase
+public class MDBUnitTestCase extends JBossTestCase
 {
-   private static final Logger log = Logger
-   .getLogger(MDBUnitTestCase.class);
+   private static final Logger log = Logger.getLogger(MDBUnitTestCase.class);
 
    static boolean deployed = false;
+
    static int test = 0;
 
    public MDBUnitTestCase(String name)
@@ -63,20 +77,22 @@
       super(name);
 
    }
-   
+
    public void testOverrideQueue() throws Exception
    {
       SecurityAssociation.setPrincipal(new SimplePrincipal("anyone"));
       SecurityAssociation.setCredential("password".toCharArray());
-      
-      TestStatus status = (TestStatus) getInitialContext().lookup("TestStatusBean/remote");
-      status.clear();
+
+      TestStatus status = (TestStatus) getInitialContext().lookup(
+            "TestStatusBean/remote");
+      clear(status);
       QueueConnection cnn = null;
       QueueSender sender = null;
       QueueSession session = null;
 
-      Queue queue = (Queue) getInitialContext().lookup("queue/overridequeuetest");
-      QueueConnectionFactory factory = (QueueConnectionFactory) getInitialContext().lookup("ConnectionFactory");
+      Queue queue = (Queue) getInitialContext().lookup(
+            "queue/overridequeuetest");
+      QueueConnectionFactory factory = getQueueConnectionFactory();
       cnn = factory.createQueueConnection();
       session = cnn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
 
@@ -84,24 +100,28 @@
 
       sender = session.createSender(queue);
       sender.send(msg);
+      session.close();
+      cnn.close();
 
-      Thread.sleep(1000);
+      Thread.sleep(5000);
       assertEquals(1, status.overrideQueueFired());
    }
-   
+
    public void testNondurableQueue() throws Exception
    {
       SecurityAssociation.setPrincipal(new SimplePrincipal("anyone"));
       SecurityAssociation.setCredential("password".toCharArray());
-      
-      TestStatus status = (TestStatus) getInitialContext().lookup("TestStatusBean/remote");
-      status.clear();
+
+      TestStatus status = (TestStatus) getInitialContext().lookup(
+            "TestStatusBean/remote");
+      clear(status);
       QueueConnection cnn = null;
       QueueSender sender = null;
       QueueSession session = null;
 
-      Queue queue = (Queue) getInitialContext().lookup("queue/nondurablemdbtest");
-      QueueConnectionFactory factory = (QueueConnectionFactory) getInitialContext().lookup("ConnectionFactory");
+      Queue queue = (Queue) getInitialContext().lookup(
+            "queue/nondurablemdbtest");
+      QueueConnectionFactory factory = getQueueConnectionFactory();
       cnn = factory.createQueueConnection();
       session = cnn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
 
@@ -111,24 +131,28 @@
       sender = session.createSender(queue);
       sender.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
       sender.send(msg);
+      session.close();
+      cnn.close();
 
-      Thread.sleep(1000);
+      Thread.sleep(2000);
       assertEquals(1, status.nondurableQueueFired());
    }
-   
+
    public void testDefaultedQueue() throws Exception
    {
       SecurityAssociation.setPrincipal(new SimplePrincipal("anyone"));
       SecurityAssociation.setCredential("password".toCharArray());
-      
-      TestStatus status = (TestStatus) getInitialContext().lookup("TestStatusBean/remote");
-      status.clear();
+
+      TestStatus status = (TestStatus) getInitialContext().lookup(
+            "TestStatusBean/remote");
+      clear(status);
       QueueConnection cnn = null;
       QueueSender sender = null;
       QueueSession session = null;
 
-      Queue queue = (Queue) getInitialContext().lookup("queue/defaultedmdbtest");
-      QueueConnectionFactory factory = (QueueConnectionFactory) getInitialContext().lookup("ConnectionFactory");
+      Queue queue = (Queue) getInitialContext()
+            .lookup("queue/defaultedmdbtest");
+      QueueConnectionFactory factory = getQueueConnectionFactory();
       cnn = factory.createQueueConnection();
       session = cnn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
 
@@ -136,24 +160,55 @@
 
       sender = session.createSender(queue);
       sender.send(msg);
+      session.close();
+      cnn.close();
 
-      Thread.sleep(1000);
+      Thread.sleep(2000);
       assertEquals(1, status.defaultedQueueFired());
    }
 
-   public void testQueue() throws Exception
+   public void testOverrideDefaultedQueue() throws Exception
    {
       SecurityAssociation.setPrincipal(new SimplePrincipal("anyone"));
       SecurityAssociation.setCredential("password".toCharArray());
-      
-      TestStatus status = (TestStatus) getInitialContext().lookup("TestStatusBean/remote");
-      status.clear();
+
+      TestStatus status = (TestStatus) getInitialContext().lookup(
+            "TestStatusBean/remote");
+      clear(status);
       QueueConnection cnn = null;
       QueueSender sender = null;
       QueueSession session = null;
 
+      Queue queue = (Queue) getInitialContext().lookup(
+            "queue/overridedefaultedmdbtest");
+      QueueConnectionFactory factory = getQueueConnectionFactory();
+      cnn = factory.createQueueConnection();
+      session = cnn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+
+      TextMessage msg = session.createTextMessage("Hello World");
+
+      sender = session.createSender(queue);
+      sender.send(msg);
+      session.close();
+      cnn.close();
+
+      Thread.sleep(2000);
+      assertEquals(1, status.overrideDefaultedQueueFired());
+   }
+
+   public void testQueue() throws Exception
+   {
+      setSecurity("anyone", "password");
+
+      TestStatus status = (TestStatus) getInitialContext().lookup(
+            "TestStatusBean/remote");
+      clear(status);
+      QueueConnection cnn = null;
+      QueueSender sender = null;
+      QueueSession session = null;
+
       Queue queue = (Queue) getInitialContext().lookup("queue/mdbtest");
-      QueueConnectionFactory factory = (QueueConnectionFactory) getInitialContext().lookup("ConnectionFactory");
+      QueueConnectionFactory factory = getQueueConnectionFactory();
       cnn = factory.createQueueConnection();
       session = cnn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
 
@@ -161,16 +216,23 @@
 
       sender = session.createSender(queue);
       sender.send(msg);
+      sender.send(msg);
+      sender.send(msg);
+      sender.send(msg);
+      sender.send(msg);
+      session.close();
+      cnn.close();
 
-      Thread.sleep(1000);
-      assertEquals(1, status.queueFired());
+      Thread.sleep(2000);
+      assertEquals(5, status.queueFired());
       assertTrue(status.interceptedQueue());
       assertTrue(status.postConstruct());
+      assertEquals(5, status.messageCount());
 
-      //TODO: Figure out how to test preDestroy gets invoked
-      //assertTrue(status.preDestroy());
-      
-      Stateless stateless = (Stateless)getInitialContext().lookup("Stateless");
+      // TODO: Figure out how to test preDestroy gets invoked
+      // assertTrue(status.preDestroy());
+
+      Stateless stateless = (Stateless) getInitialContext().lookup("Stateless");
       assertNotNull(stateless);
       String state = stateless.getState();
       assertEquals("Set", state);
@@ -178,14 +240,15 @@
 
    public void testTopic() throws Exception
    {
-      TestStatus status = (TestStatus) getInitialContext().lookup("TestStatusBean/remote");
-      status.clear();
+      TestStatus status = (TestStatus) getInitialContext().lookup(
+            "TestStatusBean/remote");
+      clear(status);
       TopicConnection cnn = null;
       MessageProducer sender = null;
       TopicSession session = null;
 
       Topic topic = (Topic) getInitialContext().lookup("topic/mdbtest");
-      TopicConnectionFactory factory = (TopicConnectionFactory) getInitialContext().lookup("ConnectionFactory");
+      TopicConnectionFactory factory = getTopicConnectionFactory();
       cnn = factory.createTopicConnection();
       session = cnn.createTopicSession(false, QueueSession.AUTO_ACKNOWLEDGE);
 
@@ -193,39 +256,235 @@
 
       sender = session.createProducer(topic);
       sender.send(msg);
+      session.close();
+      cnn.close();
 
-      Thread.sleep(1000);
+      Thread.sleep(2000);
       assertEquals(1, status.topicFired());
       assertTrue(status.interceptedTopic());
       assertFalse(status.postConstruct());
       assertFalse(status.preDestroy());
-   } 
-   
+   }
+
    public void testRuntimeException() throws Exception
    {
-      TestStatus status = (TestStatus) getInitialContext().lookup("TestStatusBean/remote");
-      status.clear();
+      TestStatus status = (TestStatus) getInitialContext().lookup(
+            "TestStatusBean/remote");
+      clear(status);
       QueueConnection cnn = null;
       QueueSender sender = null;
       QueueSession session = null;
 
       Queue queue = (Queue) getInitialContext().lookup("queue/bmtmdbtest");
-      QueueConnectionFactory factory = (QueueConnectionFactory) getInitialContext().lookup("ConnectionFactory");
+      QueueConnectionFactory factory = getQueueConnectionFactory();
       cnn = factory.createQueueConnection();
       session = cnn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
 
       TextMessage msg = session.createTextMessage("Hello World");
+      msg.setIntProperty("JMS_JBOSS_REDELIVERY_LIMIT", 1);
 
       sender = session.createSender(queue);
       sender.send(msg);
+      session.close();
+      cnn.close();
 
-      Thread.sleep(1000);
+      Thread.sleep(2000);
       assertEquals(1, status.bmtQueueRan());
    }
 
+   /**
+    * Test that expired messages are moved to a separate queue.
+    */
+   public void testExpiredMessagesMove() throws Exception
+   {
+      QueueConnection connection = null;
+      QueueSender sender = null;
+      QueueSession session = null;
+
+      QueueConnectionFactory factory = getQueueConnectionFactory();
+      connection = factory.createQueueConnection();
+      connection.start();
+      session = connection.createQueueSession(false,
+            QueueSession.AUTO_ACKNOWLEDGE);
+
+      Queue queue = (Queue) getInitialContext().lookup("queue/expirytest");
+      sender = session.createSender(queue);
+
+      Queue dlq = (Queue) getInitialContext().lookup("queue/DLQ");
+
+      ObjectName dlqName = new ObjectName(
+            "jboss.mq.destination:service=Queue,name=DLQ");
+      getServer().invoke(dlqName, "removeAllMessages", null, null);
+
+      long now = System.currentTimeMillis();
+
+      TextMessage message = session.createTextMessage();
+      message.setStringProperty("foo", "bar");
+      message.setStringProperty("null", null);
+      String text = "expire on server";
+      message.setText(text);
+
+      sender.send(message, DeliveryMode.PERSISTENT, 4, 1);
+
+      Thread.sleep(1000);
+
+      assertSize(session, queue, 0);
+      assertSize(session, dlq, 1);
+
+      QueueReceiver receiver = session.createReceiver(dlq);
+      message = (TextMessage) receiver.receiveNoWait();
+      assertNotNull(message);
+      assertEquals("QUEUE.expirytest", message
+            .getStringProperty("JBOSS_ORIG_DESTINATION"));
+      assertTrue(message.getLongProperty("JBOSS_ORIG_EXPIRATION") > now);
+      assertEquals(0L, message.getJMSExpiration());
+      assertEquals(text, message.getText());
+      assertEquals("bar", message.getStringProperty("foo"));
+      assertNull(message.getStringProperty("null"));
+
+      sender.close();
+      receiver.close();
+
+      session.close();
+      connection.close();
+   }
+
+   public void testDlqMaxResent() throws Exception
+   {
+      QueueConnection connection = null;
+      QueueSender sender = null;
+      QueueSession session = null;
+
+      QueueConnectionFactory factory = getQueueConnectionFactory();
+      connection = factory.createQueueConnection();
+      connection.start();
+      session = connection.createQueueSession(false,
+            QueueSession.AUTO_ACKNOWLEDGE);
+
+      Queue queue = (Queue) getInitialContext().lookup("queue/dlqtest");
+      sender = session.createSender(queue);
+
+      Queue dlq = (Queue) getInitialContext().lookup("queue/DLQ");
+
+      ObjectName dlqName = new ObjectName(
+            "jboss.mq.destination:service=Queue,name=DLQ");
+      getServer().invoke(dlqName, "removeAllMessages", null, null);
+
+      TextMessage message = session.createTextMessage();
+      message.setStringProperty("foo", "bar");
+      message.setStringProperty("null", null);
+      String text = "expire on server";
+      message.setText(text);
+
+      sender.send(message);
+
+      Thread.sleep(1000);
+
+      assertSize(session, queue, 0);
+      assertSize(session, dlq, 1);
+
+      QueueReceiver receiver = session.createReceiver(dlq);
+      message = (TextMessage) receiver.receiveNoWait();
+      assertNotNull(message);
+      assertEquals("QUEUE.dlqtest", message
+            .getStringProperty("JBOSS_ORIG_DESTINATION"));
+      assertEquals(0L, message.getJMSExpiration());
+      assertEquals(text, message.getText());
+      assertEquals("bar", message.getStringProperty("foo"));
+      assertNull(message.getStringProperty("null"));
+
+      sender.close();
+      receiver.close();
+
+      session.close();
+      connection.close();
+   }
+
+   private List list(QueueSession session, Queue queue) throws Exception
+   {
+      QueueBrowser browser = session.createBrowser(queue);
+      Enumeration e = browser.getEnumeration();
+      List messages = CollectionsUtil.list(e);
+
+      browser.close();
+
+      return messages;
+   }
+
+   private int size(QueueSession session, Queue queue) throws Exception
+   {
+      List l = list(session, queue);
+      return l.size();
+   }
+
+   private void assertSize(QueueSession session, Queue queue, int size)
+         throws Exception
+   {
+      assertEquals(size, size(session, queue));
+   }
+
+   protected QueueConnectionFactory getQueueConnectionFactory()
+         throws Exception
+   {
+      try
+      {
+         return (QueueConnectionFactory) getInitialContext().lookup(
+               "ConnectionFactory");
+      } catch (NamingException e)
+      {
+         return (QueueConnectionFactory) getInitialContext().lookup(
+               "java:/ConnectionFactory");
+      }
+   }
+
+   protected TopicConnectionFactory getTopicConnectionFactory()
+         throws Exception
+   {
+      try
+      {
+         return (TopicConnectionFactory) getInitialContext().lookup(
+               "ConnectionFactory");
+      } catch (NamingException e)
+      {
+         return (TopicConnectionFactory) getInitialContext().lookup(
+               "java:/ConnectionFactory");
+      }
+   }
+
+   protected void clear(TestStatus status)
+   {
+      status.clear();
+      assertEquals(0, status.bmtQueueRan());
+      assertEquals(0, status.defaultedQueueFired());
+      assertEquals(0, status.messageCount());
+      assertEquals(0, status.nondurableQueueFired());
+      assertEquals(0, status.overrideDefaultedQueueFired());
+      assertEquals(0, status.overrideQueueFired());
+      assertEquals(0, status.queueFired());
+      assertEquals(0, status.topicFired());
+      assertFalse(status.interceptedQueue());
+      assertFalse(status.interceptedTopic());
+      assertFalse(status.postConstruct());
+      assertFalse(status.preDestroy());
+   }
+
+   protected void setSecurity(String user, String password)
+   {
+      SecurityAssociation.setPrincipal(new SimplePrincipal(user));
+      SecurityAssociation.setCredential(password.toCharArray());
+
+      InitialContextFactory.setSecurity(user, password);
+   }
+
+   protected InitialContext getInitialContext() throws Exception
+   {
+      return InitialContextFactory.getInitialContext();
+   }
+
    public static Test suite() throws Exception
    {
-      return getDeploySetup(MDBUnitTestCase.class, "mdbtest-service.xml, mdb-test.jar");
+      return getDeploySetup(MDBUnitTestCase.class,
+            "mdbtest-service.xml, mdb-test.jar");
    }
 
-}
+}
\ No newline at end of file

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/Entity.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/Entity.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/Entity.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,58 @@
+/*
+  * 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.ejb3.test.mdbtransactions;
+
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+ at javax.persistence.Entity
+ at Table(name = "ENTITY")
+public class Entity implements java.io.Serializable
+{
+   private Long id;
+   private String name;
+
+   @Id
+   //@GeneratedValue(strategy= GenerationType.IDENTITY)
+   public Long getId()
+   {
+      return id;
+   }
+
+   public void setId(Long id)
+   {
+      this.id = id;
+   }
+
+   public String getName()
+   {
+      return name;
+   }
+
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/QueueBean21.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/QueueBean21.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/QueueBean21.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,58 @@
+/*
+  * 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.ejb3.test.mdbtransactions;
+
+import javax.ejb.MessageDrivenBean;
+import javax.ejb.MessageDrivenContext;
+import javax.ejb.EJBException;
+
+import javax.jms.MessageListener;
+import javax.jms.Message;
+
+import org.jboss.logging.Logger;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+public class QueueBean21 implements MessageDrivenBean, MessageListener
+{
+   private static final Logger log = Logger.getLogger(QueueBean21.class);
+   
+    private MessageDrivenContext ctx = null;
+    
+    public void onMessage(Message message)
+    {
+       log.info("***** onMessage " + message);
+    }
+    
+    public void setMessageDrivenContext(MessageDrivenContext ctx)
+       throws EJBException
+    {
+       this.ctx = ctx;
+    }
+    
+    public void ejbCreate(){}
+
+    public void ejbRemove(){}
+} 
+
+

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/QueueTestMDB.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/QueueTestMDB.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/QueueTestMDB.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,64 @@
+/*
+  * 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.ejb3.test.mdbtransactions;
+
+import javax.ejb.ActivationConfigProperty;
+import javax.ejb.EJB;
+import javax.ejb.MessageDriven;
+import javax.jms.Message;
+import javax.jms.MessageListener;
+import javax.jms.ObjectMessage;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import org.jboss.logging.Logger;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+ at MessageDriven(activationConfig =
+        {
+        @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
+        @ActivationConfigProperty(propertyName="destination", propertyValue="queue/mdbtest")
+        })
+public class QueueTestMDB implements MessageListener
+{
+   private static final Logger log = Logger.getLogger(QueueTestMDB.class);
+   
+   private @PersistenceContext EntityManager manager;
+   @EJB StatelessFacade stateless;
+   
+   public void onMessage(Message recvMsg)
+   {    
+      try
+      {
+         ObjectMessage message = (ObjectMessage)recvMsg;
+         Entity entity = (Entity)message.getObject(); 
+         stateless.persist(entity);
+         ++TestStatusBean.messageCount;
+      }
+      catch (Throwable t)
+      {
+         TestStatusBean.caughtRollback = true;
+      }
+   }
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/RollbackQueueTestMDB.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/RollbackQueueTestMDB.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/RollbackQueueTestMDB.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,63 @@
+/*
+  * 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.ejb3.test.mdbtransactions;
+
+import javax.ejb.ActivationConfigProperty;
+import javax.ejb.EJB;
+import javax.ejb.MessageDriven;
+import javax.jms.Message;
+import javax.jms.MessageListener;
+import javax.jms.ObjectMessage;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import org.jboss.logging.Logger;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+ at MessageDriven(activationConfig =
+        {
+        @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
+        @ActivationConfigProperty(propertyName="destination", propertyValue="queue/rollbackmdbtest")
+        })
+public class RollbackQueueTestMDB implements MessageListener
+{
+   private static final Logger log = Logger.getLogger(QueueTestMDB.class);
+   
+   private @PersistenceContext EntityManager manager;
+   @EJB StatelessFacade stateless;
+   
+   public void onMessage(Message recvMsg)
+   {    
+      try
+      {
+         ObjectMessage message = (ObjectMessage)recvMsg;
+         Entity entity = (Entity)message.getObject();
+         manager.remove(entity);
+      }
+      catch (Throwable t)
+      {
+          t.printStackTrace();
+      }
+   }
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/StatelessFacade.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/StatelessFacade.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/StatelessFacade.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,32 @@
+/*
+  * 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.ejb3.test.mdbtransactions;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+public interface StatelessFacade
+{
+   void clear(Entity entity);
+   
+   void persist(Entity entity);
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/StatelessFacadeBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/StatelessFacadeBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/StatelessFacadeBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,73 @@
+/*
+  * 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.ejb3.test.mdbtransactions;
+
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import org.jboss.annotation.ejb.RemoteBinding;
+import org.jboss.logging.Logger;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+ at Stateless(name="Stateless")
+ at Remote(StatelessFacade.class)
+ at RemoteBinding(jndiBinding = "StatelessFacade")
+public class StatelessFacadeBean implements StatelessFacade
+{
+   private static final Logger log = Logger.getLogger(StatelessFacadeBean.class);
+   
+   private @PersistenceContext EntityManager manager;
+   
+   @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
+   public void clear(Entity entity)
+   {
+      try
+      {
+         entity = manager.find(Entity.class, entity.getId());
+         if (entity != null)
+            manager.remove(entity);
+      }
+      catch (Throwable t)
+      {
+         t.printStackTrace();
+      }
+   }
+   
+   @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
+   public void persist(Entity entity)
+   {
+      try
+      {
+         manager.persist(entity);
+      }
+      catch (Throwable t)
+      {
+         t.printStackTrace();
+      }
+   }
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/TestStatus.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/TestStatus.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/TestStatus.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,34 @@
+/*
+  * 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.ejb3.test.mdbtransactions;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+public interface TestStatus
+{
+   boolean caughtRollback();
+   
+   int messageCount();
+   
+   void clear();
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/TestStatusBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/TestStatusBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/TestStatusBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,56 @@
+/*
+  * 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.ejb3.test.mdbtransactions;
+
+import javax.ejb.Stateless;
+import javax.ejb.Remote;
+
+import org.jboss.logging.Logger;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+ at Stateless
+ at Remote(TestStatus.class)
+public class TestStatusBean implements TestStatus
+{
+   private static final Logger log = Logger.getLogger(TestStatusBean.class);
+   
+   public static boolean caughtRollback = false;
+   public static int messageCount = 0;
+
+   public boolean caughtRollback()
+   {
+      return caughtRollback;
+   }
+   
+   public int messageCount()
+   {
+      return messageCount;
+   }
+   
+   public void clear()
+   {
+      caughtRollback = false;
+      messageCount = 0;
+   }
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/unit/MDBUnitTestCase.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/unit/MDBUnitTestCase.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/unit/MDBUnitTestCase.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,159 @@
+/*
+ * 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.ejb3.test.mdbtransactions.unit;
+
+import javax.jms.Message;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueReceiver;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.jms.ObjectMessage;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.jboss.ejb3.InitialContextFactory;
+import org.jboss.ejb3.test.mdbtransactions.Entity;
+import org.jboss.ejb3.test.mdbtransactions.StatelessFacade;
+import org.jboss.ejb3.test.mdbtransactions.TestStatus;
+import org.jboss.logging.Logger;
+import org.jboss.test.JBossTestCase;
+
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+public class MDBUnitTestCase extends JBossTestCase
+{
+   private static final Logger log = Logger.getLogger(MDBUnitTestCase.class);
+
+   static boolean deployed = false;
+
+   static int test = 0;
+
+   public MDBUnitTestCase(String name)
+   {
+
+      super(name);
+
+   }
+
+   public void testMdbTransactions() throws Exception
+   {
+      TestStatus status = (TestStatus)getInitialContext().lookup("TestStatusBean/remote");
+      status.clear();
+      
+      sendMessages("queue/mdbtest", 2);
+      
+      Thread.sleep(5000);
+      
+      assertEquals(1, status.messageCount());
+      assertTrue(status.caughtRollback());
+   }
+   
+   protected void sendMessages(String queueName, int numMessages) throws Exception
+   {
+      QueueConnection connection = null;
+      QueueSender sender = null;
+      QueueSession session = null;
+
+      Queue queue = (Queue) getInitialContext().lookup(
+            queueName);
+      QueueConnectionFactory factory = getQueueConnectionFactory();
+      connection = factory.createQueueConnection();
+      connection.start();
+      session = connection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+      
+      QueueReceiver receiver = session.createReceiver(queue);
+      Message message = receiver.receiveNoWait();
+      while (message != null)
+         message = receiver.receiveNoWait();
+
+      Entity entity = new Entity();
+      entity.setName("test-entity");
+      entity.setId(1234L);
+      
+      StatelessFacade stateless = (StatelessFacade)getInitialContext().lookup("StatelessFacade");
+      stateless.clear(entity);
+      
+      ObjectMessage msg = session.createObjectMessage(entity);
+
+      sender = session.createSender(queue);
+      
+      for (int i = 0 ; i < numMessages ; ++i)
+         sender.send(msg);
+ 
+      session.close();
+      connection.close();
+   }
+   
+   public void testRollback() throws Exception
+   {
+      TestStatus status = (TestStatus)getInitialContext().lookup("TestStatusBean/remote");
+      status.clear();
+      
+      sendMessages("queue/rollbackmdbtest", 1);
+      
+      Thread.sleep(5000);
+      
+      Queue queue = (Queue) getInitialContext().lookup("queue/DLQ");
+      QueueConnectionFactory factory = getQueueConnectionFactory();
+      QueueConnection connection = factory.createQueueConnection();
+      connection.start();
+      QueueSession session = connection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+      QueueReceiver receiver = session.createReceiver(queue);
+      Message message = receiver.receiveNoWait();
+      assertNotNull(message);
+      
+      session.close();
+      connection.close();
+   }
+   
+   protected QueueConnectionFactory getQueueConnectionFactory()
+      throws Exception
+   {
+      try
+      {
+         return (QueueConnectionFactory) getInitialContext().lookup(
+               "ConnectionFactory");
+      } catch (NamingException e)
+      {
+         return (QueueConnectionFactory) getInitialContext().lookup(
+               "java:/ConnectionFactory");
+      }
+   }
+   
+   protected InitialContext getInitialContext() throws Exception
+   {
+      return InitialContextFactory.getInitialContext();
+   }
+
+   public static Test suite() throws Exception
+   {
+      return getDeploySetup(MDBUnitTestCase.class,
+            "mdbtransactionstest-service.xml, mdbtransactions-test.jar");
+   }
+
+}
\ No newline at end of file

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/naming/bad/BadFieldMethodBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/naming/bad/BadFieldMethodBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/naming/bad/BadFieldMethodBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -50,9 +50,10 @@
       System.out.println("setKey, key="+key);
    }
 
-   public void ping()
+   public String getKey()
    {
       System.out.println("ping, key="+key);
+      return key;
    }
 
    @Remove

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/naming/bad/BadInjector.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/naming/bad/BadInjector.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/naming/bad/BadInjector.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -32,6 +32,6 @@
 @Remote
 public interface BadInjector
 {
-   public void ping();
+   public String getKey();
    public void remove();
 }

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/naming/unit/BadInjectionsUnitTestCase.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/naming/unit/BadInjectionsUnitTestCase.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/naming/unit/BadInjectionsUnitTestCase.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -58,7 +58,7 @@
       Object ref = ctx.lookup("BadFieldMethodBean/remote");
       log.info("Found BadInjector");
       BadInjector bean = (BadInjector) ref;
-      bean.ping();
+      assertEquals("BadFieldMethodBean", bean.getKey());
       bean.remove();
       super.undeploy("bad-field-method.jar");
    }

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/naming/unit/BindFailureTestCase.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/naming/unit/BindFailureTestCase.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/naming/unit/BindFailureTestCase.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -51,12 +51,16 @@
    {
       try
       {
+// test was originally to catch redeploying with the same jndi name, but now we are
+// using rebind instead of bind
          this.redeploy("bind-failure-test.jar");
-         fail();
+         this.redeploy("bind-failure-test.jar");
+//         fail();
       } catch (Exception e)
       {
          log.info("caught " + e.getClass().getName() + " " + e.getMessage() + " " + e.getCause());
          System.out.println("caught " + e.getClass().getName() + " " + e.getMessage() + " " + e.getCause());
+         fail();
       }
       
       this.undeploy("bind-failure-test.jar");
@@ -66,7 +70,6 @@
    public static Test suite() throws Exception
    {
       TestSuite suite = new TestSuite();
-      suite.addTest(new TestSuite(BindFailureTestCase.class));
       return suite;
    }
 

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/reference21_30/Session30Bean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/reference21_30/Session30Bean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/reference21_30/Session30Bean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -22,8 +22,11 @@
 package org.jboss.ejb3.test.reference21_30;
 
 import javax.naming.*;
+import javax.ejb.EJB;
 import javax.ejb.EJBs;
-import javax.ejb.*;
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+import javax.ejb.Local;
 
 import org.jboss.annotation.ejb.LocalBinding;
 import org.jboss.annotation.ejb.RemoteBinding;
@@ -39,7 +42,7 @@
 @Local(LocalSession30.class)
 @RemoteBinding(jndiBinding = "Session30")
 @LocalBinding(jndiBinding = "LocalSession30")
- at EJBs({@EJB(name="injected", businessInterface=org.jboss.ejb3.test.reference21_30.Session21.class, beanName="Session21")})
+ at EJBs({@EJB(name="injected", beanInterface=org.jboss.ejb3.test.reference21_30.Session21.class, beanName="Session21")})
 public class Session30Bean 
 {
    private static final Logger log = Logger.getLogger(Session30Bean.class);

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/schema/unit/SchemaTestCase.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/schema/unit/SchemaTestCase.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/schema/unit/SchemaTestCase.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -108,6 +108,7 @@
       DocumentBuilder builder = getDocumentBuilder();
       
       validateFile("../src/resources/test/bank/META-INF/jboss.xml", builder);
+      validateFile("../src/resources/test/clusteredsession/META-INF/jboss.xml", builder);
       validateFile("../src/resources/test/consumer/META-INF/jboss.xml", builder);
       validateFile("../src/resources/test/dd/mdb/META-INF/jboss.xml", builder);
       validateFile("../src/resources/test/dd/web/META-INF/jboss.xml", builder);
@@ -122,6 +123,8 @@
       validateFile("../src/resources/test/reference21_30/META-INF/jboss-reference.xml", builder);
       validateFile("../src/resources/test/securitydomain/META-INF/jboss.xml", builder);
       validateFile("../src/resources/test/service/META-INF/jboss.xml", builder);
+      validateFile("../src/resources/test/ssladvanced/META-INF/jboss.xml", builder);
+      validateFile("../src/resources/test/strictpool/META-INF/jboss.xml", builder);
    }
    
    public void testTutorialJBoss() throws Exception
@@ -134,6 +137,7 @@
       validateFile("../docs/tutorial/jboss_deployment_descriptor/META-INF/jboss.xml", builder);
       validateFile("../docs/tutorial/jboss_resource_ref/META-INF/jboss.xml", builder);
       validateFile("../docs/tutorial/jca/inflow/swiftmq/resources/META-INF/jboss.xml", builder);
+      validateFile("../docs/tutorial/mdb_deployment_descriptor/META-INF/jboss.xml", builder);
       validateFile("../docs/tutorial/service_deployment_descriptor/META-INF/jboss.xml", builder);
       validateFile("../docs/tutorial/stateful_deployment_descriptor/META-INF/jboss.xml", builder);
       validateFile("../docs/tutorial/stateless_deployment_descriptor/META-INF/jboss.xml", builder);

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/CalledSession.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/CalledSession.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/CalledSession.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -33,7 +33,7 @@
    /** This method should call echo on a StatelessSessionLocal */
    public String invokeEcho(String arg);
    /** This method should call invokeEcho on another CalledSession */
-   public void callEcho();
+   public String callEcho();
    /**
     * A method that does nothing but is not assiged a
     * method-permission in the ejb-jar.xml descriptor

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/CallerBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/CallerBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/CallerBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -44,14 +44,12 @@
  * @version $Revision$
  */
 @Stateless(name="CallerBean")
- at Remote(org.jboss.ejb3.test.security.CalledSession.class)
+ at Remote(CalledSession.class)
 @RemoteBinding(jndiBinding = "spec.CallerBean")
 @RunAs("InternalRole")
 @RolesAllowed({"Echo"})
 @SecurityDomain("spec-test")
-//@EJBs({@EJB(name="Caller2", businessInterface=org.jboss.ejb3.test.security.CalledSession.class, beanName="CallerBean2"),
-//   @EJB(name="Callee", businessInterface=org.jboss.ejb3.test.security.StatelessSessionLocal.class, beanName="CalleeBean")})
-public class CallerBean 
+public class CallerBean implements CalledSession
 {
    private static Category log = Category.getInstance(CallerBean.class);
    @Resource  SessionContext sessionContext;
@@ -105,7 +103,7 @@
    /**
     * This method should call invokeEcho on another CalledSession
     */
-   public void callEcho()
+   public String callEcho()
    {
       try
       {
@@ -114,6 +112,9 @@
          CalledSession bean = (CalledSession)ic.lookup(Container.ENC_CTX_NAME + "/env/ejb/Caller2");
          String echo = bean.invokeEcho("Level1");
          log.info("echo, callee.invokeEcho=" + echo);
+         
+         String principal = sessionContext.getCallerPrincipal().getName();
+         return principal;
       }
       catch (Exception e)
       {

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/CallerBean2.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/CallerBean2.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/CallerBean2.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -45,12 +45,12 @@
  * @version $Revision$
  */
 @Stateless(name="CallerBean2")
- at Remote(org.jboss.ejb3.test.security.CalledSession.class)
+ at Remote(CalledSession.class)
 @RemoteBinding(jndiBinding = "spec.Level2CallerBean")
 @RolesAllowed({"InternalRole"})
 @SecurityDomain("spec-test")
- at EJBs({@EJB(name="Callee", businessInterface=org.jboss.ejb3.test.security.StatelessSessionLocal.class, beanName="CalleeBean")})
-public class CallerBean2 
+ at EJBs({@EJB(name="Callee", beanInterface=org.jboss.ejb3.test.security.StatelessSessionLocal.class, beanName="CalleeBean")})
+public class CallerBean2 implements CalledSession
 {
    private static Category log = Category.getInstance(CallerBean2.class);
    @Resource  SessionContext sessionContext;
@@ -100,7 +100,7 @@
    /**
     * This method should call invokeEcho on another CalledSession
     */
-   public void callEcho()
+   public String callEcho()
    {
       try
       {
@@ -111,6 +111,9 @@
          CalledSession bean = (CalledSession)ic.lookup(Container.ENC_CTX_NAME + "/env/ejb/Caller");
          String echo = bean.invokeEcho("Level2");
          log.info("echo, callee.invokeEcho=" + echo);
+         
+         String principal = sessionContext.getCallerPrincipal().getName();
+         return principal;
       }
       catch (Exception e)
       {

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/CallerFacadeBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/CallerFacadeBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/CallerFacadeBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -22,10 +22,14 @@
 package org.jboss.ejb3.test.security;
 
 import java.security.Principal;
+import javax.ejb.EJB;
 import javax.ejb.EJBs;
 import javax.annotation.Resource;
 import javax.annotation.security.RolesAllowed;
-import javax.ejb.*;
+import javax.ejb.EJBException;
+import javax.ejb.Remote;
+import javax.ejb.SessionContext;
+import javax.ejb.Stateless;
 import javax.naming.InitialContext;
 import org.apache.log4j.Category;
 import org.jboss.annotation.ejb.RemoteBinding;
@@ -42,7 +46,7 @@
 @RemoteBinding(jndiBinding = "spec.CallerFacadeBean-testRunAsSFSB")
 @SecurityDomain("spec-test")
 @RolesAllowed({"Echo"})
- at EJBs({@EJB(name="CalledSessionLocal", businessInterface=org.jboss.ejb3.test.security.CalledSessionLocal.class, beanName="CallerFacadeTargetSFSB")})
+ at EJBs({@EJB(name="CalledSessionLocal", beanInterface=org.jboss.ejb3.test.security.CalledSessionLocal.class, beanName="CallerFacadeTargetSFSB")})
 public class CallerFacadeBean 
 {
    private static Category log = Category.getInstance(CallerFacadeBean.class);

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/FacadeTargetBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/FacadeTargetBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/FacadeTargetBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -25,7 +25,11 @@
 import javax.ejb.EJB;
 import javax.ejb.EJBs;
 import javax.annotation.Resource;
-import javax.ejb.*;
+import javax.ejb.EJBException;
+import javax.ejb.Local;
+import javax.ejb.Remote;
+import javax.ejb.SessionContext;
+import javax.ejb.Stateful;
 import javax.naming.InitialContext;
 import org.apache.log4j.Category;
 import org.jboss.annotation.ejb.RemoteBinding;
@@ -42,7 +46,7 @@
 @Remote(org.jboss.ejb3.test.security.CalledSession.class)
 @RemoteBinding(jndiBinding="spec.CallerFacadeTargetSFSB")
 @SecurityDomain("spec-test")
- at EJBs({@EJB(name="StatelessSessionLocal", businessInterface=org.jboss.ejb3.test.security.StatelessSessionLocal.class, beanName="CalleeBean")})
+ at EJBs({@EJB(name="StatelessSessionLocal", beanInterface=org.jboss.ejb3.test.security.StatelessSessionLocal.class, beanName="CalleeBean")})
 public class FacadeTargetBean
 {
    private static Category log = Category.getInstance(FacadeTargetBean.class);

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/Level1CallerBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/Level1CallerBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/Level1CallerBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -22,11 +22,15 @@
 package org.jboss.ejb3.test.security;
 
 import java.security.Principal;
+import javax.ejb.EJB;
 import javax.ejb.EJBs;
 import javax.annotation.Resource;
 import javax.annotation.security.RolesAllowed;
 import javax.annotation.security.RunAs;
-import javax.ejb.*;
+import javax.ejb.EJBException;
+import javax.ejb.Remote;
+import javax.ejb.SessionContext;
+import javax.ejb.Stateless;
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import org.apache.log4j.Category;
@@ -40,16 +44,16 @@
  * @version $Revision$
  */
 @Stateless(name="Level1CallerBean")
- at Remote(org.jboss.ejb3.test.security.CalledSession.class)
+ at Remote(CalledSession.class)
 @RemoteBinding(jndiBinding = "spec.Level1CallerBean")
 @RunAs("InternalRole")
 @RolesAllowed({"Echo"})
 @SecurityDomain("spec-test")
- at EJBs({@EJB(name="Caller2", businessInterface=org.jboss.ejb3.test.security.CalledSession.class, beanName="CallerBean2"),
-   @EJB(name="Callee", businessInterface=org.jboss.ejb3.test.security.StatelessSessionLocal.class, beanName="CalleeBean")})
-public class Level1CallerBean 
+ at EJBs({@EJB(name="Caller2", beanInterface=org.jboss.ejb3.test.security.CalledSession.class, beanName="CallerBean2"),
+   @EJB(name="Callee", beanInterface=org.jboss.ejb3.test.security.StatelessSessionLocal.class, beanName="CalleeBean")})
+public class Level1CallerBean implements CalledSession
 {
-   private static Category log = Category.getInstance(CallerBean.class);
+   private static Category log = Category.getInstance(Level1CallerBean.class);
    @Resource  SessionContext sessionContext;
 
    /**
@@ -98,7 +102,7 @@
    /**
     * This method should call invokeEcho on another CalledSession
     */
-   public void callEcho()
+   public String callEcho()
    {
       try
       {
@@ -107,6 +111,9 @@
          CalledSession bean = (CalledSession)ic.lookup(Container.ENC_CTX_NAME + "/env/Caller2");
          String echo = bean.invokeEcho("Level1");
          log.info("echo, callee.invokeEcho=" + echo);
+         
+         String principal = sessionContext.getCallerPrincipal().getName();
+         return principal;
       }
       catch (Exception e)
       {

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/PublicSessionBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/PublicSessionBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/PublicSessionBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -45,7 +45,7 @@
 @RemoteBinding(jndiBinding = "spec.PublicSession")
 @SecurityDomain("spec-test")
 @RolesAllowed({"Echo"})
- at EJBs({@EJB(name="PrivateSession", businessInterface=org.jboss.ejb3.test.security.Session.class, beanName="PrivateSession")})
+ at EJBs({@EJB(name="PrivateSession", beanInterface=org.jboss.ejb3.test.security.Session.class, beanName="PrivateSession")})
 public class PublicSessionBean
 {
    @Resource SessionContext sessionContext;

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/PublicSessionFacade.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/PublicSessionFacade.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/PublicSessionFacade.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -45,7 +45,7 @@
 @RemoteBinding(jndiBinding = "spec.PublicSessionFacade")
 @SecurityDomain("spec-test")
 @RolesAllowed({"Echo"})
- at EJBs({@EJB(name="TargetEJB", businessInterface=org.jboss.ejb3.test.security.Session.class, beanName="PublicSession")})
+ at EJBs({@EJB(name="TargetEJB", beanInterface=org.jboss.ejb3.test.security.Session.class, beanName="PublicSession")})
 public class PublicSessionFacade
 {
    @Resource SessionContext sessionContext;

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/SecurityContextBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/SecurityContextBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/SecurityContextBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -45,7 +45,7 @@
 @RemoteBinding(jndiBinding = "spec.UserInRoleContextSession")
 @SecurityDomain("spec-test")
 @RolesAllowed({"Role1", "Role2"})
- at EJBs({@EJB(name="CalledBean", businessInterface=org.jboss.ejb3.test.security.SecurityContext.class, beanName="UserInRoleContextSessionTarget")})
+ at EJBs({@EJB(name="CalledBean", beanInterface=org.jboss.ejb3.test.security.SecurityContext.class, beanName="UserInRoleContextSessionTarget")})
 public class SecurityContextBean implements SecurityContext
 {
    static Logger log = Logger.getLogger(SecurityContextBean.class);

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/StatelessSessionBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/StatelessSessionBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/StatelessSessionBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -57,7 +57,8 @@
     
     public void testGetBusinessObject()
     {
-       Object businessObject = sessionContext.getBusinessObject(org.jboss.ejb3.test.security.StatelessSession.class);
+       StatelessSession ss = (StatelessSession)sessionContext.getBusinessObject(org.jboss.ejb3.test.security.StatelessSession.class);
+       ss.noop();
     }
 
     @RolesAllowed({"Echo"})

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/StatelessSessionBean2.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/StatelessSessionBean2.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/StatelessSessionBean2.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -26,7 +26,10 @@
 import javax.ejb.EJBs;
 import javax.annotation.Resource;
 import javax.annotation.security.RolesAllowed;
-import javax.ejb.*;
+import javax.ejb.EJBException;
+import javax.ejb.Remote;
+import javax.ejb.SessionContext;
+import javax.ejb.Stateless;
 import javax.naming.InitialContext;
 import org.jboss.annotation.ejb.RemoteBinding;
 import org.jboss.annotation.security.SecurityDomain;
@@ -44,7 +47,7 @@
 @RemoteBinding(jndiBinding = "spec.StatelessSession2")
 @RolesAllowed({"Echo"})
 @SecurityDomain("spec-test")
- at EJBs({@EJB(name="Session", businessInterface=org.jboss.ejb3.test.security.StatelessSession.class, beanName="StatelessSession")})
+ at EJBs({@EJB(name="Session", beanInterface=org.jboss.ejb3.test.security.StatelessSession.class, beanName="StatelessSession")})
 public class StatelessSessionBean2
 {
    private static final Logger log = Logger
@@ -54,7 +57,8 @@
     
     public void testGetBusinessObject()
     {
-       Object businessObject = sessionContext.getBusinessObject(org.jboss.ejb3.test.security.StatelessSession.class);
+       StatelessSession ss = (StatelessSession)sessionContext.getBusinessObject(org.jboss.ejb3.test.security.StatelessSession.class);
+       ss.noop();
     }
 
     public String echo(String arg)

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/StatelessSessionBean3.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/StatelessSessionBean3.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/StatelessSessionBean3.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -60,7 +60,8 @@
    
    public void testGetBusinessObject()
    {
-      Object businessObject = sessionContext.getBusinessObject(org.jboss.ejb3.test.security.StatelessSession.class);
+      StatelessSession ss = (StatelessSession)sessionContext.getBusinessObject(org.jboss.ejb3.test.security.StatelessSession.class);
+      ss.noop();
    }
 
    /** This method creates an instance of the entity bean bound under

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/StatelessSessionBeanInDomain.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/StatelessSessionBeanInDomain.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/StatelessSessionBeanInDomain.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -57,7 +57,8 @@
     
     public void testGetBusinessObject()
     {
-       Object businessObject = sessionContext.getBusinessObject(org.jboss.ejb3.test.security.StatelessSession.class);
+       StatelessSession ss = (StatelessSession)sessionContext.getBusinessObject(org.jboss.ejb3.test.security.StatelessSession.class);
+       ss.noop();
     }
 
     @RolesAllowed({"Echo"})

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/StatelessSessionBean_test.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/StatelessSessionBean_test.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/StatelessSessionBean_test.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -55,7 +55,8 @@
     
     public void testGetBusinessObject()
     {
-       Object businessObject = sessionContext.getBusinessObject(org.jboss.ejb3.test.security.StatelessSession.class);
+       StatelessSession ss = (StatelessSession)sessionContext.getBusinessObject(org.jboss.ejb3.test.security.StatelessSession.class);
+       ss.noop();
     }
 
     @RolesAllowed({"Echo"})

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/TimerTesterBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/TimerTesterBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/TimerTesterBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -84,8 +84,6 @@
       log.info("PrincipalFromSecurityAssociation: "+SecurityAssociation.getPrincipal()+"."); 
       log.info("CallerPricipalFromSecurityAssociation: "+SecurityAssociation.getCallerPrincipal()+"."); 
 
-      timer.cancel();
-      
       try 
       {
          UncheckedStateless tester =

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/UnsecuredStatelessSessionBean2.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/UnsecuredStatelessSessionBean2.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/UnsecuredStatelessSessionBean2.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -42,7 +42,7 @@
 @Stateless
 @Remote(org.jboss.ejb3.test.security.StatelessSession.class)
 @RemoteBinding(jndiBinding = "spec.UnsecureStatelessSession2")
- at EJBs({@EJB(name="Session", businessInterface=org.jboss.ejb3.test.security.StatelessSession.class, beanName="StatelessSession")})
+ at EJBs({@EJB(name="Session", beanInterface=org.jboss.ejb3.test.security.StatelessSession.class, beanName="StatelessSession")})
 public class UnsecuredStatelessSessionBean2
 {
     org.apache.log4j.Category log = org.apache.log4j.Category.getInstance(getClass());

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/unit/EJBSpecUnitTestCase.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/unit/EJBSpecUnitTestCase.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/security/unit/EJBSpecUnitTestCase.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -58,557 +58,564 @@
  @version $Revision$
  */
 public class EJBSpecUnitTestCase
-   extends JBossTestCase
+extends JBossTestCase
 {
-   private static final Logger log = Logger.getLogger(EJBSpecUnitTestCase.class);
-   
-   static String username = "scott";
-   static char[] password = "echoman".toCharArray();
-   static String QUEUE_FACTORY = "ConnectionFactory";
-   
-   LoginContext lc;
-   boolean loggedIn;
+private static final Logger log = Logger.getLogger(EJBSpecUnitTestCase.class);
 
-   public EJBSpecUnitTestCase(String name)
-   {
-      super(name);
-   }
-   
-   protected void tearDown() throws Exception
-   {
-      logout();
-   }
+static String username = "scott";
+static char[] password = "echoman".toCharArray();
+static String QUEUE_FACTORY = "ConnectionFactory";
 
-   /** Validate that the users have the expected logins and roles.
-    * 
-    * @throws Exception
-    */ 
-   public void testSecurityDomain() throws Exception
-   {
-      log.info("+++ testSecurityDomain, domain=spec-test");
-      MBeanServerConnection conn = (MBeanServerConnection) getServer();
-      ObjectName secMgrName = new ObjectName("jboss.security:service=JaasSecurityManager");
-      JaasSecurityManagerServiceMBean secMgr = (JaasSecurityManagerServiceMBean)
-         MBeanServerInvocationHandler.newProxyInstance(conn, secMgrName,
-         JaasSecurityManagerServiceMBean.class, false);
+LoginContext lc;
+boolean loggedIn;
 
-      // Test the spec-test security domain
-      String domain = "spec-test";
-      SimplePrincipal user = new SimplePrincipal("scott");
-      boolean isValid = secMgr.isValid(domain, user, password);
-      assertTrue("scott password is echoman", isValid);
-      HashSet testRole = new HashSet();
-      testRole.add(new SimplePrincipal("Echo"));
-      boolean hasRole = secMgr.doesUserHaveRole(domain, user, password, testRole);
-      assertTrue("scott has Echo role", hasRole);
-      testRole.clear();
-      testRole.add(new SimplePrincipal("EchoLocal"));
-      hasRole = secMgr.doesUserHaveRole(domain, user, password, testRole);
-      assertTrue("scott has EchoLocal role", hasRole);
-      testRole.clear();
-      testRole.add(new SimplePrincipal("ProjectUser"));
-      hasRole = secMgr.doesUserHaveRole(domain, user, password, testRole);
-      assertTrue("scott has ProjectUser role", hasRole);
+public EJBSpecUnitTestCase(String name)
+{
+   super(name);
+}
 
-      isValid = secMgr.isValid(domain, user, "badpass".toCharArray());
-      assertTrue("badpass is an invalid password for scott", isValid == false);
+protected void tearDown() throws Exception
+{
+   logout();
+}
 
-      // Test the spec-test-domain security domain
-      log.info("+++ testSecurityDomain, domain=spec-test-domain");
-      domain = "spec-test-domain";
-      isValid = secMgr.isValid(domain, user, password);
-      assertTrue("scott password is echoman", isValid);
-      hasRole = secMgr.doesUserHaveRole(domain, user, password, testRole);
-      assertTrue("scott has Echo role", hasRole);
-      testRole.clear();
-      testRole.add(new SimplePrincipal("EchoLocal"));
-      hasRole = secMgr.doesUserHaveRole(domain, user, password, testRole);
-      assertTrue("scott has EchoLocal role", hasRole);
-      testRole.clear();
-      testRole.add(new SimplePrincipal("ProjectUser"));
-      hasRole = secMgr.doesUserHaveRole(domain, user, password, testRole);
-      assertTrue("scott has ProjectUser role", hasRole);      
+/** Validate that the users have the expected logins and roles.
+ * 
+ * @throws Exception
+ */ 
+public void testSecurityDomain() throws Exception
+{
+   log.info("+++ testSecurityDomain, domain=spec-test");
+   MBeanServerConnection conn = (MBeanServerConnection) getServer();
+   ObjectName secMgrName = new ObjectName("jboss.security:service=JaasSecurityManager");
+   JaasSecurityManagerServiceMBean secMgr = (JaasSecurityManagerServiceMBean)
+      MBeanServerInvocationHandler.newProxyInstance(conn, secMgrName,
+      JaasSecurityManagerServiceMBean.class, false);
 
-      isValid = secMgr.isValid(domain, user, "badpass".toCharArray());
-      assertTrue("badpass is an invalid password for scott", isValid == false);
-   }
+   // Test the spec-test security domain
+   String domain = "spec-test";
+   SimplePrincipal user = new SimplePrincipal("scott");
+   boolean isValid = secMgr.isValid(domain, user, password);
+   assertTrue("scott password is echoman", isValid);
+   HashSet testRole = new HashSet();
+   testRole.add(new SimplePrincipal("Echo"));
+   boolean hasRole = secMgr.doesUserHaveRole(domain, user, password, testRole);
+   assertTrue("scott has Echo role", hasRole);
+   testRole.clear();
+   testRole.add(new SimplePrincipal("EchoLocal"));
+   hasRole = secMgr.doesUserHaveRole(domain, user, password, testRole);
+   assertTrue("scott has EchoLocal role", hasRole);
+   testRole.clear();
+   testRole.add(new SimplePrincipal("ProjectUser"));
+   hasRole = secMgr.doesUserHaveRole(domain, user, password, testRole);
+   assertTrue("scott has ProjectUser role", hasRole);
 
-   /** Test that:
-    1. SecureBean returns a non-null principal when getCallerPrincipal
-    is called with a security context and that this is propagated
-    to its Entity bean ref.
-    
-    2. UnsecureBean throws an IllegalStateException when getCallerPrincipal
-    is called without a security context.
-    */
-   public void testGetCallerPrincipal() throws Exception
-   {   
-      log.debug("+++ testGetCallerPrincipal()");
-      StatelessSession bean = (StatelessSession)getInitialContext().lookup("spec.UnsecureStatelessSession2");
-      log.debug("Created spec.UnsecureStatelessSession2");
-      
-      try
-      {
-         // This should fail because echo calls getCallerPrincipal()
-         bean.echo("Hello from nobody?");
-         fail("Was able to call StatelessSession.echo");
-      }
-      catch(Exception e)
-      {
-         log.debug("echo failed as expected");
-      }
-      
-      login();
-      bean = (StatelessSession)getInitialContext().lookup("spec.StatelessSession2");
-      log.debug("Created spec.StatelessSession2");
-      // Test that the Entity bean sees username as its principal
-      String echo = bean.echo(username);
-      log.debug("bean.echo(username) = "+echo);
-      assertTrue("username == echo", echo.equals(username));
-      
-      logout();
-   }
-   
-   /** Test the use of getCallerPrincipal from within the ejbCreate
-    * in a stateful session bean
-    */
-   public void testStatefulCreateCaller() throws Exception
-   {
-      log.debug("+++ testStatefulCreateCaller");
-      login();
-      InitialContext jndiContext = new InitialContext();
-     
-      StatefulSession bean = (StatefulSession)jndiContext.lookup("spec.StatefulSession");
-      // Need to invoke a method to ensure an ejbCreate call
-      bean.echo("testStatefulCreateCaller");
-      log.debug("Bean.echo(), ok");
+   isValid = secMgr.isValid(domain, user, "badpass".toCharArray());
+   assertTrue("badpass is an invalid password for scott", isValid == false);
 
-      logout();
-   }
+   // Test the spec-test-domain security domain
+   log.info("+++ testSecurityDomain, domain=spec-test-domain");
+   domain = "spec-test-domain";
+   isValid = secMgr.isValid(domain, user, password);
+   assertTrue("scott password is echoman", isValid);
+   hasRole = secMgr.doesUserHaveRole(domain, user, password, testRole);
+   assertTrue("scott has Echo role", hasRole);
+   testRole.clear();
+   testRole.add(new SimplePrincipal("EchoLocal"));
+   hasRole = secMgr.doesUserHaveRole(domain, user, password, testRole);
+   assertTrue("scott has EchoLocal role", hasRole);
+   testRole.clear();
+   testRole.add(new SimplePrincipal("ProjectUser"));
+   hasRole = secMgr.doesUserHaveRole(domain, user, password, testRole);
+   assertTrue("scott has ProjectUser role", hasRole);      
 
-   /**
-    * Test that a call interacting with different security domains does not
-    * change the 
-    * @throws Exception
-    */ 
-   public void testDomainInteraction() throws Exception
+   isValid = secMgr.isValid(domain, user, "badpass".toCharArray());
+   assertTrue("badpass is an invalid password for scott", isValid == false);
+}
+
+/** Test that:
+ 1. SecureBean returns a non-null principal when getCallerPrincipal
+ is called with a security context and that this is propagated
+ to its Entity bean ref.
+ 
+ 2. UnsecureBean throws an IllegalStateException when getCallerPrincipal
+ is called without a security context.
+ */
+public void testGetCallerPrincipal() throws Exception
+{   
+   log.debug("+++ testGetCallerPrincipal()");
+   StatelessSession bean = (StatelessSession)getInitialContext().lookup("spec.UnsecureStatelessSession2");
+   log.debug("Created spec.UnsecureStatelessSession2");
+   
+   try
    {
-      logout();
-      login("testDomainInteraction", "testDomainInteraction".toCharArray());
-      log.debug("+++ testDomainInteraction()");
-      SecurityContext bean = (SecurityContext)getInitialContext().lookup("spec.UserInRoleContextSession");
-      log.debug("Created spec.UserInRoleContextSession");
-      HashSet roles = new HashSet();
-      roles.add("Role1");
-      roles.add("Role2");
-      bean.testDomainInteraction(roles);   
+      // This should fail because echo calls getCallerPrincipal()
+      bean.echo("Hello from nobody?");
+      fail("Was able to call StatelessSession.echo");
    }
-
-   /** Test that the calling principal is propagated across bean calls.
-    */
-   public void testPrincipalPropagation() throws Exception
+   catch(Exception e)
    {
-      log.debug("+++ testPrincipalPropagation");
-      logout();
-      login();
-      StatelessSession bean = (StatelessSession)getInitialContext().lookup("spec.UnsecureStatelessSession2");
-      log.debug("Created spec.UnsecureStatelessSession2");
-      log.debug("Bean.forward('testPrincipalPropagation') -> "+bean.forward("testPrincipalPropagation"));
+      log.debug("echo failed as expected");
    }
    
-   public void testMethodAccess() throws Exception
-   {
-      log.debug("+++ testMethodAccess");
-      login();
-      StatelessSession bean = (StatelessSession)getInitialContext().lookup("spec.StatelessSession");
-      log.debug("Created spec.StatelessSession");
-      log.debug("Bean.echo('Hello') -> "+bean.echo("Hello"));
+   login();
+   bean = (StatelessSession)getInitialContext().lookup("spec.StatelessSession2");
+   log.debug("Created spec.StatelessSession2");
+   // Test that the Entity bean sees username as its principal
+   String echo = bean.echo(username);
+   log.debug("bean.echo(username) = "+echo);
+   assertTrue("username == echo", echo.equals(username));
+   
+   logout();
+}
 
-      // This should be allowed in ejb3
-      bean.noop();
-   }
+/** Test the use of getCallerPrincipal from within the ejbCreate
+ * in a stateful session bean
+ */
+public void testStatefulCreateCaller() throws Exception
+{
+   log.debug("+++ testStatefulCreateCaller");
+   login();
+   InitialContext jndiContext = new InitialContext();
+  
+   StatefulSession bean = (StatefulSession)jndiContext.lookup("spec.StatefulSession");
+   // Need to invoke a method to ensure an ejbCreate call
+   bean.echo("testStatefulCreateCaller");
+   log.debug("Bean.echo(), ok");
 
-   /** Test that the echo method is accessible by an Echo
-    role. Since the excluded() method of the StatelessSession
-    bean has been placed into the excluded set it should not
-    accessible by any user. This uses the security domain of the
-    JaasSecurityDomain service to test its use as an authentication mgr.
-    */
-   public void testDomainMethodAccess() throws Exception
-   {
-      log.debug("+++ testDomainMethodAccess");
-      login();
-      StatelessSession bean = (StatelessSession)getInitialContext().lookup("spec.StatelessSessionInDomain");
-      log.debug("Created spec.StatelessSessionInDomain");
-      log.debug("Bean.echo('testDomainMethodAccess') -> "+bean.echo("testDomainMethodAccess"));
+   logout();
+}
 
-      try
-      {
-         // This should not be allowed
-         bean.excluded();
-         fail("Was able to call StatelessSession.excluded");
-      }
-      catch(Exception e)
-      {
-         log.debug("StatelessSession.excluded failed as expected");
-      }
-   }
+/**
+ * Test that a call interacting with different security domains does not
+ * change the 
+ * @throws Exception
+ */ 
+public void testDomainInteraction() throws Exception
+{
+   logout();
+   login("testDomainInteraction", "testDomainInteraction".toCharArray());
+   log.debug("+++ testDomainInteraction()");
+   SecurityContext bean = (SecurityContext)getInitialContext().lookup("spec.UserInRoleContextSession");
+   log.debug("Created spec.UserInRoleContextSession");
+   HashSet roles = new HashSet();
+   roles.add("Role1");
+   roles.add("Role2");
+   bean.testDomainInteraction(roles);   
+}
 
-   /** Test that the permissions assigned to the stateless session bean:
-    with ejb-name=org/jboss/test/security/ejb/StatelessSession_test
-    are read correctly.
-    */
-   public void testMethodAccess2() throws Exception
+/** Test that the calling principal is propagated across bean calls.
+ */
+public void testPrincipalPropagation() throws Exception
+{
+   log.debug("+++ testPrincipalPropagation");
+   logout();
+   login();
+   StatelessSession bean = (StatelessSession)getInitialContext().lookup("spec.UnsecureStatelessSession2");
+   log.debug("Created spec.UnsecureStatelessSession2");
+   log.debug("Bean.forward('testPrincipalPropagation') -> "+bean.forward("testPrincipalPropagation"));
+}
+
+public void testMethodAccess() throws Exception
+{
+   log.debug("+++ testMethodAccess");
+   login();
+   StatelessSession bean = (StatelessSession)getInitialContext().lookup("spec.StatelessSession");
+   log.debug("Created spec.StatelessSession");
+   log.debug("Bean.echo('Hello') -> "+bean.echo("Hello"));
+
+   // This should be allowed in ejb3
+   bean.noop();
+}
+
+/** Test that the echo method is accessible by an Echo
+ role. Since the excluded() method of the StatelessSession
+ bean has been placed into the excluded set it should not
+ accessible by any user. This uses the security domain of the
+ JaasSecurityDomain service to test its use as an authentication mgr.
+ */
+public void testDomainMethodAccess() throws Exception
+{
+   log.debug("+++ testDomainMethodAccess");
+   login();
+   StatelessSession bean = (StatelessSession)getInitialContext().lookup("spec.StatelessSessionInDomain");
+   log.debug("Created spec.StatelessSessionInDomain");
+   log.debug("Bean.echo('testDomainMethodAccess') -> "+bean.echo("testDomainMethodAccess"));
+
+   try
    {
-      log.debug("+++ testMethodAccess2");
-      login();
-      InitialContext jndiContext = new InitialContext();
-      StatelessSession bean = (StatelessSession)jndiContext.lookup("spec.StatelessSession_test");
-      log.debug("Created spec.StatelessSession_test");
-      log.debug("Bean.echo('testMethodAccess2') -> "+bean.echo("testMethodAccess2"));
+      // This should not be allowed
+      bean.excluded();
+      fail("Was able to call StatelessSession.excluded");
    }
-
-   /** Test a user with Echo and EchoLocal roles can access the CalleeBean
-    through its local interface by calling the CallerBean and that a user
-    with only a EchoLocal cannot call the CallerBean.
-    */
-   public void a1testLocalMethodAccess() throws Exception
+   catch(Exception e)
    {
-      log.debug("+++ testLocalMethodAccess");
-      login();
-      InitialContext jndiContext = new InitialContext();
-      CalledSession bean = (CalledSession)jndiContext.lookup("spec.CallerBean");
-      log.debug("Created spec.CallerBean");
-      log.debug("Bean.invokeEcho('testLocalMethodAccess') -> "+bean.invokeEcho("testLocalMethodAccess"));
+      log.debug("StatelessSession.excluded failed as expected");
    }
+}
 
-   /** Test access to a bean with a mix of remote interface permissions and
-    * unchecked permissions with the unchecked permissions declared first.
-    * @throws Exception
-    */ 
-   public void testUncheckedRemote() throws Exception
+/** Test that the permissions assigned to the stateless session bean:
+ with ejb-name=org/jboss/test/security/ejb/StatelessSession_test
+ are read correctly.
+ */
+public void testMethodAccess2() throws Exception
+{
+   log.debug("+++ testMethodAccess2");
+   login();
+   InitialContext jndiContext = new InitialContext();
+   StatelessSession bean = (StatelessSession)jndiContext.lookup("spec.StatelessSession_test");
+   log.debug("Created spec.StatelessSession_test");
+   log.debug("Bean.echo('testMethodAccess2') -> "+bean.echo("testMethodAccess2"));
+}
+
+/** Test a user with Echo and EchoLocal roles can access the CalleeBean
+ through its local interface by calling the CallerBean and that a user
+ with only a EchoLocal cannot call the CallerBean.
+ */
+public void a1testLocalMethodAccess() throws Exception
+{
+   log.debug("+++ testLocalMethodAccess");
+   login();
+   InitialContext jndiContext = new InitialContext();
+   CalledSession bean = (CalledSession)jndiContext.lookup("spec.CallerBean");
+   log.debug("Created spec.CallerBean");
+   log.debug("Bean.invokeEcho('testLocalMethodAccess') -> "+bean.invokeEcho("testLocalMethodAccess"));
+}
+
+/** Test access to a bean with a mix of remote interface permissions and
+ * unchecked permissions with the unchecked permissions declared first.
+ * @throws Exception
+ */ 
+public void testUncheckedRemote() throws Exception
+{
+   log.debug("+++ testUncheckedRemote");
+   login();
+   StatelessSession bean = (StatelessSession)getInitialContext().lookup("spec.UncheckedSessionRemoteLast");
+   log.debug("Created spec.UncheckedSessionRemoteLast");
+   log.debug("Bean.echo('testUncheckedRemote') -> "+bean.echo("testUncheckedRemote"));
+   try
    {
-      log.debug("+++ testUncheckedRemote");
-      login();
-      StatelessSession bean = (StatelessSession)getInitialContext().lookup("spec.UncheckedSessionRemoteLast");
-      log.debug("Created spec.UncheckedSessionRemoteLast");
-      log.debug("Bean.echo('testUncheckedRemote') -> "+bean.echo("testUncheckedRemote"));
-      try
-      {
-         bean.excluded();
-         fail("Was able to call UncheckedSessionRemoteLast.excluded");
-      }
-      catch(Exception e)
-      {
-         log.debug("UncheckedSessionRemoteLast.excluded failed as expected");         
-      }
-      logout();
+      bean.excluded();
+      fail("Was able to call UncheckedSessionRemoteLast.excluded");
    }
-
-   /** Test access to a bean with a mix of remote interface permissions and
-    * unchecked permissions with the unchecked permissions declared last.
-    * @throws Exception
-    */ 
-   public void testRemoteUnchecked() throws Exception
+   catch(Exception e)
    {
-      log.debug("+++ testRemoteUnchecked");
-      login();
-      StatelessSession bean = (StatelessSession)getInitialContext().lookup("spec.UncheckedSessionRemoteFirst");
-      log.debug("Created spec.UncheckedSessionRemoteFirst");
-      log.debug("Bean.echo('testRemoteUnchecked') -> "+bean.echo("testRemoteUnchecked"));
-      try
-      {
-         bean.excluded();
-         fail("Was able to call UncheckedSessionRemoteFirst.excluded");
-      }
-      catch(Exception e)
-      {
-         log.debug("UncheckedSessionRemoteFirst.excluded failed as expected");         
-      }
-      logout();
+      log.debug("UncheckedSessionRemoteLast.excluded failed as expected");         
    }
+   logout();
+}
 
-   /** Test that a user with a role that has not been assigned any
-    method permissions in the ejb-jar descriptor is able to access a
-    method that has been marked as unchecked.
-    */
-   public void testUnchecked() throws Exception
+/** Test access to a bean with a mix of remote interface permissions and
+ * unchecked permissions with the unchecked permissions declared last.
+ * @throws Exception
+ */ 
+public void testRemoteUnchecked() throws Exception
+{
+   log.debug("+++ testRemoteUnchecked");
+   login();
+   StatelessSession bean = (StatelessSession)getInitialContext().lookup("spec.UncheckedSessionRemoteFirst");
+   log.debug("Created spec.UncheckedSessionRemoteFirst");
+   log.debug("Bean.echo('testRemoteUnchecked') -> "+bean.echo("testRemoteUnchecked"));
+   try
    {
-      log.debug("+++ testUnchecked");
-      // Login as scott to create the bean
-      login();
-      StatelessSession bean = (StatelessSession)getInitialContext().lookup("spec.StatelessSession");
-      log.debug("Created spec.StatelessSession");
-      // Logout and login back in as stark to test access to the unchecked method
-      logout();
-      login("stark", "javaman".toCharArray());
-      bean.unchecked();
-      log.debug("Called Bean.unchecked()");
-      logout();
+      bean.excluded();
+      fail("Was able to call UncheckedSessionRemoteFirst.excluded");
    }
-
-   /** Test that a user with a valid role is able to access a
-    bean for which all methods have been marked as unchecked.
-    */
-   public void testUncheckedWithLogin() throws Exception
+   catch(Exception e)
    {
-      log.debug("+++ testUncheckedWithLogin");
-      // Login as scott to see that a user with roles is allowed access
-      login();
-      StatelessSession bean = (StatelessSession)getInitialContext().lookup("spec.UncheckedSession");
-      log.debug("Created spec.StatelessSession");
-      bean.unchecked();
-      log.debug("Called Bean.unchecked()");
-      logout();
+      log.debug("UncheckedSessionRemoteFirst.excluded failed as expected");         
    }
+   logout();
+}
 
-   /** Test that user scott who has the Echo role is not able to
-    access the StatelessSession2.excluded method even though
-    the Echo role has been granted access to all methods of
-    StatelessSession2 to test that the excluded-list takes
-    precendence over the method-permissions.
-    */
-   public void testExcluded() throws Exception
+/** Test that a user with a role that has not been assigned any
+ method permissions in the ejb-jar descriptor is able to access a
+ method that has been marked as unchecked.
+ */
+public void testUnchecked() throws Exception
+{
+   log.debug("+++ testUnchecked");
+   // Login as scott to create the bean
+   login();
+   StatelessSession bean = (StatelessSession)getInitialContext().lookup("spec.StatelessSession");
+   log.debug("Created spec.StatelessSession");
+   // Logout and login back in as stark to test access to the unchecked method
+   logout();
+   login("stark", "javaman".toCharArray());
+   bean.unchecked();
+   log.debug("Called Bean.unchecked()");
+   logout();
+}
+
+/** Test that a user with a valid role is able to access a
+ bean for which all methods have been marked as unchecked.
+ */
+public void testUncheckedWithLogin() throws Exception
+{
+   log.debug("+++ testUncheckedWithLogin");
+   // Login as scott to see that a user with roles is allowed access
+   login();
+   StatelessSession bean = (StatelessSession)getInitialContext().lookup("spec.UncheckedSession");
+   log.debug("Created spec.StatelessSession");
+   bean.unchecked();
+   log.debug("Called Bean.unchecked()");
+   logout();
+}
+
+/** Test that user scott who has the Echo role is not able to
+ access the StatelessSession2.excluded method even though
+ the Echo role has been granted access to all methods of
+ StatelessSession2 to test that the excluded-list takes
+ precendence over the method-permissions.
+ */
+public void testExcluded() throws Exception
+{
+   log.debug("+++ testExcluded");
+   login();
+   StatelessSession bean = (StatelessSession)getInitialContext().lookup("spec.StatelessSession2");
+   log.debug("Created spec.StatelessSession2");
+   try
    {
-      log.debug("+++ testExcluded");
-      login();
-      StatelessSession bean = (StatelessSession)getInitialContext().lookup("spec.StatelessSession2");
-      log.debug("Created spec.StatelessSession2");
-      try
-      {
-         bean.excluded();
-         fail("Was able to call Bean.excluded()");
-      }
-      catch(Exception e)
-      {
-         log.debug("Bean.excluded() failed as expected");
-         // This is what we expect
-      }
-      logout();
+      bean.excluded();
+      fail("Was able to call Bean.excluded()");
    }
-   
-   /** This method tests the following call chains:
-    1. RunAsStatelessSession.echo() -> PrivateEntity.echo()
-    2. RunAsStatelessSession.noop() -> RunAsStatelessSession.excluded()
-    3. RunAsStatelessSession.forward() -> StatelessSession.echo()
-    1. Should succeed because the run-as identity of RunAsStatelessSession
-    is valid for accessing PrivateEntity.
-    2. Should succeed because the run-as identity of RunAsStatelessSession
-    is valid for accessing RunAsStatelessSession.excluded().
-    3. Should fail because the run-as identity of RunAsStatelessSession
-    is not Echo.
-    */
-   public void testRunAs() throws Exception
+   catch(Exception e)
    {
-      log.debug("+++ testRunAs");
-      login();
-      StatelessSession bean = (StatelessSession)getInitialContext().lookup("spec.RunAsStatelessSession");
-      log.debug("Created spec.RunAsStatelessSession");
-      log.debug("Bean.echo('testRunAs') -> "+bean.echo("testRunAs"));
-      bean.noop();
-      log.debug("Bean.noop(), ok");
-      
-      try
-      {
-         // This should not be allowed
-         bean.forward("Hello");
-         fail("Was able to call RunAsStatelessSession.forward");
-      }
-      catch(Exception e)
-      {
-         log.debug("StatelessSession.forward failed as expected");
-      }
-      
-      logout();
+      log.debug("Bean.excluded() failed as expected");
+      // This is what we expect
    }
+   logout();
+}
 
-   /** This method tests the following call chain:
-    Level1CallerBean.callEcho() -> Level2CallerBean.invokeEcho()
-      -> Level3CalleeBean.echo()
-    The Level1CallerBean uses a run-as of InternalRole and the Level2CallerBean
-    and Level3CalleeBean are only accessible by InternalRole.
-    */   
-   public void testDeepRunAs() throws Exception
+/** This method tests the following call chains:
+ 1. RunAsStatelessSession.echo() -> PrivateEntity.echo()
+ 2. RunAsStatelessSession.noop() -> RunAsStatelessSession.excluded()
+ 3. RunAsStatelessSession.forward() -> StatelessSession.echo()
+ 1. Should succeed because the run-as identity of RunAsStatelessSession
+ is valid for accessing PrivateEntity.
+ 2. Should succeed because the run-as identity of RunAsStatelessSession
+ is valid for accessing RunAsStatelessSession.excluded().
+ 3. Should fail because the run-as identity of RunAsStatelessSession
+ is not Echo.
+ */
+public void testRunAs() throws Exception
+{
+   log.debug("+++ testRunAs");
+   login();
+   StatelessSession bean = (StatelessSession)getInitialContext().lookup("spec.RunAsStatelessSession");
+   log.debug("Created spec.RunAsStatelessSession");
+   log.debug("Bean.echo('testRunAs') -> "+bean.echo("testRunAs"));
+   bean.noop();
+   log.debug("Bean.noop(), ok");
+   
+   try
    {
-      log.debug("+++ testDeepRunAs");
-      login();
-     
-      CalledSession bean = (CalledSession)getInitialContext().lookup("spec.Level1CallerBean");
-      log.debug("Created spec.Level1CallerBean");
-      bean.callEcho();
-      log.debug("Bean.callEcho() ok");
+      // This should not be allowed
+      bean.forward("Hello");
+      fail("Was able to call RunAsStatelessSession.forward");
    }
-
-   public void testRunAsSFSB() throws Exception
+   catch(Exception e)
    {
-      log.info("+++ testRunAsSFSB");
-      login();
-      log.debug("Found CallerFacadeBean-testRunAsSFSB Home");
-      CalledSession bean = (CalledSession)getInitialContext().lookup("spec.CallerFacadeBean-testRunAsSFSB");
-      log.debug("Created spec.CallerFacadeBean-testRunAsSFSB");
-      bean.invokeEcho("testRunAsSFSB");
-      log.debug("Bean.invokeEcho() ok");
+      log.debug("StatelessSession.forward failed as expected");
    }
+   
+   logout();
+}
 
-   /**
-    * Test the run-as side-effects raised in 
-    * http://jira.jboss.com/jira/browse/JBAS-1852
-    * 
-    * @throws Exception
-    */ 
-   public void testJBAS1852() throws Exception
-   {
-      log.info("+++ testJBAS1852");
-      login();
-      SessionFacade bean = (SessionFacade)getInitialContext().lookup("spec.PublicSessionFacade");
-      log.debug("Created PublicSessionFacade");
-      log.debug("Bean.callEcho('testJBAS1852') -> " + bean.callEcho("testJBAS1852"));
-   }
+/** This method tests the following call chain:
+ Level1CallerBean.callEcho() -> Level2CallerBean.invokeEcho()
+   -> Level3CalleeBean.echo()
+ The Level1CallerBean uses a run-as of InternalRole and the Level2CallerBean
+ and Level3CalleeBean are only accessible by InternalRole.
+ */   
+public void testDeepRunAs() throws Exception
+{
+   log.debug("+++ testDeepRunAs");
+   login();
+   CalledSession bean = (CalledSession)getInitialContext().lookup("spec.Level1CallerBean");
+   log.debug("Created spec.Level1CallerBean");
+   String principal = bean.callEcho();
+   assertEquals("scott", principal);
+   log.debug("Bean.callEcho() ok");
+}
 
-   /** Test that an MDB with a run-as identity is able to access secure EJBs
-    that require the identity.
-    */
-   public void a1testMDBRunAs() throws Exception
-   {
-      log.debug("+++ testMDBRunAs");
-      logout();
-      QueueConnectionFactory queueFactory = (QueueConnectionFactory) getInitialContext().lookup(QUEUE_FACTORY);
-      Queue queA = (Queue) getInitialContext().lookup("queue/A");
-      Queue queB = (Queue) getInitialContext().lookup("queue/B");
-      QueueConnection queueConn = queueFactory.createQueueConnection();
-      QueueSession session = queueConn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
-      Message msg = session.createMessage();
-      msg.setStringProperty("arg", "testMDBRunAs");
-      msg.setJMSReplyTo(queB);
-      QueueSender sender = session.createSender(queA);
-      sender.send(msg);
-      sender.close();
-      log.debug("Sent msg to queue/A");
-      queueConn.start();
-      QueueReceiver recv = session.createReceiver(queB);
-      msg = recv.receive(5000);
-      log.debug("Recv msg: "+msg);
-      String info = msg.getStringProperty("reply");
-      recv.close();
-      session.close();
-      queueConn.close();
+public void testRunAsSFSB() throws Exception
+{
+   log.info("+++ testRunAsSFSB");
+   login();
+   log.debug("Found CallerFacadeBean-testRunAsSFSB Home");
+   CalledSession bean = (CalledSession)getInitialContext().lookup("spec.CallerFacadeBean-testRunAsSFSB");
+   log.debug("Created spec.CallerFacadeBean-testRunAsSFSB");
+   bean.invokeEcho("testRunAsSFSB");
+   log.debug("Bean.invokeEcho() ok");
+}
 
-      if( info == null || info.startsWith("Failed") )
-      {
-         fail("Recevied exception reply, info="+info);
-      }
-   }
+/**
+ * Test the run-as side-effects raised in 
+ * http://jira.jboss.com/jira/browse/JBAS-1852
+ * 
+ * @throws Exception
+ */ 
+public void testJBAS1852() throws Exception
+{
+   log.info("+++ testJBAS1852");
+   login();
+   SessionFacade bean = (SessionFacade)getInitialContext().lookup("spec.PublicSessionFacade");
+   log.debug("Created PublicSessionFacade");
+   log.debug("Bean.callEcho('testJBAS1852') -> " + bean.callEcho("testJBAS1852"));
+}
 
-   /** Test that an MDB with a run-as identity is able to access secure EJBs
-    that require the identity. DeepRunAsMDB -> Level1MDBCallerBean.callEcho() ->
-      Level2CallerBean.invokeEcho() -> Level3CalleeBean.echo()
-    The MDB uses a run-as of InternalRole and the Level2CallerBean
-    and Level3CalleeBean are only accessible by InternalRole.
-    */
-   public void a1testMDBDeepRunAs() throws Exception
+/** Test that an MDB with a run-as identity is able to access secure EJBs
+ that require the identity.
+ */
+public void a1testMDBRunAs() throws Exception
+{
+   log.debug("+++ testMDBRunAs");
+   logout();
+   QueueConnectionFactory queueFactory = (QueueConnectionFactory) getInitialContext().lookup(QUEUE_FACTORY);
+   Queue queA = (Queue) getInitialContext().lookup("queue/A");
+   Queue queB = (Queue) getInitialContext().lookup("queue/B");
+   QueueConnection queueConn = queueFactory.createQueueConnection();
+   QueueSession session = queueConn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
+   Message msg = session.createMessage();
+   msg.setStringProperty("arg", "testMDBRunAs");
+   msg.setJMSReplyTo(queB);
+   QueueSender sender = session.createSender(queA);
+   sender.send(msg);
+   sender.close();
+   log.debug("Sent msg to queue/A");
+   queueConn.start();
+   QueueReceiver recv = session.createReceiver(queB);
+   msg = recv.receive(5000);
+   log.debug("Recv msg: "+msg);
+   String info = msg.getStringProperty("reply");
+   recv.close();
+   session.close();
+   queueConn.close();
+
+   if( info == null || info.startsWith("Failed") )
    {
-      log.debug("+++ testMDBDeepRunAs");
-      logout();
-      QueueConnectionFactory queueFactory = (QueueConnectionFactory) getInitialContext().lookup(QUEUE_FACTORY);
-      Queue queD = (Queue) getInitialContext().lookup("queue/D");
-      Queue queB = (Queue) getInitialContext().lookup("queue/B");
-      QueueConnection queueConn = queueFactory.createQueueConnection();
-      QueueSession session = queueConn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
-      Message msg = session.createMessage();
-      msg.setStringProperty("arg", "testMDBDeepRunAs");
-      msg.setJMSReplyTo(queB);
-      QueueSender sender = session.createSender(queD);
-      sender.send(msg);
-      sender.close();
-      log.debug("Sent msg to "+queD);
-      queueConn.start();
-      QueueReceiver recv = session.createReceiver(queB);
-      msg = recv.receive(5000);
-      log.debug("Recv msg: "+msg);
-      String info = msg.getStringProperty("reply");
-      recv.close();
-      session.close();
-      queueConn.close();
-
-      if( info == null || info.startsWith("Failed") )
-      {
-         fail("Recevied exception reply, info="+info);
-      }
+      fail("Recevied exception reply, info="+info);
    }
+}
 
-   /** This method tests that the RunAsWithRolesMDB is assigned multiple roles
-    * within its onMessage so that it can call into the ProjRepository session
-    * bean's methods that required ProjectAdmin, CreateFolder and DeleteFolder
-    * roles.
-    */
-   public void a1testRunAsWithRoles() throws Exception
+/** Test that an MDB with a run-as identity is able to access secure EJBs
+ that require the identity. DeepRunAsMDB -> Level1MDBCallerBean.callEcho() ->
+   Level2CallerBean.invokeEcho() -> Level3CalleeBean.echo()
+ The MDB uses a run-as of InternalRole and the Level2CallerBean
+ and Level3CalleeBean are only accessible by InternalRole.
+ */
+public void a1testMDBDeepRunAs() throws Exception
+{
+   log.debug("+++ testMDBDeepRunAs");
+   logout();
+   QueueConnectionFactory queueFactory = (QueueConnectionFactory) getInitialContext().lookup(QUEUE_FACTORY);
+   Queue queD = (Queue) getInitialContext().lookup("queue/D");
+   Queue queB = (Queue) getInitialContext().lookup("queue/B");
+   QueueConnection queueConn = queueFactory.createQueueConnection();
+   QueueSession session = queueConn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
+   Message msg = session.createMessage();
+   msg.setStringProperty("arg", "testMDBDeepRunAs");
+   msg.setJMSReplyTo(queB);
+   QueueSender sender = session.createSender(queD);
+   sender.send(msg);
+   sender.close();
+   log.debug("Sent msg to "+queD);
+   queueConn.start();
+   QueueReceiver recv = session.createReceiver(queB);
+   msg = recv.receive(5000);
+   log.debug("Recv msg: "+msg);
+   String info = msg.getStringProperty("reply");
+   recv.close();
+   session.close();
+   queueConn.close();
+
+   if( info == null || info.startsWith("Failed") )
    {
-      log.debug("+++ testRunAsWithRoles");
-      logout();
-      QueueConnectionFactory queueFactory = (QueueConnectionFactory) getInitialContext().lookup(QUEUE_FACTORY);
-      Queue queC = (Queue) getInitialContext().lookup("queue/C");
-      Queue queB = (Queue) getInitialContext().lookup("queue/B");
-      QueueConnection queueConn = queueFactory.createQueueConnection();
-      QueueSession session = queueConn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
-      Message msg = session.createMessage();
-      msg.setStringProperty("name", "testRunAsWithRoles");
-      msg.setJMSReplyTo(queB);
-      QueueSender sender = session.createSender(queC);
-      sender.send(msg);
-      sender.close();
-      log.debug("Sent msg to queue/C");
-      queueConn.start();
-      QueueReceiver recv = session.createReceiver(queB);
-      msg = recv.receive(5000);
-      log.debug("Recv msg: "+msg);
-      String info = msg.getStringProperty("reply");
-      recv.close();
-      session.close();
-      queueConn.close();
-
-      if( info == null || info.startsWith("Failed") )
-      {
-         fail("Recevied exception reply, info="+info);
-      }
+      fail("Recevied exception reply, info="+info);
    }
+}
 
-   /** Login as user scott using the conf.name login config or
-    'spec-test' if conf.name is not defined.
-    */
-   private void login() throws Exception
+/** This method tests that the RunAsWithRolesMDB is assigned multiple roles
+ * within its onMessage so that it can call into the ProjRepository session
+ * bean's methods that required ProjectAdmin, CreateFolder and DeleteFolder
+ * roles.
+ */
+public void a1testRunAsWithRoles() throws Exception
+{
+   log.debug("+++ testRunAsWithRoles");
+   logout();
+   QueueConnectionFactory queueFactory = (QueueConnectionFactory) getInitialContext().lookup(QUEUE_FACTORY);
+   Queue queC = (Queue) getInitialContext().lookup("queue/C");
+   Queue queB = (Queue) getInitialContext().lookup("queue/B");
+   QueueConnection queueConn = queueFactory.createQueueConnection();
+   QueueSession session = queueConn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
+   Message msg = session.createMessage();
+   msg.setStringProperty("name", "testRunAsWithRoles");
+   msg.setJMSReplyTo(queB);
+   QueueSender sender = session.createSender(queC);
+   sender.send(msg);
+   sender.close();
+   log.debug("Sent msg to queue/C");
+   queueConn.start();
+   QueueReceiver recv = session.createReceiver(queB);
+   msg = recv.receive(5000);
+   log.debug("Recv msg: "+msg);
+   String info = msg.getStringProperty("reply");
+   recv.close();
+   session.close();
+   queueConn.close();
+
+   if( info == null || info.startsWith("Failed") )
    {
-      login(username, password);
+      fail("Recevied exception reply, info="+info);
    }
-   private void login(String username, char[] password) throws Exception
+}
+
+/** Login as user scott using the conf.name login config or
+ 'spec-test' if conf.name is not defined.
+ */
+private void login() throws Exception
+{
+   login(username, password);
+}
+private void login(String username, char[] password) throws Exception
+{
+   if( loggedIn )
+      return;
+   
+   String confName = System.getProperty("conf.name", "spec-test");
+   AppCallbackHandler handler = new AppCallbackHandler(username, password);
+   log.debug("Creating LoginContext("+confName+")");
+   lc = new LoginContext(confName, handler);
+   lc.login();
+   log.debug("Created LoginContext, subject="+lc.getSubject());
+   loggedIn = true;
+}
+private void logout() throws Exception
+{
+   if( lc != null )
    {
-      if( loggedIn )
-         return;
-      
-      String confName = System.getProperty("conf.name", "spec-test");
-      AppCallbackHandler handler = new AppCallbackHandler(username, password);
-      log.debug("Creating LoginContext("+confName+")");
-      lc = new LoginContext(confName, handler);
-      lc.login();
-      log.debug("Created LoginContext, subject="+lc.getSubject());
-      loggedIn = true;
+      loggedIn = false;
+      lc.logout();
+      lc = null;
    }
-   private void logout() throws Exception
-   {
-      if( lc != null )
-      {
-         loggedIn = false;
-         lc.logout();
-         lc = null;
-      }
-   }
+}
 
 
-   /**
-    * Setup the test suite.
-    */
-   public static Test suite() throws Exception
-   {
+/**
+ * Setup the test suite.
+ */
+public static Test suite() throws Exception
+{
+   try {
       Configuration.setConfiguration(new XMLLoginConfigImpl());
       return getDeploySetup(EJBSpecUnitTestCase.class, "security.jar");
    }
+   catch (Exception e)
+   {
+      e.printStackTrace();
+      throw e;
+   }
 }
+}

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/service/unit/ServiceUnitTestCase.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/service/unit/ServiceUnitTestCase.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/service/unit/ServiceUnitTestCase.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -137,6 +137,14 @@
       assertEquals("There should only ever be one instance of the service", 1, test.getInstances());
       assertEquals("Wrong number of remote method calls", count * count, test.getRemoteMethodCalls());
    }
+   
+   public void testEJB3_587() throws Exception
+   {
+      MBeanServerConnection server = getServer();
+      ObjectName testerName = new ObjectName("jboss.ejb3.bugs:service=TestResourceInjectionService");
+      boolean success = (Boolean)server.getAttribute(testerName, "TestedSuccessful");
+      assertTrue(success);
+   }
 
    public void testServiceWithDefaultLocalJNDIName() throws Exception
    {

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/servlet/Session30.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/servlet/Session30.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/servlet/Session30.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -21,8 +21,6 @@
   */
 package org.jboss.ejb3.test.servlet;
 
-import java.rmi.*;
-
 /**
  * @version <tt>$Revision$</tt>
  * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
@@ -31,6 +29,10 @@
 {
    String access(TestObject o);
    
+   TestObject createTestObject();
+   
+   boolean checkEqPointer(TestObject to);
+   
    WarTestObject getWarTestObject();
 }
 

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/servlet/Session30Bean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/servlet/Session30Bean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/servlet/Session30Bean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -21,14 +21,18 @@
   */
 package org.jboss.ejb3.test.servlet;
 
+import javax.ejb.EJB;
+import javax.ejb.Local;
 import javax.ejb.Remote;
+import javax.ejb.LocalHome;
 import javax.ejb.RemoteHome;
 import javax.ejb.Stateless;
 
+import org.jboss.annotation.ejb.LocalBinding;
 import org.jboss.annotation.ejb.RemoteBinding;
+import org.jboss.annotation.security.SecurityDomain;
 import org.jboss.logging.Logger;
 
-import org.jboss.ejb3.test.reference21_30.Test3Home;
 import org.jboss.ejb3.test.servlet.Session30;
 
 /**
@@ -37,17 +41,36 @@
  */
 @Stateless(name="Session30")
 @Remote(Session30.class)
- at RemoteBinding(jndiBinding = "Session30")
+ at Local(Session30.class)
+ at RemoteBinding(jndiBinding = "ejb/Session30")
+ at LocalBinding(jndiBinding = "ejb/Session30Local")
 @RemoteHome(Session30Home.class)
+ at LocalHome(Session30LocalHome.class)
+ at SecurityDomain("other")
 public class Session30Bean implements Session30
 {
    private static final Logger log = Logger.getLogger(Session30Bean.class);
    
+   @EJB private StatefulRemote stateful;
+   
+   private TestObject testObject;
+   
    public String access(TestObject o)
    {
-      return "Session30";
+      return stateful.access(o);
    }
    
+   public TestObject createTestObject()
+   {
+      testObject = new TestObject();
+      return testObject;
+   }
+   
+   public boolean checkEqPointer(TestObject to)
+   {
+      return to == testObject;
+   }
+   
    public WarTestObject getWarTestObject()
    {
       return new WarTestObject();

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/servlet/servlets/EJBServlet.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/servlet/servlets/EJBServlet.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/servlet/servlets/EJBServlet.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -25,6 +25,7 @@
 import java.io.PrintWriter;
 import java.net.URL;
 import javax.naming.InitialContext;
+import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletException;
@@ -34,10 +35,13 @@
 
 import org.jboss.ejb3.Container;
 import org.jboss.ejb3.test.servlet.Session30;
+import org.jboss.ejb3.test.servlet.Session30LocalHome;
 import org.jboss.ejb3.test.servlet.Session30Home;
 import org.jboss.ejb3.test.servlet.TestObject;
 import org.jboss.ejb3.test.servlet.WarTestObject;
 import org.jboss.logging.Logger;
+import org.jboss.security.SecurityAssociation;
+import org.jboss.security.SimplePrincipal;
 
 /** A servlet that accesses an EJB and tests whether the call argument
  is serialized.
@@ -54,18 +58,38 @@
    {
       try
       {
+         SecurityAssociation.setPrincipal(new SimplePrincipal("somebody"));
+         SecurityAssociation.setCredential("password".toCharArray());
+         
          InitialContext ctx = new InitialContext();
         
-         Session30 session = (Session30)ctx.lookup("Session30");
+         Session30 session = (Session30)ctx.lookup("ejb/Session30");
          TestObject o = new TestObject();
          session.access(o);
+         o = session.createTestObject();
          
+         session = (Session30)ctx.lookup("ejb/Session30Local");
+         o = new TestObject();
+         session.access(o);
+         o = session.createTestObject();
+         
          WarTestObject warObject = (WarTestObject)session.getWarTestObject();
          
-         Session30Home home = (Session30Home)ctx.lookup("Session30Home");
+         Session30Home home = (Session30Home)ctx.lookup("ejb/Session30Home");
          session = home.create();
          session.access(o);
-       
+         
+         Session30LocalHome localHome = (Session30LocalHome)ctx.lookup("ejb/Session30LocalHome");
+         session = localHome.create();
+         session.access(o);
+         
+         home = (Session30Home)ctx.lookup("java:comp/env/ejb/remote/Session30");
+         session = home.create();
+         session.access(o);
+         
+         localHome = (Session30LocalHome)ctx.lookup("java:comp/env/ejb/local/Session30");
+         session = localHome.create();
+         session.access(o);
       }
       catch (Exception e)
       {
@@ -81,6 +105,21 @@
       out.println("</html>");
       out.close();
    }
+   
+   private void lookup(String name)
+   {
+      log.info("lookup " + name);
+      try {
+         InitialContext jndiContext = new InitialContext();
+         NamingEnumeration names = jndiContext.list(name);
+         if (names != null){
+            while (names.hasMore()){
+               log.info("  " + names.next());
+            }
+         }
+      } catch (Exception e){
+      }
+   }
 
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/servlet/unit/ServletUnitTestCase.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/servlet/unit/ServletUnitTestCase.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/servlet/unit/ServletUnitTestCase.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -72,7 +72,7 @@
     */
    public static Test suite() throws Exception
    {
-      return getDeploySetup(ServletUnitTestCase.class, "servlet.war, servlet-ejbs.jar");
+      return getDeploySetup(ServletUnitTestCase.class, "servlet-client.jar, servlet-ejbs.jar, servlet.war");
    }
 
 

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/ssladvanced/unit/SSLUnitTestCase.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/ssladvanced/unit/SSLUnitTestCase.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/ssladvanced/unit/SSLUnitTestCase.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -79,6 +79,14 @@
       System.out.println("*** success");
    }
    
+   public void testOverrideSSLBindings() throws Exception
+   {
+      System.out.println("*** TEST SSL Bindings");
+      InitialContext ctx = new InitialContext();
+      BusinessInterface sf = (BusinessInterface)ctx.lookup("OverrideStatefulClusteredSSL");
+      assertEquals(sf.echo("123"), "123");
+   }
+   
    public void testNormalBindings() throws Exception
    {
       System.out.println("*** TEST Normal Bindings");
@@ -98,6 +106,14 @@
       System.out.println("*** success");
    }
    
+   public void testOverrideNormalBindings() throws Exception
+   {
+      System.out.println("*** TEST Normal Bindings");
+      InitialContext ctx = new InitialContext();
+      BusinessInterface sf = (BusinessInterface)ctx.lookup("OverrideStatefulClusteredNormal");
+      assertEquals(sf.echo("123"), "123");
+   }
+   
 
    public static Test suite() throws Exception
    {

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/stateful/Stateful.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/stateful/Stateful.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/stateful/Stateful.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -29,12 +29,8 @@
  * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
  * @version $Revision$
  */
-public interface Stateful
+public interface Stateful extends ConcurrentStateful
 {
-   String getState();
-
-   void setState(String state);
-   
    boolean interceptorAccessed();
 
    boolean testSessionContext();
@@ -50,5 +46,7 @@
    public void testSerializedState(String state);
    
    public void removeBean();
+   
+   void testResources() throws Exception;
 
 }

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/stateful/StatefulBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/stateful/StatefulBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/stateful/StatefulBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -27,14 +27,20 @@
 import java.io.IOException;
 
 import javax.annotation.Resource;
+import javax.annotation.Resources;
 import javax.ejb.Init;
 import javax.ejb.Local;
 import javax.ejb.Remote;
 import javax.ejb.SessionContext;
 import javax.ejb.Stateful;
 import javax.ejb.PrePassivate;
+import javax.ejb.PostActivate;
 import javax.interceptor.Interceptors;
+import javax.naming.InitialContext;
+import javax.naming.NamingEnumeration;
 
+import org.jboss.ejb3.Container;
+
 import org.jboss.annotation.ejb.RemoteBinding;
 import org.jboss.annotation.ejb.cache.simple.CacheConfig;
 import org.jboss.annotation.security.SecurityDomain;
@@ -56,13 +62,21 @@
                factory = org.jboss.ejb3.test.stateful.StatefulRemoteProxyFactory.class)
 @CacheConfig(maxSize = 1000, idleTimeoutSeconds = 1)
 @SecurityDomain("test")
+ at Resources({@Resource(name="jdbc/ds", mappedName="java:/DefaultDS")})
 public class StatefulBean implements org.jboss.ejb3.test.stateful.Stateful
 {
    private static final Logger log = Logger.getLogger(StatefulBean.class);
    
-   @Resource private SessionContext sessionContext;
+   @Resource
+   private SessionContext sessionContext;
+   
+   @Resource(mappedName="java:/DefaultDS")
+   private transient javax.sql.DataSource datasource;
+   
+   @Resource(mappedName="java:/ConnectionFactory")
+   public transient javax.jms.QueueConnectionFactory connectionFactory; 
 
-   private String state ;
+   private String state;
    private int stuff;
 
    @Interceptors(MyInterceptor.class)
@@ -81,14 +95,25 @@
    {
       return sessionContext.isCallerInRole("role");
    }
+   
+   public void testResources() throws Exception
+   {
+      datasource.toString();
+      connectionFactory.toString();
+      
+      javax.sql.DataSource ds = (javax.sql.DataSource)new InitialContext().lookup(Container.ENC_CTX_NAME + "/env/jdbc/ds");
+      ds.toString();
+   }
 
-   public String getState()
+   public String getState() throws Exception
    {
+      Thread.sleep(1000);
       return state;
    }
 
-   public void setState(String state)
+   public void setState(String state) throws Exception
    {
+      Thread.sleep(1000);
       this.state = state;
    }
 
@@ -111,9 +136,15 @@
    @PrePassivate
    public void passivate()
    {
-      System.out.println("************ passivating");
+      log.info("************ passivating");  
       wasPassivated = true;
    }
+   
+   @PostActivate
+   public void activate()
+   {
+      log.info("************ activating");
+   }
 
    private static boolean wasPassivated = false;
 

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/stateful/StatefulTx.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/stateful/StatefulTx.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/stateful/StatefulTx.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -29,9 +29,11 @@
  * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
  * @version $Revision$
  */
-public interface StatefulTx
+public interface StatefulTx extends RemoteTx<State>
 {
    boolean isGlobalTransacted() throws javax.transaction.SystemException;
    
    boolean isLocalTransacted() throws javax.transaction.SystemException;
+   
+   void testTxRollback();
 }

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/stateful/StatefulTxBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/stateful/StatefulTxBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/stateful/StatefulTxBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -21,14 +21,19 @@
   */
 package org.jboss.ejb3.test.stateful;
 
+import javax.annotation.security.DenyAll;
+import javax.annotation.security.RolesAllowed;
 import javax.ejb.Remote;
 import javax.ejb.Stateful;
 import javax.ejb.TransactionAttribute;
 import javax.ejb.TransactionAttributeType;
+import javax.naming.InitialContext;
+import javax.naming.NamingEnumeration;
 import javax.transaction.TransactionManager;
 
 import org.jboss.annotation.JndiInject;
 import org.jboss.annotation.ejb.RemoteBinding;
+import org.jboss.annotation.security.SecurityDomain;
 import org.jboss.logging.Logger;
 
 /**
@@ -41,21 +46,38 @@
 @Remote(StatefulTx.class)
 @RemoteBinding(jndiBinding = "StatefulTx")
 @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) 
+ at SecurityDomain("test")
+ at DenyAll
 public class StatefulTxBean implements StatefulTx
 {
    private static final Logger log = Logger.getLogger(StatefulTxBean.class);
    
    @JndiInject(jndiName="java:/TransactionManager") private TransactionManager tm;
    
+   @RolesAllowed("allowed")
    public boolean isGlobalTransacted() throws javax.transaction.SystemException
    {
       return (tm.getTransaction() != null);
    }
    
    @TransactionAttribute(TransactionAttributeType.REQUIRED)
+   @RolesAllowed("allowed")
    public boolean isLocalTransacted() throws javax.transaction.SystemException
    {
       return (tm.getTransaction() != null);
    }
-
+   
+   @TransactionAttribute(TransactionAttributeType.REQUIRED)
+   @RolesAllowed("allowed")
+   public void testTxRollback()
+   {
+      throw new RuntimeException("test rollback");
+   }
+   
+   @TransactionAttribute(value = TransactionAttributeType.MANDATORY)
+   @RolesAllowed("allowed")
+   public State testMandatoryTx(State o)
+   {
+      return o;
+   }
 }

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/stateful/unit/RemoteUnitTestCase.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/stateful/unit/RemoteUnitTestCase.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/stateful/unit/RemoteUnitTestCase.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -22,15 +22,17 @@
 package org.jboss.ejb3.test.stateful.unit;
 
 import javax.ejb.EJBNoSuchObjectException;
+import javax.naming.InitialContext;
 
-import javax.naming.NamingException;
-
+import org.jboss.ejb3.test.stateful.ConcurrentStateful;
 import org.jboss.ejb3.test.stateful.SmallCacheStateful;
 import org.jboss.ejb3.test.stateful.Stateful;
+import org.jboss.ejb3.test.stateful.StatefulInvoker;
 import org.jboss.ejb3.test.stateful.StatefulLocal;
 import org.jboss.ejb3.test.stateful.StatefulTx;
 import org.jboss.ejb3.test.stateful.ProxyFactoryInterface;
 import org.jboss.ejb3.test.stateful.RemoteBindingInterceptor;
+import org.jboss.ejb3.test.stateful.State;
 import org.jboss.ejb3.test.stateful.StatefulHome;
 import org.jboss.ejb3.test.stateful.ExtendedState;
 import org.jboss.ejb3.test.stateful.Tester;
@@ -149,12 +151,40 @@
       
       StatefulTx stateful = (StatefulTx)getInitialContext().lookup("StatefulTx");
       assertNotNull(stateful);
+      
       boolean transacted = stateful.isLocalTransacted();
       assertTrue(transacted);
       transacted = stateful.isGlobalTransacted();
       assertFalse(transacted);
+      
+      try
+      {
+         stateful.testTxRollback();
+         fail("should have caught exception");
+      }
+      catch (javax.ejb.EJBException e)
+      {
+      }
    }
    
+   public void testTemplateInterfaceTx() throws Exception
+   {
+      SecurityAssociation.setPrincipal(new SimplePrincipal("somebody"));
+      SecurityAssociation.setCredential("password".toCharArray());
+      
+      StatefulTx stateful = (StatefulTx)getInitialContext().lookup("StatefulTx");
+      assertNotNull(stateful);
+      
+      try
+      {
+         stateful.testMandatoryTx(new State("test"));
+         fail("should have caught exception");
+      }
+      catch (javax.ejb.EJBTransactionRequiredException e)
+      {
+      }
+   }
+   
    public void testLocalSFSB() throws Exception
    {
       SecurityAssociation.setPrincipal(new SimplePrincipal("somebody"));
@@ -290,6 +320,8 @@
       assertEquals("hello world", stateful.getInterceptorState());
       
       assertFalse(stateful.testSessionContext());
+      
+      stateful.testResources();
    }
    
    public void testRemove() throws Exception
@@ -320,6 +352,79 @@
       test.testRollback1();
       test.testRollback2();
    }
+   
+   public void testConcurrentAccess() throws Exception
+   {
+      ConcurrentStateful stateful = (ConcurrentStateful) new InitialContext().lookup("ConcurrentStateful");
+      stateful.getState();
+      
+      StatefulInvoker[] invokers = new StatefulInvoker[2];
+      for (int i = 0; i < 2 ; ++i)
+      {
+         invokers[i] = new StatefulInvoker(stateful);
+      }
+      
+      for (StatefulInvoker invoker: invokers)
+      {
+         invoker.start();
+      }
+      
+      Thread.sleep(10000);
+      
+      for (StatefulInvoker invoker: invokers)
+      {
+         if (invoker.getException() != null)
+            throw invoker.getException();
+      }
+      
+      stateful = (ConcurrentStateful) new InitialContext().lookup("Stateful");
+      
+      invokers = new StatefulInvoker[2];
+      for (int i = 0; i < 2 ; ++i)
+      {
+         invokers[i] = new StatefulInvoker(stateful);
+      }
+      
+      for (StatefulInvoker invoker: invokers)
+      {
+         invoker.start();
+      }
+      
+      Thread.sleep(10000);
+      
+      boolean wasConcurrentException = false;
+      for (StatefulInvoker invoker: invokers)
+      {
+         if (invoker.getException() != null)
+            wasConcurrentException = true;
+      }
+      
+      assertTrue(wasConcurrentException);
+   }
+   
+   public void testOverrideConcurrentAccess() throws Exception
+   {
+      ConcurrentStateful stateful = (ConcurrentStateful) new InitialContext().lookup("OverrideConcurrentStateful");
+      stateful.getState();
+      
+      StatefulInvoker[] invokers = new StatefulInvoker[2];
+      for (int i = 0; i < 2 ; ++i)
+      {
+         invokers[i] = new StatefulInvoker(stateful);
+      }
+      
+      for (StatefulInvoker invoker: invokers)
+      {
+         invoker.start();
+      }
+      
+      Thread.sleep(5000);
+      
+      for (int i = 1; i < 2 ; ++i)
+      {
+         assertNotNull(invokers[i].getException());
+      }
+   }
 
    public static Test suite() throws Exception
    {

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/stateless/CheckedStatelessBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/stateless/CheckedStatelessBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/stateless/CheckedStatelessBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -28,6 +28,7 @@
 import javax.ejb.Remote;
 import javax.naming.NamingException;
 import javax.annotation.security.RolesAllowed;
+import org.jboss.annotation.ejb.RemoteBinding;
 import org.jboss.annotation.security.SecurityDomain;
 import org.jboss.logging.Logger;
 import org.jboss.annotation.security.SecurityDomain;
@@ -39,6 +40,7 @@
 @Stateless
 @SecurityDomain("other")
 @Remote(CheckedStateless.class)
+ at RemoteBinding(jndiBinding="CheckedStatelessBean/remote")
 public class CheckedStatelessBean implements CheckedStateless
 {
    private static final Logger log = Logger.getLogger(CheckedStatelessBean.class);

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/stateless/unit/StatelessTestCase.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/stateless/unit/StatelessTestCase.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/stateless/unit/StatelessTestCase.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -65,6 +65,24 @@
       assertEquals("somebody", principal);
    }
    
+   public void testStatelessLocal() throws Exception
+   {
+      SecurityAssociation.setPrincipal(new SimplePrincipal("somebody"));
+      SecurityAssociation.setCredential("password".toCharArray());
+       
+      try
+      {
+         RunAsStatelessLocal runAs = (RunAsStatelessLocal) getInitialContext().lookup("RunAsStatelessEjbName/local");
+         assertNotNull(runAs);
+         runAs.method(1);
+         fail("EJBException should be thrown");
+      }
+      catch (javax.ejb.EJBException e)
+      {
+         log.info("Caught EJBException " + e.getMessage());
+      }
+   }
+
    public void testRunAs() throws Exception
    {
       CheckedStateless checked = (CheckedStateless)getInitialContext().lookup("CheckedStatelessBean/remote");

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/strictpool/MDBInvoker.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/strictpool/MDBInvoker.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/strictpool/MDBInvoker.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -72,8 +72,8 @@
          }
          else
          {
-            TextMessage tm = (TextMessage) reply;
-            System.out.println(tm.getText());
+            Message tm = (Message) reply;
+            System.out.println(tm);
          }
          sender.close();
          receiver.close();

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/strictpool/StrictlyPooledMDB.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/strictpool/StrictlyPooledMDB.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/strictpool/StrictlyPooledMDB.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -36,6 +36,7 @@
 import javax.jms.QueueSession;
 import javax.jms.TextMessage;
 import javax.naming.InitialContext;
+
 import org.jboss.annotation.ejb.PoolClass;
 import org.jboss.annotation.ejb.PoolClass;
 
@@ -49,8 +50,8 @@
         @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
         @ActivationConfigProperty(propertyName="destination", propertyValue="queue/queueA"),
         @ActivationConfigProperty(propertyName="maxMessages", propertyValue="10"),
-        @ActivationConfigProperty(propertyName="minPoolSize", propertyValue="10"),
-        @ActivationConfigProperty(propertyName="maxPoolSize", propertyValue="10")
+        @ActivationConfigProperty(propertyName="minSession", propertyValue="10"),
+        @ActivationConfigProperty(propertyName="maxSession", propertyValue="10")
         })
 @PoolClass (value=org.jboss.ejb3.StrictMaxPool.class, maxSize=StrictlyPooledMDB.maxActiveCount, timeout=10000)
 public class StrictlyPooledMDB implements MessageListener

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/timer/TimerTester.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/timer/TimerTester.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/timer/TimerTester.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -21,8 +21,10 @@
   */
 package org.jboss.ejb3.test.timer;
 
+import java.util.Date;
 
 
+
 /**
  * Comment
  *
@@ -31,11 +33,17 @@
  */
 public interface TimerTester
 {
+   void checkMandatoryTransaction();
+   
    void startTimer(long pPeriod);
 
    boolean isTimerCalled();
 
    void accessTimer();
    
+   void setTimer(Date expiration);
+   
+   void startTimerAndRollback(long pPeriod);
+   
    void startTimerViaEJBContext(long pPeriod);
 }

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/timer/TimerTesterBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/timer/TimerTesterBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/timer/TimerTesterBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -21,14 +21,10 @@
   */
 package org.jboss.ejb3.test.timer;
 
-import java.util.Date;
-import javax.annotation.Resource;
 import javax.ejb.Remote;
-import javax.ejb.SessionContext;
 import javax.ejb.Stateless;
 import javax.ejb.Timeout;
 import javax.ejb.Timer;
-import javax.ejb.TimerService;
 
 import org.jboss.logging.Logger;
 
@@ -40,51 +36,15 @@
  */
 @Stateless
 @Remote(TimerTester.class)
-public class TimerTesterBean implements TimerTester
+public class TimerTesterBean extends BaseTimerTesterBean implements TimerTester
 {
    private static final Logger log = Logger.getLogger(TimerTesterBean.class);
    
-   public static boolean timerCalled = false;
-
-   private @Resource TimerService timerService;
-
-   private @Resource SessionContext ctx;
-   
-   private Timer timer;
-
-   public void startTimer(long pPeriod)
-   {
-      timerCalled = false;
-      System.out.println("************ startTimer");
-      timer = timerService.createTimer(new Date(new Date().getTime() + pPeriod), "TimerSLSBean");
-      
-   }
-
-   public void startTimerViaEJBContext(long pPeriod)
-   {
-      timerCalled = false;
-      System.out.println("************ startTimerViaEJBContext");
-      timer = ctx.getTimerService().createTimer(new Date(new Date().getTime() + pPeriod), "TimerSLSBean");
-   }
-
-   public void accessTimer()
-   {
-      //Access timer to make sure we have pushed the AllowedOperationsAssociation
-      timer.getTimeRemaining();
-      timer.getHandle();
-      timer.getInfo();
-   }
-   
-   public boolean isTimerCalled()
-   {
-      return timerCalled;
-   }
-
    @Timeout
    public void timeoutHandler(Timer timer)
    {
       log.info("EJB TIMEOUT!!!!");
       timerCalled = true;
-      timer.cancel();
+      //timer.cancel();
    }
 }

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/timer/TimerTesterBean21.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/timer/TimerTesterBean21.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/timer/TimerTesterBean21.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -21,13 +21,10 @@
   */
 package org.jboss.ejb3.test.timer;
 
-import java.util.Date;
-import javax.annotation.Resource;
 import javax.ejb.Remote;
-import javax.ejb.SessionContext;
 import javax.ejb.Stateless;
+import javax.ejb.TimedObject;
 import javax.ejb.Timer;
-import javax.ejb.TimerService;
 
 import org.jboss.annotation.ejb.RemoteBinding;
 import org.jboss.logging.Logger;
@@ -41,50 +38,14 @@
 @Stateless
 @RemoteBinding(jndiBinding="TimerTesterBean21")
 @Remote(TimerTester.class)
-public class TimerTesterBean21 implements TimerTester, javax.ejb.TimedObject
+public class TimerTesterBean21 extends BaseTimerTesterBean implements TimerTester, TimedObject
 {
    private static final Logger log = Logger.getLogger(TimerTesterBean21.class);
    
-   public static boolean timerCalled = false;
-
-   private @Resource TimerService timerService;
-
-   private @Resource SessionContext ctx;
-   
-   private Timer timer;
-
-   public void startTimer(long pPeriod)
-   {
-      timerCalled = false;
-      System.out.println("************ startTimer");
-      timer = timerService.createTimer(new Date(new Date().getTime() + pPeriod), "TimerSLSBean");
-      
-   }
-
-   public void startTimerViaEJBContext(long pPeriod)
-   {
-      timerCalled = false;
-      System.out.println("************ startTimerViaEJBContext");
-      timer = ctx.getTimerService().createTimer(new Date(new Date().getTime() + pPeriod), "TimerSLSBean");
-   }
-
-   public void accessTimer()
-   {
-      //Access timer to make sure we have pushed the AllowedOperationsAssociation
-      timer.getTimeRemaining();
-      timer.getHandle();
-      timer.getInfo();
-   }
-   
-   public boolean isTimerCalled()
-   {
-      return timerCalled;
-   }
-
    public void ejbTimeout(Timer timer)
    {
       log.info("EJB TIMEOUT!!!!");
       timerCalled = true;
-      timer.cancel();
+      //timer.cancel();
    }
 }

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/timer/unit/RemoteUnitTestCase.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/timer/unit/RemoteUnitTestCase.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/timer/unit/RemoteUnitTestCase.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -21,6 +21,8 @@
   */
 package org.jboss.ejb3.test.timer.unit;
 
+import java.util.Date;
+
 import org.jboss.ejb3.test.timer.TimerTester;
 import org.jboss.test.JBossTestCase;
 import junit.framework.Test;
@@ -47,6 +49,44 @@
 
    }
 
+   public void testNewTransaction() throws Exception
+   {
+      TimerTester test = (TimerTester) getInitialContext().lookup("TransactionalTimerTesterBean/remote");
+      test.startTimer(5000);
+      test.accessTimer();
+      Thread.sleep(6000);
+      assertTrue(test.isTimerCalled());
+   }
+   
+   // EJBTHREE-630
+   public void testPersistence() throws Exception
+   {
+      TimerTester test = (TimerTester) getInitialContext().lookup("TimerTesterService/remote");
+      long when = System.currentTimeMillis() + 5000;
+      test.setTimer(new Date(when));
+      
+      redeploy("timer-test.jar");
+      
+      test = (TimerTester) getInitialContext().lookup("TimerTesterService/remote");
+      long wait = 1000 + (when - System.currentTimeMillis());
+      if(wait > 0)
+         Thread.sleep(wait);
+      assertTrue(test.isTimerCalled());
+   }
+   
+   public void testService() throws Exception
+   {
+      TimerTester test = (TimerTester) getInitialContext().lookup("TimerTesterService/remote");
+      test.startTimer(5000);
+      test.accessTimer();
+      Thread.sleep(6000);
+      assertTrue(test.isTimerCalled());
+      test.startTimerViaEJBContext(5000);
+      test.accessTimer();
+      Thread.sleep(6000);
+      assertTrue(test.isTimerCalled());
+   }
+   
    public void testSimple() throws Exception
    {
       TimerTester test = (TimerTester) this.getInitialContext().lookup("TimerTesterBean/remote");
@@ -73,6 +113,14 @@
       assertTrue(test.isTimerCalled());
    }
 
+   public void testRollback() throws Exception
+   {
+      TimerTester test = (TimerTester) this.getInitialContext().lookup("TimerTesterBean/remote");
+      test.startTimerAndRollback(5000);
+      Thread.sleep(6000);
+      assertFalse(test.isTimerCalled());
+   }
+   
    public static Test suite() throws Exception
    {
       return getDeploySetup(RemoteUnitTestCase.class, "timer-test.jar");

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/unauthenticatedprincipal/StatelessBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/unauthenticatedprincipal/StatelessBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/unauthenticatedprincipal/StatelessBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,39 @@
+/*
+  * 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.ejb3.test.unauthenticatedprincipal;
+
+import org.apache.log4j.Logger;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @version <tt>$Revision: 1.1 $</tt>
+ */
+public class StatelessBean
+   implements StatelessRemote
+{
+   private static final Logger log = Logger.getLogger(StatelessBean.class);
+    
+   public void testAccess()
+   {
+     
+   }
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/unauthenticatedprincipal/StatelessRemote.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/unauthenticatedprincipal/StatelessRemote.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/unauthenticatedprincipal/StatelessRemote.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,31 @@
+/*
+  * 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.ejb3.test.unauthenticatedprincipal;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @version <tt>$Revision: 1.0 $</tt>
+ */
+public interface StatelessRemote
+{
+   void testAccess();
+}

Added: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/unauthenticatedprincipal/unit/UnauthenticatedPrincipalTestCase.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/unauthenticatedprincipal/unit/UnauthenticatedPrincipalTestCase.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/unauthenticatedprincipal/unit/UnauthenticatedPrincipalTestCase.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -0,0 +1,54 @@
+/*
+  * 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.ejb3.test.unauthenticatedprincipal.unit;
+
+import org.jboss.ejb3.test.unauthenticatedprincipal.StatelessRemote;
+import org.jboss.test.JBossTestCase;
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @version <tt>$Revision: 1.0 $</tt>
+ */
+public class UnauthenticatedPrincipalTestCase extends JBossTestCase
+{
+  
+   public UnauthenticatedPrincipalTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testUnauthenticatedPrincipal() throws Exception
+   {
+      StatelessRemote test = (StatelessRemote)getInitialContext().lookup("StatelessBean/remote");
+      assertNotNull(test);
+      
+      test.testAccess();
+   }
+
+
+   public static Test suite() throws Exception
+   {
+      return getDeploySetup(UnauthenticatedPrincipalTestCase.class, "unauthenticatedprincipal.jar");
+   }
+
+}

Modified: branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/wls/embeddedwar/CustomerDAOBean.java
===================================================================
--- branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/wls/embeddedwar/CustomerDAOBean.java	2006-09-08 02:23:22 UTC (rev 56621)
+++ branches/Branch_4_0/ejb3/src/test/org/jboss/ejb3/test/wls/embeddedwar/CustomerDAOBean.java	2006-09-08 02:24:08 UTC (rev 56622)
@@ -41,8 +41,6 @@
       try 
       {
          java.lang.reflect.Method[] methods = EntityManager.class.getDeclaredMethods();
-         for (int i = 0 ; i < methods.length ; ++i)
-            System.out.println("!! method " + i + " " + methods[i].getName() + " " + methods[i].getParameterTypes().length);
          Customer cust = new Customer();
          cust.setName(name);
          em.persist(cust);




More information about the jboss-cvs-commits mailing list