[jboss-cvs] JBossAS SVN: r69046 - in branches: JBPAPP_4_2_0_GA_CP_4_3_MERGE/build and 80 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jan 16 15:55:41 EST 2008


Author: dbhole
Date: 2008-01-16 15:55:40 -0500 (Wed, 16 Jan 2008)
New Revision: 69046

Added:
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/imports/build-mq2jbm.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test-configs/clusteredjms2/
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test-configs/clusteredjms2/deploy/
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test-configs/clusteredjms2/deploy/jboss-messaging.sar/
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test-configs/clusteredjms2/deploy/jboss-messaging.sar/messaging-service.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/consumer/consumertest-jbm-service.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/consumer/consumertest-mq-service.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/dd/mdb/dd-mdb-mq-service.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/interceptors2/interceptors2test-mq-service.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/mdb/mdbtest-mq-service.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/mdbtransactions/mdbtransactionstest-mq-service.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/mq2jbm.xsl
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/strictpool/strictpool_mdbtest-mq-service.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/ReplyToCMDB.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/strictpool/unit/MDBCallable.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/imports/sections/jbm.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/ClusteredTestCase.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/ParallelTest.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/ParallelTestContainer.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/killservice/
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/killservice/KillService.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/killservice/KillServiceMBean.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossJMSUnitTestCase.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/jbossmessaging/META-INF/
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/jbossmessaging/META-INF/jboss-service.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/jbossmessaging/test-clustered-destinations-full-service.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/jbossmessaging/test-destinations-service.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/test-configs/jbm-cluster1/
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/test-configs/jbm-cluster1/deploy/
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/test-configs/jbm-cluster1/deploy/hsqldb-ds.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/test-configs/jbm-cluster2/
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/test-configs/jbm-cluster2/deploy/
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/test-configs/jbm-cluster2/deploy/hsqldb-ds.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/util/fileurllister/deploy/dotted.subdir/
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/util/fileurllister/deploy/dotted.subdir/four.xml
Removed:
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test-configs/clusteredjms2/deploy/
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test-configs/clusteredjms2/deploy/jboss-messaging.sar/
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test-configs/clusteredjms2/deploy/jboss-messaging.sar/messaging-service.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/consumer/consumertest-service.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/dd/mdb/dd-mdb-service.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/interceptors2/interceptors2test-service.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/mdb/mdbtest-service.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/mdbtransactions/mdbtransactionstest-service.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/strictpool/strictpool_mdbtest-service.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/strictpool/MDBInvoker.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/messaging/src/etc/server-jbm/default/deploy/jboss-messaging.sar/META-INF/MANIFEST.MF
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/messaging/src/etc/server-jbm/default/deploy/jboss-messaging.sar/connection-factories-service.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/messaging/src/etc/server-jbm/default/deploy/jboss-messaging.sar/destinations-service.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/messaging/src/etc/server-jbm/default/deploy/jboss-messaging.sar/hsqldb-persistence-service.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/messaging/src/etc/server-jbm/default/deploy/jboss-messaging.sar/messaging-service.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/messaging/src/etc/server-jbm/default/deploy/jboss-messaging.sar/remoting-bisocket-service.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/ClusteredTestCase.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/ParallelTest.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/ParallelTestContainer.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/killservice/
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/killservice/KillService.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/killservice/KillServiceMBean.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossJMSUnitTest.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/test/Jms11UnitTest.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/jbossmessaging/META-INF/jboss-service.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/test-configs/jbm-cluster1/deploy/
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/test-configs/jbm-cluster1/deploy/hsqldb-ds.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/test-configs/jbm-cluster2/deploy/
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/test-configs/jbm-cluster2/deploy/hsqldb-ds.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/util/fileurllister/deploy/dotted.sub.dir/
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/util/fileurllister/deploy/dotted.subdir/four.xml
Modified:
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/build/README
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/build/build-distr.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/build/build-thirdparty.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/build/build.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/connector/src/etc/example-config/hajndi-jms-ds.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/connector/src/etc/example-config/jms-ds.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/connector/src/main/org/jboss/resource/adapter/jms/inflow/dlq/GenericDLQHandler.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/connector/src/resources/jca-sar/jbossjca-service.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/.classpath
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/build-test.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/build.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/main/org/jboss/ejb3/EJB3Deployer.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/main/org/jboss/ejb3/EJB3DeployerMBean.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/main/org/jboss/ejb3/cache/tree/StatefulTreeCache.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/main/org/jboss/ejb3/jms/JMSDestinationFactory.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/main/org/jboss/ejb3/jms/ServerPeerJMSDestinationFactory.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/main/org/jboss/ejb3/mdb/ProducerFactory.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/META-INF/jboss-service.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test-configs/localfromremote1/deploy/
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test-configs/localfromremote2/deploy/
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/dd/mdb/META-INF/ejb-jar.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/service/META-INF/jboss.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/clusteredjms/unit/MDBUnitTestCase.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/consumer/unit/ConsumerUnitTestCase.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/dd/mdb/QueueBean.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/dd/mdb/unit/MDBUnitTestCase.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/ejbthree959/Status.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/ejbthree959/StatusBean.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/BusinessInterface.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/StatefulBean.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/unit/MultiBindingsTestCase.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/interceptors2/unit/InterceptorsTestCase.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/jbas4489/BMTCleanUp.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/jbas4489/BMTCleanUpBean.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/jbas4489/unit/BMTCleanUpUnitTestCase.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/mdb/unit/ConcurrentMDBUnitTestCase.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/mdb/unit/MDBUnitTestCase.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/mdb/unit/MetricsUnitTestCase.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/QueueTestMDB.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/RollbackQueueTestMDB.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/StatelessFacadeBean.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/unit/MDBUnitTestCase.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/service/TestResourceInjectionService.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/strictpool/StrictlyPooledMDB.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/strictpool/unit/StrictPoolUnitTestCase.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3x/src/main/javax/annotation/PostConstruct.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3x/src/main/javax/annotation/PreDestroy.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3x/src/main/javax/annotation/security/DenyAll.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3x/src/main/javax/annotation/security/PermitAll.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3x/src/main/javax/ejb/EJBs.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3x/src/main/javax/ejb/Local.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3x/src/main/javax/ejb/LocalHome.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3x/src/main/javax/ejb/Remote.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3x/src/main/javax/ejb/RemoteHome.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3x/src/main/javax/ejb/TransactionManagement.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/jmx/src/main/org/jboss/mx/loading/RepositoryClassLoader.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/jmx/src/main/org/jboss/mx/loading/UnifiedLoaderRepository3.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/messaging/src/etc/server/default/deploy/jbossmq-destinations-service.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/server/src/etc/conf/default/jboss-log4j.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/server/src/etc/conf/default/jboss-minimal.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/server/src/etc/conf/default/jboss-service.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/server/src/resources/uuid-key-generator/META-INF/jboss-service.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/system/src/bin/run.sh
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/system/src/main/org/jboss/Version.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/test/src/main/org/jboss/test/JBossTestServices.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/.classpath
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/build.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/imports/server-config.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/imports/test-jars.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/JBossTestClusteredServices.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/compatibility/test/SerialVersionUIDUnitTestCase.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/test/SessionCloseStressTestCase.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jmx/xmbean/XMLAttributePersistenceManagerTestService.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/timer/test/BasicTimerUnitTestCase.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/tm/ejb/TxTimeoutBean.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/util/test/FileURLListerUnitTestCase.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/thirdparty/
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/tomcat/src/main/org/jboss/web/tomcat/service/session/JBossCacheWrapper.java
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/tools/etc/buildmagic/buildmagic.ent
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/tools/etc/buildmagic/version-info.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/varia/src/resources/services/binding/sample-bindings.xml
   branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/varia/src/resources/services/snmp/deploy/attributes.mib
Log:

Temporary commit location to run hudson tests on JBPAPP_4_2_0_GA_CP + merger from JBPAPP_4_2



Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE (from rev 69045, branches/JBPAPP_4_2_0_GA_CP)

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/build/README
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/build/README	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/build/README	2008-01-16 20:55:40 UTC (rev 69046)
@@ -1,11 +1,10 @@
 Build files allow for conditional switching between MQ and JBM:
 
 -Dbuild.soa=true passed to build/build.xml builds with JBM
--Djbosstest.useJBM=true passed to testsuite/build.xml tests with JBM
+-Djbosstest.test.soa=true passed to testsuite/build.xml tests with JBM
 
 Not supplying -Dbuild.soa=true will build with MQ
-Not supplying -Djbosstest.useJBM will run MQ tests
+Not supplying -Djbosstest.test.soa will run MQ tests
 
 The version with MQ will identify itself as EAP 4.2
 The version with JBM, however, will identify itself as EAP 4.3
-

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/build/build-distr.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/build/build-distr.xml	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/build/build-distr.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -524,11 +524,44 @@
     </copy>
   </target>
 	
+  <target name="replace-messaging-examples" description="Replacing configuration examples for JMS">
+ 	 <delete dir="${install.root}/docs/examples/jms"/>
+ 	
+	 <mkdir dir="${install.root}/docs/examples/jms"/>
+
+ 	 <copy todir="${install.root}/docs/examples/jms">
+ 	 	<fileset dir="${jboss.messaging.resources}" includes="**"/>
+ 	 </copy>
+  </target>
+
+
+  <target name="replace-messaging-clustered" if="jbm-clustered">
+  	<copy todir="${install.server}/${target}/deploy/jboss-messaging.sar">
+  		<fileset dir="${jboss.messaging.resources}">
+            <include name="connection-factories-service.xml"/>
+            <include name="destinations-service.xml"/>
+            <include name="clustered-hsqldb-persistence-service.xml"/>
+            <include name="messaging-service.xml"/>
+            <include name="remoting-bisocket-service.xml"/>
+  		</fileset>
+  	</copy>
+  </target>
+	
+
+  <target name="replace-messaging-nonclustered" unless="jbm-clustered">
+      <copy todir="${install.server}/${target}/deploy/jboss-messaging.sar">
+          <fileset dir="${jboss.messaging.resources}">
+              <include name="connection-factories-service.xml"/>
+              <include name="destinations-service.xml"/>
+              <include name="hsqldb-persistence-service.xml"/>
+              <include name="messaging-service.xml"/>
+              <include name="remoting-bisocket-service.xml"/>
+          </fileset>
+      </copy>
+  </target>
+      
   <target name="replace-messaging" description = "Replace JBossMQ by JBoss Messaging on a given installation">
-  	
   	<property name="target" value="default"/>
-  	
-	
   	<echo message="target = ${target} ${jboss.messaging.lib}"/>
   	<move todir="${install.server}/${target}/deploy" failonerror="no">
   	  <fileset dir="${install.server}/${target}/deploy/jms">
@@ -550,20 +583,33 @@
       </fileset>
     </copy>
   	
+  	<unzip src="${jboss.messaging.lib}/jboss-messaging.jar" dest="${project.root}/messaging/output/etc/server-jbm/default/deploy/jboss-messaging.sar">
+  		<patternset>
+  			<include name="META-INF/MANIFEST.MF"/>
+        </patternset>
+  	</unzip>
+  	
   	<replace file="${install.server}/${target}/conf/standardjboss.xml">
 	  	<replacefilter token="jboss.mq:service=DestinationManager" value="jboss.messaging:service=ServerPeer"/>
 	  	<replacefilter token="&gt;createTopic&lt;" value="&gt;deployTopic&lt;"/>
 	  	<replacefilter token="&gt;createQueue&lt;" value="&gt;deployQueue&lt;"/>
   	</replace>
 
+  	<replace file="${install.server}/${target}/conf/jboss-service.xml">
+	  	<replacefilter token="jboss.mq:service=DestinationManager" value="jboss.messaging:service=ServerPeer"/>
+  	</replace>
   	
+    <antcall target="replace-messaging-clustered"></antcall>
+    <antcall target="replace-messaging-nonclustered"></antcall>
+
+  	
   	<delete dir="${install.server}/${target}/deploy/jms"/>
   	<delete dir="${install.server}/${target}/deploy-hasingleton/jms"/>
 
     <!-- Removing jbossmq libraries -->
     <delete file="${install.server}/${target}/lib/jbossmq.jar"/>
-    <delete file="${install.client}/jbossmq-client.jar"/> 
-
+	<delete file="${install.client}/jbossmq-client.jar"/> 
+	<copy file="${jboss.messaging.lib}/jboss-messaging-client.jar" todir="${install.client}"/>
   </target>
 	
 

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/build/build-thirdparty.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/build/build-thirdparty.xml	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/build/build-thirdparty.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -83,7 +83,7 @@
     <componentref name="hibernate" version="3.2.4.SP1_CP01-brew"/>
     <componentref name="hibernate-annotations" version="3.2.1.GA.patch01-brew"/>
     <componentref name="hibernate-entitymanager" version="3.2.1.GA-brew"/>
-    <componentref name="hsqldb" version="1.8.0.8-brew"/>
+    <componentref name="hsqldb" version="1.8.0.8.patch01-brew"/>
     <componentref name="jacorb" version="2.3.0jboss.patch5-brew"/>
     <componentref name="javassist" version="3.5.0.GA-brew"/>
     <componentref name="jaxen" version="1.1-brew"/>
@@ -121,7 +121,7 @@
     <componentref name="trove" version="1.0.2-brew"/>
     <componentref name="woodstox" version="3.1.1-brew"/>
     <componentref name="xdoclet" version="1.2.3-brew"/>
-    <componentref name="jboss/messaging" version="1.4.0.SP1-brew"/>
+    <componentref name="jboss/messaging" version="1.4.0.SP3_CP01-brew"/>
   </build>
 
   <synchronizeinfo/>

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/build/build.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/build/build.xml	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/build/build.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -390,17 +390,23 @@
 
   <!-- Parameter target - The target which will be replaced by jboss-messaging -->
   <target name="replace-messaging" description = "Replace JBossMQ by JBoss Messaging on a given installation" depends="init" if="build.soa">
-  	
+
   	 <ant antfile="build-distr.xml" target="replace-messaging">
- 	 	 <property name="target" value="default" />
+	 	 <property name="target" value="default" />
+	 	 <property name="source-config" value="default" />
   	 </ant>
  	 <ant antfile="build-distr.xml" target="replace-messaging">
 	 	 <property name="target" value="all" />
+ 	 	 <property name="jbm-clustered" value="true"/>
  	 </ant>
  	 <ant antfile="build-distr.xml" target="replace-messaging">
 	 	 <property name="target" value="production" />
+ 	 	 <property name="jbm-clustered" value="true"/>
  	 </ant>
   	
+  	
+  	 <ant antfile="build-distr.xml" target="replace-messaging-examples"/>
+  	
   </target>
 
   <!-- === -->
@@ -592,7 +598,6 @@
   <target name="install"
     description="Install the structure for a release."
     depends="partition-build">
-   	 <antcall target="replace-messaging"/>
   </target>
 
   <target name="release"
@@ -633,9 +638,10 @@
   -->
   <target name="partition-build" depends="init">
     <antcall target="partition-production"/>
-    <antcall target="makeProductionConfigChanges"/>
     <antcall target="partition-default"/>
     <antcall target="partition-minimal"/>
+    <antcall target="makeConfigChanges"/>
+    <antcall target="replace-messaging"/>
     <antcall target="jboss-all-client"/>
     <!--<antcall target="setup-ejb3-dist"/>-->
   </target>
@@ -649,7 +655,7 @@
       </fileset>
     </copy>
 
-    <!-- The customizationd for "production" runs go here -->
+    <!-- The customizations for "production" runs go here -->
 
     <!-- JAVA_OPTS="-Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512" -->
     <copy tofile="${install.production}/run.conf"
@@ -868,404 +874,161 @@
     </condition>
   </target>
 
-  <!-- Modify run.sh for production config -->
+  <!-- Update config and other files for production config -->
   <target name="makeProductionConfigChanges" 
-          depends="partition-production">
+          depends="partition-default,partition-production">
 
-        <!-- Fix up the EOL characters for Windows files -->
-        <antcall target="fixEOL"/>
+     <ant antfile="build.xml" target="updateConfigFiles">
+         <property name="config.type" value="dev" />
+         <property name="config.dir" value="${install.all}" />
+     </ant>
 
-        <!-- Set all JVMs except darwin to use -server -->
+     <ant antfile="build.xml" target="updateConfigFiles">
+         <property name="config.type" value="dev" />
+         <property name="config.dir" value="${install.default}" />
+     </ant>
 
-        <replace file="${install.bin}/run.sh"
-                 summary="true">
+     <ant antfile="build.xml" target="updateConfigFiles">
+         <property name="config.type" value="prod" />
+         <property name="config.dir" value="${install.production}" />
+     </ant>
+      
+  </target>
 
-            <replacetoken><![CDATA[
-# If -server not set in JAVA_OPTS, set it, if supported
-SERVER_SET=`echo $JAVA_OPTS | $GREP "\-server"`
-if [ "x$SERVER_SET" = "x" ]; then
+  <!-- Update config files for 4.2/4.3 -->
+  <target name="makeConfigChanges" 
+          depends="makeProductionConfigChanges">
 
-    # Check for SUN(tm) JVM w/ HotSpot support
-    if [ "x$HAS_HOTSPOT" = "x" ]; then
-	HAS_HOTSPOT=`"$JAVA" -version 2>&1 | $GREP -i HotSpot`
-    fi
+     <!-- Fix up the EOL characters for Windows files -->
+     <antcall target="fixEOL"/>
+     
+     <condition property="verconf.to.keep" value="43CONF" else="42CONF">
+         <or>
+             <isset property="build.soa"/>
+             <isset property="build.with.jbm"/>
+         </or>
+     </condition>
 
-    # Enable -server if we have Hotspot, unless we can't
-    if [ "x$HAS_HOTSPOT" != "x" ]; then
-	# MacOS does not support -server flag
-	if [ "$darwin" != "true" ]; then
-	    JAVA_OPTS="-server $JAVA_OPTS"
-	fi
-    fi
-fi
-]]></replacetoken>
+     <condition property="verconf.to.delete" value="42CONF" else="43CONF">
+         <or>
+             <isset property="build.soa"/>
+             <isset property="build.with.jbm"/>
+         </or>
+     </condition>
 
-            <replacevalue><![CDATA[
-# If -server not set in JAVA_OPTS, set it, if supported
-SERVER_SET=`echo $JAVA_OPTS | $GREP "\-server"`
-if [ "x$SERVER_SET" = "x" ]; then
+     <replaceregexp file="${install.examples}/binding-manager/sample-bindings.xml"
+         flags="gm"
+         match="@.*${verconf.to.keep}\s"
+         replace=""
+     />
 
-    # Check for SUN(tm) JVM w/ HotSpot support
-    if [ "x$HAS_HOTSPOT" = "x" ]; then
-	HAS_HOTSPOT=`"$JAVA" -version 2>&1 | $GREP -i HotSpot`
-    fi
+     <replaceregexp file="${install.examples}/binding-manager/sample-bindings.xml"
+         flags="gs"
+         match="@${verconf.to.delete}((?!@END.*CONF).)*@END${verconf.to.delete}\s"
+         replace=""
+     />
+  
+  </target>
 
-    # Enable -server if we have Hotspot, unless we can't
-	# MacOS does not support -server flag
-	if [ "$darwin" != "true" ]; then
-	    JAVA_OPTS="-server $JAVA_OPTS"
-	fi
-fi
-]]></replacevalue>
+  <!-- Modify run.sh for production config -->
+  <target name="updateConfigFiles">
 
-        </replace>
+        <property name="config.type" value=""/>
+        <property name="config.dir" value=""/>
 
-  <!-- Uncomment the configuration to make the key generation cluster safe -->
+        <condition property="conf.to.keep" value="DEVCONF" else="PRODCONF">
+            <equals arg1="${config.type}" arg2="dev"/>
+        </condition>
 
-        <replace file="${install.production}/deploy/uuid-key-generator.sar/META-INF/jboss-service.xml"
-                 summary="true">
+        <condition property="conf.to.delete" value="PRODCONF" else="DEVCONF">
+            <equals arg1="${config.type}" arg2="dev"/>
+        </condition>
+ 
+       <!-- Uncomment the configuration to make the key generation cluster safe -->
 
-            <replacetoken><![CDATA[
-     <!-- Uncomment to make it cluster-safe: Select current Hi value query (FOR UPDATE is recommended)
-     <attribute name="SelectHiSql">
-        select HIGHVALUES from HILOSEQUENCES where SEQUENCENAME='general' FOR UPDATE
-     </attribute>                                                  
-     -->
-]]></replacetoken>
+        <replaceregexp file="${config.dir}/deploy/uuid-key-generator.sar/META-INF/jboss-service.xml"
+            flags="gm"
+            match="@.*${conf.to.keep}\s"
+            replace=""
+        />
 
-            <replacevalue><![CDATA[
-     <!-- Uncomment to make it cluster-safe: Select current Hi value query (FOR UPDATE is recommended) -->
-     <attribute name="SelectHiSql">
-        select HIGHVALUES from HILOSEQUENCES where SEQUENCENAME='general' FOR UPDATE
-     </attribute> 
-]]></replacevalue>
+        <replaceregexp file="${config.dir}/deploy/uuid-key-generator.sar/META-INF/jboss-service.xml"
+            flags="gs"
+            match="@${conf.to.delete}((?!@END.*CONF).)*@END${conf.to.delete}\s"
+            replace=""
+        />
 
-        </replace>
 
-  <!-- Only the customers explicit production queues should be configured in the mq destinations file  -->
+        <!-- Only the customers explicit production queues should be configured in the mq destinations file  -->
 
-        <replace file="${install.production}/deploy-hasingleton/jms/jbossmq-destinations-service.xml"
-                 summary="true">
+        <replaceregexp file="${config.dir}/deploy-hasingleton/jms/jbossmq-destinations-service.xml"
+            flags="gm"
+            match="@.*${conf.to.keep}\s"
+            replace=""
+        />
 
-            <replacetoken><![CDATA[
-<server>
-  <!-- Destination without a configured SecurityManager or without a 
-       a SecurityConf will default to role guest with read=true, write=true,
-       create=false.
-  -->
-]]></replacetoken>
+        <replaceregexp file="${config.dir}/deploy-hasingleton/jms/jbossmq-destinations-service.xml"
+            flags="gs"
+            match="@${conf.to.delete}((?!@END.*CONF).)*@END${conf.to.delete}\s"
+            replace=""
+        />
 
-            <replacevalue><![CDATA[
-<server>
-  <!-- Destination without a configured SecurityManager or without a 
-       a SecurityConf will default to role guest with read=true, write=true,
-       create=false.
-]]></replacevalue>
 
-        </replace>
+        <!-- Reduce log verbosity -->
 
-        <replace file="${install.production}/deploy-hasingleton/jms/jbossmq-destinations-service.xml"
-                 summary="true">
+        <replaceregexp file="${config.dir}/conf/jboss-log4j.xml"
+            flags="gm"
+            match="@.*${conf.to.keep}\s"
+            replace=""
+        />
 
-            <replacetoken><![CDATA[
-</server>
-]]></replacetoken>
+        <replaceregexp file="${config.dir}/conf/jboss-log4j.xml"
+            flags="gs"
+            match="@${conf.to.delete}((?!@END.*CONF).)*@END${conf.to.delete}\s"
+            replace=""
+        />
 
-            <replacevalue><![CDATA[
--->
-</server>
-]]></replacevalue>
 
-        </replace>
+        <!-- Increase time between scans for hot deploy -->
 
-  <!-- Reduce log verbosity -->
+        <replaceregexp file="${config.dir}/conf/jboss-minimal.xml"
+            flags="gm"
+            match="@.*${conf.to.keep}\s"
+            replace=""
+        />
 
-        <replace file="${install.production.conf}/jboss-log4j.xml"
-                 summary="true">
+        <replaceregexp file="${config.dir}/conf/jboss-minimal.xml"
+            flags="gs"
+            match="@${conf.to.delete}((?!@END.*CONF).)*@END${conf.to.delete}\s"
+            replace=""
+        />
 
-            <replacetoken><![CDATA[
-   <!-- ============================== -->
-   <!-- Append messages to the console -->
-   <!-- ============================== -->
+        <replaceregexp file="${config.dir}/conf/jboss-service.xml"
+            flags="gm"
+            match="@.*${conf.to.keep}\s"
+            replace=""
+        />
 
-   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
-      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
-      <param name="Target" value="System.out"/>
-      <param name="Threshold" value="INFO"/>
+        <replaceregexp file="${config.dir}/conf/jboss-service.xml"
+            flags="gs"
+            match="@${conf.to.delete}((?!@END.*CONF).)*@END${conf.to.delete}\s"
+            replace=""
+        />
 
-      <layout class="org.apache.log4j.PatternLayout">
-         <!-- The default pattern: Date Priority [Category] Message\n -->
-         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
-      </layout>
-   </appender>
-]]></replacetoken>
+        <!-- Disable connection close debug monitoring -->
 
-            <replacevalue><![CDATA[
-   <!-- ============================== -->
-   <!-- Append messages to the console -->
-   <!-- ============================== -->
-   <!--
-   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
-      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
-      <param name="Target" value="System.out"/>
-      <param name="Threshold" value="INFO"/>
+        <replaceregexp file="${config.dir}/deploy/jbossjca-service.xml"
+            flags="gm"
+            match="@.*${conf.to.keep}\s"
+            replace=""
+        />
 
-      <layout class="org.apache.log4j.PatternLayout">
-         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
-      </layout>
-   </appender>
-   -->
-]]></replacevalue>
+        <replaceregexp file="${config.dir}/deploy/jbossjca-service.xml"
+            flags="gs"
+            match="@${conf.to.delete}((?!@END.*CONF).)*@END${conf.to.delete}\s"
+            replace=""
+        />
 
-        </replace>
-
-        <replace file="${install.production.conf}/jboss-log4j.xml"
-                 summary="true">
-
-            <replacetoken><![CDATA[
-   <!-- Buffer events and log them asynchronously
-   <appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
-     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
-     <appender-ref ref="FILE"/>
-     <appender-ref ref="CONSOLE"/>
-     <appender-ref ref="SMTP"/>
-   </appender>
-   -->
-]]></replacetoken>
-
-            <replacevalue><![CDATA[
-   <!-- Buffer events and log them asynchronously -->
-   <appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
-     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
-     <appender-ref ref="FILE"/>
-     <!--
-     <appender-ref ref="CONSOLE"/>
-     <appender-ref ref="SMTP"/>
-     -->
-   </appender>
-]]></replacevalue>
-
-        </replace>
-
-        <replace file="${install.production.conf}/jboss-log4j.xml"
-                 summary="true">
-
-            <replacetoken><![CDATA[
-   <!-- Limit the org.apache category to INFO as its DEBUG is verbose -->
-   <category name="org.apache">
-      <priority value="INFO"/>
-   </category>
-
-   <!-- Limit the org.jboss.serial (jboss-serialization) to INFO as its DEBUG is verbose -->
-   <category name="org.jboss.serial">
-      <priority value="INFO"/>
-   </category>
-]]></replacetoken>
-
-            <replacevalue><![CDATA[
-   <!-- Limit the org.apache category to INFO as its DEBUG is verbose -->
-   <category name="org.apache">
-      <priority value="WARN"/>
-   </category>
-
-   <!-- Limit the org.jboss.serial (jboss-serialization) to INFO as its DEBUG is verbose -->
-   <category name="org.jboss.serial">
-      <priority value="WARN"/>
-   </category>
-]]></replacevalue>
-
-        </replace>
-
-        <replace file="${install.production.conf}/jboss-log4j.xml"
-                 summary="true">
-
-            <replacetoken><![CDATA[
-   <!-- Limit the JSR77 categories -->
-   <category name="org.jboss.management">
-      <priority value="INFO"/>
-   </category>
-]]></replacetoken>
-
-            <replacevalue><![CDATA[
-   <!-- Limit the JSR77 categories -->
-   <category name="org.jboss.management">
-      <priority value="WARN"/>
-   </category>
-
-   <!-- Limit seam logging -->
-   <category name="org.jboss.seam">
-      <priority value="WARN"/>
-   </category> 
-]]></replacevalue>
-
-        </replace>
-
-        <replace file="${install.production.conf}/jboss-log4j.xml"
-                 summary="true">
-
-            <replacetoken><![CDATA[
-   <root>
-      <appender-ref ref="CONSOLE"/>
-      <appender-ref ref="FILE"/>
-   </root>
-
-]]></replacetoken>
-
-            <replacevalue><![CDATA[
-   <root>
-      <!-- <appender-ref ref="CONSOLE"/> -->
-      <appender-ref ref="ASYNC"/>
-   </root>
-]]></replacevalue>
-
-        </replace>
-
-        <replace file="${install.production.conf}/jboss-log4j.xml"
-                 summary="true">
-
-            <replacetoken><![CDATA[
-   <!-- Clustering logging -->
-   <!-- Uncomment the following to redirect the org.jgroups and
-      org.jboss.ha categories to a cluster.log file.
-
-   <appender name="CLUSTER" class="org.jboss.logging.appender.RollingFileAppender">
-     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
-     <param name="File" value="${jboss.server.log.dir}/cluster.log"/>
-     <param name="Append" value="false"/>
-     <param name="MaxFileSize" value="500KB"/>
-     <param name="MaxBackupIndex" value="1"/>
-
-     <layout class="org.apache.log4j.PatternLayout">
-       <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
-     </layout>
-   </appender>
-   <category name="org.jgroups">
-     <priority value="DEBUG" />
-     <appender-ref ref="CLUSTER"/>
-   </category>
-   <category name="org.jboss.ha">
-     <priority value="DEBUG" />
-     <appender-ref ref="CLUSTER"/>
-   </category>
-   -->
-]]></replacetoken>
-
-            <replacevalue><![CDATA[
-]]></replacevalue>
-
-        </replace>
-
-        <replace file="${install.production.conf}/jboss-log4j.xml"
-                 summary="true">
-
-            <replacetoken><![CDATA[
-   <!-- ================ -->
-   <!-- Limit categories -->
-   <!-- ================ -->
-]]></replacetoken>
-
-            <replacevalue><![CDATA[
-   <!-- Clustering logging -->
-   <!-- Uncomment the following to redirect the org.jgroups and
-      org.jboss.ha categories to a cluster.log file. -->
-   <!--
-   <appender name="CLUSTER" class="org.jboss.logging.appender.RollingFileAppender">
-     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
-     <param name="File" value="${jboss.server.log.dir}/cluster.log"/>
-     <param name="Append" value="false"/>
-     <param name="MaxFileSize" value="500KB"/>
-     <param name="MaxBackupIndex" value="1"/>
-
-     <layout class="org.apache.log4j.PatternLayout">
-       <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
-     </layout>
-   </appender>
-   -->
-
-   <!-- ================ -->
-   <!-- Limit categories -->
-   <!-- ================ -->
-
-   <category name="org.jboss.ha">
-     <priority value="INFO" />
-   </category>
-
-   <category name="com.arjuna">
-     <priority value="INFO" />
-   </category>
-
-   <category name="org.hibernate">
-     <priority value="INFO" />
-   </category>
-]]></replacevalue>
-
-        </replace>
-
-        <replace file="${install.production.conf}/jboss-log4j.xml"
-                 summary="true">
-
-            <replacetoken><![CDATA[
-   <!-- ================ -->
-   <!-- Limit categories -->
-   <!-- ================ -->
-]]></replacetoken>
-
-            <replacevalue><![CDATA[
-   <!-- ================ -->
-   <!-- Limit categories -->
-   <!-- ================ -->
-
-   <category name="org.jboss.web">
-     <priority value="INFO" />
-   </category>
-]]></replacevalue>
-
-        </replace>
-
-  <!-- Increase time between scans for hot deploy -->
-
-        <replace file="${install.production.conf}/jboss-minimal.xml"
-                 summary="true">
-
-            <replacetoken><![CDATA[
-      <attribute name="ScanPeriod">5000</attribute>
-]]></replacetoken>
-
-            <replacevalue><![CDATA[
-      <attribute name="ScanPeriod">60000</attribute>
-]]></replacevalue>
-
-        </replace>
-
-        <replace file="${install.production.conf}/jboss-service.xml"
-                 summary="true">
-
-            <replacetoken><![CDATA[
-      <attribute name="ScanPeriod">5000</attribute>
-]]></replacetoken>
-
-            <replacevalue><![CDATA[
-      <attribute name="ScanPeriod">60000</attribute>
-]]></replacevalue>
-
-        </replace>
-
-  <!-- Disable connection close debug monitoring -->
-
-        <replace file="${install.production}/deploy/jbossjca-service.xml"
-                 summary="true">
-
-            <replacetoken><![CDATA[
-    <!-- Enable connection close debug monitoring -->
-    <attribute name="Debug">true</attribute>
-]]></replacetoken>
-
-            <replacevalue><![CDATA[
-    <!-- Enable connection close debug monitoring -->
-    <attribute name="Debug">false</attribute>
-]]></replacevalue>
-
-        </replace>
   </target>
 
   <!-- Before executing <replace> task on Windows, convert the target files from -->
@@ -1273,14 +1036,15 @@
   <!-- <replace> does not break due to line termination inconsistencies -->
   <target name="fixEOL" depends="check.windows" if="is.windows">
     <echo message="Fixing EOL characters for multi-line text replacement on Windows"/>
-    <fixcrlf srcdir="${install.bin}" includes="run.conf" eol="crlf"/>
-    <fixcrlf srcdir="${install.bin}" includes="run.sh" eol="crlf"/>
-    <fixcrlf srcdir="${install.production}/deploy/uuid-key-generator.sar/META-INF" includes="jboss-service.xml" eol="crlf"/>
-    <fixcrlf srcdir="${install.production}/deploy-hasingleton/jms" includes="jbossmq-destinations-service.xml" eol="crlf"/>
-    <fixcrlf srcdir="${install.production.conf}" includes="jboss-log4j.xml" eol="crlf"/>
-    <fixcrlf srcdir="${install.production.conf}" includes="jboss-minimal.xml" eol="crlf"/>
-    <fixcrlf srcdir="${install.production.conf}" includes="jboss-service.xml" eol="crlf"/>
-    <fixcrlf srcdir="${install.production}/deploy" includes="jbossjca-service.xml" eol="crlf"/>
+    <fixcrlf srcdir="../system/src/bin" includes="run.conf" eol="crlf"/>
+    <fixcrlf srcdir="../system/src/bin" includes="run.sh" eol="crlf"/>
+    <fixcrlf srcdir="../server/src/resources/uuid-key-generator/META-INF" includes="jboss-service.xml" eol="crlf"/>
+    <fixcrlf srcdir="../messaging/src/etc/server/default/deploy" includes="jbossmq-destinations-service.xml" eol="crlf"/>
+    <fixcrlf srcdir="../server/src/etc/conf/default" includes="jboss-log4j.xml" eol="crlf"/>
+    <fixcrlf srcdir="../server/src/etc/conf/default" includes="jboss-minimal.xml" eol="crlf"/>
+    <fixcrlf srcdir="../server/src/etc/conf/default" includes="jboss-service.xml" eol="crlf"/>
+    <fixcrlf srcdir="../connector/src/resources/jca-sar" includes="jbossjca-service.xml" eol="crlf"/>
+    <fixcrlf srcdir="../varia/src/resources/services/binding" includes="sample-bindings.xml" eol="crlf"/>
   </target>
 
   <!-- set proxy settings -->

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/connector/src/etc/example-config/hajndi-jms-ds.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/connector/src/etc/example-config/hajndi-jms-ds.xml	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/connector/src/etc/example-config/hajndi-jms-ds.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -8,7 +8,7 @@
 
   <!-- The JMS provider loader -->
   <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
-	 name="jboss.mq:service=JMSProviderLoader,name=HAJNDIJMSProvider">
+	 name="jboss.jms:service=JMSProviderLoader,name=HAJNDIJMSProvider">
     <attribute name="ProviderName">DefaultJMSProvider</attribute>
     <attribute name="ProviderAdapterClass">
       org.jboss.jms.jndi.JNDIProviderAdapter
@@ -36,7 +36,7 @@
 
   <!-- The server session pool for Message Driven Beans -->
   <mbean code="org.jboss.jms.asf.ServerSessionPoolLoader"
-	 name="jboss.mq:service=ServerSessionPoolMBean,name=StdJMSPool">
+	 name="jboss.jms:service=ServerSessionPoolMBean,name=StdJMSPool">
     <depends optional-attribute-name="XidFactory">jboss:service=XidFactory</depends>
     <attribute name="PoolName">StdJMSPool</attribute>
     <attribute name="PoolFactoryClass">

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/connector/src/etc/example-config/jms-ds.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/connector/src/etc/example-config/jms-ds.xml	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/connector/src/etc/example-config/jms-ds.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -8,7 +8,7 @@
 
   <!-- The JMS provider loader -->
   <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
-	 name="jboss.mq:service=JMSProviderLoader,name=JMSProvider">
+	 name="jboss.jms:service=JMSProviderLoader,name=JMSProvider">
     <attribute name="ProviderName">DefaultJMSProvider</attribute>
     <attribute name="ProviderAdapterClass">
       org.jboss.jms.jndi.JNDIProviderAdapter
@@ -30,7 +30,7 @@
 
   <!-- The server session pool for Message Driven Beans -->
   <mbean code="org.jboss.jms.asf.ServerSessionPoolLoader"
-	 name="jboss.mq:service=ServerSessionPoolMBean,name=StdJMSPool">
+	 name="jboss.jms:service=ServerSessionPoolMBean,name=StdJMSPool">
     <depends optional-attribute-name="XidFactory">jboss:service=XidFactory</depends>
     <attribute name="PoolName">StdJMSPool</attribute>
     <attribute name="PoolFactoryClass">

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/connector/src/main/org/jboss/resource/adapter/jms/inflow/dlq/GenericDLQHandler.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/connector/src/main/org/jboss/resource/adapter/jms/inflow/dlq/GenericDLQHandler.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/connector/src/main/org/jboss/resource/adapter/jms/inflow/dlq/GenericDLQHandler.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -87,9 +87,13 @@
             count = incrementResentCounter(id);
          }
          
-         if (count > maxResent)
+         int max = maxResent;
+         if (msg.propertyExists(JMS_JBOSS_REDELIVERY_LIMIT))
+            max = msg.getIntProperty(JMS_JBOSS_REDELIVERY_LIMIT);
+         
+         if (count > max)
          {
-            warnDLQ(msg, count, maxResent);
+            warnDLQ(msg, count, max);
             clearResentCounter(id);
             return true;
          }

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/connector/src/resources/jca-sar/jbossjca-service.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/connector/src/resources/jca-sar/jbossjca-service.xml	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/connector/src/resources/jca-sar/jbossjca-service.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -60,7 +60,12 @@
     <depends optional-attribute-name="TransactionManagerServiceName">jboss:service=TransactionManager</depends>
 
     <!-- Enable connection close debug monitoring -->
+ at DEVCONF
     <attribute name="Debug">true</attribute>
+ at ENDDEVCONF
+ at PRODCONF
+    <attribute name="Debug">false</attribute>
+ at ENDPRODCONF
 
   </mbean>
 

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/.classpath
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/.classpath	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/.classpath	2008-01-16 20:55:40 UTC (rev 69046)
@@ -2,7 +2,7 @@
 <classpath>
 	<classpathentry excluding="org/jboss/ejb3/MC*|org/jboss/ejb3/client/|org/jboss/ejb3/clientmodule/|org/jboss/ejb3/deployers/|org/jboss/ejb3/embedded/" kind="src" path="src/main"/>
 	<classpathentry kind="src" path="docs/tutorial/ssl/src"/>
-	<classpathentry excluding="org/jboss/ejb3/test/**/*EmbeddedTest.java|org/jboss/ejb3/test/appclient/|org/jboss/ejb3/test/clusteredentity/unit/*Test*.java|org/jboss/ejb3/test/clusteredservice/|org/jboss/ejb3/test/clusteredsession/unit/|org/jboss/ejb3/test/ejbthree921/unit/|org/jboss/ejb3/test/standalone/" kind="src" output="output/eclipse-test-classes" path="src/test"/>
+	<classpathentry excluding="org/jboss/ejb3/test/**/*EmbeddedTest.java|org/jboss/ejb3/test/appclient/|org/jboss/ejb3/test/clusteredentity/unit/*Test*.java|org/jboss/ejb3/test/clusteredservice/|org/jboss/ejb3/test/clusteredsession/unit/|org/jboss/ejb3/test/ejbthree921/unit/|org/jboss/ejb3/test/jaxws/|org/jboss/ejb3/test/standalone/|org/jboss/ejb3/test/webservices/" kind="src" output="output/eclipse-test-classes" path="src/test"/>
 	<classpathentry excluding="*" kind="src" path="docs/embedded-tutorial/advanced-deployment/archive/src"/>
 	<classpathentry excluding="*" kind="src" path="docs/embedded-tutorial/advanced-deployment/archive-by-resource/src"/>
 	<classpathentry excluding="*" kind="src" path="docs/embedded-tutorial/advanced-deployment/deploy-dir/src"/>

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/build-test.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/build-test.xml	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/build-test.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -33,6 +33,16 @@
    <property name="buildlog.level" value="info" />
    <property environment="env"/>
 
+   <!-- TODO: integrate jboss.jms.provider and jboss.jms.product -->
+   
+   <condition property="jboss.jms.provider" value="jbm" else="mq">
+      <isset property="build.soa"/>
+   </condition>
+   
+   <condition property="jboss.jms.product" value="messaging" else="mq">
+      <isset property="build.soa"/>
+   </condition>
+   
    <!-- Set a hostname property based on COMPUTERNAME for win32, HOSTNAME
    otherwise and initialize the node0/node1 cluster hostnames to localhost
    and ${hostname} by default. If you cannot route multicast traffic between
@@ -222,6 +232,7 @@
    <property name="build.stylesheets" value="${module.output}/stylesheets"/>
    <!-- build.resources is needed for the test-configs directory used by the create-config macro -->
    <property name="build.resources" value="${module.source}/resources"/>
+   <property name="target.resources" value="${module.output}/resources"/>
 
    <!-- Install/Release structure -->
    <property name="install.id" value="${module.name}-${module.version}"/>
@@ -312,6 +323,7 @@
    <property name="jbosstest.beancount" value="5"/>
    <property name="jbosstest.nodeploy" value="false"/>
 
+   <import file="imports/build-mq2jbm.xml"/>
    <import file="imports/build-simple.xml"/>
    
    <target name="init">
@@ -364,6 +376,8 @@
          <classpath refid="javac.classpath"/>
          <exclude name="org/jboss/ejb3/test/**/*EmbeddedTest.java"/>
          <exclude name="org/jboss/ejb3/test/appclient/**"/>
+         <exclude name="org/jboss/ejb3/test/jaxws/**"/>
+         <exclude name="org/jboss/ejb3/test/webservices/**"/>
          <exclude name="org/jboss/ejb3/test/standalone/**"/>
       </javac>
    </target>
@@ -455,13 +469,15 @@
          </fileset>
       </jar>
 
+      <build-jms-dd name="jca/inflow" descriptor="jmsmdbtest-service.xml"/>
+      
       <jar jarfile="${build.lib}/jmsinflowmdb.jar">
          <fileset dir="${build.classes}">
             <include name="org/jboss/ejb3/test/jca/inflowmdb/JMS*.class"/>
             <include name="org/jboss/ejb3/test/jca/inflowmdb/Stateless*.class"/>
             <include name="org/jboss/ejb3/test/jca/inflowmdb/unit/*.class"/>
          </fileset>
-         <fileset dir="${build.resources}/test/jca/inflow">
+         <fileset dir="${target.resources}/test/jca/inflow">
             <include name="jmsmdbtest-service.xml"/>
          </fileset>
       </jar>
@@ -911,6 +927,7 @@
          </fileset>
       </copy>
 
+      <mq2jbm basedir="${resources}/test/interceptors2"/>
    </target>
 
    <target name="interceptors3"
@@ -1338,6 +1355,8 @@
             <include name="*.xml"/>
          </fileset>
       </copy>
+      
+      <mq2jbm basedir="${resources}/test/dd/mdb"/>
    </target>
 
    <target name="jms"
@@ -2190,6 +2209,8 @@
             <include name="*.xml"/>
          </fileset>
       </copy>
+      
+      <mq2jbm basedir="${resources}/test/strictpool"/>
    </target>
 
    <target name="relationships"
@@ -2375,6 +2396,8 @@
             <include name="*.xml"/>
          </fileset>
       </copy>
+      
+      <mq2jbm basedir="${resources}/test/mdbtransactions"/>
    </target>
 
    <target name="longlived"
@@ -2595,6 +2618,8 @@
             <include name="*.xml"/>
          </fileset>
       </copy>
+      
+      <mq2jbm basedir="${resources}/test/mdb"/>
    </target>
 
    <target name="mdbtopic"
@@ -3225,14 +3250,23 @@
             <include name="META-INF/jboss-service.xml"/>
          </fileset>
       </jar>
+      
+      <build-jms-dd name="service" descriptor="test-destination-service.xml"/>
+      
+      <mkdir dir="${target.resources}/test/service/META-INF"/>
+      <copy file="${resources}/test/service/META-INF/jboss.xml" todir="${target.resources}/test/service/META-INF"/>
+      <replace file="${target.resources}/test/service/META-INF/jboss.xml" token="@@jboss.jms.product@@" value="${jboss.jms.product}"/>
+      
       <jar jarfile="${build.lib}/service-test.jar">
          <fileset dir="${build.classes}">
             <include name="org/jboss/ejb3/test/service/*.class"/>
          </fileset>
          <fileset dir="${resources}/test/service">
             <include name="META-INF/ejb-jar.xml"/>
+            <include name="META-INF/persistence.xml"/>
+         </fileset>
+         <fileset dir="${target.resources}/test/service">
             <include name="META-INF/jboss.xml"/>
-            <include name="META-INF/persistence.xml"/>
             <include name="test-destination-service.xml"/>
          </fileset>
          <fileset dir="${resources}/test">
@@ -3618,6 +3652,8 @@
          <sysproperty key="jbosstest.cluster.node1.jndi.url" value="${node1.jndi.url}"/>
          <sysproperty key="java.naming.provider.url" value="${test.jndi.url}"/>
 
+         <!-- for EAP 4.3, jboss.jms.provider must either be jbm or mq -->
+         <sysproperty key="jboss.jms.provider" value="${jboss.jms.provider}"/>
 
          <jvmarg line="${jvmargs}" />
 

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/build.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/build.xml	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/build.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -37,6 +37,16 @@
    <!-- ================================================================== -->
 
    <!--
+    Configure the right JMSDestinationFactory, in EAP 4.2 we communicate with JBossMQ,
+    in EAP 4.3 we communicate with JBoss Messaging.
+   -->
+   <condition property="JMSDestinationFactory"
+      value="org.jboss.ejb3.jms.ServerPeerJMSDestinationFactory" 
+      else="org.jboss.ejb3.jms.DestinationManagerJMSDestinationFactory">
+      <isset property="build.soa"/>
+   </condition>
+
+   <!--
       | Initialize the build system.  Must depend on '_buildmagic:init'.
       | Other targets should depend on 'init' or things will mysteriously fail.
     -->
@@ -155,6 +165,7 @@
       <property name="build.lib" value="${module.output}/lib"/>
       <property name="build.api" value="${module.output}/api"/>
       <property name="build.etc" value="${module.output}/etc"/>
+      <property name="build.resources" value="${module.output}/resources"/>
 
       <!-- Install/Release structure -->
       <property name="install.id" value="${module.name}-${module.version}"/>
@@ -371,6 +382,14 @@
          </fileset>
       </jar>
 
+      <!-- set JMSDestinationFactory -->
+      <echo level="warning" message="build.soa = ${build.soa}"/>
+      <mkdir dir="${build.resources}/META-INF"/>
+      <copy todir="${build.resources}/META-INF" file="${resources}/META-INF/jboss-service.xml"/>
+      <replace file="${build.resources}/META-INF/jboss-service.xml" 
+         token="@@JMSDestinationFactory@@"
+         value="${JMSDestinationFactory}"/>
+      
       <mkdir dir="${build.lib}/ejb3.deployer"/>
       <copy todir="${build.lib}/ejb3.deployer">
          <fileset dir="${build.lib}">
@@ -381,9 +400,11 @@
          </fileset>
          <fileset dir="${resources}">
             <!--include name="META-INF/ejb3-deployers-beans.xml"/-->
-            <include name="META-INF/jboss-service.xml"/>
             <include name="META-INF/persistence.properties"/>
          </fileset>
+         <fileset dir="${build.resources}">
+            <include name="META-INF/jboss-service.xml"/>
+         </fileset>
       </copy>
       <copy todir="${build.lib}" file="${resources}/ejb3-interceptors-aop.xml"/>
       <!--copy todir="${build.lib}" file="${resources}/ejb3-clustered-sfsbcache-beans.xml"/>

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/imports/build-mq2jbm.xml (from rev 66659, branches/JBPAPP_4_2/ejb3/imports/build-mq2jbm.xml)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/imports/build-mq2jbm.xml	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/imports/build-mq2jbm.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -0,0 +1,42 @@
+<project name="build-mq2jbm">
+   <target name="_build-mq2jbm-transform" if="build.soa">
+      <xslt style="${resources}/test/mq2jbm.xsl" 
+      	in="${resources}/test/${testname}/${descriptor}" 
+      	out="${target.resources}/test/${testname}/${descriptor}"/>
+   </target>
+   
+   <target name="_build-mq2jbm-copymq" unless="build.soa">
+      <copy todir="${target.resources}/test/${testname}" file="${resources}/test/${testname}/${descriptor}"/>
+   </target>
+   
+   <target name="_build-jms-dd" depends="_build-mq2jbm-transform,_build-mq2jbm-copymq"/>
+   
+   <macrodef name="build-jms-dd"
+      description="build the right jms deployment descriptor">
+      <attribute name="name" description="the name of the test"/>
+      <attribute name="descriptor" description="the JBossMQ deployment descriptor file"/>
+      <sequential>
+         <mkdir dir="${target.resources}/test/@{name}"/>
+         
+         <antcall target="_build-jms-dd">
+            <param name="descriptor" value="@{descriptor}"/>
+            <param name="testname" value="@{name}"/>
+         </antcall>
+      </sequential>
+   </macrodef>
+   
+   <!-- Transform a series of mq descriptors -->
+   <macrodef name="mq2jbm"
+      description="transform mq descriptors into jbm descriptors">
+      <attribute name="basedir" description="the directory containing mq descriptors"/>
+      <sequential>
+         <mkdir dir="${build.lib}"/>
+         
+         <xslt style="${resources}/test/mq2jbm.xsl"
+            basedir="@{basedir}"
+	        destdir="${build.lib}">
+            <mapper type="regexp" from="^(.*)-mq-service.xml$$" to="\1-jbm-service.xml"/>
+         </xslt>
+      </sequential>
+   </macrodef>
+</project>
\ No newline at end of file

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/main/org/jboss/ejb3/EJB3Deployer.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/EJB3Deployer.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/main/org/jboss/ejb3/EJB3Deployer.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -47,6 +47,7 @@
 import org.jboss.deployment.DeploymentInfo;
 import org.jboss.deployment.SubDeployer;
 import org.jboss.deployment.SubDeployerSupport;
+import org.jboss.ejb3.jms.JMSDestinationFactory;
 import org.jboss.ejb3.naming.SimpleMultiplexer;
 import org.jboss.logging.Logger;
 import org.jboss.metadata.MetaData;
@@ -302,6 +303,11 @@
       this.deployEjb3ExtensionOnly = deployEjb3ExtensionOnly;
    }
 
+   public void setJMSDestinationFactory(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException
+   {
+      JMSDestinationFactory.setJMSDestinationFactory(className);
+   }
+   
    /**
     * Overriden to set the hibernate.bytecode.provider from the
     * 

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/main/org/jboss/ejb3/EJB3DeployerMBean.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/EJB3DeployerMBean.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/main/org/jboss/ejb3/EJB3DeployerMBean.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -45,4 +45,5 @@
    /** Jar files to ignore */
    void setJarsIgnoredForScanning(JarsIgnoredForScanningMBean mbean);
 
+   void setJMSDestinationFactory(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException;
 }

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/main/org/jboss/ejb3/cache/tree/StatefulTreeCache.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/cache/tree/StatefulTreeCache.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/main/org/jboss/ejb3/cache/tree/StatefulTreeCache.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -40,6 +40,7 @@
 import org.jboss.cache.CacheException;
 import org.jboss.cache.AbstractTreeCacheListener;
 import org.jboss.cache.DataNode;
+import org.jboss.cache.RegionNotEmptyException;
 import org.jboss.cache.TreeCache;
 import org.jboss.cache.TreeCacheMBean;
 import org.jboss.ejb3.Container;
@@ -322,7 +323,18 @@
       cleanBeanRegion();
       
       cache.registerClassLoader(cacheNode.toString(), cl);
-      cache.activateRegion(cacheNode.toString());
+      try
+      {
+         cache.activateRegion(cacheNode.toString());
+      }
+      catch (RegionNotEmptyException e)
+      {
+         // this can happen with nested bean contexts if gravitation
+         // pulls a parent bean over after the parent region is stopped
+         // Clean up and try again
+         cleanBeanRegion();
+         cache.activateRegion(cacheNode.toString());
+      }
       
       log.debug("initialize(): create eviction region: " +region + " for ejb: " +this.ejbContainer.getEjbName());
    

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/main/org/jboss/ejb3/jms/JMSDestinationFactory.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/jms/JMSDestinationFactory.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/main/org/jboss/ejb3/jms/JMSDestinationFactory.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -31,11 +31,18 @@
  */
 public abstract class JMSDestinationFactory
 {
-   private static final JMSDestinationFactory instance = new DestinationManagerJMSDestinationFactory();
+   private static JMSDestinationFactory instance;
    
+   public static void setJMSDestinationFactory(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException
+   {
+      Class<?> cls = Class.forName(className);
+      instance = (JMSDestinationFactory) cls.newInstance();
+   }
+   
    public static JMSDestinationFactory getInstance()
    {
-      // TODO: implement proper plugin point
+      if(instance == null)
+         throw new IllegalStateException("JMSDestinationFactory has not been initialized");
       return instance;
    }
    

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/main/org/jboss/ejb3/jms/ServerPeerJMSDestinationFactory.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/jms/ServerPeerJMSDestinationFactory.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/main/org/jboss/ejb3/jms/ServerPeerJMSDestinationFactory.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -55,12 +55,12 @@
       if (type == Topic.class)
       {
          destinationContext = "topic";
-         methodName = "createTopic";
+         methodName = "deployTopic";
       }
       else if (type == Queue.class)
       {
          destinationContext = "queue";
-         methodName = "createQueue";
+         methodName = "deployQueue";
       }
       else
       {

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/main/org/jboss/ejb3/mdb/ProducerFactory.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/mdb/ProducerFactory.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/main/org/jboss/ejb3/mdb/ProducerFactory.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -147,6 +147,14 @@
 
    public void stop() throws Exception
    {
-      Util.unbind(ctx, jndiName);
+      try
+      {
+         Util.unbind(ctx, jndiName);
+      }
+      catch(NamingException e)
+      {
+         log.warn("Unable to unbind " + jndiName);
+         throw e;
+      }
    }
 }

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/META-INF/jboss-service.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/resources/META-INF/jboss-service.xml	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/META-INF/jboss-service.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -193,6 +193,12 @@
             <type>org.jboss.ejb3.JarsIgnoredForScanningMBean</type>
          </attribute>
 
+         <attribute access="write-only" setMethod="setJMSDestinationFactory">
+            <description>The JMSDestinationFactory to use for temporary destinations</description>
+            <name>JMSDestinationFactory</name>
+            <type>java.lang.String</type>
+         </attribute>
+
          <!-- ServiceMBean operations -->
          <operation>
             <description>Standard MBean lifecycle method</description>
@@ -303,7 +309,10 @@
          </operation>
       </xmbean>
       <!-- Inline XMBean Descriptor END -->
-
+      
+      <!-- The right destination factory is put in during the build -->
+      <attribute name="JMSDestinationFactory">@@JMSDestinationFactory@@</attribute>
+      
       <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>

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/consumer/consumertest-jbm-service.xml (from rev 66649, branches/JBPAPP_4_2/ejb3/src/resources/test/consumer/consumertest-jbm-service.xml)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/consumer/consumertest-jbm-service.xml	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/consumer/consumertest-jbm-service.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+   <mbean code="org.jboss.jms.server.destination.QueueService"
+      name="jboss.messaging.destination:service=Queue,name=mdbtest"
+      xmbean-dd="xmdesc/Queue-xmbean.xml">
+      <attribute name="JNDIName">queue/mdbtest</attribute>
+      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+      <depends>jboss.messaging:service=PostOffice</depends>
+   </mbean>
+
+   <mbean code="org.jboss.jms.server.destination.QueueService"
+      name="jboss.messaging.destination:service=Queue,name=consumerqueuetest"
+      xmbean-dd="xmdesc/Queue-xmbean.xml">
+      <attribute name="JNDIName">queue/consumerqueuetest</attribute>
+      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+      <depends>jboss.messaging:service=PostOffice</depends>
+   </mbean>
+
+   <mbean code="org.jboss.jms.server.destination.TopicService"
+      name="jboss.messaging.destination:service=Topic,name=mdbtest"
+      xmbean-dd="xmdesc/Queue-xmbean.xml">
+      <attribute name="JNDIName">topic/mdbtest</attribute>
+      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+      <depends>jboss.messaging:service=PostOffice</depends>
+   </mbean>
+
+</server>

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/consumer/consumertest-mq-service.xml (from rev 66649, branches/JBPAPP_4_2/ejb3/src/resources/test/consumer/consumertest-mq-service.xml)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/consumer/consumertest-mq-service.xml	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/consumer/consumertest-mq-service.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+   <mbean code="org.jboss.mq.server.jmx.Queue"
+      name="jboss.mq.destination:service=Queue,name=queuetest">
+      <attribute name="JNDIName">queue/mdbtest</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=consumerqueuetest">
+      <attribute name="JNDIName">queue/consumertest</attribute>
+      <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+   </mbean>
+
+   <mbean code="org.jboss.mq.server.jmx.Topic"
+      name="jboss.mq.destination:service=Topic,name=topictest">
+      <attribute name="JNDIName">topic/mdbtest</attribute>
+      <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+   </mbean>
+
+</server>

Deleted: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/consumer/consumertest-service.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/resources/test/consumer/consumertest-service.xml	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/consumer/consumertest-service.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
-   <mbean code="org.jboss.mq.server.jmx.Queue"
-      name="jboss.mq.destination:service=Queue,name=queuetest">
-      <attribute name="JNDIName">queue/mdbtest</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=consumerqueuetest">
-      <attribute name="JNDIName">queue/consumertest</attribute>
-      <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
-   </mbean>
-
-   <mbean code="org.jboss.mq.server.jmx.Topic"
-      name="jboss.mq.destination:service=Topic,name=topictest">
-      <attribute name="JNDIName">topic/mdbtest</attribute>
-      <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
-   </mbean>
-
-</server>

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/dd/mdb/META-INF/ejb-jar.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/resources/test/dd/mdb/META-INF/ejb-jar.xml	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/dd/mdb/META-INF/ejb-jar.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -125,10 +125,10 @@
           	<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>
           	<activation-config-property-name>clientId</activation-config-property-name>
           	<activation-config-property-value>DurableTopicTest</activation-config-property-value>
-          </activation-config-property-->
+          </activation-config-property>
         </activation-config>
       </message-driven>
 

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/dd/mdb/dd-mdb-mq-service.xml (from rev 66659, branches/JBPAPP_4_2/ejb3/src/resources/test/dd/mdb/dd-mdb-mq-service.xml)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/dd/mdb/dd-mdb-mq-service.xml	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/dd/mdb/dd-mdb-mq-service.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE server>
+
+<server>
+  <mbean code="org.jboss.mq.server.jmx.Queue"
+	 name="jboss.mq.destination:service=Queue,name=myMDBQueue">
+    <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+    <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
+    <attribute name="SecurityConf">
+      <security>
+        <role name="guest" read="true" write="true"/>
+        <role name="publisher" read="true" write="true" create="false"/>
+        <role name="noacc" read="false" write="false" create="false"/>
+      </security>
+    </attribute>
+  </mbean>
+  <mbean code="org.jboss.mq.server.jmx.Topic"
+	 name="jboss.mq.destination:service=Topic,name=myMDBTopic">
+    <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+    <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
+    <attribute name="SecurityConf">
+      <security>
+        <role name="guest" read="true" write="true"/>
+        <role name="publisher" read="true" write="true" create="false"/>
+        <role name="durpublisher" read="true" write="true" create="true"/>
+      </security>
+    </attribute>
+  </mbean>
+  <mbean code="org.jboss.naming.NamingAlias" 
+         name="jboss.test:test=mdb,alias=anotherContext/QueueInADifferentContext">
+     <attribute name="FromName">anotherContext/QueueInADifferentContext</attribute>
+     <attribute name="ToName">queue/myMDBQueue</attribute>
+  </mbean>
+  <mbean code="org.jboss.naming.NamingAlias" 
+         name="jboss.test:test=mdb,alias=anotherContext/TopicInADifferentContext">
+     <attribute name="FromName">anotherContext/TopicInADifferentContext</attribute>
+     <attribute name="ToName">topic/myMDBTopic</attribute>
+  </mbean>
+</server>
\ No newline at end of file

Deleted: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/dd/mdb/dd-mdb-service.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/resources/test/dd/mdb/dd-mdb-service.xml	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/dd/mdb/dd-mdb-service.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE server>
-
-<server>
-  <mbean code="org.jboss.mq.server.jmx.Queue"
-	 name="jboss.mq.destination:service=Queue,name=myMDBQueue">
-    <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
-    <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
-    <attribute name="SecurityConf">
-      <security>
-        <role name="guest" read="true" write="true"/>
-        <role name="publisher" read="true" write="true" create="false"/>
-        <role name="noacc" read="false" write="false" create="false"/>
-      </security>
-    </attribute>
-  </mbean>
-  <mbean code="org.jboss.mq.server.jmx.Topic"
-	 name="jboss.mq.destination:service=Topic,name=myMDBTopic">
-    <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
-    <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
-    <attribute name="SecurityConf">
-      <security>
-        <role name="guest" read="true" write="true"/>
-        <role name="publisher" read="true" write="true" create="false"/>
-        <role name="durpublisher" read="true" write="true" create="true"/>
-      </security>
-    </attribute>
-  </mbean>
-  <mbean code="org.jboss.naming.NamingAlias" 
-         name="jboss.test:test=mdb,alias=anotherContext/QueueInADifferentContext">
-     <attribute name="FromName">anotherContext/QueueInADifferentContext</attribute>
-     <attribute name="ToName">queue/myMDBQueue</attribute>
-  </mbean>
-  <mbean code="org.jboss.naming.NamingAlias" 
-         name="jboss.test:test=mdb,alias=anotherContext/TopicInADifferentContext">
-     <attribute name="FromName">anotherContext/TopicInADifferentContext</attribute>
-     <attribute name="ToName">topic/myMDBTopic</attribute>
-  </mbean>
-</server>
\ No newline at end of file

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/interceptors2/interceptors2test-mq-service.xml (from rev 66659, branches/JBPAPP_4_2/ejb3/src/resources/test/interceptors2/interceptors2test-mq-service.xml)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/interceptors2/interceptors2test-mq-service.xml	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/interceptors2/interceptors2test-mq-service.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+   <mbean code="org.jboss.mq.server.jmx.Queue"
+      name="jboss.mq.destination:service=Queue,name=mixedqueue">
+      <attribute name="JNDIName">queue/mixedqueue</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=defaultonlyqueue">
+      <attribute name="JNDIName">queue/defaultonlyqueue</attribute>
+      <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+   </mbean>
+
+</server>

Deleted: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/interceptors2/interceptors2test-service.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/resources/test/interceptors2/interceptors2test-service.xml	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/interceptors2/interceptors2test-service.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
-   <mbean code="org.jboss.mq.server.jmx.Queue"
-      name="jboss.mq.destination:service=Queue,name=mixedqueue">
-      <attribute name="JNDIName">queue/mixedqueue</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=defaultonlyqueue">
-      <attribute name="JNDIName">queue/defaultonlyqueue</attribute>
-      <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
-   </mbean>
-
-</server>

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/mdb/mdbtest-mq-service.xml (from rev 66659, branches/JBPAPP_4_2/ejb3/src/resources/test/mdb/mdbtest-mq-service.xml)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/mdb/mdbtest-mq-service.xml	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/mdb/mdbtest-mq-service.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+<!--
+   <mbean code="org.jboss.mq.server.jmx.Queue"
+      name="jboss.mq.destination:service=Queue,name=cmtmdbtest">
+      <attribute name="JNDIName">queue/cmtmdbtest</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=queuetest">
+      <attribute name="JNDIName">queue/mdbtest</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=defaultedqueuetest">
+      <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">
+      <attribute name="JNDIName">queue/nondurablemdbtest</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=bmtqueuetest">
+      <attribute name="JNDIName">queue/bmtmdbtest</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=overridequeuetest">
+      <attribute name="JNDIName">queue/overridequeuetest</attribute>
+      <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+   </mbean>
+
+   <mbean code="org.jboss.mq.server.jmx.Topic"
+      name="jboss.mq.destination:service=Topic,name=topictest">
+      <attribute name="JNDIName">topic/mdbtest</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=transactionmdbtest">
+      <attribute name="JNDIName">queue/transactionmdbtest</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=expirationtest">
+      <attribute name="JNDIName">queue/expirationmdbtest</attribute>
+<!--       <attribute name="ExpiryDestination">jboss.mq.destination:name=DLQ,service=Queue</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=expirytest">
+      <attribute name="JNDIName">queue/expirytest</attribute>
+<!--       <attribute name="ExpiryDestination">jboss.mq.destination:name=DLQ,service=Queue</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:name=DLQ,service=Queue</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=concurrentqueuetest">
+      <attribute name="JNDIName">queue/concurrentmdbtest</attribute>
+      <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+   </mbean>
+
+</server>

Deleted: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/mdb/mdbtest-service.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/resources/test/mdb/mdbtest-service.xml	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/mdb/mdbtest-service.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
-<!--
-   <mbean code="org.jboss.mq.server.jmx.Queue"
-      name="jboss.mq.destination:service=Queue,name=cmtmdbtest">
-      <attribute name="JNDIName">queue/cmtmdbtest</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=queuetest">
-      <attribute name="JNDIName">queue/mdbtest</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=defaultedqueuetest">
-      <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">
-      <attribute name="JNDIName">queue/nondurablemdbtest</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=bmtqueuetest">
-      <attribute name="JNDIName">queue/bmtmdbtest</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=overridequeuetest">
-      <attribute name="JNDIName">queue/overridequeuetest</attribute>
-      <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
-   </mbean>
-
-   <mbean code="org.jboss.mq.server.jmx.Topic"
-      name="jboss.mq.destination:service=Topic,name=topictest">
-      <attribute name="JNDIName">topic/mdbtest</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=transactionmdbtest">
-      <attribute name="JNDIName">queue/transactionmdbtest</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=expirationtest">
-      <attribute name="JNDIName">queue/expirationmdbtest</attribute>
-<!--       <attribute name="ExpiryDestination">jboss.mq.destination:name=DLQ,service=Queue</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=expirytest">
-      <attribute name="JNDIName">queue/expirytest</attribute>
-<!--       <attribute name="ExpiryDestination">jboss.mq.destination:name=DLQ,service=Queue</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:name=DLQ,service=Queue</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=concurrentqueuetest">
-      <attribute name="JNDIName">queue/concurrentmdbtest</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=mismatchedqueuetest">
-      <attribute name="JNDIName">queue/mismatchedmdbtest</attribute>
-      <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
-   </mbean>
-
-</server>

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/mdbtransactions/mdbtransactionstest-mq-service.xml (from rev 66823, branches/JBPAPP_4_2/ejb3/src/resources/test/mdbtransactions/mdbtransactionstest-mq-service.xml)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/mdbtransactions/mdbtransactionstest-mq-service.xml	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/mdbtransactions/mdbtransactionstest-mq-service.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+   <mbean code="org.jboss.mq.server.jmx.Queue"
+      name="jboss.mq.destination:service=Queue,name=queuetest">
+      <attribute name="JNDIName">queue/mdbtest</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=badcreationtest">
+      <attribute name="JNDIName">queue/badcreationmdb</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=rollbackqueuetest">
+      <attribute name="JNDIName">queue/rollbackmdbtest</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=queue21test">
+      <attribute name="JNDIName">queue/mdb21test</attribute>
+      <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+   </mbean>
+</server>

Deleted: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/mdbtransactions/mdbtransactionstest-service.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/resources/test/mdbtransactions/mdbtransactionstest-service.xml	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/mdbtransactions/mdbtransactionstest-service.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
-   <mbean code="org.jboss.mq.server.jmx.Queue"
-      name="jboss.mq.destination:service=Queue,name=queuetest">
-      <attribute name="JNDIName">queue/mdbtest</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=badcreationtest">
-      <attribute name="JNDIName">queue/badcreationmdb</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=rollbackqueuetest">
-      <attribute name="JNDIName">queue/rollbackmdbtest</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=queue21test">
-      <attribute name="JNDIName">queue/mdb21test</attribute>
-      <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
-   </mbean>
-</server>

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/mq2jbm.xsl (from rev 66649, branches/JBPAPP_4_2/ejb3/src/resources/test/mq2jbm.xsl)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/mq2jbm.xsl	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/mq2jbm.xsl	2008-01-16 20:55:40 UTC (rev 69046)
@@ -0,0 +1,76 @@
+<?xml version='1.0'?>
+<!-- Transform a JBoss MQ deployment descriptor into a JBoss Messaging one -->
+<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
+   
+   <xsl:output method="xml" indent="yes"/>
+   
+   <xsl:template match="/">
+      <xsl:element name="server">
+         <xsl:apply-templates/>
+      </xsl:element>
+   </xsl:template>
+   
+   <xsl:template match="mbean">
+      <xsl:choose>
+         <!-- only transform mq mbeans -->
+         <xsl:when test="starts-with(@code,'org.jboss.mq.server.jmx')">
+            <xsl:element name="mbean">
+               <!-- set destionationType to either Topic or Queue -->
+               <xsl:variable name="destinationType" select="substring-after(@code,'jmx.')"/>
+               
+               <!-- TODO: is name always the last part? -->
+               <xsl:variable name="destinationName" select="substring-after(@name,'name=')"/>
+               
+               <xsl:attribute name="code">
+                  <xsl:value-of select="concat('org.jboss.jms.server.destination.',$destinationType,'Service')"/>
+               </xsl:attribute>
+               
+               <xsl:attribute name="name">
+                  <xsl:value-of select="concat('jboss.messaging.destination:service=',$destinationType,',name=',$destinationName)"/>
+               </xsl:attribute>
+               
+               <xsl:attribute name="xmbean-dd">
+                  <xsl:value-of select="concat('xmdesc/',$destinationType,'-xmbean.xml')"/>
+               </xsl:attribute>
+               
+               <xsl:apply-templates/>
+            </xsl:element>
+         </xsl:when>
+         <!-- copy in any other mbeans -->
+         <xsl:otherwise>
+            <xsl:copy-of select="."/>
+         </xsl:otherwise>
+      </xsl:choose>
+   </xsl:template>
+   
+   <!-- rename attribute SecurityConf to SecurityConfig -->
+   <xsl:template match="attribute[@name='SecurityConf']">
+      <xsl:element name="attribute">
+         <xsl:attribute name="name">SecurityConfig</xsl:attribute>
+         <xsl:copy-of select="*"/>
+      </xsl:element>
+   </xsl:template>
+   
+   <!-- copy in all attributes specified on the mq mbean -->
+   <xsl:template match="attribute">
+      <xsl:copy-of select="."/>
+   </xsl:template>
+   
+   <!-- change the destination manager -->
+   <xsl:template match="depends[@optional-attribute-name='DestinationManager']">
+      <xsl:element name="depends">
+         <xsl:attribute name="optional-attribute-name">
+            <xsl:text>ServerPeer</xsl:text>
+         </xsl:attribute>
+         <xsl:text>jboss.messaging:service=ServerPeer</xsl:text>
+      </xsl:element>
+      <xsl:text>
+      </xsl:text>
+      <xsl:element name="depends">
+         <xsl:text>jboss.messaging:service=PostOffice</xsl:text>
+      </xsl:element>
+   </xsl:template>
+
+   <!-- ignore any remaining depends -->
+   <xsl:template match="depends"/>
+</xsl:transform>
\ No newline at end of file

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/service/META-INF/jboss.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/resources/test/service/META-INF/jboss.xml	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/service/META-INF/jboss.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -54,5 +54,10 @@
             <jndi-name>queue/mdbtest</jndi-name>
          </resource-env-ref>
       </service>
+      <service>
+         <ejb-name>TestResourceInjectionService</ejb-name>
+         <ejb-class>org.jboss.ejb3.test.service.TestResourceInjectionService</ejb-class>
+         <depends>jboss.@@jboss.jms.product@@.destination:name=myTestTopic,service=Topic</depends>
+      </service>
    </enterprise-beans>
 </jboss>

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/strictpool/strictpool_mdbtest-mq-service.xml (from rev 66823, branches/JBPAPP_4_2/ejb3/src/resources/test/strictpool/strictpool_mdbtest-mq-service.xml)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/strictpool/strictpool_mdbtest-mq-service.xml	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/strictpool/strictpool_mdbtest-mq-service.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+   <mbean code="org.jboss.mq.server.jmx.Queue"
+      name="jboss.mq.destination:service=Queue,name=queueA">
+      <attribute name="JNDIName">queue/queueA</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=queueB">
+      <attribute name="JNDIName">queue/queueB</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=queueC">
+      <attribute name="JNDIName">queue/queueC</attribute>
+      <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+   </mbean>
+
+</server>

Deleted: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/strictpool/strictpool_mdbtest-service.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/resources/test/strictpool/strictpool_mdbtest-service.xml	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test/strictpool/strictpool_mdbtest-service.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
-   <mbean code="org.jboss.mq.server.jmx.Queue"
-      name="jboss.mq.destination:service=Queue,name=queueA">
-      <attribute name="JNDIName">queue/queueA</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=queueB">
-      <attribute name="JNDIName">queue/queueB</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=queueC">
-      <attribute name="JNDIName">queue/queueC</attribute>
-      <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
-   </mbean>
-
-</server>

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test-configs/clusteredjms2 (from rev 67518, branches/JBPAPP_4_2/ejb3/src/resources/test-configs/clusteredjms2)

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test-configs/clusteredjms2/deploy (from rev 67518, branches/JBPAPP_4_2/ejb3/src/resources/test-configs/clusteredjms2/deploy)

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test-configs/clusteredjms2/deploy/jboss-messaging.sar (from rev 67518, branches/JBPAPP_4_2/ejb3/src/resources/test-configs/clusteredjms2/deploy/jboss-messaging.sar)

Deleted: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test-configs/clusteredjms2/deploy/jboss-messaging.sar/messaging-service.xml
===================================================================
--- branches/JBPAPP_4_2/ejb3/src/resources/test-configs/clusteredjms2/deploy/jboss-messaging.sar/messaging-service.xml	2007-11-27 22:28:59 UTC (rev 67518)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test-configs/clusteredjms2/deploy/jboss-messaging.sar/messaging-service.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -1,102 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-     The JBoss Messaging service deployment descriptor.
-
-     $Id: messaging-service.xml 3337 2007-11-16 12:22:58Z timfox $
- -->
-<server>
-
-   <!-- ServerPeer MBean configuration
-        ============================== -->
-
-   <mbean code="org.jboss.jms.server.ServerPeer" name="jboss.messaging:service=ServerPeer" xmbean-dd="xmdesc/ServerPeer-xmbean.xml">
-
-      <!-- The unique id of the server peer - in a cluster each node MUST have a unique value - must be an integer -->
-
-      <attribute name="ServerPeerID">1</attribute>
-      
-      <!-- The default JNDI context to use for queues when they are deployed without specifying one --> 
-      
-      <attribute name="DefaultQueueJNDIContext">/queue</attribute>
-      
-      <!-- The default JNDI context to use for topics when they are deployed without specifying one --> 
-      
-      <attribute name="DefaultTopicJNDIContext">/topic</attribute>
-
-	  <attribute name="PostOffice">jboss.messaging:service=PostOffice</attribute>
-	  
-	  <!-- The JAAS security domain to use for JBoss Messaging -->
-	  
-      <attribute name="SecurityDomain">java:/jaas/messaging</attribute>
-      
-      <!-- The default security configuration to apply to destinations - this can be overridden on a per destination basis -->
-      
-      <attribute name="DefaultSecurityConfig">
-        <security>
-            <role name="guest" read="true" write="true" create="true"/>
-        </security>
-      </attribute>
-      
-      <!-- The default Dead Letter Queue (DLQ) to use for destinations.
-           This can be overridden on a per destinatin basis -->
-      
-      <attribute name="DefaultDLQ">jboss.messaging.destination:service=Queue,name=DLQ</attribute>
-      
-      <!-- The default maximum number of times to attempt delivery of a message before sending to the DLQ (if configured).
-           This can be overridden on a per destinatin basis -->
-      
-      <attribute name="DefaultMaxDeliveryAttempts">10</attribute>
-      
-      <!-- The default Expiry Queue to use for destinations. This can be overridden on a per destinatin basis -->
-      
-      <attribute name="DefaultExpiryQueue">jboss.messaging.destination:service=Queue,name=ExpiryQueue</attribute>
-      
-      <!-- The default redelivery delay to impose. This can be overridden on a per destination basis -->
-      
-      <attribute name="DefaultRedeliveryDelay">0</attribute>
-      
-      <!-- The periodicity of the message counter manager enquiring on queues for statistics -->
-      
-      <attribute name="MessageCounterSamplePeriod">5000</attribute>
-      
-      <!-- The maximum amount of time for a client to wait for failover to start on the server side after
-           it has detected failure -->
-      
-      <attribute name="FailoverStartTimeout">60000</attribute>
-      
-      <!-- The maximum amount of time for a client to wait for failover to complete on the server side after
-           it has detected failure -->
-      
-      <attribute name="FailoverCompleteTimeout">300000</attribute>
-      
-      <!-- The maximum number of days results to maintain in the message counter history -->
-      
-      <attribute name="DefaultMessageCounterHistoryDayLimit">-1</attribute>
-      
-      <!-- The name of the connection factory to use for creating connections between nodes to pull messages -->
-      
-      <attribute name="ClusterPullConnectionFactoryName">jboss.messaging.connectionfactory:service=ClusterPullConnectionFactory</attribute>
-      
-      <!-- When redistributing messages in the cluster. Do we need to preserve the order of messages received
-            by a particular consumer from a particular producer? -->
-            
-      <attribute name="DefaultPreserveOrdering">false</attribute>
-      
-      <!-- Max. time to hold previously delivered messages back waiting for clients to reconnect after failover -->
-      
-      <attribute name="RecoverDeliveriesTimeout">300000</attribute>
-      
-      <!-- The password used by the message sucker connections to create connections.
-           THIS SHOULD ALWAYS BE CHANGED AT INSTALL TIME TO SECURE SYSTEM
-      <attribute name="SuckerPassword"></attribute>
-      -->
-
-      <depends optional-attribute-name="PersistenceManager">jboss.messaging:service=PersistenceManager</depends>
-      
-      <depends optional-attribute-name="JMSUserManager">jboss.messaging:service=JMSUserManager</depends>
-      
-      <depends>jboss.messaging:service=Connector,transport=bisocket</depends>
-
-   </mbean>
-
-</server>
\ No newline at end of file

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test-configs/clusteredjms2/deploy/jboss-messaging.sar/messaging-service.xml (from rev 67518, branches/JBPAPP_4_2/ejb3/src/resources/test-configs/clusteredjms2/deploy/jboss-messaging.sar/messaging-service.xml)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test-configs/clusteredjms2/deploy/jboss-messaging.sar/messaging-service.xml	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test-configs/clusteredjms2/deploy/jboss-messaging.sar/messaging-service.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+     The JBoss Messaging service deployment descriptor.
+
+     $Id: messaging-service.xml 3337 2007-11-16 12:22:58Z timfox $
+ -->
+<server>
+
+   <!-- ServerPeer MBean configuration
+        ============================== -->
+
+   <mbean code="org.jboss.jms.server.ServerPeer" name="jboss.messaging:service=ServerPeer" xmbean-dd="xmdesc/ServerPeer-xmbean.xml">
+
+      <!-- The unique id of the server peer - in a cluster each node MUST have a unique value - must be an integer -->
+
+      <attribute name="ServerPeerID">1</attribute>
+      
+      <!-- The default JNDI context to use for queues when they are deployed without specifying one --> 
+      
+      <attribute name="DefaultQueueJNDIContext">/queue</attribute>
+      
+      <!-- The default JNDI context to use for topics when they are deployed without specifying one --> 
+      
+      <attribute name="DefaultTopicJNDIContext">/topic</attribute>
+
+	  <attribute name="PostOffice">jboss.messaging:service=PostOffice</attribute>
+	  
+	  <!-- The JAAS security domain to use for JBoss Messaging -->
+	  
+      <attribute name="SecurityDomain">java:/jaas/messaging</attribute>
+      
+      <!-- The default security configuration to apply to destinations - this can be overridden on a per destination basis -->
+      
+      <attribute name="DefaultSecurityConfig">
+        <security>
+            <role name="guest" read="true" write="true" create="true"/>
+        </security>
+      </attribute>
+      
+      <!-- The default Dead Letter Queue (DLQ) to use for destinations.
+           This can be overridden on a per destinatin basis -->
+      
+      <attribute name="DefaultDLQ">jboss.messaging.destination:service=Queue,name=DLQ</attribute>
+      
+      <!-- The default maximum number of times to attempt delivery of a message before sending to the DLQ (if configured).
+           This can be overridden on a per destinatin basis -->
+      
+      <attribute name="DefaultMaxDeliveryAttempts">10</attribute>
+      
+      <!-- The default Expiry Queue to use for destinations. This can be overridden on a per destinatin basis -->
+      
+      <attribute name="DefaultExpiryQueue">jboss.messaging.destination:service=Queue,name=ExpiryQueue</attribute>
+      
+      <!-- The default redelivery delay to impose. This can be overridden on a per destination basis -->
+      
+      <attribute name="DefaultRedeliveryDelay">0</attribute>
+      
+      <!-- The periodicity of the message counter manager enquiring on queues for statistics -->
+      
+      <attribute name="MessageCounterSamplePeriod">5000</attribute>
+      
+      <!-- The maximum amount of time for a client to wait for failover to start on the server side after
+           it has detected failure -->
+      
+      <attribute name="FailoverStartTimeout">60000</attribute>
+      
+      <!-- The maximum amount of time for a client to wait for failover to complete on the server side after
+           it has detected failure -->
+      
+      <attribute name="FailoverCompleteTimeout">300000</attribute>
+      
+      <!-- The maximum number of days results to maintain in the message counter history -->
+      
+      <attribute name="DefaultMessageCounterHistoryDayLimit">-1</attribute>
+      
+      <!-- The name of the connection factory to use for creating connections between nodes to pull messages -->
+      
+      <attribute name="ClusterPullConnectionFactoryName">jboss.messaging.connectionfactory:service=ClusterPullConnectionFactory</attribute>
+      
+      <!-- When redistributing messages in the cluster. Do we need to preserve the order of messages received
+            by a particular consumer from a particular producer? -->
+            
+      <attribute name="DefaultPreserveOrdering">false</attribute>
+      
+      <!-- Max. time to hold previously delivered messages back waiting for clients to reconnect after failover -->
+      
+      <attribute name="RecoverDeliveriesTimeout">300000</attribute>
+      
+      <!-- The password used by the message sucker connections to create connections.
+           THIS SHOULD ALWAYS BE CHANGED AT INSTALL TIME TO SECURE SYSTEM
+      <attribute name="SuckerPassword"></attribute>
+      -->
+
+      <depends optional-attribute-name="PersistenceManager">jboss.messaging:service=PersistenceManager</depends>
+      
+      <depends optional-attribute-name="JMSUserManager">jboss.messaging:service=JMSUserManager</depends>
+      
+      <depends>jboss.messaging:service=Connector,transport=bisocket</depends>
+
+   </mbean>
+
+</server>
\ No newline at end of file


Property changes on: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test-configs/localfromremote1/deploy
___________________________________________________________________
Name: svn:ignore
   + localfromremote-test.jar



Property changes on: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/resources/test-configs/localfromremote2/deploy
___________________________________________________________________
Name: svn:ignore
   + localfromremote-test.jar


Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/clusteredjms/unit/MDBUnitTestCase.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/clusteredjms/unit/MDBUnitTestCase.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/clusteredjms/unit/MDBUnitTestCase.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -39,7 +39,6 @@
 import org.jboss.ejb3.test.clusteredjms.TestStatus;
 import org.jboss.logging.Logger;
 import org.jboss.test.JBossTestCase;
-import org.jboss.test.JBossClusteredTestCase;
 
 /**
  * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/consumer/unit/ConsumerUnitTestCase.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/consumer/unit/ConsumerUnitTestCase.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/consumer/unit/ConsumerUnitTestCase.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -213,7 +213,7 @@
 
    public static Test suite() throws Exception
    {
-      return getDeploySetup(ConsumerUnitTestCase.class, "consumertest-service.xml, consumer-test.jar");
+      return getDeploySetup(ConsumerUnitTestCase.class, "consumertest-${jboss.jms.provider}-service.xml, consumer-test.jar");
    }
 
 }

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/dd/mdb/QueueBean.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/dd/mdb/QueueBean.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/dd/mdb/QueueBean.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -21,6 +21,8 @@
  */
 package org.jboss.ejb3.test.dd.mdb;
 
+import java.sql.Connection;
+
 import javax.annotation.Resource;
 import javax.ejb.MessageDrivenBean;
 import javax.ejb.MessageDrivenContext;
@@ -101,7 +103,8 @@
    {
       stateless.test();
       statelessLocal.testLocal();
-      testDatasource.getConnection();
+      Connection conn = testDatasource.getConnection();
+      conn.close();
       
       Context initCtx = new InitialContext();
       Context myEnv = (Context) initCtx.lookup(Container.ENC_CTX_NAME + "/env");

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/dd/mdb/unit/MDBUnitTestCase.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/dd/mdb/unit/MDBUnitTestCase.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/dd/mdb/unit/MDBUnitTestCase.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -24,6 +24,8 @@
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.Map;
+
 import javax.jms.ObjectMessage;
 import javax.jms.Queue;
 import javax.jms.QueueConnection;
@@ -81,25 +83,37 @@
    QueueConnection queueConnection;
    TopicConnection topicConnection;
    
-   static HashMap jndiToDestName = new HashMap();
+   static Map<String, String> jndiToDestName = new HashMap<String, String>();
    static
    {
-      jndiToDestName.put("queue/testQueue", "QUEUE.testQueue");
-      jndiToDestName.put("topic/testTopic", "TOPIC.testTopic");
-      jndiToDestName.put("topic/testDurableTopic", "TOPIC.testDurableTopic");
-      jndiToDestName.put("queue/ex", "QUEUE.ex");
-      jndiToDestName.put("queue/A", "QUEUE.A");
-      jndiToDestName.put("queue/B", "QUEUE.B");
+      String jbossJmsProvider = System.getProperty("jboss.jms.provider");
+      if(jbossJmsProvider.equals("mq"))
+      {
+         jndiToDestName.put("queue/testQueue", "QUEUE.testQueue");
+         jndiToDestName.put("topic/testTopic", "TOPIC.testTopic");
+         jndiToDestName.put("topic/testDurableTopic", "TOPIC.testDurableTopic");
+         jndiToDestName.put("queue/ex", "QUEUE.ex");
+         jndiToDestName.put("queue/A", "QUEUE.A");
+         jndiToDestName.put("queue/B", "QUEUE.B");
+      }
+      else if(jbossJmsProvider.equals("jbm"))
+      {
+         jndiToDestName.put("queue/testQueue", "JBossQueue[testQueue]");
+         jndiToDestName.put("topic/testTopic", "JBossTopic[testTopic]");
+         jndiToDestName.put("topic/testDurableTopic", "JBossTopic[testDurableTopic]");
+         jndiToDestName.put("queue/ex", "JBossQueue[ex]");
+         jndiToDestName.put("queue/A", "JBossQueue[A]");
+         jndiToDestName.put("queue/B", "JBossQueue[B]");         
+      }
+      else
+         throw new IllegalStateException("Unknown jboss jms provider " + jbossJmsProvider);
    }
    
 
    // JMSProviderAdapter providerAdapter;
 
-   String dest;
-
-   public MDBUnitTestCase(String name, String dest) {
+   public MDBUnitTestCase(String name) {
       super(name);
-      this.dest = dest;
       // Get JMS JNDI Adapter
       // Class cls = Class.forName(providerAdapterClass);
       // providerAdapter = (JMSProviderAdapter)cls.newInstance();
@@ -107,7 +121,11 @@
       // provider specific queue and topic names!!
    }
 
-
+   private boolean isMQ()
+   {
+      return System.getProperty("jboss.jms.provider", "mq").equals("mq");
+   }
+   
    protected void tearDown() throws Exception {
       if (topicConnection != null) {
          topicConnection.close();
@@ -117,7 +135,7 @@
       }
    }
 
-   protected void printHeader() {
+   protected void printHeader(String dest) {
       log.info("\n---- Testing method " + getName() +
                          " for destination " +dest);
    }
@@ -148,8 +166,8 @@
    /**
     * Test sending messages to Topic testTopic
     */
-   public void testQueue() throws Exception {
-      printHeader();
+   public void testQueue(String dest) throws Exception {
+      printHeader(dest);
       TestStatus status = (TestStatus)getInitialContext().lookup("TestStatusBean/remote");
       status.clear();
       
@@ -166,10 +184,12 @@
 
       sender.close();
       
-      Thread.currentThread().sleep(10000);
+      Thread.sleep(10000);
       
       ArrayList destinations = status.getDestinations();
-      int size = (dest.equals("queue/ex")) ? 110 : 10;
+      // Wolf: MQ delivers 110 messages (don't ask)
+      int expected = isMQ() ? 110 : 100;
+      int size = (dest.equals("queue/ex")) ? expected : 10;
 
       assertEquals(size, destinations.size());
       String destinationName = (String)jndiToDestName.get(dest);
@@ -182,8 +202,8 @@
    /**
     * Test sending messages to Queue testQueue
     */
-   public void testTopic() throws Exception {
-      printHeader();
+   public void testTopic(String dest) throws Exception {
+      printHeader(dest);
       TestStatus status = (TestStatus)getInitialContext().lookup("TestStatusBean/remote");
       status.clear();
 
@@ -202,7 +222,7 @@
 
       pub.close();
 
-      Thread.currentThread().sleep(10000);
+      Thread.sleep(20000);
 
       ArrayList destinations = status.getDestinations();
       
@@ -220,10 +240,11 @@
     * Test sending messages to queue testObjectMessage
     */
    public void testObjectMessage() throws Exception {
-      printHeader();
+      String dest = "queue/testObjectMessage";
+      printHeader(dest);
       QueueSession session = getQueueSession();
       // Non portable!!
-      Queue queue = (Queue)getInitialContext().lookup("queue/testObjectMessage");
+      Queue queue = (Queue)getInitialContext().lookup(dest);
       QueueSender sender = session.createSender(queue);
 
       log.debug("TestQueue: Sending 10 messages 1-10");
@@ -238,11 +259,6 @@
    }
 
 
-   public void testWaitForCompletion() throws Exception {
-      try { Thread.currentThread().sleep(1000*20);
-      } catch ( InterruptedException e ) {}
-   }
-
    public void testNoQueueConstructionForAlreadyExists()
       throws Exception
    {
@@ -271,22 +287,48 @@
       fail("It should not create topic/TopicInADifferentContext");
    }
 
+   public void testQueue() throws Exception
+   {
+      testQueue("queue/testQueue");
+   }
+   
+   public void testTopic() throws Exception
+   {
+      testTopic("topic/testTopic");
+   }
+   
+   public void testDurableTopic() throws Exception
+   {
+      testTopic("topic/testDurableTopic");
+   }
+   
+   public void testQueueEx() throws Exception
+   {
+      testQueue("queue/ex");
+   }
+   
+   public void testQueueA() throws Exception
+   {
+      testQueue("queue/A");
+   }
+   
+   // FIXME: this is really silly, should be part of test method
+   public void testWaitForCompletion() throws Exception {
+      try { Thread.sleep(1000*20);
+      } catch ( InterruptedException e ) {}
+   }
+
+   public void testQueueB() throws Exception
+   {
+      testQueue("queue/B");
+   }
+   
    /**
     * Setup the test suite.
     */
    public static Test suite() throws Exception
    {
-      TestSuite suite = new TestSuite();
-      suite.addTest(new MDBUnitTestCase("testQueue","queue/testQueue"));
-      suite.addTest(new MDBUnitTestCase("testTopic","topic/testTopic"));
-      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("testWaitForCompletion",""));
-      suite.addTest(new MDBUnitTestCase("testQueue","queue/B"));
-
-     return new JBossTestSetup(getDeploySetup(suite, "dd-mdb-service.xml, dd-mdb.jar"));
-
+     return new JBossTestSetup(getDeploySetup(MDBUnitTestCase.class, "dd-mdb-${jboss.jms.provider}-service.xml, dd-mdb.jar"));
    }
 }
 

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/ejbthree959/Status.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree959/Status.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/ejbthree959/Status.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -27,7 +27,7 @@
  * Comment
  *
  * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision: $
+ * @version $Revision$
  */
 @Remote
 public interface Status

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/ejbthree959/StatusBean.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree959/StatusBean.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/ejbthree959/StatusBean.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -27,7 +27,7 @@
  * Dirty bean to check status of MyStatefulBean
  *
  * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision: $
+ * @version $Revision$
  */
 @Stateless
 public class StatusBean implements Status

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/BusinessInterface.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/BusinessInterface.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/BusinessInterface.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -24,7 +24,7 @@
 /**
  *
  * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision: $
+ * @version $Revision$
  */
 public interface BusinessInterface
 {

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/StatefulBean.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/StatefulBean.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/StatefulBean.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -29,7 +29,7 @@
 /**
  *
  * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision: $
+ * @version $Revision$
  */
 @Stateful
 @RemoteBindings({

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/unit/MultiBindingsTestCase.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/unit/MultiBindingsTestCase.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/ejbthree994/unit/MultiBindingsTestCase.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -36,7 +36,7 @@
  * Test if multiple remote bindings work correctly.
  *
  * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision: $
+ * @version $Revision$
  */
 public class MultiBindingsTestCase extends JBossTestCase
 {

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/interceptors2/unit/InterceptorsTestCase.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/interceptors2/unit/InterceptorsTestCase.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/interceptors2/unit/InterceptorsTestCase.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -774,7 +774,7 @@
    
    public static Test suite() throws Exception
    {
-      return getDeploySetup(InterceptorsTestCase.class, "interceptors2test-service.xml, interceptors2-test.jar");
+      return getDeploySetup(InterceptorsTestCase.class, "interceptors2test-${jboss.jms.provider}-service.xml, interceptors2-test.jar");
    }
 
 }
\ No newline at end of file

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/jbas4489/BMTCleanUp.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbas4489/BMTCleanUp.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/jbas4489/BMTCleanUp.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -25,7 +25,7 @@
  * Comment
  *
  * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision: $
+ * @version $Revision$
  */
 public interface BMTCleanUp
 {

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/jbas4489/BMTCleanUpBean.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbas4489/BMTCleanUpBean.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/jbas4489/BMTCleanUpBean.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -39,7 +39,7 @@
  * Comment
  *
  * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision: $
+ * @version $Revision$
  */
 @Stateless
 @Remote(BMTCleanUp.class)

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/jbas4489/unit/BMTCleanUpUnitTestCase.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/jbas4489/unit/BMTCleanUpUnitTestCase.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/jbas4489/unit/BMTCleanUpUnitTestCase.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -30,7 +30,7 @@
  * Comment
  *
  * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision: $
+ * @version $Revision$
  */
 public class BMTCleanUpUnitTestCase extends JBossTestCase
 {

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/mdb/unit/ConcurrentMDBUnitTestCase.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/mdb/unit/ConcurrentMDBUnitTestCase.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/mdb/unit/ConcurrentMDBUnitTestCase.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -120,7 +120,7 @@
    public static Test suite() throws Exception
    {
       return getDeploySetup(ConcurrentMDBUnitTestCase.class,
-            "mdbtest-service.xml, mdb-test.jar");
+            "mdbtest-${jboss.jms.provider}-service.xml, mdb-test.jar");
    }
 
 }
\ No newline at end of file

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/mdb/unit/MDBUnitTestCase.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/mdb/unit/MDBUnitTestCase.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/mdb/unit/MDBUnitTestCase.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -21,6 +21,7 @@
  */
 package org.jboss.ejb3.test.mdb.unit;
 
+import java.lang.reflect.Method;
 import java.util.Enumeration;
 import java.util.List;
 
@@ -77,9 +78,21 @@
 
    }
 
+   private static ObjectName getDlqName() throws Exception
+   {
+      String jmsProvider = System.getProperty("jboss.jms.provider", "mq");
+      if(jmsProvider.equals("jbm")) jmsProvider = "messaging";
+      return new ObjectName("jboss." + jmsProvider + ".destination:name=DLQ,service=Queue");
+   }
+   
+   private boolean isJBM()
+   {
+      return System.getProperty("jboss.jms.provider", "mq").equals("jbm");
+   }
+   
    private static void removeAllMessagesFromDLQ() throws Exception
    {
-      ObjectName dlqName = new ObjectName("jboss.mq.destination:name=DLQ,service=Queue");
+      ObjectName dlqName = getDlqName();
       ClientKernelAbstraction kernel = KernelAbstractionFactory.getClientInstance();
       kernel.invoke(dlqName, "removeAllMessages", new Object[0], new String[0]);
    }
@@ -384,7 +397,17 @@
 
       Thread.sleep(2000);
 
-      assertSize(session, queue, 0);
+      // JBMESSAGING-1141: a queue browser shows expired messages
+      if(size(session, queue) == 1)
+      {
+         QueueReceiver receiver = session.createReceiver(dlq);
+         message = (TextMessage) receiver.receive(2000);
+         assertNull(message);
+      }
+      else
+      {
+         assertSize(session, queue, 0);
+      }
       
       /* TODO: await implementation of JBMESSAGING-126
       assertSize(session, dlq, 1);
@@ -441,14 +464,21 @@
       assertSize(session, dlq, 1);
 
       QueueReceiver receiver = session.createReceiver(dlq);
-      message = (TextMessage) receiver.receiveNoWait();
+      // JBMESSAGING-1140: wait for the message to arrive
+      message = (TextMessage) receiver.receive(2000);
       assertNotNull(message);
-      // AS 4.x
-      assertEquals("QUEUE.dlqtest", message
-            .getStringProperty("JBOSS_ORIG_DESTINATION"));
-      // AS 5.x
-//      assertEquals("JBossQueue[dlqtest]", message
-//            .getStringProperty("JBOSS_ORIG_DESTINATION"));
+      if(!isJBM())
+      {
+         // MQ (AS 4.x)
+         assertEquals("QUEUE.dlqtest", message
+               .getStringProperty("JBOSS_ORIG_DESTINATION"));
+      }
+      else
+      {
+         // JBM (AS 5.x and EAP 4.3)
+         assertEquals("JBossQueue[dlqtest]", message
+               .getStringProperty("JBOSS_ORIG_DESTINATION"));
+      }
       assertEquals(0L, message.getJMSExpiration());
       assertEquals(text, message.getText());
       assertEquals("bar", message.getStringProperty("foo"));
@@ -563,7 +593,7 @@
 //      // the second message should never have arrived, so the bean ran once
 //      assertEquals("The second message should never have arrived (EJBTHREE-890)", 1, status.expirationQueueRan());
       // In AS 4.2 expiration doesn't work, so the second message will arrive, see EJBTHREE-890
-      assertEquals(2, status.expirationQueueRan());
+      assertEquals(isJBM() ? 1 : 2, status.expirationQueueRan());
    }
 
    public void testCMTTxNotSupported() throws Exception
@@ -721,7 +751,7 @@
    public static Test suite() throws Exception
    {
       return getDeploySetup(MDBUnitTestCase.class,
-            "mdbtest-service.xml, mdb-test.jar");
+            "mdbtest-${jboss.jms.provider}-service.xml, mdb-test.jar");
    }
 
 }
\ No newline at end of file

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/mdb/unit/MetricsUnitTestCase.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/mdb/unit/MetricsUnitTestCase.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/mdb/unit/MetricsUnitTestCase.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -76,7 +76,7 @@
 
    public static Test suite() throws Exception
    {
-      return getDeploySetup(MetricsUnitTestCase.class, "mdbtest-service.xml, mdb-test.jar");
+      return getDeploySetup(MetricsUnitTestCase.class, "mdbtest-${jboss.jms.provider}-service.xml, mdb-test.jar");
    }
 
 }

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/QueueTestMDB.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/QueueTestMDB.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/QueueTestMDB.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -22,14 +22,13 @@
 package org.jboss.ejb3.test.mdbtransactions;
 
 import javax.ejb.ActivationConfigProperty;
-import javax.ejb.EJB;
 import javax.ejb.MessageDriven;
+import javax.jms.JMSException;
 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;
 
 /**
@@ -45,20 +44,19 @@
    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;
+         Entity entity = (Entity)message.getObject();
+         manager.remove(entity);
       }
-      catch (Throwable t)
+      catch (JMSException e)
       {
-         TestStatusBean.caughtRollback = true;
+         e.printStackTrace();
+         throw new RuntimeException(e);
       }
    }
 }

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/ReplyToCMDB.java (from rev 67044, branches/JBPAPP_4_2/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/ReplyToCMDB.java)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/ReplyToCMDB.java	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/ReplyToCMDB.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -0,0 +1,116 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+  *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.mdbtransactions;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.annotation.Resource;
+import javax.ejb.ActivationConfigProperty;
+import javax.ejb.MessageDriven;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageListener;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.jms.TextMessage;
+
+/**
+ * Reply a message to queue/C whenever a message is received on queue/B.
+ * Note that this has nothing to do with the actual test.
+ * 
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+ at MessageDriven(activationConfig =
+{
+   @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
+   @ActivationConfigProperty(propertyName="destination", propertyValue="queue/B")
+})
+public class ReplyToCMDB implements MessageListener
+{
+   @Resource(mappedName="ConnectionFactory")
+   private QueueConnectionFactory factory;
+   
+   @Resource(mappedName="queue/C")
+   private Queue replyQueue;
+   
+   private QueueConnection connection;
+   private QueueSession session;
+   private QueueSender sender;
+   
+   public void onMessage(Message message)
+   {
+      try
+      {
+         TextMessage reply;
+         if(message instanceof TextMessage)
+         {
+            reply = session.createTextMessage("Reply: " + ((TextMessage) message).getText());
+         }
+         else
+         {
+            reply = session.createTextMessage("Unknown message");
+         }
+         sender.send(reply);
+      }
+      catch(JMSException e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+   
+   @PostConstruct
+   public void postConstruct()
+   {
+      try
+      {
+         connection = factory.createQueueConnection();
+         session = connection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+         sender = session.createSender(replyQueue);
+      }
+      catch(JMSException e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+   
+   @PreDestroy
+   public void preDestroy()
+   {
+      try
+      {
+         if(sender != null)
+            sender.close();
+         if(session != null)
+            session.close();
+         if(connection != null)
+            connection.close();
+      }
+      catch(JMSException e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+}

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/RollbackQueueTestMDB.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/RollbackQueueTestMDB.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/RollbackQueueTestMDB.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -24,6 +24,7 @@
 import javax.ejb.ActivationConfigProperty;
 import javax.ejb.EJB;
 import javax.ejb.MessageDriven;
+import javax.jms.JMSException;
 import javax.jms.Message;
 import javax.jms.MessageListener;
 import javax.jms.ObjectMessage;
@@ -52,12 +53,18 @@
       try
       {
          ObjectMessage message = (ObjectMessage)recvMsg;
-         Entity entity = (Entity)message.getObject();
-         manager.remove(entity);
+         Entity entity = (Entity)message.getObject(); 
+         stateless.persist(entity);
+         ++TestStatusBean.messageCount;
       }
-      catch (Throwable t)
+      catch (JMSException e)
       {
-          t.printStackTrace();
+         e.printStackTrace();
       }
+      catch (RuntimeException e)
+      {
+         TestStatusBean.caughtRollback = true;
+         throw e;
+      }
    }
 }

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/StatelessFacadeBean.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/StatelessFacadeBean.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/StatelessFacadeBean.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -54,7 +54,7 @@
       }
       catch (Throwable t)
       {
-         t.printStackTrace();
+         log.error("clear failed", t);
       }
    }
    
@@ -67,7 +67,7 @@
       }
       catch (Throwable t)
       {
-         t.printStackTrace();
+         log.error("persist failed", t);
       }
    }
 }

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/unit/MDBUnitTestCase.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/unit/MDBUnitTestCase.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/mdbtransactions/unit/MDBUnitTestCase.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -21,14 +21,18 @@
  */
 package org.jboss.ejb3.test.mdbtransactions.unit;
 
+import java.util.Enumeration;
+
 import javax.jms.Message;
 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.ObjectMessage;
+import javax.jms.TextMessage;
 
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
@@ -59,18 +63,115 @@
       super(name);
 
    }
-
+   
+   /**
+    * This tests the basic functionality of sending a message.
+    * Precondition for the actual test.
+    * @throws Exception
+    */
+   public void testSimpleQueue() throws Exception
+   {
+      InitialContext ctx = new InitialContext();
+      Queue queue = (Queue) ctx.lookup("queue/A");
+      QueueConnectionFactory factory = (QueueConnectionFactory) ctx.lookup("ConnectionFactory");
+      QueueConnection connection = factory.createQueueConnection();
+      try
+      {
+         connection.start();
+         QueueSession session = connection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+         QueueSender sender = session.createSender(queue);
+         TextMessage message = session.createTextMessage("Hello world");
+         sender.send(message);
+         sender.close();
+         QueueReceiver receiver = session.createReceiver(queue);
+         Message msg = receiver.receive(5000);
+         assertNotNull(msg);
+         receiver.close();
+         session.close();
+      }
+      finally
+      {
+         connection.close();
+      }
+   }
+   
+   /**
+    * Send a message to a MDB and receive it back on another queue.
+    * Precondition for the actual test.
+    * @throws Exception
+    */
+   public void testPingPong() throws Exception
+   {
+      InitialContext ctx = new InitialContext();
+      Queue queue = (Queue) ctx.lookup("queue/B");
+      Queue replyQueue = (Queue) ctx.lookup("queue/C");
+      QueueConnectionFactory factory = (QueueConnectionFactory) ctx.lookup("ConnectionFactory");
+      QueueConnection connection = factory.createQueueConnection();
+      try
+      {
+         connection.start();
+         QueueSession session = connection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+         QueueSender sender = session.createSender(queue);
+         TextMessage message = session.createTextMessage("Hello world");
+         sender.send(message);
+         sender.close();
+         QueueReceiver receiver = session.createReceiver(replyQueue);
+         Message msg = receiver.receive(5000);
+         assertNotNull(msg);
+         receiver.close();
+         session.close();
+      }
+      finally
+      {
+         connection.close();
+      }
+   }
+   
    public void testMdbTransactions() throws Exception
    {
       TestStatus status = (TestStatus)getInitialContext().lookup("TestStatusBean/remote");
       status.clear();
       
-      sendMessages("queue/mdbtest", 2);
+      sendMessages("queue/rollbackmdbtest", 2);
       
       Thread.sleep(5000);
       
       assertEquals(1, status.messageCount());
       assertTrue(status.caughtRollback());
+      
+      Queue queue = (Queue) getInitialContext().lookup("queue/DLQ");
+      QueueConnectionFactory factory = getQueueConnectionFactory();
+      QueueConnection connection = factory.createQueueConnection();
+      try
+      {
+         connection.start();
+         QueueSession session = connection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+         
+         QueueReceiver receiver = session.createReceiver(queue);
+         
+         /*
+         {
+            Queue sendQueue = (Queue) getInitialContext().lookup("queue/rollbackmdbtest");
+            QueueSender sender = session.createSender(sendQueue);
+            TextMessage message = session.createTextMessage("Should never arrive");
+            message.setIntProperty("JMS_JBOSS_REDELIVERY_LIMIT", 0);
+            sender.send(message);
+            sender.close();
+         }
+         */
+         
+         Message message = receiver.receive(5000);
+         assertNotNull(message);
+         
+         session.close();
+         connection.close();
+      }
+      finally
+      {
+         connection.close();
+      }
+      
+      sendMessages("queue/mdbtest", 1);
    }
    
    public void testRollback() throws Exception
@@ -78,23 +179,12 @@
       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();
    }
    
+   /**
+    * Test sending a message to a MDB which can not be created.
+    * @throws Exception
+    */
    public void testBadCreation() throws Exception
    {
       TestStatus status = (TestStatus)getInitialContext().lookup("TestStatusBean/remote");
@@ -102,33 +192,67 @@
       
       sendMessages("queue/badcreationmdb", 1);
       
-      Thread.sleep(5000);
-      
-      Queue queue = (Queue) getInitialContext().lookup("queue/DLQ");
-      QueueConnectionFactory factory = getQueueConnectionFactory();
+      InitialContext ctx = getInitialContext();
+      Queue dlq = (Queue) ctx.lookup("queue/DLQ");
+      QueueConnectionFactory factory = (QueueConnectionFactory) ctx.lookup("ConnectionFactory");
       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();
+      try
+      {
+         connection.start();
+         QueueSession session = connection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+         QueueReceiver receiver = session.createReceiver(dlq);
+         
+         //sendMessages(session, "queue/badcreationmdb", 1);
+         /*
+         {
+            Queue queue = (Queue) ctx.lookup("queue/badcreationmdb");
+            QueueSender sender = session.createSender(queue);
+            TextMessage message = session.createTextMessage("Should never arrive");
+            message.setIntProperty("JMS_JBOSS_REDELIVERY_LIMIT", 0);
+            sender.send(message);
+            sender.close();
+         }
+         */
+         
+         //Thread.sleep(5000);
+         
+         log.info("ENTERING RECEIVE");
+         Message message = receiver.receive(5000);
+         log.info("EXITING RECEIVE WITH " + message);
+         assertNotNull(message);
+         
+         session.close();
+      }
+      finally
+      {
+         connection.close();
+      }
    }
    
    protected void sendMessages(String queueName, int numMessages) throws Exception
    {
-      QueueConnection connection = null;
+      InitialContext ctx = getInitialContext();
+      QueueConnectionFactory factory = (QueueConnectionFactory) ctx.lookup("ConnectionFactory");
+      QueueConnection connection = factory.createQueueConnection();
+      try
+      {
+         connection.start();
+         QueueSession session = connection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+         sendMessages(session, queueName, numMessages);
+         session.close();
+      }
+      finally
+      {
+         connection.close();
+      }
+   }
+   
+   protected void sendMessages(QueueSession session, String queueName, int numMessages) throws Exception
+   {
       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();
@@ -143,28 +267,19 @@
       stateless.clear(entity);
       
       ObjectMessage msg = session.createObjectMessage(entity);
+      msg.setIntProperty("JMS_JBOSS_REDELIVERY_LIMIT", 0);
 
       sender = session.createSender(queue);
       
       for (int i = 0 ; i < numMessages ; ++i)
          sender.send(msg);
- 
-      session.close();
-      connection.close();
    }
    
    protected QueueConnectionFactory getQueueConnectionFactory()
       throws Exception
    {
-      try
-      {
-         return (QueueConnectionFactory) getInitialContext().lookup(
-               "ConnectionFactory");
-      } catch (NamingException e)
-      {
-         return (QueueConnectionFactory) getInitialContext().lookup(
-               "java:/ConnectionFactory");
-      }
+      // We want the server connection factory
+      return (QueueConnectionFactory) getInitialContext().lookup("ConnectionFactory");
    }
    
    protected InitialContext getInitialContext() throws Exception
@@ -175,7 +290,7 @@
    public static Test suite() throws Exception
    {
       return getDeploySetup(MDBUnitTestCase.class,
-            "mdbtransactionstest-service.xml, mdbtransactions-test.jar");
+            "mdbtransactionstest-${jboss.jms.provider}-service.xml, mdbtransactions-test.jar");
    }
 
 }
\ No newline at end of file

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/service/TestResourceInjectionService.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/service/TestResourceInjectionService.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/service/TestResourceInjectionService.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -4,7 +4,6 @@
 import javax.jms.Topic;
 import javax.jms.TopicConnectionFactory;
 
-import org.jboss.annotation.ejb.Depends;
 import org.jboss.annotation.ejb.Management;
 import org.jboss.annotation.ejb.Service;
 import org.jboss.logging.Logger;
@@ -17,7 +16,8 @@
  */
 @Service(objectName = "jboss.ejb3.bugs:service=TestResourceInjectionService")
 @Management(TestResourceInjectionServiceIF.class)
- at Depends("jboss.mq.destination:name=myTestTopic,service=Topic")
+// We can't be certain that we use MQ, so the depends is dynamically inserted into the dd 
+//@Depends("jboss.mq.destination:name=myTestTopic,service=Topic")
 public class TestResourceInjectionService implements TestResourceInjectionServiceIF {
 
 	private static Logger log = Logger.getLogger(TestResourceInjectionService.class);

Deleted: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/strictpool/MDBInvoker.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/strictpool/MDBInvoker.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/strictpool/MDBInvoker.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -1,89 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ejb3.test.strictpool;
-
-import javax.jms.QueueSession;
-import javax.jms.Queue;
-import javax.jms.QueueSender;
-import javax.jms.TextMessage;
-import javax.jms.QueueReceiver;
-import javax.jms.Message;
-import javax.jms.ObjectMessage;
-
-import EDU.oswego.cs.dl.util.concurrent.CountDown;
-import org.jboss.logging.Logger;
-
-/**
- * Adapted from the EJB 2.1 tests (org.jboss.test.cts.test.SessionInvoker)
- * @author <a href="mailto:kabir.khan at jboss.org">Kabir Khan</a>
- * @version $Revision$
- */
-public class MDBInvoker extends Thread
-{
-   QueueSession session;
-   Queue queueA;
-   Queue queueB;
-   int id;
-   CountDown done;
-   public Exception runEx;
-
-   public MDBInvoker(QueueSession session, Queue queueA, Queue queueB, int id, CountDown done)
-   {
-      super("MDBInvoker#"+id);
-      this.session = session;
-      this.queueA = queueA;
-      this.queueB = queueB;
-      this.id = id;
-      this.done = done;
-   }
-   public void run()
-   {
-      System.out.println("Begin run, this="+this);
-      try
-      {
-         QueueSender sender = session.createSender(queueA);
-         TextMessage message = session.createTextMessage();
-         message.setText(this.toString());
-         sender.send(message);
-         QueueReceiver receiver = session.createReceiver(queueB);
-         Message reply = receiver.receive(20000);
-         if( reply == null )
-         {
-            runEx = new IllegalStateException("Message receive timeout");
-         }
-         else
-         {
-            Message tm = (Message) reply;
-            System.out.println(tm);
-         }
-         sender.close();
-         receiver.close();
-      }
-      catch(Exception e)
-      {
-         runEx = e;
-      }
-      done.release();
-      System.out.println("End run, this="+this);
-   }
-
-}

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/strictpool/StrictlyPooledMDB.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/strictpool/StrictlyPooledMDB.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/strictpool/StrictlyPooledMDB.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -26,6 +26,7 @@
 import javax.ejb.EJBException;
 import javax.ejb.MessageDriven;
 import javax.ejb.MessageDrivenContext;
+import javax.jms.DeliveryMode;
 import javax.jms.JMSException;
 import javax.jms.Message;
 import javax.jms.MessageListener;
@@ -39,6 +40,7 @@
 
 import org.jboss.annotation.ejb.PoolClass;
 import org.jboss.annotation.ejb.PoolClass;
+import org.jboss.logging.Logger;
 
 /**
  * Adapted from the EJB 2.1 tests (org.jboss.test.cts.ejb.StrictlyPooledMDB)
@@ -50,12 +52,15 @@
         @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
         @ActivationConfigProperty(propertyName="destination", propertyValue="queue/queueA"),
         @ActivationConfigProperty(propertyName="maxMessages", propertyValue="10"),
-        @ActivationConfigProperty(propertyName="minSession", propertyValue="10"),
-        @ActivationConfigProperty(propertyName="maxSession", propertyValue="10")
+        @ActivationConfigProperty(propertyName="minSession", propertyValue="2"),
+        @ActivationConfigProperty(propertyName="maxSession", propertyValue="2")
         })
- at PoolClass (value=org.jboss.ejb3.StrictMaxPool.class, maxSize=StrictlyPooledMDB.maxActiveCount, timeout=10000)
+// EJBTHREE-1003 is not implemented in EAP 4
+//@PoolClass (value=org.jboss.ejb3.StrictMaxPool.class, maxSize=StrictlyPooledMDB.maxActiveCount, timeout=10000)
 public class StrictlyPooledMDB implements MessageListener
 {
+   private static final Logger log = Logger.getLogger(StrictlyPooledMDB.class);
+   
    /** The class wide max count of instances allows */
    public static final int maxActiveCount = 2;
    /** The class wide count of instances active in business code */
@@ -78,7 +83,7 @@
    @Resource public void setMessageDrivenContext(MessageDrivenContext ctx)
       throws EJBException
    {
-      System.out.println("setMessageDrivenContext()");
+      log.info("setMessageDrivenContext()");
       this.ctx = ctx;
       try
       {
@@ -86,12 +91,12 @@
          QueueConnectionFactory factory = (QueueConnectionFactory) iniCtx.lookup("java:/ConnectionFactory");
          queConn = factory.createQueueConnection();
          session = queConn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
-         Queue queue = (Queue) iniCtx.lookup("queue/queueB");
-         sender = session.createSender(queue);
+         sender = session.createSender(null);
+         sender.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
       }
       catch(Exception e)
       {
-         System.out.println("Setup failure");
+         log.info("Setup failure");
          e.printStackTrace();
          throw new EJBException("Setup failure", e);
       }
@@ -114,7 +119,7 @@
       }
       catch(Exception e)
       {
-         System.out.println("Failed to close JMS resources");
+         log.info("Failed to close JMS resources");
          e.printStackTrace();
       }
    }
@@ -122,7 +127,7 @@
    public void onMessage(Message message)
    {
       int count = incActiveCount();
-      System.out.println("Begin onMessage, activeCount="+count+", ctx="+ctx);
+      log.info("Begin onMessage, activeCount="+count+", ctx="+ctx);
       try
       {
          Message reply = null;
@@ -140,12 +145,12 @@
             // Send an ack
             reply = session.createTextMessage("Recevied msg="+tm.getText());
          }
-         Thread.currentThread().sleep(1000);
-         sender.send(reply);
+         Thread.sleep(1000);
+         sender.send(message.getJMSReplyTo(), reply);
       }
       catch(JMSException e)
       {
-         System.out.println("Failed to send error message");
+         log.info("Failed to send error message");
          e.printStackTrace();
       }
       catch(InterruptedException e)
@@ -154,7 +159,7 @@
       finally
       {
          count = decActiveCount();
-         System.out.println("End onMessage, activeCount="+count+", ctx="+ctx);
+         log.info("End onMessage, activeCount="+count+", ctx="+ctx);
       }
    }
 }

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/strictpool/unit/MDBCallable.java (from rev 66823, branches/JBPAPP_4_2/ejb3/src/test/org/jboss/ejb3/test/strictpool/unit/MDBCallable.java)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/strictpool/unit/MDBCallable.java	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/strictpool/unit/MDBCallable.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -0,0 +1,109 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+  *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.strictpool.unit;
+
+import java.util.concurrent.Callable;
+
+import javax.jms.DeliveryMode;
+import javax.jms.Message;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueReceiver;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.jms.TemporaryQueue;
+import javax.jms.TextMessage;
+
+import org.jboss.logging.Logger;
+
+/**
+ * Send a JMS text message and expect a reply.
+ * 
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class MDBCallable implements Callable<String>
+{
+   private static final Logger log = Logger.getLogger(MDBCallable.class);
+   
+   private QueueConnection connection;
+   private Queue queue;
+   private String text;
+   
+   public MDBCallable(QueueConnection connection, Queue queue, String text)
+   {
+      assert connection != null : "connection is null";
+      assert queue != null : "queue is null";
+      assert text != null : "text is null";
+      
+      this.connection = connection;
+      this.queue = queue;
+      this.text = text;
+   }
+   
+   public String call() throws Exception
+   {
+      log.info("start mdb call " + this);
+      // JMS 1.1 4.4.6: since we're concurrent, let's create our own session
+      QueueSession session = connection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+      try
+      {
+         TemporaryQueue replyQueue = session.createTemporaryQueue();
+         QueueReceiver receiver = session.createReceiver(replyQueue);
+         
+         QueueSender sender = session.createSender(queue);
+         sender.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
+         TextMessage message = session.createTextMessage();
+         message.setJMSReplyTo(replyQueue);
+         message.setText(text);
+         sender.send(message);
+         sender.close();
+         
+         Message reply = receiver.receive(20000);
+         receiver.close();
+         replyQueue.delete();
+         
+         if(reply instanceof TextMessage)
+            return ((TextMessage) reply).getText();
+         
+         if(reply instanceof ObjectMessage)
+         {
+            Object obj = ((ObjectMessage) reply).getObject();
+            if(obj instanceof Exception)
+               throw (Exception) obj;
+            
+            if(obj instanceof String)
+               return (String) obj;
+            
+            throw new IllegalStateException("Can't handle " + obj);
+         }
+         
+         throw new IllegalStateException("Can't handle " + reply);
+      }
+      finally
+      {
+         session.close();
+         log.info("end mdb call " + this);
+      }
+   }
+}

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/strictpool/unit/StrictPoolUnitTestCase.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/strictpool/unit/StrictPoolUnitTestCase.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3/src/test/org/jboss/ejb3/test/strictpool/unit/StrictPoolUnitTestCase.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -21,15 +21,31 @@
  */
 package org.jboss.ejb3.test.strictpool.unit;
 
-import javax.jms.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.Session;
+import javax.jms.TextMessage;
 import javax.naming.InitialContext;
-import org.jboss.ejb3.test.strictpool.MDBInvoker;
+
+import junit.framework.Test;
+
+import org.jboss.ejb3.test.strictpool.Counter;
 import org.jboss.ejb3.test.strictpool.SessionInvoker;
 import org.jboss.ejb3.test.strictpool.StrictlyPooledSession;
-import org.jboss.ejb3.test.strictpool.Counter;
 import org.jboss.test.JBossTestCase;
+
 import EDU.oswego.cs.dl.util.concurrent.CountDown;
-import junit.framework.Test;
 
 
 /**
@@ -81,37 +97,39 @@
    public void testMessageDriven() throws Exception
    {
       System.out.println("*** testMessageDriven");
-      CountDown done = new CountDown(MAX_SIZE);
       InitialContext ctx = new InitialContext();
       QueueConnectionFactory factory = (QueueConnectionFactory) ctx.lookup(QUEUE_FACTORY);
       QueueConnection queConn = factory.createQueueConnection();
-      QueueSession session = queConn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
       Queue queueA = (Queue) ctx.lookup("queue/queueA");
-      Queue queueB = (Queue) ctx.lookup("queue/queueB");
       queConn.start();
-      MDBInvoker[] threads = new MDBInvoker[MAX_SIZE];
+      ExecutorService executor = Executors.newFixedThreadPool(MAX_SIZE);
+      List<Future<String>> results = new ArrayList<Future<String>>();
       for(int n = 0; n < MAX_SIZE; n ++)
       {
-         MDBInvoker t = new MDBInvoker(session, queueA, queueB, n, done);
-         threads[n] = t;
-         t.start();
+         results.add(executor.submit(new MDBCallable(queConn, queueA, "message " + n)));
       }
-      assertTrue("Acquired done", done.attempt(1500 * MAX_SIZE));
-      session.close();
+      executor.shutdown();
+      boolean terminated = executor.awaitTermination(MAX_SIZE * 2, TimeUnit.SECONDS);
+      if(!terminated)
+      {
+         for(Future<String> result : results)
+         {
+            result.cancel(true);
+         }
+         fail("executor failed to terminate in time");
+      }
       queConn.close();
 
       for(int n = 0; n < MAX_SIZE; n ++)
       {
-         MDBInvoker t = threads[n];
-         if( t.runEx != null )
-         {
-            t.runEx.printStackTrace();
-            fail("Inovker.runEx != null, msg="+t.runEx.getMessage());
-         }
+         String result = results.get(n).get();
+         assertEquals("Recevied msg=message " + n, result);
       }
    }
+   
    public void testPoolTimeout() throws Exception
    {
+      System.out.println("*** testPoolTimeout");
       InitialContext ctx = new InitialContext();
       ConnectionFactory factory = (ConnectionFactory)ctx.lookup("ConnectionFactory");
       Connection conn = factory.createConnection();
@@ -126,7 +144,7 @@
       TextMessage msg2 = session.createTextMessage("hello world 2");
       msg2.setIntProperty("JMS_JBOSS_REDELIVERY_LIMIT", 1);
       sender.send(msg2);
-
+      
       Thread.sleep(5000);
       Counter counter = (Counter)ctx.lookup("CounterBean/remote");
       assertEquals(1, counter.getCount());
@@ -135,7 +153,7 @@
 
    public static Test suite() throws Exception
    {
-      return getDeploySetup(StrictPoolUnitTestCase.class, "strictpool_mdbtest-service.xml, strictpool-test.jar");
+      return getDeploySetup(StrictPoolUnitTestCase.class, "strictpool_mdbtest-${jboss.jms.provider}-service.xml, strictpool-test.jar");
 
    }
 

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3x/src/main/javax/annotation/PostConstruct.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3x/src/main/javax/annotation/PostConstruct.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3x/src/main/javax/annotation/PostConstruct.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -33,7 +33,7 @@
  * first business method is invoked on the bean.
  * 
  * @author <a href="mailto:kabir.khan at jboss.org">Kabir Khan</a>
- * @version $Revision: 57283 $
+ * @version $Revision$
  */
 @Documented
 @Target({METHOD})

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3x/src/main/javax/annotation/PreDestroy.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3x/src/main/javax/annotation/PreDestroy.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3x/src/main/javax/annotation/PreDestroy.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -32,7 +32,7 @@
  * annotation has completed.
  * 
  * @author <a href="mailto:kabir.khan at jboss.org">Kabir Khan</a>
- * @version $Revision: 57283 $
+ * @version $Revision$
  */
 @Documented
 @Target({METHOD})

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3x/src/main/javax/annotation/security/DenyAll.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3x/src/main/javax/annotation/security/DenyAll.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3x/src/main/javax/annotation/security/DenyAll.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -32,7 +32,7 @@
  * execute the specified method(s).
  * 
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
- * @version $Revision: 57283 $
+ * @version $Revision$
  */
 @Documented
 @Target({ElementType.METHOD})

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3x/src/main/javax/annotation/security/PermitAll.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3x/src/main/javax/annotation/security/PermitAll.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3x/src/main/javax/annotation/security/PermitAll.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -32,7 +32,7 @@
  * execute the specified method(s).
  * 
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
- * @version $Revision: 57283 $
+ * @version $Revision$
  */
 @Documented
 @Target({ElementType.TYPE, ElementType.METHOD})

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3x/src/main/javax/ejb/EJBs.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3x/src/main/javax/ejb/EJBs.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3x/src/main/javax/ejb/EJBs.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -32,7 +32,7 @@
  * references on a bean class.
  *
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
- * @version $Revision: 45433 $
+ * @version $Revision$
  */
 @Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME)
 public @interface EJBs

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3x/src/main/javax/ejb/Local.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3x/src/main/javax/ejb/Local.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3x/src/main/javax/ejb/Local.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -30,7 +30,7 @@
  * Bean class annotation that specifies remote interfaces of the Session bean.
  *
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
- * @version $Revision: 37459 $
+ * @version $Revision$
  */
 @Target({ElementType.TYPE})
 @Retention(RetentionPolicy.RUNTIME)

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3x/src/main/javax/ejb/LocalHome.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3x/src/main/javax/ejb/LocalHome.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3x/src/main/javax/ejb/LocalHome.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -30,7 +30,7 @@
  * Annotation for specifying the local home interface for a bean
  *
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
- * @version $Revision: 39861 $
+ * @version $Revision$
  */
 @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME)
 public @interface LocalHome

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3x/src/main/javax/ejb/Remote.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3x/src/main/javax/ejb/Remote.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3x/src/main/javax/ejb/Remote.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -30,7 +30,7 @@
  * Bean class annotation that specifies remote interfaces of the Session bean.
  *
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
- * @version $Revision: 37459 $
+ * @version $Revision$
  */
 @Target({ElementType.TYPE})
 @Retention(RetentionPolicy.RUNTIME)

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3x/src/main/javax/ejb/RemoteHome.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3x/src/main/javax/ejb/RemoteHome.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3x/src/main/javax/ejb/RemoteHome.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -30,7 +30,7 @@
  * Annotation for specifying the remote home interface for a bean
  *
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
- * @version $Revision: 39861 $
+ * @version $Revision$
  */
 @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME)
 public @interface RemoteHome

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3x/src/main/javax/ejb/TransactionManagement.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3x/src/main/javax/ejb/TransactionManagement.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/ejb3x/src/main/javax/ejb/TransactionManagement.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -34,7 +34,7 @@
  * demarcation.
  * 
  * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
- * @version $Revision: 37459 $
+ * @version $Revision$
  */
 @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME)
    public @interface TransactionManagement

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/jmx/src/main/org/jboss/mx/loading/RepositoryClassLoader.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/jmx/src/main/org/jboss/mx/loading/RepositoryClassLoader.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/jmx/src/main/org/jboss/mx/loading/RepositoryClassLoader.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -620,6 +620,10 @@
          throw new ClassNotFoundException("Class Not Found(blacklist): " + name);
       }
 
+      if (repository == null)
+      {
+          throw new IllegalStateException("Invalid usage of undeployed classloader");
+      }
       Translator translator = repository.getTranslator();
       if (translator != null)
       {

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/jmx/src/main/org/jboss/mx/loading/UnifiedLoaderRepository3.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/jmx/src/main/org/jboss/mx/loading/UnifiedLoaderRepository3.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/jmx/src/main/org/jboss/mx/loading/UnifiedLoaderRepository3.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -21,6 +21,7 @@
  */
 package org.jboss.mx.loading;
 
+import java.lang.ref.WeakReference;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLClassLoader;
@@ -72,6 +73,17 @@
    /** Used to provide a relative ordering of UCLs based on the order in
     * which they are added to the repository */
    private static int addedCount;
+   /** The jmx notification behavior mode. This is set by the
+    * org.jboss.mx.loading.UnifiedLoaderRepository.notifyMode system
+    * property.
+    */
+   // Send notification with the ClassLoader as the user data
+   private static final int LEGACY_MODE = 0;
+   // Send notification with the ClassLoader as the user data wrapped in a WeakReference
+   private static final int WEAK_REFERENCE_MODE = 1;
+   // Don't send any notifications
+   private static final int NO_NOTIFICATION_MODE = 2;
+   private static int NOTIFICATION_MODE;
 
    // Attributes ----------------------------------------------------
 
@@ -148,6 +160,24 @@
     */
    private MBeanNotificationInfo[] info;
 
+   static
+   {
+      // JBAS-4593 notification behavior
+      String value = ClassToStringAction.getProperty("org.jboss.mx.loading.UnifiedLoaderRepository.notifyMode", "0");
+      NOTIFICATION_MODE = Integer.valueOf(value).intValue();
+      switch(NOTIFICATION_MODE)
+      {
+         case LEGACY_MODE:
+         case WEAK_REFERENCE_MODE:
+         case NO_NOTIFICATION_MODE:
+         break;
+         default:
+            log.warn("Invalid org.jboss.mx.loading.UnifiedLoaderRepository.notifyMode("
+                  +value+"), defaulting to LEGACY_MODE");
+            NOTIFICATION_MODE = LEGACY_MODE;
+         break;
+      }
+   }
 
    // Public --------------------------------------------------------
 
@@ -927,9 +957,15 @@
          broadcaster.sendNotification(msg);
       }
 
-      Notification msg = new Notification(CLASSLOADER_REMOVED, this, getNextSequenceNumber());
-      msg.setUserData(cl);
-      broadcaster.sendNotification(msg);
+      if (NOTIFICATION_MODE == LEGACY_MODE || NOTIFICATION_MODE == WEAK_REFERENCE_MODE)
+      {
+         Notification msg = new Notification(CLASSLOADER_REMOVED, this, getNextSequenceNumber());
+         if (NOTIFICATION_MODE == WEAK_REFERENCE_MODE)
+            msg.setUserData(new WeakReference(cl));
+         else
+            msg.setUserData(cl);
+         broadcaster.sendNotification(msg);
+      }
    }
 
    /**
@@ -944,9 +980,15 @@
    public LoaderRepository registerClassLoader(RepositoryClassLoader ucl)
    {
       addClassLoader(ucl);
-      Notification msg = new Notification(CLASSLOADER_ADDED, this, getNextSequenceNumber());
-      msg.setUserData(ucl);
-      broadcaster.sendNotification(msg);
+      if (NOTIFICATION_MODE == LEGACY_MODE || NOTIFICATION_MODE == WEAK_REFERENCE_MODE)
+      {
+         Notification msg = new Notification(CLASSLOADER_ADDED, this, getNextSequenceNumber());
+         if (NOTIFICATION_MODE == WEAK_REFERENCE_MODE)
+            msg.setUserData(new WeakReference(ucl));
+         else
+            msg.setUserData(ucl);
+         broadcaster.sendNotification(msg);
+      }
 
       return this;
    }
@@ -983,15 +1025,22 @@
    {
       if (info == null)
       {
-         info = new MBeanNotificationInfo[]{
-            new MBeanNotificationInfo(new String[]{"CLASSLOADER_ADDED"},
-                    "javax.management.Notification",
-                    "Notification that a classloader has been added to the extensible classloader"),
-            new MBeanNotificationInfo(new String[]{"CLASS_REMOVED"},
-                    "javax.management.Notification",
-                    "Notification that a class has been removed from the extensible classloader")
-
-         };
+         if (NOTIFICATION_MODE != NO_NOTIFICATION_MODE)
+         {
+            info = new MBeanNotificationInfo[]{
+               new MBeanNotificationInfo(new String[]{"CLASSLOADER_ADDED"},
+                       "javax.management.Notification",
+                       "Notification that a classloader has been added to the extensible classloader"),
+               new MBeanNotificationInfo(new String[]{"CLASS_REMOVED"},
+                       "javax.management.Notification",
+                       "Notification that a class has been removed from the extensible classloader")
+   
+            };
+         }
+         else
+         {
+            info = new MBeanNotificationInfo[0];
+         }
       }
       return info;
    }

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/messaging/src/etc/server/default/deploy/jbossmq-destinations-service.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/messaging/src/etc/server/default/deploy/jbossmq-destinations-service.xml	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/messaging/src/etc/server/default/deploy/jbossmq-destinations-service.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -15,7 +15,9 @@
   <!-- Destination without a configured SecurityManager or without a 
        a SecurityConf will default to role guest with read=true, write=true,
        create=false.
+ at DEVCONF
   -->
+ at ENDDEVCONF
   <mbean code="org.jboss.mq.server.jmx.Topic"
 	 name="jboss.mq.destination:service=Topic,name=testTopic">
     <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
@@ -86,5 +88,7 @@
 	 name="jboss.mq.destination:service=Queue,name=ex">
     <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
   </mbean>
-
+ at PRODCONF
+-->
+ at ENDPRODCONF
 </server>

Deleted: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/messaging/src/etc/server-jbm/default/deploy/jboss-messaging.sar/META-INF/MANIFEST.MF
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/messaging/src/etc/server-jbm/default/deploy/jboss-messaging.sar/META-INF/MANIFEST.MF	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/messaging/src/etc/server-jbm/default/deploy/jboss-messaging.sar/META-INF/MANIFEST.MF	2008-01-16 20:55:40 UTC (rev 69046)
@@ -1,13 +0,0 @@
-Manifest-Version: 1.0
-Ant-Version: Apache Ant 1.6.2
-Created-By: 1.5.0_07-b03 (Sun Microsystems Inc.)
-Specification-Title: JBoss Messaging
-Specification-Version: 1.3.0.GA
-Specification-Vendor: JBoss Inc. (http://www.jboss.org/)
-Implementation-Title: JBoss Messaging
-Implementation-URL: http://www.jboss.org/
-Implementation-Version: 1.3.0.GA (build: CVSTag=JBossMessaging_1_3_0_G
- A date=200706111737)
-Implementation-Vendor: JBoss Inc. (http://www.jboss.org/)
-Implementation-Vendor-Id: http://www.jboss.org/
-

Deleted: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/messaging/src/etc/server-jbm/default/deploy/jboss-messaging.sar/connection-factories-service.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/messaging/src/etc/server-jbm/default/deploy/jboss-messaging.sar/connection-factories-service.xml	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/messaging/src/etc/server-jbm/default/deploy/jboss-messaging.sar/connection-factories-service.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -1,149 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-     Messaging Connection Factories deployment descriptor.
-
-     $Id: connection-factories-service.xml 3201 2007-10-19 10:39:50Z timfox $
- -->
-
-<server>
-
-   <!-- The default connection factory does not support automatic failover or load balancing-
-        this is so we can maintain compatiblity with applications written for JBoss MQ which use this
-        connection factory.
-   -->     
-   <mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"
-      name="jboss.messaging.connectionfactory:service=ConnectionFactory"
-      xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml">
-      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-      <depends optional-attribute-name="Connector">jboss.messaging:service=Connector,transport=bisocket</depends>
-      <depends>jboss.messaging:service=PostOffice</depends>
-
-      <attribute name="JNDIBindings">
-         <bindings>
-            <binding>/ConnectionFactory</binding>
-            <binding>/XAConnectionFactory</binding>
-            <binding>java:/ConnectionFactory</binding>
-            <binding>java:/XAConnectionFactory</binding>
-         </bindings>
-      </attribute>
-   </mbean>
-
-   <!-- A clustered connection factory that supports automatic failover and load balancing of created
-        connections.
-        This factory is not suitable to be used by MDBs.
-   -->
-   <mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"
-      name="jboss.messaging.connectionfactory:service=ClusteredConnectionFactory"
-      xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml">
-      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-      <depends optional-attribute-name="Connector">jboss.messaging:service=Connector,transport=bisocket</depends>
-      <depends>jboss.messaging:service=PostOffice</depends>
-
-      <attribute name="JNDIBindings">
-         <bindings>
-            <binding>/ClusteredConnectionFactory</binding>
-            <binding>/ClusteredXAConnectionFactory</binding>
-            <binding>java:/ClusteredConnectionFactory</binding>
-            <binding>java:/ClusteredXAConnectionFactory</binding>
-         </bindings>
-      </attribute>
-
-      <attribute name="SupportsFailover">true</attribute>
-      <attribute name="SupportsLoadBalancing">true</attribute>      
-   </mbean>
-   
-   <!-- A connection factory with no JNDI bindings that is used in clustering to create the connections that
-        pull messages from one node to another
-   -->
-   <mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"
-      name="jboss.messaging.connectionfactory:service=ClusterPullConnectionFactory"
-      xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml">
-      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-      <depends optional-attribute-name="Connector">jboss.messaging:service=Connector,transport=bisocket</depends>
-      <depends>jboss.messaging:service=PostOffice</depends>
-      <attribute name="SupportsFailover">false</attribute>
-      <attribute name="SupportsLoadBalancing">false</attribute>      
-   </mbean>
-   
-   <!-- An example connection factory with all attributes shown 
-   
-   <mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"
-      name="jboss.messaging.connectionfactory:service=MyExampleConnectionFactory"
-      xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml">
-      
-      <constructor>
-      
-         <!- - You can specify the default Client ID to use for connections created using this factory - -> 
-         
-         <arg type="java.lang.String" value="MyClientID"/>
-         
-      </constructor>
-      
-      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-      
-      <!- - The transport to use - can be bisocket, sslbisocket or http - ->
-      
-      <depends optional-attribute-name="Connector">jboss.messaging:service=Connector,transport=http</depends>
-      
-      <depends>jboss.messaging:service=PostOffice</depends>
-      
-      <!- - PrefetchSize determines the approximate maximum number of messages the client consumer will buffer locally - ->
-      
-      <attribute name="PrefetchSize">150</attribute>
-      
-      <!- - Paging params to be used for temporary queues - ->
-      
-      <attribute name="DefaultTempQueueFullSize">200000</attribute>
-      
-      <attribute name="DefaultTempQueuePageSizeSize">2000</attribute>
-      
-      <attribute name="DefaultTempQueueDownCacheSize">2000</attribute>
-      
-      <!- - The batch size to use when using the DUPS_OK_ACKNOWLEDGE acknowledgement mode - ->
-      
-      <attribute name="DupsOKBatchSize">5000</attribute>
-      
-      <!- - Does this connection factory support automatic failover? - ->
-      
-      <attribute name="SupportsFailover">false</attribute>
-      
-      <!- - Does this connection factory support automatic client side load balancing? - ->
-      
-      <attribute name="SupportsLoadBalancing">false</attribute>  
-            
-      <!- - The class name of the factory used to create the load balancing policy to use on the client side - ->
-      
-      <attribute name="LoadBalancingFactory">org.jboss.jms.client.plugin.RoundRobinLoadBalancingFactory</attribute>  
-
-      <!- - Whether we should be strict TCK compliant, i.e. how we deal with foreign messages, defaults to false- ->
-
-      <attribute name="StrictTck">false</attribute>
-      
-      <!- - Disable JBoss Remoting Connector sanity checks - There is rarely a good reason to set this to true - ->
-      
-      <attribute name="DisableRemotingChecks">false</attribute>
-
-      <!- - The connection factory will be bound in the following places in JNDI - ->
-
-      <attribute name="JNDIBindings">
-      
-         <bindings>
-         
-            <binding>/acme/MyExampleConnectionFactory</binding>
-            
-            <binding>/acme/MyExampleConnectionFactoryDupe</binding>
-            
-            <binding>java:/xyz/CF1</binding>
-            
-            <binding>java:/connectionfactories/acme/connection_factory</binding>
-            
-         </bindings>
-         
-      </attribute>   
-       
-   </mbean>
-   
-   -->
-
-</server>
\ No newline at end of file

Deleted: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/messaging/src/etc/server-jbm/default/deploy/jboss-messaging.sar/destinations-service.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/messaging/src/etc/server-jbm/default/deploy/jboss-messaging.sar/destinations-service.xml	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/messaging/src/etc/server-jbm/default/deploy/jboss-messaging.sar/destinations-service.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -1,199 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-     Messaging Destinations deployment descriptor.
-
-     $Id$
- -->
-
-<server>
-
-   <!--
-      The Default Dead Letter Queue. This destination is a dependency of an EJB MDB container.
-   -->
-
-   <mbean code="org.jboss.jms.server.destination.QueueService"
-      name="jboss.messaging.destination:service=Queue,name=DLQ"
-      xmbean-dd="xmdesc/Queue-xmbean.xml">
-      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-      <depends>jboss.messaging:service=PostOffice</depends>
-   </mbean>
-   
-   <!--
-      The Default Expiry Queue.
-   -->
-
-   <mbean code="org.jboss.jms.server.destination.QueueService"
-      name="jboss.messaging.destination:service=Queue,name=ExpiryQueue"
-      xmbean-dd="xmdesc/Queue-xmbean.xml">
-      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-      <depends>jboss.messaging:service=PostOffice</depends>
-   </mbean>   
-
-   <!--
-        Example destinations.
-   -->
-
-   <mbean code="org.jboss.jms.server.destination.TopicService"
-      name="jboss.messaging.destination:service=Topic,name=testTopic"
-      xmbean-dd="xmdesc/Topic-xmbean.xml">
-      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-      <depends>jboss.messaging:service=PostOffice</depends>
-      <attribute name="SecurityConfig">
-         <security>
-            <role name="guest" read="true" write="true"/>
-            <role name="publisher" read="true" write="true" create="false"/>
-            <role name="durpublisher" read="true" write="true" create="true"/>
-         </security>
-      </attribute>
-   </mbean>
-
-   <mbean code="org.jboss.jms.server.destination.TopicService"
-      name="jboss.messaging.destination:service=Topic,name=securedTopic"
-      xmbean-dd="xmdesc/Topic-xmbean.xml">
-      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-      <depends>jboss.messaging:service=PostOffice</depends>
-      <attribute name="SecurityConfig">
-         <security>
-            <role name="publisher" read="true" write="true" create="false"/>
-         </security>
-      </attribute>
-   </mbean>
-
-   <mbean code="org.jboss.jms.server.destination.TopicService"
-      name="jboss.messaging.destination:service=Topic,name=testDurableTopic"
-      xmbean-dd="xmdesc/Topic-xmbean.xml">
-      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-      <depends>jboss.messaging:service=PostOffice</depends>
-      <attribute name="SecurityConfig">
-         <security>
-            <role name="guest" read="true" write="true"/>
-            <role name="publisher" read="true" write="true" create="false"/>
-            <role name="durpublisher" read="true" write="true" create="true"/>
-         </security>
-      </attribute>
-   </mbean>
-
-   <mbean code="org.jboss.jms.server.destination.QueueService"
-      name="jboss.messaging.destination:service=Queue,name=testQueue"
-      xmbean-dd="xmdesc/Queue-xmbean.xml">
-      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-      <depends>jboss.messaging:service=PostOffice</depends>
-      <attribute name="SecurityConfig">
-         <security>
-            <role name="guest" read="true" write="true"/>
-            <role name="publisher" read="true" write="true" create="false"/>
-            <role name="noacc" read="false" write="false" create="false"/>
-         </security>
-      </attribute>
-   </mbean>
-
-   <mbean code="org.jboss.jms.server.destination.QueueService"
-      name="jboss.messaging.destination:service=Queue,name=A"
-      xmbean-dd="xmdesc/Queue-xmbean.xml">
-      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-      <depends>jboss.messaging:service=PostOffice</depends>
-   </mbean>
-
-   <mbean code="org.jboss.jms.server.destination.QueueService"
-      name="jboss.messaging.destination:service=Queue,name=B"
-      xmbean-dd="xmdesc/Queue-xmbean.xml">
-      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-      <depends>jboss.messaging:service=PostOffice</depends>
-   </mbean>
-
-   <mbean code="org.jboss.jms.server.destination.QueueService"
-      name="jboss.messaging.destination:service=Queue,name=C"
-      xmbean-dd="xmdesc/Queue-xmbean.xml">
-      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-      <depends>jboss.messaging:service=PostOffice</depends>
-   </mbean>
-
-   <mbean code="org.jboss.jms.server.destination.QueueService"
-      name="jboss.messaging.destination:service=Queue,name=D"
-      xmbean-dd="xmdesc/Queue-xmbean.xml">
-      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-      <depends>jboss.messaging:service=PostOffice</depends>
-   </mbean>
-
-   <mbean code="org.jboss.jms.server.destination.QueueService"
-      name="jboss.messaging.destination:service=Queue,name=ex"
-      xmbean-dd="xmdesc/Queue-xmbean.xml">
-      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-      <depends>jboss.messaging:service=PostOffice</depends>
-   </mbean>
-   
-   <!-- It's possible for indiviual queues and topics to use a specific queue for
-   an expiry or DLQ -->
-   
-   <mbean code="org.jboss.jms.server.destination.QueueService"
-      name="jboss.messaging.destination:service=Queue,name=PrivateDLQ"
-      xmbean-dd="xmdesc/Queue-xmbean.xml">
-      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-      <depends>jboss.messaging:service=PostOffice</depends>
-   </mbean>
-   
-   <mbean code="org.jboss.jms.server.destination.QueueService"
-      name="jboss.messaging.destination:service=Queue,name=PrivateExpiryQueue"
-      xmbean-dd="xmdesc/Queue-xmbean.xml">
-      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-      <depends>jboss.messaging:service=PostOffice</depends>
-   </mbean>      
-   
-   <mbean code="org.jboss.jms.server.destination.QueueService"
-      name="jboss.messaging.destination:service=Queue,name=QueueWithOwnDLQAndExpiryQueue"
-      xmbean-dd="xmdesc/Queue-xmbean.xml">
-      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-      <depends>jboss.messaging:service=PostOffice</depends>
-      <attribute name="DLQ">jboss.messaging.destination:service=Queue,name=PrivateDLQ</attribute>
-      <attribute name="ExpiryQueue">jboss.messaging.destination:service=Queue,name=PrivateExpiryQueue</attribute>
-   </mbean> 
-   
-   <mbean code="org.jboss.jms.server.destination.TopicService"
-      name="jboss.messaging.destination:service=Topic,name=TopicWithOwnDLQAndExpiryQueue"
-      xmbean-dd="xmdesc/Topic-xmbean.xml">
-      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-      <depends>jboss.messaging:service=PostOffice</depends>
-      <attribute name="DLQ">jboss.messaging.destination:service=Queue,name=PrivateDLQ</attribute>
-      <attribute name="ExpiryQueue">jboss.messaging.destination:service=Queue,name=PrivateExpiryQueue</attribute>
-   </mbean>       
-   
-   <!-- Queues and Topics can also specify their own redelivery delay -->
-   
-   <mbean code="org.jboss.jms.server.destination.QueueService"
-      name="jboss.messaging.destination:service=Queue,name=QueueWithOwnRedeliveryDelay"
-      xmbean-dd="xmdesc/Queue-xmbean.xml">
-      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-      <depends>jboss.messaging:service=PostOffice</depends>
-      <attribute name="RedeliveryDelay">5000</attribute>
-   </mbean>
-   
-   <mbean code="org.jboss.jms.server.destination.TopicService"
-      name="jboss.messaging.destination:service=Topic,name=TopicWithOwnRedeliveryDelay"
-      xmbean-dd="xmdesc/Topic-xmbean.xml">
-      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-      <depends>jboss.messaging:service=PostOffice</depends>
-      <attribute name="RedeliveryDelay">5000</attribute>
-   </mbean>     
-   
-   <!--
-        Example clustered destinations.
-   -->
-   
-   <mbean code="org.jboss.jms.server.destination.QueueService"
-      name="jboss.messaging.destination:service=Queue,name=testDistributedQueue"
-      xmbean-dd="xmdesc/Queue-xmbean.xml">
-      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-      <depends>jboss.messaging:service=PostOffice</depends>
-      <attribute name="Clustered">true</attribute>
-   </mbean>   
-   
-   <mbean code="org.jboss.jms.server.destination.TopicService"
-      name="jboss.messaging.destination:service=Topic,name=testDistributedTopic"
-      xmbean-dd="xmdesc/Topic-xmbean.xml">
-      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-      <depends>jboss.messaging:service=PostOffice</depends>
-      <attribute name="Clustered">true</attribute>
-   </mbean>   
-
-</server>
\ No newline at end of file

Deleted: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/messaging/src/etc/server-jbm/default/deploy/jboss-messaging.sar/hsqldb-persistence-service.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/messaging/src/etc/server-jbm/default/deploy/jboss-messaging.sar/hsqldb-persistence-service.xml	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/messaging/src/etc/server-jbm/default/deploy/jboss-messaging.sar/hsqldb-persistence-service.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -1,104 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-     Hypersonic persistence deployment descriptor.
-     
-     DO NOT USE HYPERSONIC IN PRODUCTION or in a clustered environment- Hypersonic does not have transaction isolation
-
-     $Id$
- -->
-
-<server>
-
-   <!-- Persistence Manager MBean configuration
-       ======================================= -->
-   
-   <mbean code="org.jboss.messaging.core.jmx.JDBCPersistenceManagerService"
-      name="jboss.messaging:service=PersistenceManager"
-      xmbean-dd="xmdesc/JDBCPersistenceManager-xmbean.xml">
-      
-      <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
-      
-      <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
-            
-      <!-- The datasource to use for the persistence manager -->
-                                
-      <attribute name="DataSource">java:/DefaultDS</attribute>
-      
-      <!-- If true will attempt to create tables and indexes on every start-up -->
-                  
-      <attribute name="CreateTablesOnStartup">true</attribute>
-      
-      <!-- If true then will use JDBC batch updates -->
-                 
-      <attribute name="UsingBatchUpdates">false</attribute>
-      
-      <!-- The maximum number of parameters to include in a prepared statement -->            
-      
-      <attribute name="MaxParams">500</attribute>
-   </mbean>
-
-   <!-- Messaging Post Office MBean configuration
-        ========================================= -->
-   
-   <mbean code="org.jboss.messaging.core.jmx.MessagingPostOfficeService"
-      name="jboss.messaging:service=PostOffice"      
-      xmbean-dd="xmdesc/MessagingPostOffice-xmbean.xml">
-            
-      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-      
-      <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
-      
-      <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
-      
-      <!-- The name of the post office -->      
-                 
-      <attribute name="PostOfficeName">JMS post office</attribute>
-      
-      <!-- The datasource used by the post office to access it's binding information -->                       
-      
-      <attribute name="DataSource">java:/DefaultDS</attribute>
-      
-      <!-- If true will attempt to create tables and indexes on every start-up -->
-                        
-      <attribute name="CreateTablesOnStartup">true</attribute>
-      
-      <!-- This post office is NON CLUSTERED - do not use clustering with Hypersonic!! -->
-      
-      <attribute name="Clustered">false</attribute>
-   </mbean>
-
-   <!-- Messaging JMS User Manager MBean config
-        ======================================= -->
-   
-   <mbean code="org.jboss.jms.server.plugin.JDBCJMSUserManagerService"
-      name="jboss.messaging:service=JMSUserManager"
-      xmbean-dd="xmdesc/JMSUserManager-xmbean.xml">
-      
-      <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
-      
-      <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
-      
-      <attribute name="DataSource">java:/DefaultDS</attribute>
-      
-      <attribute name="CreateTablesOnStartup">true</attribute>
-      
-      <attribute name="SqlProperties"><![CDATA[
-POPULATE.TABLES.1  = INSERT INTO JBM_USER (USER_ID, PASSWD) VALUES ('guest', 'guest')
-POPULATE.TABLES.2  = INSERT INTO JBM_USER (USER_ID, PASSWD) VALUES ('j2ee', 'j2ee')
-POPULATE.TABLES.3  = INSERT INTO JBM_USER (USER_ID, PASSWD, CLIENTID) VALUES ('john', 'needle', 'DurableSubscriberExample')
-POPULATE.TABLES.4  = INSERT INTO JBM_USER (USER_ID, PASSWD) VALUES ('nobody', 'nobody')
-POPULATE.TABLES.5  = INSERT INTO JBM_USER (USER_ID, PASSWD) VALUES ('dynsub', 'dynsub')
-POPULATE.TABLES.6  = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('guest','guest')
-POPULATE.TABLES.7  = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('j2ee','guest')
-POPULATE.TABLES.8  = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('john','guest')
-POPULATE.TABLES.9  = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('subscriber','john')
-POPULATE.TABLES.10 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('publisher','john')
-POPULATE.TABLES.11 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('publisher','dynsub')
-POPULATE.TABLES.12 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('durpublisher','john')
-POPULATE.TABLES.13 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('durpublisher','dynsub')
-POPULATE.TABLES.14 = INSERT INTO JBM_ROLE (ROLE_ID, USER_ID) VALUES ('noacc','nobody')
-      ]]></attribute>
-   </mbean>
-
-</server>
\ No newline at end of file

Deleted: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/messaging/src/etc/server-jbm/default/deploy/jboss-messaging.sar/messaging-service.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/messaging/src/etc/server-jbm/default/deploy/jboss-messaging.sar/messaging-service.xml	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/messaging/src/etc/server-jbm/default/deploy/jboss-messaging.sar/messaging-service.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -1,110 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-     The JBoss Messaging service deployment descriptor.
-
-     $Id: messaging-service.xml 3204 2007-10-19 12:42:17Z timfox $
- -->
-
-<server>
-
-   <!-- ServerPeer MBean configuration
-        ============================== -->
-
-   <mbean code="org.jboss.jms.server.ServerPeer"
-      name="jboss.messaging:service=ServerPeer"
-      xmbean-dd="xmdesc/ServerPeer-xmbean.xml">
-
-      <!-- The unique id of the server peer - in a cluster each node MUST have a unique value - must be an integer -->
-
-      <attribute name="ServerPeerID">0</attribute>
-      
-      <!-- The default JNDI context to use for queues when they are deployed without specifying one --> 
-      
-      <attribute name="DefaultQueueJNDIContext">/queue</attribute>
-      
-      <!-- The default JNDI context to use for topics when they are deployed without specifying one --> 
-      
-      <attribute name="DefaultTopicJNDIContext">/topic</attribute>
-
-	  <attribute name="PostOffice">jboss.messaging:service=PostOffice</attribute>
-	  
-	  <!-- The JAAS security domain to use for JBoss Messaging -->
-	  
-      <attribute name="SecurityDomain">java:/jaas/messaging</attribute>
-      
-      <!-- The default security configuration to apply to destinations - this can be overridden on a per destination basis -->
-      
-      <attribute name="DefaultSecurityConfig">
-        <security>
-            <role name="guest" read="true" write="true" create="true"/>
-        </security>
-      </attribute>
-      
-      <!-- The default Dead Letter Queue (DLQ) to use for destinations.
-           This can be overridden on a per destinatin basis -->
-      
-      <attribute name="DefaultDLQ">jboss.messaging.destination:service=Queue,name=DLQ</attribute>
-      
-      <!-- The default maximum number of times to attempt delivery of a message before sending to the DLQ (if configured).
-           This can be overridden on a per destinatin basis -->
-      
-      <attribute name="DefaultMaxDeliveryAttempts">10</attribute>
-      
-      <!-- The default Expiry Queue to use for destinations. This can be overridden on a per destinatin basis -->
-      
-      <attribute name="DefaultExpiryQueue">jboss.messaging.destination:service=Queue,name=ExpiryQueue</attribute>
-      
-      <!-- The default redelivery delay to impose. This can be overridden on a per destination basis -->
-      
-      <attribute name="DefaultRedeliveryDelay">0</attribute>
-      
-      <!-- The periodicity of the message counter manager enquiring on queues for statistics -->
-      
-      <attribute name="MessageCounterSamplePeriod">5000</attribute>
-      
-      <!-- The maximum amount of time for a client to wait for failover to start on the server side after
-           it has detected failure -->
-      
-      <attribute name="FailoverStartTimeout">60000</attribute>
-      
-      <!-- The maximum amount of time for a client to wait for failover to complete on the server side after
-           it has detected failure -->
-      
-      <attribute name="FailoverCompleteTimeout">300000</attribute>
-      
-      <!-- The maximum number of days results to maintain in the message counter history -->
-      
-      <attribute name="DefaultMessageCounterHistoryDayLimit">-1</attribute>
-      
-      <!-- The name of the connection factory to use for creating connections between nodes to pull messages -->
-      
-      <attribute name="ClusterPullConnectionFactoryName">jboss.messaging.connectionfactory:service=ClusterPullConnectionFactory</attribute>
-      
-      <!-- Use XA when pulling persistent messages from a remote node to this one. -->
-      
-      <attribute name="UseXAForMessagePull">false</attribute>
-      
-      <!-- When redistributing messages in the cluster. Do we need to preserve the order of messages received
-            by a particular consumer from a particular producer? -->
-            
-      <attribute name="DefaultPreserveOrdering">false</attribute>
-      
-      <!-- Max. time to hold previously delivered messages back waiting for clients to reconnect after failover -->
-      
-      <attribute name="RecoverDeliveriesTimeout">300000</attribute>
-      
-      <!-- The password used by the message sucker connections to create connections.
-           THIS SHOULD ALWAYS BE CHANGED AT INSTALL TIME TO SECURE SYSTEM
-      <attribute name="SuckerPassword"></attribute>
-      -->
-
-      <depends optional-attribute-name="PersistenceManager">jboss.messaging:service=PersistenceManager</depends>
-      
-      <depends optional-attribute-name="JMSUserManager">jboss.messaging:service=JMSUserManager</depends>
-      
-      <depends>jboss.messaging:service=Connector,transport=bisocket</depends>
-
-   </mbean>
-
-</server>

Deleted: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/messaging/src/etc/server-jbm/default/deploy/jboss-messaging.sar/remoting-bisocket-service.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/messaging/src/etc/server-jbm/default/deploy/jboss-messaging.sar/remoting-bisocket-service.xml	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/messaging/src/etc/server-jbm/default/deploy/jboss-messaging.sar/remoting-bisocket-service.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-     Standard bisocket-based Remoting service deployment descriptor.
-
-     $Id: remoting-bisocket-service.xml 3237 2007-10-21 15:27:51Z timfox $
- -->
-
-<server>
-
-   <!-- Standard bisocket connector - the bisocket transport only opens connection from client->server
-        so can be used with firewalls where only outgoing connections are allowed.
-        For examples of HTTP and SSL transports see docs/examples -->
-   <mbean code="org.jboss.remoting.transport.Connector"
-          name="jboss.messaging:service=Connector,transport=bisocket"
-          display-name="Bisocket Transport Connector">
-      <attribute name="Configuration">
-         <config>
-            <invoker transport="bisocket">
-            
-               <!-- There should be no reason to change these parameters - warning!
-                    Changing them may stop JBoss Messaging working correctly -->            
-               <attribute name="marshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
-               <attribute name="unmarshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
-               <attribute name="dataType" isParam="true">jms</attribute>
-               <attribute name="socket.check_connection" isParam="true">false</attribute>
-               <attribute name="timeout" isParam="true">0</attribute>
-               <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
-               <attribute name="serverBindPort">4457</attribute>
-               <attribute name="clientSocketClass" isParam="true">org.jboss.jms.client.remoting.ClientSocketWrapper</attribute>
-               <attribute name="serverSocketClass">org.jboss.jms.server.remoting.ServerSocketWrapper</attribute>
-               <attribute name="numberOfCallRetries" isParam="true">1</attribute>
-               <attribute name="pingFrequency" isParam="true">214748364</attribute>
-               <attribute name="pingWindowFactor" isParam="true">10</attribute>
-               <attribute name="onewayThreadPool">org.jboss.jms.server.remoting.DirectThreadPool</attribute>
-               <!-- End immutable parameters -->
-               
-               <!-- Periodicity of client pings. Server window by default is twice this figure -->                               
-               <attribute name="clientLeasePeriod" isParam="true">10000</attribute>
-
-               <!-- Number of seconds to wait for a connection in the client pool to become free -->
-               <attribute name="numberOfRetries" isParam="true">10</attribute>
-
-               <!-- Max Number of connections in client pool. This should be significantly higher than
-                    the max number of sessions/consumers you expect -->
-               <attribute name="clientMaxPoolSize" isParam="true">200</attribute>
-               
-               <!-- Use these parameters to specify values for binding and connecting control connections to 
-                    work with your firewall/NAT configuration
-               <attribute name="secondaryBindPort">xyz</attribute>                           
-               <attribute name="secondaryConnectPort">abc</attribute>               
-               -->
-                          
-            </invoker>
-            <handlers>
-               <handler subsystem="JMS">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>
-            </handlers>
-         </config>
-      </attribute>
-   </mbean>
-
-</server>

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/server/src/etc/conf/default/jboss-log4j.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/server/src/etc/conf/default/jboss-log4j.xml	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/server/src/etc/conf/default/jboss-log4j.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -61,6 +61,7 @@
    <!-- Append messages to the console -->
    <!-- ============================== -->
 
+ at DEVCONF
    <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
       <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
       <param name="Target" value="System.out"/>
@@ -71,11 +72,26 @@
          <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
       </layout>
    </appender>
+ at ENDDEVCONF
+ at PRODCONF
+   <!--
+   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+      <param name="Target" value="System.out"/>
+      <param name="Threshold" value="INFO"/>
+
+      <layout class="org.apache.log4j.PatternLayout">
+         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
+      </layout>
+   </appender>
+   -->
+ at ENDPRODCONF
   
    <!-- ====================== -->
    <!-- More Appender examples -->
    <!-- ====================== -->
 
+ at DEVCONF
    <!-- Buffer events and log them asynchronously
    <appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
@@ -84,6 +100,18 @@
      <appender-ref ref="SMTP"/>
    </appender>
    -->
+ at ENDDEVCONF
+ at PRODCONF
+   <!-- Buffer events and log them asynchronously -->
+   <appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
+     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+     <appender-ref ref="FILE"/>
+     <!--
+     <appender-ref ref="CONSOLE"/>
+     <appender-ref ref="SMTP"/>
+     -->
+   </appender>
+ at ENDPRODCONF
 
    <!-- EMail events to an administrator
    <appender name="SMTP" class="org.apache.log4j.net.SMTPAppender">
@@ -154,19 +182,66 @@
       </layout>
    </appender>
    -->
-   
+
+ at PRODCONF
+   <!-- Clustering logging -->
+   <!-- Uncomment the following to redirect the org.jgroups and
+      org.jboss.ha categories to a cluster.log file. -->
+   <!--
+   <appender name="CLUSTER" class="org.jboss.logging.appender.RollingFileAppender">
+     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+     <param name="File" value="${jboss.server.log.dir}/cluster.log"/>
+     <param name="Append" value="false"/>
+     <param name="MaxFileSize" value="500KB"/>
+     <param name="MaxBackupIndex" value="1"/>
+
+     <layout class="org.apache.log4j.PatternLayout">
+       <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+     </layout>
+   </appender>
+   -->
+ at ENDPRODCONF
+
    <!-- ================ -->
    <!-- Limit categories -->
    <!-- ================ -->
 
+ at PRODCONF
+   <category name="org.jboss.web">
+     <priority value="INFO" />
+   </category>
+
+   <category name="org.jboss.ha">
+     <priority value="INFO" />
+   </category>
+
+   <category name="com.arjuna">
+     <priority value="INFO" />
+   </category>
+
+   <category name="org.hibernate">
+     <priority value="INFO" />
+   </category>
+
+ at ENDPRODCONF
    <!-- Limit the org.apache category to INFO as its DEBUG is verbose -->
    <category name="org.apache">
+ at DEVCONF
       <priority value="INFO"/>
+ at ENDDEVCONF
+ at PRODCONF
+      <priority value="WARN"/>
+ at ENDPRODCONF
    </category>
 
    <!-- Limit the org.jboss.serial (jboss-serialization) to INFO as its DEBUG is verbose -->
    <category name="org.jboss.serial">
+ at DEVCONF
       <priority value="INFO"/>
+ at ENDDEVCONF
+ at PRODCONF
+      <priority value="WARN"/>
+ at ENDPRODCONF
    </category>
 
    <!-- Limit the org.jgroups category to WARN as its INFO is verbose -->
@@ -186,10 +261,22 @@
    -->
 
    <!-- Limit the JSR77 categories -->
+ at DEVCONF
    <category name="org.jboss.management">
       <priority value="INFO"/>
    </category>
+ at ENDDEVCONF
+ at PRODCONF
+   <category name="org.jboss.management">
+      <priority value="WARN"/>
+   </category>
 
+   <!-- Limit seam logging -->
+   <category name="org.jboss.seam">
+      <priority value="WARN"/>
+   </category>
+ at ENDPRODCONF
+
    <!-- Enable JBossWS message tracing
    <category name="org.jboss.ws.core.MessageTrace">
     <priority value="TRACE"/>
@@ -264,10 +351,19 @@
    <!-- Setup the Root category -->
    <!-- ======================= -->
 
+ at DEVCONF
    <root>
       <appender-ref ref="CONSOLE"/>
       <appender-ref ref="FILE"/>
    </root>
+ at ENDDEVCONF
+ at PRODCONF
+   <root>
+      <!-- <appender-ref ref="CONSOLE"/> -->
+      <appender-ref ref="ASYNC"/>
+   </root>
+ at ENDPRODCONF
+ at DEVCONF
 
    <!-- Clustering logging -->
    <!-- Uncomment the following to redirect the org.jgroups and
@@ -293,5 +389,6 @@
      <appender-ref ref="CLUSTER"/>
    </category>
    -->
+ at ENDDEVCONF
 
 </log4j:configuration>

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/server/src/etc/conf/default/jboss-minimal.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/server/src/etc/conf/default/jboss-minimal.xml	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/server/src/etc/conf/default/jboss-minimal.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -134,7 +134,12 @@
       -->
       <attribute name="Filter">org.jboss.deployment.scanner.DeploymentFilter</attribute>
 
+ at DEVCONF
       <attribute name="ScanPeriod">5000</attribute>
+ at ENDDEVCONF
+ at PRODCONF
+      <attribute name="ScanPeriod">60000</attribute>
+ at ENDPRODCONF
 
       <!-- URLs are comma seperated and unprefixed arguments are considered
          file URLs and resolve relative to server home(JBOSS_DIST/server/default)

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/server/src/etc/conf/default/jboss-service.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/server/src/etc/conf/default/jboss-service.xml	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/server/src/etc/conf/default/jboss-service.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -648,7 +648,12 @@
       </attribute>
 
       <!-- Frequency in milliseconds to rescan the URLs for changes -->
+ at DEVCONF
       <attribute name="ScanPeriod">5000</attribute>
+ at ENDDEVCONF
+ at PRODCONF
+      <attribute name="ScanPeriod">60000</attribute>
+ at ENDPRODCONF
 
       <!-- A flag to disable the scans -->
       <attribute name="ScanEnabled">true</attribute>

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/server/src/resources/uuid-key-generator/META-INF/jboss-service.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/server/src/resources/uuid-key-generator/META-INF/jboss-service.xml	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/server/src/resources/uuid-key-generator/META-INF/jboss-service.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -38,11 +38,19 @@
         create table HILOSEQUENCES (SEQUENCENAME varchar(50) not null, HIGHVALUES integer not null, constraint hilo_pk primary key (SEQUENCENAME))
      </attribute>
 
+ at DEVCONF
      <!-- Uncomment to make it cluster-safe: Select current Hi value query (FOR UPDATE is recommended)
      <attribute name="SelectHiSql">
         select HIGHVALUES from HILOSEQUENCES where SEQUENCENAME='general' FOR UPDATE
      </attribute>                                                  
      -->
+ at ENDDEVCONF
+ at PRODCONF
+     <!-- Uncomment to make it cluster-safe: Select current Hi value query (FOR UPDATE is recommended) -->
+     <attribute name="SelectHiSql">
+        select HIGHVALUES from HILOSEQUENCES where SEQUENCENAME='general' FOR UPDATE
+     </attribute>
+ at ENDPRODCONF
 
      <!-- whether the table should be created (if doesn't exist yet) at the start phase -->
      <attribute name="CreateTable">true</attribute>

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/system/src/bin/run.sh
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/system/src/bin/run.sh	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/system/src/bin/run.sh	2008-01-16 20:55:40 UTC (rev 69046)
@@ -169,11 +169,9 @@
     fi
 
     # Enable -server if we have Hotspot, unless we can't
-    if [ "x$HAS_HOTSPOT" != "x" ]; then
-	# MacOS does not support -server flag
-	if [ "$darwin" != "true" ]; then
-	    JAVA_OPTS="-server $JAVA_OPTS"
-	fi
+    # MacOS does not support -server flag
+    if [ "$darwin" != "true" ]; then
+        JAVA_OPTS="-server $JAVA_OPTS"
     fi
 fi
 

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/system/src/main/org/jboss/Version.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/system/src/main/org/jboss/Version.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/system/src/main/org/jboss/Version.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -233,7 +233,8 @@
       buff.append(getMajor()).append(".");
       buff.append(getMinor()).append(".");
       buff.append(getRevision()).append(".");
-      buff.append(getTag());
+      buff.append(getTag()).append("_");
+      buff.append(getName());
       
       return buff.toString();      
    }

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/test/src/main/org/jboss/test/JBossTestServices.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/test/src/main/org/jboss/test/JBossTestServices.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/test/src/main/org/jboss/test/JBossTestServices.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -36,6 +36,7 @@
 
 import org.apache.log4j.Category;
 import org.jboss.test.util.AppCallbackHandler;
+import org.jboss.util.StringPropertyReplacer;
 
 /**
  * This is provides services for jboss junit test cases and TestSetups. It supplies
@@ -161,13 +162,15 @@
     * Otherwise, it looks for jbosstest.deploy.dir or if missing ../lib. Then it
     * tries to construct a file url or a url.
     *
-    * @param filename                   name of the file/url you want
+    * @param filenameExpression         name of the file/url you want
     * @return                           A URL
     * @exception MalformedURLException  Description of Exception
     */
-   protected URL getDeployURL(final String filename)
+   protected URL getDeployURL(final String filenameExpression)
       throws MalformedURLException
    {
+      final String filename = StringPropertyReplacer.replaceProperties(filenameExpression);
+      
       // First see if it is already a complete url.
       try
       {

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/.classpath
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/.classpath	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/.classpath	2008-01-16 20:55:40 UTC (rev 69046)
@@ -48,7 +48,6 @@
 	<classpathentry kind="lib" path="/tools/lib/ant-junit.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/cache/lib/jboss-cache-jdk50.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/apache-xalan/lib/xalan.jar"/>
-	<classpathentry kind="lib" path="/thirdparty/objectweb-joramtests/lib/joram-tests.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/javassist/lib/javassist.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/jbossxb/lib/jboss-xml-binding.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/apache-logging/lib/commons-logging.jar"/>
@@ -63,5 +62,7 @@
 	<classpathentry kind="lib" path="/thirdparty/jboss/profiler/jvmti/lib/jboss-profiler-jvmti.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/web/lib/jbossweb.jar" sourcepath="/thirdparty/jboss/web/lib/jbossweb-src.zip"/>
 	<classpathentry kind="lib" path="/thirdparty/apache-codec/lib/commons-codec.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/objectweb-joramtests/lib/joramtests.jar" sourcepath="/thirdparty/objectweb-joramtests/lib/joramtests-sources.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/jboss/messaging/lib/jboss-messaging.jar"/>
 	<classpathentry kind="output" path="output/eclipse-classes"/>
 </classpath>

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/build.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/build.xml	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/build.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -711,8 +711,8 @@
      <include name="**/*UnitTestCase.class"/>
      <patternset refid="all.excludes-jbossmessaging"/>
      <exclude name="**/test/xa/test/XAUnitTestCase.class"/>
-  	 <!-- this is a super class... no tests on it -->
-  	 <exclude name="org/jboss/test/jbossmessaging/JMSTestCase.class"/> 	
+     <exclude name="org/jboss/test/jbossmessaging/JMSTestCase.class"/>     
+     <exclude name="org/jboss/test/jbossmessaging/clustertest/ClusteredTestCase.class"/>
   </patternset>
 
   <patternset id="jbossmessaging.excludes">
@@ -824,6 +824,8 @@
     <antcall target="tests-unified"/>
     <antcall target="tests-aop-scoped"/>
     <antcall target="tests-classloader-leak"/>
+    <antcall target="tests-jbmcluster"/>
+    <antcall target="tests-jbmNonCluster"/>
     <antcall target="tests-report"/>
     <record name="${basedir}/build.log" action="stop"/>
   </target>
@@ -963,7 +965,108 @@
     <antcall target="tests-txtimer"/>
     <server:stop name="all"/>
   </target>
+	
+   	
+   <target name="create-jbmcluster">
+      <!-- Create clean configuration -->
+   	  <delete dir="${jboss.dist}/server/jbm-cluster1" />
+   	  <delete dir="${jboss.dist}/server/jbm-cluster2" />
+      <create-config baseconf="all" newconf="jbm-cluster1">
+         <patternset>
+            <include name="conf/**"/>
+            <include name="deploy/**"/>
+            <include name="deployers/**"/>
+            <include name="deploy-hasingleton/**"/>
+            <include name="lib/**"/>
+         </patternset>
+      </create-config>
+      <create-config baseconf="all" newconf="jbm-cluster2">
+         <patternset>
+            <include name="conf/**"/>
+             <include name="deploy/**"/>
+             <include name="deployers/**"/>
+             <include name="deploy-hasingleton/**"/>
+             <include name="lib/**"/>
+         </patternset>
+      </create-config>
+      <replace file="${jboss.dist}/server/jbm-cluster2/deploy/jboss-messaging.sar/messaging-service.xml">
+         <replacefilter token="&lt;attribute name=&quot;ServerPeerID&quot;&gt;0&lt;/attribute&gt;"
+              value="&lt;attribute name=&quot;ServerPeerID&quot;&gt;1&lt;/attribute&gt;"/>
+      </replace>
+      
+   </target>
 
+   <target name="create-jbmnoncluster">
+      <!-- Create clean configuration -->
+      <delete dir="${jboss.dist}/server/jbm-noncluster" />
+      <create-config baseconf="default" newconf="jbm-noncluster">
+         <patternset>
+            <include name="conf/**"/>
+            <include name="deploy/**"/>
+            <include name="deployers/**"/>
+            <include name="deploy-hasingleton/**"/>
+            <include name="lib/**"/>
+         </patternset>
+      </create-config>
+   </target>
+
+   <target name="tests-jbmNonCluster" if="jbosstest.test.soa"
+       description="Run JBM in standard (default) mode">
+
+      <antcall target="create-jbmnoncluster"/>
+
+      <server:start name="jbm-noncluster"/>
+
+      <antcall target="exec-jbmnonclustered"/>
+
+      <!--  I'm not stopping jbm-cluster2 as this server will be killed during the test -->            
+      <server:stop name="jbm-noncluster"/>
+       
+   </target>
+   
+   <target name="tests-jbmcluster" if="jbosstest.test.soa"
+   	   description="Run JBM in cluster">
+
+      <antcall target="create-jbmcluster"/>
+
+      <server:start name="jbm-cluster1"/>
+      <server:start name="jbm-cluster2"/>
+
+      <antcall target="exec-jbmclustered"/>
+
+      <!--  I'm not stopping jbm-cluster2 as this server will be killed during the test -->            
+      <server:stop name="jbm-cluster1"/>
+   	   
+   </target>
+   
+   <target name="exec-jbmclustered">
+    <patternset id="jbm-clustered">
+      <include name="org/jboss/test/jbossmessaging/clustertest/*TestCase.class"/>
+    </patternset>
+
+    <antcall target="test-execute-units">
+      <param name="includes.refid" value="jbm-clustered"/>
+      <param name="jboss-junit-configuration" value="jbm-clustered"/>
+    </antcall>
+      
+   </target>
+
+   <target name="exec-jbmnonclustered">
+    <patternset id="jbm-nonclustered">
+      <include name="org/jboss/test/jbossmessaging/perf/*TestCase.class"/>
+      <include name="org/jboss/test/jbossmessaging/ra/*TestCase.class"/>
+      <include name="org/jboss/test/jbossmessaging/test/*TestCase.class"/>
+    </patternset>
+
+    <antcall target="test-execute-units">
+      <param name="includes.refid" value="jbm-nonclustered"/>
+      <param name="jboss-junit-configuration" value="jbm-nonclustered"/>
+    </antcall>
+      
+   </target>
+
+	
+
   <!-- Test netbooting a subset of the default configuration
   -->
   <target name="netboot-tests" description="Tests run against a custom netboot configuration">
@@ -2378,9 +2481,11 @@
   <target name="tests-webservice-ssl" description="Tomcat tests requiring an SSL connector">
     <!-- Create the ssl enabled tomcat config -->
     <create-config baseconf="default" newconf="webservice-ssl">
-      <patternset>
-        <include name="**/*"/>
-      </patternset>
+       <patternset>
+          <include name="conf/**"/>
+          <include name="deploy/**"/>
+          <include name="lib/**"/>
+       </patternset>
     </create-config>
     <server:start name="webservice-ssl"/>
     <!-- Specify the JSSE properties -->

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/imports/sections/jbm.xml (from rev 67044, branches/JBPAPP_4_2/testsuite/imports/sections/jbm.xml)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/imports/sections/jbm.xml	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/imports/sections/jbm.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -0,0 +1,16 @@
+<project name="tests-jbm-jars">
+   
+   <!-- jms tests -->
+   <target name="_jars-jbm">
+      <mkdir dir="${build.lib}"/>
+      
+      <jar destfile="${build.lib}/jbm-killservice.sar">
+         <fileset dir="${build.classes}">
+            <include name="org/jboss/test/jbossmessaging/clustertest/killservice/*"/>
+         </fileset>
+         <fileset dir="${build.resources}/jbossmessaging">
+            <include name="META-INF/jboss-service.xml"/>		
+         </fileset>
+      </jar>	
+   </target>
+</project>

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/imports/server-config.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/imports/server-config.xml	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/imports/server-config.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -83,7 +83,37 @@
          <sysproperty key="java.endorsed.dirs" value="${jboss.dist}/lib/endorsed" />
          <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
       </server>
-      <server name="securitymgr" config="default" host="${node0}">
+
+    <server name="jbm-noncluster" host="${node0}">
+       <jvmarg value="-Xms128m" />
+       <jvmarg value="-Xmx512m" />
+       <jvmarg value="-XX:MaxPermSize=512m" />
+       <jvmarg value="-XX:+HeapDumpOnOutOfMemoryError" />
+        <sysproperty key="java.endorsed.dirs" value="${jboss.dist}/lib/endorsed" />
+        <sysproperty key="java.net.preferIPv4Stack" value="true" />
+    </server>
+    
+   	<server name="jbm-cluster1" host="${node0}">
+       <jvmarg value="-Xms128m" />
+       <jvmarg value="-Xmx512m" />
+       <jvmarg value="-XX:MaxPermSize=512m" />
+       <jvmarg value="-XX:+HeapDumpOnOutOfMemoryError" />
+        <sysproperty key="java.endorsed.dirs" value="${jboss.dist}/lib/endorsed" />
+        <sysproperty key="java.net.preferIPv4Stack" value="true" />
+    </server>
+   	
+    <server name="jbm-cluster2" host="${node1}">
+       <jvmarg value="-Xms128m" />
+       <jvmarg value="-Xmx512m" />
+       <jvmarg value="-XX:MaxPermSize=512m" />
+       <jvmarg value="-XX:+HeapDumpOnOutOfMemoryError" />
+        <sysproperty key="java.net.preferIPv4Stack" value="true" />
+       <sysproperty key="jbossnode0" value="${node0}"/>
+       <sysproperty key="java.endorsed.dirs" value="${jboss.dist}/lib/endorsed" />
+        <sysproperty key="java.net.preferIPv4Stack" value="true" />
+    </server>
+
+    <server name="securitymgr" config="default" host="${node0}">
          <jvmarg value="${jpda.cmdline}" />
          <jvmarg value="-Xmx64m" />
          <jvmarg value="-Djboss.home.dir=${jboss.dist}" />
@@ -381,7 +411,9 @@
          <echo message="creating @{conf} config, jboss.dist=@{jboss.dist}"/>
          <create-config baseconf="default" newconf="@{conf}">
             <patternset>
-               <include name="**/*"/>
+          	<include name="conf/**"/>
+          	<include name="deploy/**"/>
+          	<include name="lib/**"/>            
              </patternset>
          </create-config>
          <!-- Unified config is now the default in 4.2.x

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/imports/test-jars.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/imports/test-jars.xml	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/imports/test-jars.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -70,6 +70,7 @@
 	<import file="sections/xa.xml"/>
 	<import file="sections/xslt.xml"/>
 	<import file="sections/byvalue.xml"/>
+	<import file="sections/jbm.xml"/>
 
 	<!--
 	| Build all jar files.
@@ -152,7 +153,8 @@
       _jars-wsrp,
       _jars-xa,
       _jars-xslt,
-      _jars-byvalue
+      _jars-byvalue,
+	  _jars-jbm
       ">
 	</target>
 

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/JBossTestClusteredServices.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/JBossTestClusteredServices.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/JBossTestClusteredServices.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -53,7 +53,7 @@
       super(className);
    }
 
-   int getServerCount()
+   public int getServerCount()
    {
       return servers.size();
    }
@@ -65,14 +65,15 @@
       adaptors.toArray(tmp);
       return tmp;
    }
-   RMIAdaptor getAdaptor(int index) throws Exception
+   
+   public RMIAdaptor getAdaptor(int index) throws Exception
    {
       init();
       RMIAdaptor adaptor = (RMIAdaptor) adaptors.get(index);
       return adaptor;
    }
 
-   String[] getServers() throws Exception
+   public String[] getServers() throws Exception
    {
       init();
       String[] tmp = new String[servers.size()];

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/compatibility/test/SerialVersionUIDUnitTestCase.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/compatibility/test/SerialVersionUIDUnitTestCase.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/compatibility/test/SerialVersionUIDUnitTestCase.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -382,7 +382,11 @@
          "javax.xml.namespace.QName",
          // ?
          "javax.xml.rpc.soap.SOAPFaultException",
-         // Ignore dom4j issues
+         // upgrade to jbossws-2.0.1
+	 "javax.xml.rpc.JAXRPCException",
+	 "javax.xml.rpc.ServiceException",
+	 "javax.xml.soap.SOAPException",
+	 // Ignore dom4j issues
          "org.dom4j",
          // Ignore org.apache.* issues
          "org.apache",

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest (from rev 67044, branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest)

Deleted: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/ClusteredTestCase.java
===================================================================
--- branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/ClusteredTestCase.java	2007-11-13 21:31:41 UTC (rev 67044)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/ClusteredTestCase.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -1,712 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.test.jbossmessaging.clustertest;
-
-import java.util.StringTokenizer;
-import java.util.concurrent.CountDownLatch;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.DeliveryMode;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.management.ObjectName;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-
-import org.jboss.jmx.adaptor.rmi.RMIAdaptor;
-
-import org.jboss.jms.client.FailoverEvent;
-import org.jboss.jms.client.FailoverListener;
-import org.jboss.jms.client.JBossConnection;
-import org.jboss.test.JBossClusteredTestCase;
-import org.jboss.test.JBossTestClusteredServices;
-import org.jboss.test.JBossTestClusteredSetup;
-import org.jboss.test.JBossTestSetup;
-import org.jboss.util.id.GUID;
-
-import EDU.oswego.cs.dl.util.concurrent.LinkedQueue;
-
-import junit.framework.Test;
-
-/**
- * 
- * Each failover test would require a whole shutdown cycle, what means.. start, run test, kill, assert.. (for each test).
- * Instead of doing that we run tests in parallel, using this little framework defined by ParallelTestContainer and assert all of them in a single server kill.
- * Also: System.exit(-1); wasn't enough to perform a server crash, as it was causing a regular shutdown, so we are using some reflection to call java.lang.Shutdown#halt.
- * @author <a href="clebert.suconic at jboss.com">Clebert Suconic</a>
- *
- */
-public class ClusteredTestCase extends ParallelTestContainer
-{
-
-    CountDownLatch latchCluster = new CountDownLatch(1);
-    CountDownLatch latchFailover = new CountDownLatch(5);
-    CountDownLatch latchServerAlreadyKilled = new CountDownLatch(1);
-
-    public ParallelTest[] getTests()
-    {
-        return new ParallelTest[]
-        { new ClusterTestSimple(latchCluster), 
-            new FailoverTestSimple(latchFailover, latchServerAlreadyKilled),
-            new FailoverTestSimpleTransacted("testFailoverTransactedKillOnCommit", true, latchFailover, latchServerAlreadyKilled, "testDistributedQueueC"),
-            new FailoverTestSimpleTransacted("testFailoverTransactedKillOnMessageReceive", false, latchFailover, latchServerAlreadyKilled, "testDistributedQueueD"),
-            new FailoverTestSessionWithOneTransactedPersistentMessageFailover(latchFailover, latchServerAlreadyKilled),
-            new FailoverSessionWithOneTransactedNonPersistentMessageFailover(latchFailover, latchServerAlreadyKilled)};
-    }
-
-    public void doTest() throws Exception
-    {
-        
-        JBossTestClusteredServices testServices = new JBossTestClusteredServices("ClusteredTestCase");
-        testServices.init();
-        
-        RMIAdaptor rmi = testServices.getAdaptor(1);
-        
-        ObjectName name = new ObjectName("test:name=JBMKillService");
-        if (testServices.getServerCount() != 2)
-        {
-            throw new Exception ("This test requires 2 servers but it got with " + testServices.getServerCount());
-        }
-        
-        latchCluster.await();
-        
-        System.out.println("Clustered tests have finished");
-        
-        latchFailover.await();
-        
-        System.out.println("Ready to kill");
-
-        rmi.invoke(name, "kill", new Integer[]{1000}, new String[]{"int"});
-        
-        Thread.sleep(1000);
-        
-        System.out.println("Server already killed");
-        latchServerAlreadyKilled.countDown();
-        
-    }
-
-
-    
-    protected static int getServerId(Connection conn)
-    {
-        return ((JBossConnection) conn).getServerID();
-    }
-
-    protected Connection createConnectionOnServer(ConnectionFactory factory,
-            int serverId) throws Exception
-    {
-        int count = 0;
-
-        while (true)
-        {
-            if (count++ > 10)
-                throw new IllegalStateException(
-                        "Cannot make connection to node " + serverId);
-
-            Connection connection = factory.createConnection();
-
-            if (getServerId(connection) == serverId)
-            {
-                return connection;
-            } else
-            {
-                connection.close();
-            }
-        }
-    }
-    
-    abstract class FailoverTest extends ParallelTest
-    {
-        Context ctx;
-        ConnectionFactory cf;
-        CountDownLatch latch;
-        CountDownLatch latchAlreadyKilled;
-
-        public FailoverTest(String name, CountDownLatch latch, CountDownLatch latchAlreadyKilled)
-        {
-            super(name);
-            this.latch = latch;
-            this.latchAlreadyKilled = latchAlreadyKilled;
-        }
-
-        public void setUp() throws Exception
-        {
-            super.setUp();
-            ctx = new InitialContext();
-            cf = (ConnectionFactory) ctx.lookup("/ClusteredConnectionFactory");
-        }
-
-        public abstract void runTest() throws Throwable;
-        
-    }
-
-    class FailoverTestSimple extends FailoverTest
-    {
-
-
-        public FailoverTestSimple(CountDownLatch latch, CountDownLatch latchAlreadyKilled)
-        {
-            super("testSimpleFailover", latch, latchAlreadyKilled);
-        }
-
-        public void setUp() throws Exception
-        {
-            super.setUp();
-        }
-
-        public void tearDown() throws Exception
-        {
-            super.tearDown();
-        }
-
-        public void runTest() throws Exception
-        {
-
-            boolean latchCalled = false;
-            Connection conn0 = null;
-            try
-            {
-                conn0 = createConnectionOnServer(cf, 1);
-                Queue queue = (Queue)ctx.lookup("/queue/testDistributedQueueA");
-                
-                
-                
-                Session session0 = conn0.createSession(false, Session.AUTO_ACKNOWLEDGE);
-                MessageConsumer consumer = session0.createConsumer(queue);
-                MessageProducer producer = session0.createProducer(queue);
-                conn0.start();
-                
-                String strmsg = "Hello from " + this.getName() + " guid="+ new GUID().toString();
-
-                producer.send(session0.createTextMessage(strmsg));
-                
-                latchCalled = true;
-                latch.countDown();
-                latchAlreadyKilled.await();
-                
-                TextMessage msg = (TextMessage)consumer.receive(15000);
-                assertNotNull("message not received", msg);
-                assertEquals(strmsg, msg.getText());
-                
-            } 
-            finally
-            {
-                try
-                {
-                    if (conn0 != null)
-                    {
-                        conn0.close();
-                    }
-                }
-                catch (Throwable ignored)
-                {
-                    // It should never happen, but better to send it to System.out than just ignore it
-                    ignored.printStackTrace();
-                }
-
-                if (!latchCalled) 
-                {
-                    latch.countDown();
-                }
-            
-            }
-        }
-
-    }
-    
-    class FailoverTestSimpleTransacted extends FailoverTest
-    {
-
-        String jndiQueue;
-        boolean killOnTransaction;
-
-        public FailoverTestSimpleTransacted(String name, boolean killOnTransaction, CountDownLatch latch, CountDownLatch latchAlreadyKilled, String jndiQueue)
-        {
-            super(name, latch, latchAlreadyKilled);
-            this.killOnTransaction = killOnTransaction;
-            this.jndiQueue = jndiQueue;
-        }
-
-        public void setUp() throws Exception
-        {
-            super.setUp();
-        }
-
-        public void tearDown() throws Exception
-        {
-            super.tearDown();
-        }
-
-        public void runTest() throws Exception
-        {
-
-            boolean latchCalled = false;
-            Connection conn0 = null;
-            try
-            {
-                conn0 = createConnectionOnServer(cf, 1);
-                Queue queue = (Queue)ctx.lookup("/queue/" + jndiQueue);
-                
-                Session session0 = conn0.createSession(true, Session.CLIENT_ACKNOWLEDGE);
-                MessageConsumer consumer = session0.createConsumer(queue);
-                MessageProducer producer = session0.createProducer(queue);
-                conn0.start();
-                
-                String strmsg = "Hello from " + this.getName() + " guid="+ new GUID().toString();
-
-                producer.send(session0.createTextMessage(strmsg));
-                session0.commit();
-                
-
-                if (!killOnTransaction)
-                {
-                    latchCalled = true;
-                    latch.countDown();
-                    latchAlreadyKilled.await();
-                    
-                    System.out.println("After kill on (kill on receive)");
-                }
-                
-                TextMessage msg = (TextMessage)consumer.receive(15000);
-                
-                msg.acknowledge();
-                
-                if (killOnTransaction)
-                {
-                    latchCalled = true;
-                    latch.countDown();
-                    latchAlreadyKilled.await();
-                    System.out.println("After kill on (kill on commit)");
-                }
-                
-                session0.commit();
-                
-                assertNotNull("message not received", msg);
-                assertEquals(strmsg, msg.getText());
-                
-                msg =  (TextMessage)consumer.receive(1000);
-                assertNull("Message Queue should be empty by now!", msg);
-                
-            } 
-            finally
-            {
-                try
-                {
-                    if (conn0 != null)
-                    {
-                        conn0.close();
-                    }
-                }
-                catch (Throwable ignored)
-                {
-                    // It should never happen, but better to send it to System.out than just ignore it
-                    ignored.printStackTrace();
-                }
-
-                if (!latchCalled)
-                {
-                    latch.countDown();
-                }
-            }
-        }
-
-    }
-
-    class ClusterTestSimple extends ParallelTest
-    {
-
-        Context ctx;
-        ConnectionFactory cf;
-        CountDownLatch latch;
-
-        public ClusterTestSimple(CountDownLatch latch)
-        {
-            super("testSimpleCluster");
-
-            this.latch = latch;
-        }
-
-        public void setUp() throws Exception
-        {
-            ctx = new InitialContext();
-            cf = (ConnectionFactory) ctx.lookup("/ClusteredConnectionFactory");
-        }
-
-        public void tearDown() throws Exception
-        {
-            super.tearDown();
-        }
-
-        public void runTest() throws Exception
-        {
-
-            Connection conn0 = null, conn1 = null;
-            try
-            {
-                conn0 = createConnectionOnServer(cf, 0);
-                conn1 = createConnectionOnServer(cf, 1);
-                Queue queue = (Queue)ctx.lookup("/queue/testDistributedQueueB");
-                
-                Session session1 = conn1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-                MessageConsumer consumer = session1.createConsumer(queue);
-                conn1.start();
-                
-                
-                Session session0 = conn0.createSession(false, Session.AUTO_ACKNOWLEDGE);
-                MessageProducer producer = session0.createProducer(queue);
-                
-                String strmsg = "Hello from " + this.getName() + " guid="+ new GUID().toString();
-                
-                producer.send(session0.createTextMessage(strmsg));
-                
-                
-                TextMessage msg = (TextMessage)consumer.receive(15000);
-                assertNotNull("message not received", msg);
-                assertEquals(strmsg, msg.getText());
-                
-            } 
-            finally
-            {
-                try
-                {
-                    if (conn0 != null)
-                    {
-                        conn0.close();
-                    }
-                }
-                catch (Throwable ignored)
-                {
-                    // It should never happen, but better to send it to System.out than just ignore it
-                    ignored.printStackTrace();
-                }
-                try
-                {
-                    if (conn1 != null)
-                    {
-                        conn1.close();
-                    }
-                }
-                catch (Throwable ignored)
-                {
-                    // It should never happen, but better to send it to System.out than just ignore it
-                    ignored.printStackTrace();
-                }
-                
-                latch.countDown();
-            }
-        }
-
-    }
-    
-    class FailoverTestSessionWithOneTransactedPersistentMessageFailover extends FailoverTest
-    {
-
-        public FailoverTestSessionWithOneTransactedPersistentMessageFailover(
-                CountDownLatch latch,
-                CountDownLatch latchAlreadyKilled)
-        {
-            super("testSessionWithOneTransactedPersistentMessageFailover", latch, latchAlreadyKilled);
-        }
-        
-        public void setUp() throws Exception
-        {
-            super.setUp();
-        }
-        
-        public void runTest() throws Throwable
-        {
-            boolean latchAlreadyCalled = false;
-            Connection conn = null;
-
-            Queue queue = (Queue) ctx.lookup("/queue/testDistributedQueueE");
-            
-            try
-            {
-               conn = createConnectionOnServer(cf, 1);
-
-               conn.start();
-
-               Session session = conn.createSession(true, Session.SESSION_TRANSACTED);
-
-               // send 2 transacted messages (one persistent and one non-persistent) but don't commit
-               MessageProducer prod = session.createProducer(queue);
-
-               prod.setDeliveryMode(DeliveryMode.PERSISTENT);
-               prod.send(session.createTextMessage("clik-persistent"));
-
-               // close the producer
-               prod.close();
-
-               System.out.println("producer closed");
-
-               // create a consumer on the same local queue (creating a consumer AFTER failover will end
-               // up getting messages from a local queue, not a failed over queue; at least until
-               // redistribution is implemented.
-
-               Session session2 = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-               MessageConsumer cons = session2.createConsumer(queue);
-
-               // register a failover listener
-               SimpleFailoverListener failoverListener = new SimpleFailoverListener();
-               ((JBossConnection)conn).registerFailoverListener(failoverListener);
-
-               latchAlreadyCalled = true;
-               latch.countDown();
-               latchAlreadyKilled.await();
-
-               // wait for the client-side failover to complete
-
-               while(true)
-               {
-                  FailoverEvent event = failoverListener.getEvent(30000);
-                  if (event != null && FailoverEvent.FAILOVER_COMPLETED == event.getType())
-                  {
-                     break;
-                  }
-                  if (event == null)
-                  {
-                     fail("Did not get expected FAILOVER_COMPLETED event");
-                  }
-               }
-
-               // failover complete
-               assertEquals(0, getServerId(conn));
-
-               // commit the failed-over session
-               session.commit();
-
-               // make sure messages made it to the queue
-
-               TextMessage tm = (TextMessage)cons.receive(2000);
-               assertNotNull(tm);
-               assertEquals("clik-persistent", tm.getText());
-            }
-            finally
-            {
-               if (!latchAlreadyCalled)
-               {
-                   latch.countDown();
-               }
-               if (conn != null)
-               {
-                  conn.close();
-               }
-            }
-        }
-        
-    }
-    
-    class FailoverSessionWithOneTransactedNonPersistentMessageFailover extends FailoverTest
-    {
-
-        public FailoverSessionWithOneTransactedNonPersistentMessageFailover(
-                CountDownLatch latch,
-                CountDownLatch latchAlreadyKilled)
-        {
-            super("testSessionWithOneTransactedNonPersistentMessageFailover", latch, latchAlreadyKilled);
-        }
-        
-        public void setUp() throws Exception
-        {
-            super.setUp();
-        }
-        
-        public void runTest() throws Throwable
-        {
-            Connection conn = null;
-            
-            boolean latchCalled = false;
-            
-            Queue queue = (Queue) ctx.lookup("queue/testDistributedQueueF");
-
-            try
-            {
-               conn = createConnectionOnServer(cf, 1);
-
-               conn.start();
-
-               Session session = conn.createSession(true, Session.SESSION_TRANSACTED);
-
-               MessageProducer prod = session.createProducer(queue);
-
-               prod.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
-               prod.send(session.createTextMessage("clik-non-persistent"));
-
-               // close the producer
-               prod.close();
-
-               // create a consumer on the same local queue (creating a consumer AFTER failover will end
-               // up getting messages from a local queue, not a failed over queue; at least until
-               // redistribution is implemented.
-
-               Session session2 = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-               MessageConsumer cons = session2.createConsumer(queue);
-
-               // register a failover listener
-               SimpleFailoverListener failoverListener = new SimpleFailoverListener();
-               ((JBossConnection)conn).registerFailoverListener(failoverListener);
-
-               latchCalled = true;
-               latch.countDown();
-               latchAlreadyKilled.await();
-
-               // wait for the client-side failover to complete
-
-               while(true)
-               {
-                  FailoverEvent event = failoverListener.getEvent(30000);
-                  if (event != null && FailoverEvent.FAILOVER_COMPLETED == event.getType())
-                  {
-                     break;
-                  }
-                  if (event == null)
-                  {
-                     fail("Did not get expected FAILOVER_COMPLETED event");
-                  }
-               }
-
-               // failover complete
-
-               assertEquals(0, getServerId(conn));
-
-               // commit the failed-over session
-               session.commit();
-
-               // make sure messages made it to the queue
-
-               TextMessage tm = (TextMessage)cons.receive(2000);
-               assertNotNull(tm);
-               assertEquals("clik-non-persistent", tm.getText());
-            }
-            finally
-            {
-               if (!latchCalled)
-               {
-                   latch.countDown();
-               }
-               if (conn != null)
-               {
-                  conn.close();
-               }
-            }
-        }
-    }
-    
-    
-    public static Test suite() throws Exception
-    {
-        ClassLoader loader = ClusteredTestCase.class.getClassLoader(); 
-
-        final String destinations = loader.getResource("jbossmessaging/test-clustered-destinations-full-service.xml").toString();
-        final String jarNames = destinations + ",jbm-killservice.sar";
-        final Test test = new ClusteredTestCase();
-        
-        
-        JBossTestSetup wrapper = new JBossTestClusteredSetup(test)
-        {
-
-           protected void setUp() throws Exception
-           {
-              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);
-             }
-                  
-              // wait a few seconds so that the cluster stabilize
-              synchronized (this)
-              {
-                 wait(2000);
-              }
-           }
-
-           protected void tearDown() throws Exception
-           {
-              
-              if (jarNames != null)
-              {
-                 JBossTestClusteredServices clusteredDelegate = (JBossTestClusteredServices) delegate;
-                 
-                 // deploy 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.getLog().debug("Attempt undeploy of " + jarName);
-                    clusteredDelegate.undeploy(clusteredDelegate.getAdaptor(0), jarName);
-                    this.getLog().debug("undeployed package: " + jarName);
-                 }            
-              }
-           }
-        };
-        return wrapper;
-        
-    }
-    
-    
-    // Inner classes --------------------------------------------------------------------------------
-    
-    protected class SimpleFailoverListener implements FailoverListener
-    {
-       private LinkedQueue buffer;
-
-       public SimpleFailoverListener()
-       {
-          buffer = new LinkedQueue();
-       }
-
-       public void failoverEventOccured(FailoverEvent event)
-       {
-          try
-          {
-             buffer.put(event);
-          }
-          catch(InterruptedException e)
-          {
-             throw new RuntimeException("Putting thread interrupted while trying to add event " +
-                "to buffer", e);
-          }
-       }
-
-       /**
-        * Blocks until a FailoverEvent is available or timeout occurs, in which case returns null.
-        */
-       public FailoverEvent getEvent(long timeout) throws InterruptedException
-       {
-          return (FailoverEvent)buffer.poll(timeout);
-       }
-    }
-    
-}

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/ClusteredTestCase.java (from rev 67044, branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/ClusteredTestCase.java)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/ClusteredTestCase.java	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/ClusteredTestCase.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -0,0 +1,712 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.test.jbossmessaging.clustertest;
+
+import java.util.StringTokenizer;
+import java.util.concurrent.CountDownLatch;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.DeliveryMode;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.management.ObjectName;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+
+import org.jboss.jmx.adaptor.rmi.RMIAdaptor;
+
+import org.jboss.jms.client.FailoverEvent;
+import org.jboss.jms.client.FailoverListener;
+import org.jboss.jms.client.JBossConnection;
+import org.jboss.test.JBossClusteredTestCase;
+import org.jboss.test.JBossTestClusteredServices;
+import org.jboss.test.JBossTestClusteredSetup;
+import org.jboss.test.JBossTestSetup;
+import org.jboss.util.id.GUID;
+
+import EDU.oswego.cs.dl.util.concurrent.LinkedQueue;
+
+import junit.framework.Test;
+
+/**
+ * 
+ * Each failover test would require a whole shutdown cycle, what means.. start, run test, kill, assert.. (for each test).
+ * Instead of doing that we run tests in parallel, using this little framework defined by ParallelTestContainer and assert all of them in a single server kill.
+ * Also: System.exit(-1); wasn't enough to perform a server crash, as it was causing a regular shutdown, so we are using some reflection to call java.lang.Shutdown#halt.
+ * @author <a href="clebert.suconic at jboss.com">Clebert Suconic</a>
+ *
+ */
+public class ClusteredTestCase extends ParallelTestContainer
+{
+
+    CountDownLatch latchCluster = new CountDownLatch(1);
+    CountDownLatch latchFailover = new CountDownLatch(5);
+    CountDownLatch latchServerAlreadyKilled = new CountDownLatch(1);
+
+    public ParallelTest[] getTests()
+    {
+        return new ParallelTest[]
+        { new ClusterTestSimple(latchCluster), 
+            new FailoverTestSimple(latchFailover, latchServerAlreadyKilled),
+            new FailoverTestSimpleTransacted("testFailoverTransactedKillOnCommit", true, latchFailover, latchServerAlreadyKilled, "testDistributedQueueC"),
+            new FailoverTestSimpleTransacted("testFailoverTransactedKillOnMessageReceive", false, latchFailover, latchServerAlreadyKilled, "testDistributedQueueD"),
+            new FailoverTestSessionWithOneTransactedPersistentMessageFailover(latchFailover, latchServerAlreadyKilled),
+            new FailoverSessionWithOneTransactedNonPersistentMessageFailover(latchFailover, latchServerAlreadyKilled)};
+    }
+
+    public void doTest() throws Exception
+    {
+        
+        JBossTestClusteredServices testServices = new JBossTestClusteredServices("ClusteredTestCase");
+        testServices.init();
+        
+        RMIAdaptor rmi = testServices.getAdaptor(1);
+        
+        ObjectName name = new ObjectName("test:name=JBMKillService");
+        if (testServices.getServerCount() != 2)
+        {
+            throw new Exception ("This test requires 2 servers but it got with " + testServices.getServerCount());
+        }
+        
+        latchCluster.await();
+        
+        System.out.println("Clustered tests have finished");
+        
+        latchFailover.await();
+        
+        System.out.println("Ready to kill");
+
+        rmi.invoke(name, "kill", new Integer[]{1000}, new String[]{"int"});
+        
+        Thread.sleep(1000);
+        
+        System.out.println("Server already killed");
+        latchServerAlreadyKilled.countDown();
+        
+    }
+
+
+    
+    protected static int getServerId(Connection conn)
+    {
+        return ((JBossConnection) conn).getServerID();
+    }
+
+    protected Connection createConnectionOnServer(ConnectionFactory factory,
+            int serverId) throws Exception
+    {
+        int count = 0;
+
+        while (true)
+        {
+            if (count++ > 10)
+                throw new IllegalStateException(
+                        "Cannot make connection to node " + serverId);
+
+            Connection connection = factory.createConnection();
+
+            if (getServerId(connection) == serverId)
+            {
+                return connection;
+            } else
+            {
+                connection.close();
+            }
+        }
+    }
+    
+    abstract class FailoverTest extends ParallelTest
+    {
+        Context ctx;
+        ConnectionFactory cf;
+        CountDownLatch latch;
+        CountDownLatch latchAlreadyKilled;
+
+        public FailoverTest(String name, CountDownLatch latch, CountDownLatch latchAlreadyKilled)
+        {
+            super(name);
+            this.latch = latch;
+            this.latchAlreadyKilled = latchAlreadyKilled;
+        }
+
+        public void setUp() throws Exception
+        {
+            super.setUp();
+            ctx = new InitialContext();
+            cf = (ConnectionFactory) ctx.lookup("/ClusteredConnectionFactory");
+        }
+
+        public abstract void runTest() throws Throwable;
+        
+    }
+
+    class FailoverTestSimple extends FailoverTest
+    {
+
+
+        public FailoverTestSimple(CountDownLatch latch, CountDownLatch latchAlreadyKilled)
+        {
+            super("testSimpleFailover", latch, latchAlreadyKilled);
+        }
+
+        public void setUp() throws Exception
+        {
+            super.setUp();
+        }
+
+        public void tearDown() throws Exception
+        {
+            super.tearDown();
+        }
+
+        public void runTest() throws Exception
+        {
+
+            boolean latchCalled = false;
+            Connection conn0 = null;
+            try
+            {
+                conn0 = createConnectionOnServer(cf, 1);
+                Queue queue = (Queue)ctx.lookup("/queue/testDistributedQueueA");
+                
+                
+                
+                Session session0 = conn0.createSession(false, Session.AUTO_ACKNOWLEDGE);
+                MessageConsumer consumer = session0.createConsumer(queue);
+                MessageProducer producer = session0.createProducer(queue);
+                conn0.start();
+                
+                String strmsg = "Hello from " + this.getName() + " guid="+ new GUID().toString();
+
+                producer.send(session0.createTextMessage(strmsg));
+                
+                latchCalled = true;
+                latch.countDown();
+                latchAlreadyKilled.await();
+                
+                TextMessage msg = (TextMessage)consumer.receive(15000);
+                assertNotNull("message not received", msg);
+                assertEquals(strmsg, msg.getText());
+                
+            } 
+            finally
+            {
+                try
+                {
+                    if (conn0 != null)
+                    {
+                        conn0.close();
+                    }
+                }
+                catch (Throwable ignored)
+                {
+                    // It should never happen, but better to send it to System.out than just ignore it
+                    ignored.printStackTrace();
+                }
+
+                if (!latchCalled) 
+                {
+                    latch.countDown();
+                }
+            
+            }
+        }
+
+    }
+    
+    class FailoverTestSimpleTransacted extends FailoverTest
+    {
+
+        String jndiQueue;
+        boolean killOnTransaction;
+
+        public FailoverTestSimpleTransacted(String name, boolean killOnTransaction, CountDownLatch latch, CountDownLatch latchAlreadyKilled, String jndiQueue)
+        {
+            super(name, latch, latchAlreadyKilled);
+            this.killOnTransaction = killOnTransaction;
+            this.jndiQueue = jndiQueue;
+        }
+
+        public void setUp() throws Exception
+        {
+            super.setUp();
+        }
+
+        public void tearDown() throws Exception
+        {
+            super.tearDown();
+        }
+
+        public void runTest() throws Exception
+        {
+
+            boolean latchCalled = false;
+            Connection conn0 = null;
+            try
+            {
+                conn0 = createConnectionOnServer(cf, 1);
+                Queue queue = (Queue)ctx.lookup("/queue/" + jndiQueue);
+                
+                Session session0 = conn0.createSession(true, Session.CLIENT_ACKNOWLEDGE);
+                MessageConsumer consumer = session0.createConsumer(queue);
+                MessageProducer producer = session0.createProducer(queue);
+                conn0.start();
+                
+                String strmsg = "Hello from " + this.getName() + " guid="+ new GUID().toString();
+
+                producer.send(session0.createTextMessage(strmsg));
+                session0.commit();
+                
+
+                if (!killOnTransaction)
+                {
+                    latchCalled = true;
+                    latch.countDown();
+                    latchAlreadyKilled.await();
+                    
+                    System.out.println("After kill on (kill on receive)");
+                }
+                
+                TextMessage msg = (TextMessage)consumer.receive(15000);
+                
+                msg.acknowledge();
+                
+                if (killOnTransaction)
+                {
+                    latchCalled = true;
+                    latch.countDown();
+                    latchAlreadyKilled.await();
+                    System.out.println("After kill on (kill on commit)");
+                }
+                
+                session0.commit();
+                
+                assertNotNull("message not received", msg);
+                assertEquals(strmsg, msg.getText());
+                
+                msg =  (TextMessage)consumer.receive(1000);
+                assertNull("Message Queue should be empty by now!", msg);
+                
+            } 
+            finally
+            {
+                try
+                {
+                    if (conn0 != null)
+                    {
+                        conn0.close();
+                    }
+                }
+                catch (Throwable ignored)
+                {
+                    // It should never happen, but better to send it to System.out than just ignore it
+                    ignored.printStackTrace();
+                }
+
+                if (!latchCalled)
+                {
+                    latch.countDown();
+                }
+            }
+        }
+
+    }
+
+    class ClusterTestSimple extends ParallelTest
+    {
+
+        Context ctx;
+        ConnectionFactory cf;
+        CountDownLatch latch;
+
+        public ClusterTestSimple(CountDownLatch latch)
+        {
+            super("testSimpleCluster");
+
+            this.latch = latch;
+        }
+
+        public void setUp() throws Exception
+        {
+            ctx = new InitialContext();
+            cf = (ConnectionFactory) ctx.lookup("/ClusteredConnectionFactory");
+        }
+
+        public void tearDown() throws Exception
+        {
+            super.tearDown();
+        }
+
+        public void runTest() throws Exception
+        {
+
+            Connection conn0 = null, conn1 = null;
+            try
+            {
+                conn0 = createConnectionOnServer(cf, 0);
+                conn1 = createConnectionOnServer(cf, 1);
+                Queue queue = (Queue)ctx.lookup("/queue/testDistributedQueueB");
+                
+                Session session1 = conn1.createSession(false, Session.AUTO_ACKNOWLEDGE);
+                MessageConsumer consumer = session1.createConsumer(queue);
+                conn1.start();
+                
+                
+                Session session0 = conn0.createSession(false, Session.AUTO_ACKNOWLEDGE);
+                MessageProducer producer = session0.createProducer(queue);
+                
+                String strmsg = "Hello from " + this.getName() + " guid="+ new GUID().toString();
+                
+                producer.send(session0.createTextMessage(strmsg));
+                
+                
+                TextMessage msg = (TextMessage)consumer.receive(15000);
+                assertNotNull("message not received", msg);
+                assertEquals(strmsg, msg.getText());
+                
+            } 
+            finally
+            {
+                try
+                {
+                    if (conn0 != null)
+                    {
+                        conn0.close();
+                    }
+                }
+                catch (Throwable ignored)
+                {
+                    // It should never happen, but better to send it to System.out than just ignore it
+                    ignored.printStackTrace();
+                }
+                try
+                {
+                    if (conn1 != null)
+                    {
+                        conn1.close();
+                    }
+                }
+                catch (Throwable ignored)
+                {
+                    // It should never happen, but better to send it to System.out than just ignore it
+                    ignored.printStackTrace();
+                }
+                
+                latch.countDown();
+            }
+        }
+
+    }
+    
+    class FailoverTestSessionWithOneTransactedPersistentMessageFailover extends FailoverTest
+    {
+
+        public FailoverTestSessionWithOneTransactedPersistentMessageFailover(
+                CountDownLatch latch,
+                CountDownLatch latchAlreadyKilled)
+        {
+            super("testSessionWithOneTransactedPersistentMessageFailover", latch, latchAlreadyKilled);
+        }
+        
+        public void setUp() throws Exception
+        {
+            super.setUp();
+        }
+        
+        public void runTest() throws Throwable
+        {
+            boolean latchAlreadyCalled = false;
+            Connection conn = null;
+
+            Queue queue = (Queue) ctx.lookup("/queue/testDistributedQueueE");
+            
+            try
+            {
+               conn = createConnectionOnServer(cf, 1);
+
+               conn.start();
+
+               Session session = conn.createSession(true, Session.SESSION_TRANSACTED);
+
+               // send 2 transacted messages (one persistent and one non-persistent) but don't commit
+               MessageProducer prod = session.createProducer(queue);
+
+               prod.setDeliveryMode(DeliveryMode.PERSISTENT);
+               prod.send(session.createTextMessage("clik-persistent"));
+
+               // close the producer
+               prod.close();
+
+               System.out.println("producer closed");
+
+               // create a consumer on the same local queue (creating a consumer AFTER failover will end
+               // up getting messages from a local queue, not a failed over queue; at least until
+               // redistribution is implemented.
+
+               Session session2 = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+               MessageConsumer cons = session2.createConsumer(queue);
+
+               // register a failover listener
+               SimpleFailoverListener failoverListener = new SimpleFailoverListener();
+               ((JBossConnection)conn).registerFailoverListener(failoverListener);
+
+               latchAlreadyCalled = true;
+               latch.countDown();
+               latchAlreadyKilled.await();
+
+               // wait for the client-side failover to complete
+
+               while(true)
+               {
+                  FailoverEvent event = failoverListener.getEvent(30000);
+                  if (event != null && FailoverEvent.FAILOVER_COMPLETED == event.getType())
+                  {
+                     break;
+                  }
+                  if (event == null)
+                  {
+                     fail("Did not get expected FAILOVER_COMPLETED event");
+                  }
+               }
+
+               // failover complete
+               assertEquals(0, getServerId(conn));
+
+               // commit the failed-over session
+               session.commit();
+
+               // make sure messages made it to the queue
+
+               TextMessage tm = (TextMessage)cons.receive(2000);
+               assertNotNull(tm);
+               assertEquals("clik-persistent", tm.getText());
+            }
+            finally
+            {
+               if (!latchAlreadyCalled)
+               {
+                   latch.countDown();
+               }
+               if (conn != null)
+               {
+                  conn.close();
+               }
+            }
+        }
+        
+    }
+    
+    class FailoverSessionWithOneTransactedNonPersistentMessageFailover extends FailoverTest
+    {
+
+        public FailoverSessionWithOneTransactedNonPersistentMessageFailover(
+                CountDownLatch latch,
+                CountDownLatch latchAlreadyKilled)
+        {
+            super("testSessionWithOneTransactedNonPersistentMessageFailover", latch, latchAlreadyKilled);
+        }
+        
+        public void setUp() throws Exception
+        {
+            super.setUp();
+        }
+        
+        public void runTest() throws Throwable
+        {
+            Connection conn = null;
+            
+            boolean latchCalled = false;
+            
+            Queue queue = (Queue) ctx.lookup("queue/testDistributedQueueF");
+
+            try
+            {
+               conn = createConnectionOnServer(cf, 1);
+
+               conn.start();
+
+               Session session = conn.createSession(true, Session.SESSION_TRANSACTED);
+
+               MessageProducer prod = session.createProducer(queue);
+
+               prod.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
+               prod.send(session.createTextMessage("clik-non-persistent"));
+
+               // close the producer
+               prod.close();
+
+               // create a consumer on the same local queue (creating a consumer AFTER failover will end
+               // up getting messages from a local queue, not a failed over queue; at least until
+               // redistribution is implemented.
+
+               Session session2 = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+               MessageConsumer cons = session2.createConsumer(queue);
+
+               // register a failover listener
+               SimpleFailoverListener failoverListener = new SimpleFailoverListener();
+               ((JBossConnection)conn).registerFailoverListener(failoverListener);
+
+               latchCalled = true;
+               latch.countDown();
+               latchAlreadyKilled.await();
+
+               // wait for the client-side failover to complete
+
+               while(true)
+               {
+                  FailoverEvent event = failoverListener.getEvent(30000);
+                  if (event != null && FailoverEvent.FAILOVER_COMPLETED == event.getType())
+                  {
+                     break;
+                  }
+                  if (event == null)
+                  {
+                     fail("Did not get expected FAILOVER_COMPLETED event");
+                  }
+               }
+
+               // failover complete
+
+               assertEquals(0, getServerId(conn));
+
+               // commit the failed-over session
+               session.commit();
+
+               // make sure messages made it to the queue
+
+               TextMessage tm = (TextMessage)cons.receive(2000);
+               assertNotNull(tm);
+               assertEquals("clik-non-persistent", tm.getText());
+            }
+            finally
+            {
+               if (!latchCalled)
+               {
+                   latch.countDown();
+               }
+               if (conn != null)
+               {
+                  conn.close();
+               }
+            }
+        }
+    }
+    
+    
+    public static Test suite() throws Exception
+    {
+        ClassLoader loader = ClusteredTestCase.class.getClassLoader(); 
+
+        final String destinations = loader.getResource("jbossmessaging/test-clustered-destinations-full-service.xml").toString();
+        final String jarNames = destinations + ",jbm-killservice.sar";
+        final Test test = new ClusteredTestCase();
+        
+        
+        JBossTestSetup wrapper = new JBossTestClusteredSetup(test)
+        {
+
+           protected void setUp() throws Exception
+           {
+              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);
+             }
+                  
+              // wait a few seconds so that the cluster stabilize
+              synchronized (this)
+              {
+                 wait(2000);
+              }
+           }
+
+           protected void tearDown() throws Exception
+           {
+              
+              if (jarNames != null)
+              {
+                 JBossTestClusteredServices clusteredDelegate = (JBossTestClusteredServices) delegate;
+                 
+                 // deploy 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.getLog().debug("Attempt undeploy of " + jarName);
+                    clusteredDelegate.undeploy(clusteredDelegate.getAdaptor(0), jarName);
+                    this.getLog().debug("undeployed package: " + jarName);
+                 }            
+              }
+           }
+        };
+        return wrapper;
+        
+    }
+    
+    
+    // Inner classes --------------------------------------------------------------------------------
+    
+    protected class SimpleFailoverListener implements FailoverListener
+    {
+       private LinkedQueue buffer;
+
+       public SimpleFailoverListener()
+       {
+          buffer = new LinkedQueue();
+       }
+
+       public void failoverEventOccured(FailoverEvent event)
+       {
+          try
+          {
+             buffer.put(event);
+          }
+          catch(InterruptedException e)
+          {
+             throw new RuntimeException("Putting thread interrupted while trying to add event " +
+                "to buffer", e);
+          }
+       }
+
+       /**
+        * Blocks until a FailoverEvent is available or timeout occurs, in which case returns null.
+        */
+       public FailoverEvent getEvent(long timeout) throws InterruptedException
+       {
+          return (FailoverEvent)buffer.poll(timeout);
+       }
+    }
+    
+}

Deleted: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/ParallelTest.java
===================================================================
--- branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/ParallelTest.java	2007-11-13 21:31:41 UTC (rev 67044)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/ParallelTest.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -1,87 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.test.jbossmessaging.clustertest;
-
-import junit.framework.TestCase;
-import junit.framework.TestListener;
-import junit.framework.TestResult;
-
-/**
- * On clustered Tests we execute a series of tests simultaneously, and get the
- * results at once. This is done because several tests will require a server
- * kill. Doing the test this way we can save a bunch of server kills
- */
-public abstract class ParallelTest extends TestCase
-{
-
-    boolean isSuccess;
-
-    public TestResult result;
-    public Thread t;
-    public TestListener listener;
-
-    public ParallelTest(String name)
-    {
-        super(name);
-    }
-
-
-    public void setListener(TestListener listener)
-    {
-        this.listener = listener;
-    }
-    
-    public void run(TestResult result)
-    {
-        result.addListener(listener);
-        super.run(result);
-    }
-
-    
-    public abstract void runTest() throws Throwable;
-    
-    public void execRun()
-    {
-        result = run();
-    }
-
-    class LocalThread extends Thread
-    {
-        public void run()
-        {
-            execRun();
-        }
-    }
-
-    public void startTest()
-    {
-        t = new LocalThread();
-        t.start();
-    }
-
-    public void join() throws InterruptedException
-    {
-        t.join();
-    }
-
-}

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/ParallelTest.java (from rev 67044, branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/ParallelTest.java)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/ParallelTest.java	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/ParallelTest.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.test.jbossmessaging.clustertest;
+
+import junit.framework.TestCase;
+import junit.framework.TestListener;
+import junit.framework.TestResult;
+
+/**
+ * On clustered Tests we execute a series of tests simultaneously, and get the
+ * results at once. This is done because several tests will require a server
+ * kill. Doing the test this way we can save a bunch of server kills
+
+ * @author <a href="clebert.suconic at jboss.com">Clebert Suconic</a>
+ */
+public abstract class ParallelTest extends TestCase
+{
+
+    boolean isSuccess;
+
+    public TestResult result;
+    public Thread t;
+    public TestListener listener;
+
+    public ParallelTest(String name)
+    {
+        super(name);
+    }
+
+
+    public void setListener(TestListener listener)
+    {
+        this.listener = listener;
+    }
+    
+    public void run(TestResult result)
+    {
+        result.addListener(listener);
+        super.run(result);
+    }
+
+    
+    public abstract void runTest() throws Throwable;
+    
+    class LocalThread extends Thread
+    {
+        public void run()
+        {
+            ParallelTest.this.run();
+        }
+    }
+
+    public void startTest()
+    {
+        t = new LocalThread();
+        t.start();
+    }
+
+    public void join() throws InterruptedException
+    {
+        t.join();
+    }
+
+}

Deleted: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/ParallelTestContainer.java
===================================================================
--- branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/ParallelTestContainer.java	2007-11-13 21:31:41 UTC (rev 67044)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/ParallelTestContainer.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -1,116 +0,0 @@
-/*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005, JBoss Inc., and individual contributors as indicated
-  * by the @authors tag. See the copyright.txt in the distribution for a
-  * full listing of individual contributors.
-  *
-  * This is free software; you can redistribute it and/or modify it
-  * under the terms of the GNU Lesser General Public License as
-  * published by the Free Software Foundation; either version 2.1 of
-  * the License, or (at your option) any later version.
-  *
-  * This software is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
-  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  * Lesser General Public License for more details.
-  *
-  * You should have received a copy of the GNU Lesser General Public
-  * License along with this software; if not, write to the Free
-  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-  */
-
-
-package org.jboss.test.jbossmessaging.clustertest;
-
-import junit.framework.AssertionFailedError;
-import junit.framework.Test;
-import junit.framework.TestListener;
-import junit.framework.TestResult;
-
-public abstract class ParallelTestContainer implements Test
-{
-
-    public abstract ParallelTest[] getTests();
-    
-    public void run(TestResult res)
-    {
-        AggregatorListener listener = new AggregatorListener(res);
-        
-        ParallelTest tests[] = getTests();
-        
-        for (ParallelTest test: tests)
-        {
-            test.setListener(listener);
-            test.startTest();
-        }
-        
-        try
-        {
-            doTest();
-        }
-        catch (Throwable e)
-        {
-            res.addError(this, e);
-        }
-        
-        for (ParallelTest test: tests)
-        {
-            try
-            {
-                test.join();
-            } catch (InterruptedException ignored)
-            {
-                // this should never happen, but case it ever happens doesn't hurt anything some debug info on the System.out
-                ignored.printStackTrace();
-            }
-        }
-        
-    }
-    
-    
-    // This execution point could be used to do some logic as tests are being executed
-    public abstract void doTest() throws Throwable;
-    
-    
-   
-    class AggregatorListener implements TestListener
-    {
-        
-        TestResult target;
-
-        public AggregatorListener(TestResult target)
-        {
-            this.target=target;
-        }
-
-        public void addError(Test test, Throwable t)
-        {
-            
-            target.addError(test, t);
-        }
-
-        public void addFailure(Test test, AssertionFailedError t)
-        {
-            target.addFailure(test, t);
-        }
-
-        public void endTest(Test test)
-        {
-            target.endTest(test);
-        }
-
-        public void startTest(Test test)
-        {
-            target.startTest(test);
-        }
-    }
-    
-    public int countTestCases()
-    {
-        return 1;
-    }
-    
-    
-
-}

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/ParallelTestContainer.java (from rev 67044, branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/ParallelTestContainer.java)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/ParallelTestContainer.java	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/ParallelTestContainer.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -0,0 +1,121 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+
+
+package org.jboss.test.jbossmessaging.clustertest;
+
+import junit.framework.AssertionFailedError;
+import junit.framework.Test;
+import junit.framework.TestListener;
+import junit.framework.TestResult;
+
+/**
+ * 
+ * @author <a href="clebert.suconic at jboss.com">Clebert Suconic</a>
+ *
+ */
+public abstract class ParallelTestContainer implements Test
+{
+
+    public abstract ParallelTest[] getTests();
+    
+    public void run(TestResult res)
+    {
+        AggregatorListener listener = new AggregatorListener(res);
+        
+        ParallelTest tests[] = getTests();
+        
+        for (ParallelTest test: tests)
+        {
+            test.setListener(listener);
+            test.startTest();
+        }
+        
+        try
+        {
+            doTest();
+        }
+        catch (Throwable e)
+        {
+            res.addError(this, e);
+        }
+        
+        for (ParallelTest test: tests)
+        {
+            try
+            {
+                test.join();
+            } catch (InterruptedException ignored)
+            {
+                // this should never happen, but case it ever happens doesn't hurt anything some debug info on the System.out
+                ignored.printStackTrace();
+            }
+        }
+        
+    }
+    
+    
+    // This execution point could be used to do some logic as tests are being executed
+    public abstract void doTest() throws Throwable;
+    
+    
+   
+    class AggregatorListener implements TestListener
+    {
+        
+        TestResult target;
+
+        public AggregatorListener(TestResult target)
+        {
+            this.target=target;
+        }
+
+        public void addError(Test test, Throwable t)
+        {
+            
+            target.addError(test, t);
+        }
+
+        public void addFailure(Test test, AssertionFailedError t)
+        {
+            target.addFailure(test, t);
+        }
+
+        public void endTest(Test test)
+        {
+            target.endTest(test);
+        }
+
+        public void startTest(Test test)
+        {
+            target.startTest(test);
+        }
+    }
+    
+    public int countTestCases()
+    {
+        return 1;
+    }
+    
+    
+
+}

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/killservice (from rev 67044, branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/killservice)

Deleted: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/killservice/KillService.java
===================================================================
--- branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/killservice/KillService.java	2007-11-13 21:31:41 UTC (rev 67044)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/killservice/KillService.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -1,70 +0,0 @@
-/*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005, JBoss Inc., and individual contributors as indicated
-  * by the @authors tag. See the copyright.txt in the distribution for a
-  * full listing of individual contributors.
-  *
-  * This is free software; you can redistribute it and/or modify it
-  * under the terms of the GNU Lesser General Public License as
-  * published by the Free Software Foundation; either version 2.1 of
-  * the License, or (at your option) any later version.
-  *
-  * This software is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
-  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  * Lesser General Public License for more details.
-  *
-  * You should have received a copy of the GNU Lesser General Public
-  * License along with this software; if not, write to the Free
-  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-  */
-
-
-package org.jboss.test.jbossmessaging.clustertest.killservice;
-
-import java.lang.reflect.Method;
-
-import org.jboss.system.ServiceMBeanSupport;
-
-
-public class KillService extends ServiceMBeanSupport implements KillServiceMBean
-{
-
-    public void kill(final int miliseconds)
-    {
-        new Thread()
-        {
-            public void run()
-            {
-                try
-                {
-                    System.out.println("Server will be killed in " + miliseconds + " miliseconds");
-                    Thread.sleep(miliseconds);
-                    try
-                    {
-                        /** We need a real halt for failover, as System.exit would cause a regular shutdown process */
-                        Class clazz = this.getClass().getClassLoader().loadClass("java.lang.Shutdown");
-                        Method method = clazz.getDeclaredMethod("halt",  new Class[]{Integer.TYPE});
-                        method.setAccessible(true);
-                        System.out.println("Halt forced!");
-                        System.out.flush();
-                        method.invoke(null, new Object[]{new Integer(-1)});
-                    }
-                    catch (Exception ex)
-                    {
-                        ex.printStackTrace();
-                    }
-                }
-                catch (Exception ignored)
-                {
-                    // nothing to do if it's interrupted
-                }
-                
-                
-            }
-        }.start();
-        
-    }
-
-}

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/killservice/KillService.java (from rev 67044, branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/killservice/KillService.java)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/killservice/KillService.java	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/killservice/KillService.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -0,0 +1,70 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+
+
+package org.jboss.test.jbossmessaging.clustertest.killservice;
+
+import java.lang.reflect.Method;
+
+import org.jboss.system.ServiceMBeanSupport;
+
+
+public class KillService extends ServiceMBeanSupport implements KillServiceMBean
+{
+
+    public void kill(final int miliseconds)
+    {
+        new Thread()
+        {
+            public void run()
+            {
+                try
+                {
+                    System.out.println("Server will be killed in " + miliseconds + " miliseconds");
+                    Thread.sleep(miliseconds);
+                    try
+                    {
+                        /** We need a real halt for failover, as System.exit would cause a regular shutdown process */
+                        Class clazz = this.getClass().getClassLoader().loadClass("java.lang.Shutdown");
+                        Method method = clazz.getDeclaredMethod("halt",  new Class[]{Integer.TYPE});
+                        method.setAccessible(true);
+                        System.out.println("Halt forced!");
+                        System.out.flush();
+                        method.invoke(null, new Object[]{new Integer(-1)});
+                    }
+                    catch (Exception ex)
+                    {
+                        ex.printStackTrace();
+                    }
+                }
+                catch (Exception ignored)
+                {
+                    // nothing to do if it's interrupted
+                }
+                
+                
+            }
+        }.start();
+        
+    }
+
+}

Deleted: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/killservice/KillServiceMBean.java
===================================================================
--- branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/killservice/KillServiceMBean.java	2007-11-13 21:31:41 UTC (rev 67044)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/killservice/KillServiceMBean.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -1,29 +0,0 @@
-/*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005, JBoss Inc., and individual contributors as indicated
-  * by the @authors tag. See the copyright.txt in the distribution for a
-  * full listing of individual contributors.
-  *
-  * This is free software; you can redistribute it and/or modify it
-  * under the terms of the GNU Lesser General Public License as
-  * published by the Free Software Foundation; either version 2.1 of
-  * the License, or (at your option) any later version.
-  *
-  * This software is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
-  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  * Lesser General Public License for more details.
-  *
-  * You should have received a copy of the GNU Lesser General Public
-  * License along with this software; if not, write to the Free
-  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-  */
-
-
-package org.jboss.test.jbossmessaging.clustertest.killservice;
-
-public interface KillServiceMBean
-{
-   public void kill(int seconds);
-}

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/killservice/KillServiceMBean.java (from rev 67044, branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/killservice/KillServiceMBean.java)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/killservice/KillServiceMBean.java	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/killservice/KillServiceMBean.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -0,0 +1,29 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+
+
+package org.jboss.test.jbossmessaging.clustertest.killservice;
+
+public interface KillServiceMBean
+{
+   public void kill(int seconds);
+}

Deleted: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossJMSUnitTest.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossJMSUnitTest.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossJMSUnitTest.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -1,1355 +0,0 @@
-/*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005, JBoss Inc., and individual contributors as indicated
-  * by the @authors tag. See the copyright.txt in the distribution for a
-  * full listing of individual contributors.
-  *
-  * This is free software; you can redistribute it and/or modify it
-  * under the terms of the GNU Lesser General Public License as
-  * published by the Free Software Foundation; either version 2.1 of
-  * the License, or (at your option) any later version.
-  *
-  * This software is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
-  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  * Lesser General Public License for more details.
-  *
-  * You should have received a copy of the GNU Lesser General Public
-  * License along with this software; if not, write to the Free
-  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-  */
-package org.jboss.test.jbossmessaging.test;
-
-import java.util.Enumeration;
-
-import javax.jms.DeliveryMode;
-import javax.jms.InvalidDestinationException;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.Queue;
-import javax.jms.QueueBrowser;
-import javax.jms.QueueConnection;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.QueueReceiver;
-import javax.jms.QueueRequestor;
-import javax.jms.QueueSender;
-import javax.jms.QueueSession;
-import javax.jms.ServerSession;
-import javax.jms.ServerSessionPool;
-import javax.jms.Session;
-import javax.jms.TemporaryQueue;
-import javax.jms.TemporaryTopic;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-import javax.jms.TopicConnection;
-import javax.jms.TopicConnectionFactory;
-import javax.jms.TopicPublisher;
-import javax.jms.TopicSession;
-import javax.jms.TopicSubscriber;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-
-import org.jboss.logging.Logger;
-import org.jboss.test.jbossmessaging.JMSTestCase;
-
-import EDU.oswego.cs.dl.util.concurrent.CountDown;
-
-/**
- * Basic jms tests.
- *
- * @author Scott.Stark at jboss.org
- * @version $Revision: 64261 $
- */
-public class JBossJMSUnitTest extends JMSTestCase
-{
-   /** The default TopicFactory jndi name */
-   static String TOPIC_FACTORY = "ConnectionFactory";
-   /** The default QueueFactory jndi name */
-   static String QUEUE_FACTORY = "ConnectionFactory";
-
-   static String TEST_QUEUE = "queue/testQueue";
-   static String TEST_TOPIC = "topic/testTopic";
-   static String TEST_DURABLE_TOPIC = "topic/testDurableTopic";
-
-   //JMSProviderAdapter providerAdapter;
-   static Context context;
-   static QueueConnection queueConnection;
-   static TopicConnection topicConnection;
-
-   public JBossJMSUnitTest(String name) throws Exception
-   {
-      super(name);
-   }
-
-   // Emptys out all the messages in a queue
-   protected void drainQueue() throws Exception
-   {
-      QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
-      Queue queue = (Queue) context.lookup(TEST_QUEUE);
-
-      QueueReceiver receiver = session.createReceiver(queue);
-      Message message = receiver.receive(50);
-      int c = 0;
-      while (message != null)
-      {
-         message = receiver.receive(50);
-         c++;
-      }
-
-      if (c != 0)
-         getLog().debug("  Drained " + c + " messages from the queue");
-
-      session.close();
-   }
-
-   protected void connect() throws Exception
-   {
-
-      if (context == null)
-      {
-
-         context = new InitialContext();
-
-      }
-      QueueConnectionFactory queueFactory = (QueueConnectionFactory) context.lookup(QUEUE_FACTORY);
-      queueConnection = queueFactory.createQueueConnection();
-
-      TopicConnectionFactory topicFactory = (TopicConnectionFactory) context.lookup(TOPIC_FACTORY);
-      topicConnection = topicFactory.createTopicConnection();
-
-      getLog().debug("Connection to spyderMQ established.");
-
-   }
-
-   protected void disconnect() throws Exception
-   {
-	  if (queueConnection != null)
-	  {
-	      queueConnection.close();
-	      queueConnection = null;
-	  }
-	  
-	  if (topicConnection != null)
-	  {
-	      topicConnection.close();
-	      topicConnection = null;
-	  }
-   }
-   
-   protected void tearDown() throws Exception
-   {
-	   super.tearDown();
-	   disconnect();
-   }
-
-   /**
-    * Test that messages are ordered by message arrival and priority.
-    * This also tests :
-    * 		Using a non-transacted AUTO_ACKNOWLEDGE session
-    *		Using a QueueReceiver
-    *		Using a QueueSender
-    *			Sending PERSITENT and NON_PERSISTENT text messages.
-    *		Using a QueueBrowser
-    */
-   public void testQueueMessageOrder() throws Exception
-   {
-
-      getLog().debug("Starting QueueMessageOrder test");
-
-      connect();
-
-      queueConnection.start();
-
-      drainQueue();
-
-      QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
-      Queue queue = (Queue) context.lookup(TEST_QUEUE);
-      QueueSender sender = session.createSender(queue);
-
-      TextMessage message = session.createTextMessage();
-      message.setText("Normal message");
-      sender.send(message, DeliveryMode.NON_PERSISTENT, 4, 0);
-      //sender.send(queue, message, DeliveryMode.NON_PERSISTENT, 4, 0);
-      message.setText("Persistent message");
-      sender.send(message, DeliveryMode.PERSISTENT, 4, 0);
-      //sender.send(queue, message, DeliveryMode.PERSISTENT, 4, 0);
-      message.setText("High Priority Persistent message");
-      sender.send(message, DeliveryMode.PERSISTENT, 10, 0);
-      //sender.send(queue, message, DeliveryMode.PERSISTENT, 10, 0);
-
-      //message.setText("Expiring Persistent message");
-      //sender.send(queue, message, DeliveryMode.NON_PERSISTENT, 4, 1);
-
-      QueueBrowser browser = session.createBrowser(queue);
-      Enumeration i = browser.getEnumeration();
-      //message = (TextMessage)enum.nextElement();
-      //if( !message.getText().equals("High Priority Persistent message") )
-      //	throw new Exception("Queue is not prioritizing messages correctly. Unexpected Message:"+message);
-      getLog().debug(message.getText());
-
-      message = (TextMessage) i.nextElement();
-      //if( !message.getText().equals("Normal message") )
-      //	throw new Exception("Queue is not ordering messages correctly. Unexpected Message:"+message);
-      getLog().debug(message.getText());
-
-      message = (TextMessage) i.nextElement();
-      //if( !message.getText().equals("Persistent message") )
-      //	throw new Exception("Queue is not ordering messages correctly. Unexpected Message:"+message);
-      getLog().debug(message.getText());
-
-      // if( enum.hasMoreElements() )
-      //	throw new Exception("Queue does not expire messages correctly. Unexpected Message:"+enum.nextElement());
-
-      disconnect();
-      getLog().debug("QueueMessageOrder passed");
-   }
-
-   /**
-    * Test that a using QueueRequestor works.
-    * this also tests that :
-    *		temporary queues work.
-    */
-   public void testRequestReplyQueue() throws Exception
-   {
-
-      getLog().debug("Starting RequestReplyQueue test");
-      connect();
-
-      {
-         queueConnection.start();
-         drainQueue();
-      }
-
-      Thread serverThread = new Thread()
-      {
-         public void run()
-         {
-            Logger log = Logger.getLogger(getClass().getName());
-            try
-            {
-               log.debug("Server Thread Started");
-               QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
-               Queue queue = (Queue) context.lookup(TEST_QUEUE);
-
-               QueueReceiver queueReceiver = session.createReceiver(queue);
-
-               boolean done = false;
-               while (!done)
-               {
-                  TextMessage message = (TextMessage) queueReceiver.receive();
-                  Queue tempQueue = (Queue) message.getJMSReplyTo();
-
-                  QueueSender replySender = session.createSender(tempQueue);
-                  TextMessage reply = session.createTextMessage();
-                  reply.setText("Request Processed");
-                  reply.setJMSCorrelationID(message.getJMSMessageID());
-                  replySender.send(reply);
-
-                  if (message.getText().equals("Quit"))
-                     done = true;
-               }
-
-               session.close();
-               log.debug("Server Thread Finished");
-
-            }
-            catch (Exception e)
-            {
-               log.error("Error", e);
-            }
-         }
-      };
-
-      serverThread.start();
-
-      QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
-      Queue queue = (Queue) context.lookup(TEST_QUEUE);
-
-      QueueRequestor queueRequestor = new QueueRequestor(session, queue);
-      TextMessage message = session.createTextMessage();
-      message.setText("Request Test");
-
-      for (int i = 0; i < 5; i++)
-      {
-
-         getLog().debug("Making client request #" + i);
-         TextMessage reply = (TextMessage) queueRequestor.request(message);
-         String replyID = new String(reply.getJMSCorrelationID());
-         if (!replyID.equals(message.getJMSMessageID()))
-            throw new Exception("REQUEST: ERROR: Reply does not match sent message");
-
-      }
-
-      getLog().debug("Making client request to shut server down.");
-      message.setText("Quit");
-      queueRequestor.request(message);
-
-      serverThread.join();
-      disconnect();
-
-      getLog().debug("RequestReplyQueue passed");
-   }
-
-   /**
-    * Test that temporary queues can be deleted.
-    */
-   public void testTemporaryQueueDelete() throws Exception
-   {
-
-      getLog().debug("Starting TemporaryQueueDelete test");
-      connect();
-
-      QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
-      TemporaryQueue queue = session.createTemporaryQueue();
-
-      queue.delete();
-
-      disconnect();
-
-      getLog().debug("TemporaryQueueDelete passed");
-   }
-
-   /**
-    * Test that temporary topics can be deleted.
-    */
-   public void testTemporaryTopicDelete() throws Exception
-   {
-
-      getLog().debug("Starting TemporaryTopicDelete test");
-      connect();
-
-      TopicSession session = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
-      TemporaryTopic topic = session.createTemporaryTopic();
-
-      topic.delete();
-
-      disconnect();
-
-      getLog().debug("TemporaryTopicDelete passed");
-   }
-
-   /**
-    * Test invalid destination trying to send a message.
-    */
-   public void testInvalidDestinationQueueSend() throws Exception
-   {
-
-      getLog().debug("Starting InvaidDestinationQueueSend test");
-      connect();
-
-      QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
-      TemporaryQueue queue = session.createTemporaryQueue();
-      QueueSender sender = session.createSender(queue);
-      queue.delete();
-
-      TextMessage message = session.createTextMessage("hello");
-      boolean caught = false;
-      try
-      {
-         sender.send(message);
-      }
-      catch (InvalidDestinationException expected)
-      {
-         caught = true;
-      }
-
-      disconnect();
-
-      assertTrue("Expected an InvalidDestinationException", caught);
-
-      getLog().debug("InvaldDestinationQueueSend passed");
-   }
-
-   /**
-    * Test invalid destination trying to browse a message.
-    */
-   public void testInvalidDestinationQueueBrowse() throws Exception
-   {
-
-      getLog().debug("Starting InvalidDestinationQueueBrowse test");
-      connect();
-
-      QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
-      TemporaryQueue queue = session.createTemporaryQueue();
-      QueueBrowser browser = session.createBrowser(queue);
-      queue.delete();
-
-      boolean caught = false;
-      try
-      {
-         browser.getEnumeration();
-      }
-      catch (InvalidDestinationException expected)
-      {
-         caught = true;
-      }
-
-      disconnect();
-
-      assertTrue("Expected an InvalidDestinationException", caught);
-
-      getLog().debug("InvalidDestinationQueueBrowse passed");
-   }
-
-   /**
-    * Test invalid destination trying to send a message.
-    */
-   public void testInvalidDestinationTopicPublish() throws Exception
-   {
-
-      getLog().debug("Starting InvaidDestinationTopicPublish test");
-      connect();
-
-      TopicSession session = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
-      TemporaryTopic topic = session.createTemporaryTopic();
-      TopicPublisher publisher = session.createPublisher(topic);
-      topic.delete();
-
-      TextMessage message = session.createTextMessage("hello");
-      boolean caught = false;
-      try
-      {
-         publisher.publish(message);
-      }
-      catch (InvalidDestinationException expected)
-      {
-         caught = true;
-      }
-
-      disconnect();
-
-      assertTrue("Expected an InvalidDestinationException", caught);
-
-      getLog().debug("InvaldDestinationTopicPublish passed");
-   }
-
-   /**
-    * Test errors trying on topic subscribe.
-    */
-   public void testErrorsTopicSubscribe() throws Exception
-   {
-
-      getLog().debug("Starting InvalidDestinationTopicSubscribe test");
-      connect();
-
-      try
-      {
-         TopicSession session = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
-         Topic topic = (Topic) context.lookup(TEST_TOPIC);
-         TemporaryTopic temp = session.createTemporaryTopic();
-
-         boolean caught = false;
-         try
-         {
-            session.createSubscriber(null);
-         }
-         catch (InvalidDestinationException expected)
-         {
-            caught = true;
-         }
-         assertTrue("Expected an InvalidDestinationException for a null topic", caught);
-
-         caught = false;
-         try
-         {
-            session.createSubscriber(null, null, true);
-         }
-         catch (InvalidDestinationException expected)
-         {
-            caught = true;
-         }
-         assertTrue("Expected an InvalidDestinationException for a null topic", caught);
-
-         caught = false;
-         try
-         {
-            session.createDurableSubscriber(null, "NotUsed");
-         }
-         catch (InvalidDestinationException expected)
-         {
-            caught = true;
-         }
-         assertTrue("Expected an InvalidDestinationException for a null topic", caught);
-
-         caught = false;
-         try
-         {
-            session.createDurableSubscriber(temp, "NotUsed");
-         }
-         catch (InvalidDestinationException expected)
-         {
-            caught = true;
-         }
-         assertTrue("Expected an InvalidDestinationException for a temporary topic", caught);
-
-         caught = false;
-         try
-         {
-            session.createDurableSubscriber(null, "NotUsed", null, true);
-         }
-         catch (InvalidDestinationException expected)
-         {
-            caught = true;
-         }
-         assertTrue("Expected an InvalidDestinationException for a null topic", caught);
-
-         caught = false;
-         try
-         {
-            session.createDurableSubscriber(temp, "NotUsed", null, true);
-         }
-         catch (InvalidDestinationException expected)
-         {
-            caught = true;
-         }
-         assertTrue("Expected an InvalidDestinationException for a temporary topic", caught);
-
-         caught = false;
-         try
-         {
-            session.createDurableSubscriber(topic, null);
-         }
-         catch (Exception expected)
-         {
-            caught = true;
-         }
-         assertTrue("Expected a Exception for a null subscription", caught);
-
-         caught = false;
-         try
-         {
-            session.createDurableSubscriber(topic, null, null, false);
-         }
-         catch (Exception expected)
-         {
-            caught = true;
-         }
-         assertTrue("Expected a Exception for a null subscription", caught);
-
-         caught = false;
-         try
-         {
-            session.createDurableSubscriber(topic, "  ");
-         }
-         catch (Exception expected)
-         {
-            caught = true;
-         }
-         assertTrue("Expected a Exception for an empty subscription", caught);
-
-         caught = false;
-         try
-         {
-            session.createDurableSubscriber(topic, "  ", null, false);
-         }
-         catch (Exception expected)
-         {
-            caught = true;
-         }
-         assertTrue("Expected a Exception for an empty subscription", caught);
-      }
-      finally
-      {
-         disconnect();
-      }
-
-      getLog().debug("InvalidDestinationTopicSubscriber passed");
-   }
-
-   /**
-    * Test create queue.
-    */
-   public void testCreateQueue() throws Exception
-   {
-
-      getLog().debug("Starting create queue test");
-      connect();
-
-      QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
-
-      Queue jndiQueue = (Queue) getInitialContext().lookup("queue/testQueue");
-      Queue createQueue = session.createQueue(jndiQueue.getQueueName());
-      assertTrue("Failed for " + QUEUE_FACTORY, jndiQueue.equals(createQueue));
-
-      getLog().debug("InvalidDestinationTopicSubscriber passed");
-   }
-
-   public void testMessageListener() throws Exception
-   {
-      getLog().debug("Starting create queue test");
-
-      connect();
-      queueConnection.start();
-      drainQueue();
-      final CountDown counter1 = new CountDown(3);
-
-      QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
-      Queue queue = (Queue) context.lookup(TEST_QUEUE);
-
-      QueueReceiver receiver = session.createReceiver(queue);
-      receiver.setMessageListener(new MessageListener()
-      {
-         public void onMessage(Message msg)
-         {
-            Logger log = Logger.getLogger(getClass().getName());
-            log.debug("ML");
-            try
-            {
-               if (msg instanceof TextMessage)
-               {
-                  log.debug(((TextMessage) msg).getText());
-                  counter1.release();
-               }
-            }
-            catch (Exception e)
-            {
-            }
-         }
-      });
-
-      QueueSender sender = session.createSender(queue);
-
-      TextMessage message = session.createTextMessage();
-      message.setText("Normal message");
-      sender.send(message, DeliveryMode.NON_PERSISTENT, 4, 0);
-      //sender.send(queue, message, DeliveryMode.NON_PERSISTENT, 4, 0);
-      message.setText("Persistent message");
-      sender.send(message, DeliveryMode.PERSISTENT, 4, 0);
-      //sender.send(queue, message, DeliveryMode.PERSISTENT, 4, 0);
-      message.setText("High Priority Persistent message");
-      sender.send(message, DeliveryMode.PERSISTENT, 10, 0);
-      //sender.send(queue, message, DeliveryMode.PERSISTENT, 10, 0);
-
-      // Wait for the msgs to be received
-      counter1.acquire();
-      log.debug("MessageListener1 received the TMs sent");
-
-      final CountDown counter2 = new CountDown(2);
-      receiver.setMessageListener(new MessageListener()
-      {
-         public void onMessage(Message msg)
-         {
-            Logger log = Logger.getLogger(getClass().getName());
-            log.debug("ML 2");
-            try
-            {
-               if (msg instanceof TextMessage)
-               {
-                  log.debug(((TextMessage) msg).getText());
-                  counter2.release();
-               }
-            }
-            catch (Exception e)
-            {
-            }
-         }
-      });
-
-      message.setText("Persistent message");
-      sender.send(message, DeliveryMode.PERSISTENT, 4, 0);
-      //sender.send(queue, message, DeliveryMode.PERSISTENT, 4, 0);
-      message.setText("High Priority Persistent message");
-      sender.send(message, DeliveryMode.PERSISTENT, 10, 0);
-      //sender.send(queue, message, DeliveryMode.PERSISTENT, 10, 0);
-
-      // Wait for the msgs to be received
-      counter2.acquire();
-      log.debug("MessageListener2 received the TMs sent");
-
-      receiver.setMessageListener(null);
-
-      message.setText("Persistent message");
-      sender.send(message, DeliveryMode.PERSISTENT, 4, 0);
-      //sender.send(queue, message, DeliveryMode.PERSISTENT, 4, 0);
-      message.setText("High Priority Persistent message");
-      sender.send(message, DeliveryMode.PERSISTENT, 10, 0);
-      //sender.send(queue, message, DeliveryMode.PERSISTENT, 10, 0);
-
-      sender.close();
-      drainQueue();
-      disconnect();
-      getLog().debug("MessageListener test passed");
-   }
-
-   public void testApplicationServerStuff() throws Exception
-   {
-      getLog().debug("Starting testing app server stuff");
-      connect();
-
-      Queue testQueue = (Queue) context.lookup(TEST_QUEUE);
-      final QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
-
-      session.setMessageListener(new MessageListener()
-      {
-         public void onMessage(Message mess)
-         {
-            Logger log = Logger.getLogger(getClass().getName());
-            log.debug("Processing message");
-            try
-            {
-               if (mess instanceof TextMessage)
-                  log.debug(((TextMessage) mess).getText());
-            }
-            catch (Exception e)
-            {
-               log.error("Error", e);
-            }
-         }
-      });
-
-      QueueSender sender = session.createSender(testQueue);
-      sender.send(session.createTextMessage("Hi"));
-      sender.send(session.createTextMessage("There"));
-      sender.send(session.createTextMessage("Guys"));
-      queueConnection.createConnectionConsumer(testQueue, null, new ServerSessionPool()
-      {
-         public ServerSession getServerSession()
-         {
-            Logger.getLogger(getClass().getName()).debug("Getting server session.");
-            return new ServerSession()
-            {
-               public Session getSession()
-               {
-                  return session;
-               }
-               public void start()
-               {
-                  Logger.getLogger(getClass().getName()).debug("Starting server session.");
-                  session.run();
-               }
-            };
-         }
-      }, 10);
-
-      queueConnection.start();
-
-      try
-      {
-         Thread.sleep(5 * 1000);
-      }
-      catch (Exception e)
-      {
-      }
-
-      disconnect();
-      getLog().debug("Testing app server stuff passed");
-   }
-
-   //simply put a few messages on the test queue for next time.
-   /*   public void testPM() throws Exception
-      {
-         getLog().debug("Starting testing pm");
-         connect();
-         
-         Queue testQueue = (Queue)context.lookup(TEST_QUEUE);
-         QueueSession session = queueConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
-         QueueSender sender = session.createSender(testQueue);
-         sender.send(session.createTextMessage("From last time"));
-         sender.send(session.createTextMessage("From last time"));
-         sender.send(session.createTextMessage("From last time"));
-         sender.close();
-         session.close();
-         disconnect();
-         getLog().debug("Testing pm stuff passed");
-      }
-   */
-   private void drainMessagesForTopic(TopicSubscriber sub) throws JMSException
-   {
-      Message msg = sub.receive(50);
-      int c = 0;
-      while (msg != null)
-      {
-         c++;
-         if (msg instanceof TextMessage)
-            getLog().debug(((TextMessage) msg).getText());
-         msg = sub.receive(50);
-      }
-      getLog().debug("Received " + c + " messages from topic.");
-   }
-
-   public void testTopics() throws Exception
-   {
-      getLog().debug("Starting Topic test");
-      connect();
-
-      TopicConnectionFactory topicFactory = (TopicConnectionFactory) context.lookup(TOPIC_FACTORY);
-      topicConnection = topicFactory.createTopicConnection("john", "needle");
-
-      topicConnection.start();
-
-      //set up some subscribers to the topic
-      TopicSession session = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
-      Topic topic = (Topic) context.lookup(TEST_TOPIC);
-
-      TopicSubscriber sub1 = session.createDurableSubscriber(topic, "sub1");
-      TopicSubscriber sub2 = session.createSubscriber(topic);
-      TopicSubscriber sub3 = session.createSubscriber(topic);
-
-      //Now a sender
-      TopicPublisher sender = session.createPublisher(topic);
-
-      //send some messages
-      sender.publish(session.createTextMessage("Message 1"));
-      sender.publish(session.createTextMessage("Message 2"));
-      sender.publish(session.createTextMessage("Message 3"));
-      drainMessagesForTopic(sub1);
-      drainMessagesForTopic(sub2);
-      drainMessagesForTopic(sub3);
-
-      //close some subscribers
-      sub1.close();
-      sub2.close();
-
-      //send some more messages
-      sender.publish(session.createTextMessage("Message 4"));
-      sender.publish(session.createTextMessage("Message 5"));
-      sender.publish(session.createTextMessage("Message 6"));
-
-      //give time for message 4 to be negatively acked (as it will be cause last receive timed out)
-      try
-      {
-         Thread.sleep(5 * 1000);
-      }
-      catch (InterruptedException e)
-      {
-      }
-
-      drainMessagesForTopic(sub3);
-
-      //open subscribers again.
-      sub1 = session.createDurableSubscriber(topic, "sub1");
-      sub2 = session.createSubscriber(topic);
-
-      //Send a final message
-      sender.publish(session.createTextMessage("Final message"));
-      sender.close();
-
-      drainMessagesForTopic(sub1);
-      drainMessagesForTopic(sub2);
-      drainMessagesForTopic(sub3);
-
-      sub1.close();
-      sub2.close();
-      sub3.close();
-
-      session.unsubscribe("sub1");
-
-      topicConnection.stop();
-      topicConnection.close();
-
-      disconnect();
-      getLog().debug("Topic test passed");
-   }
-
-   /**
-    * Test to seeif the NoLocal feature of topics works.
-    * Messages published from the same connection should not
-    * be received by Subscribers on the same connection.
-    */
-   public void testTopicNoLocal() throws Exception
-   {
-      getLog().debug("Starting TopicNoLocal test");
-      connect();
-
-      TopicConnectionFactory topicFactory = (TopicConnectionFactory) context.lookup(TOPIC_FACTORY);
-      TopicConnection topicConnection1 = topicFactory.createTopicConnection();
-      topicConnection1.start();
-      TopicConnection topicConnection2 = topicFactory.createTopicConnection();
-      topicConnection2.start();
-
-      // We don't want local messages on this topic.
-      TopicSession session1 = topicConnection1.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
-      Topic topic = (Topic) context.lookup(TEST_TOPIC);
-      TopicSubscriber subscriber1 = session1.createSubscriber(topic, null, true);
-      TopicPublisher sender1 = session1.createPublisher(topic);
-
-      //Now a sender
-      TopicSession session2 = topicConnection2.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
-      TopicPublisher sender2 = session2.createPublisher(topic);
-
-      drainMessagesForTopic(subscriber1);
-
-      //send some messages
-      sender1.publish(session1.createTextMessage("Local Message"));
-      sender2.publish(session2.createTextMessage("Remote Message"));
-
-      // Get the messages, we should get the remote message
-      // but not the local message
-      TextMessage msg1 = (TextMessage) subscriber1.receive(2000);
-      if (msg1 == null)
-      {
-         fail("Did not get any messages");
-      }
-      else
-      {
-         getLog().debug("Got message: " + msg1);
-         if (msg1.getText().equals("Local Message"))
-         {
-            fail("Got a local message");
-         }
-         TextMessage msg2 = (TextMessage) subscriber1.receive(2000);
-         if (msg2 != null)
-         {
-            getLog().debug("Got message: " + msg2);
-            fail("Got an extra message.  msg1:" + msg1 + ", msg2:" + msg2);
-         }
-      }
-
-      topicConnection1.stop();
-      topicConnection1.close();
-      topicConnection2.stop();
-      topicConnection2.close();
-
-      disconnect();
-      getLog().debug("TopicNoLocal test passed");
-   }
-
-   /**
-    * Test to see whether no local works if a message
-    * was created somewhere else.
-    */
-   public void testTopicNoLocalBounce() throws Exception
-   {
-      getLog().debug("Starting TopicNoLocalBounce test");
-      connect();
-
-      TopicConnectionFactory topicFactory = (TopicConnectionFactory) context.lookup(TOPIC_FACTORY);
-      TopicConnection topicConnection1 = topicFactory.createTopicConnection();
-      topicConnection1.start();
-      TopicConnection topicConnection2 = topicFactory.createTopicConnection();
-      topicConnection2.start();
-
-      // Session 1
-      TopicSession session1 = topicConnection1.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
-      Topic topic = (Topic) context.lookup(TEST_TOPIC);
-      TopicSubscriber subscriber1 = session1.createSubscriber(topic, null, true);
-      TopicPublisher sender1 = session1.createPublisher(topic);
-
-      // Session 2
-      TopicSession session2 = topicConnection2.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
-      TopicSubscriber subscriber2 = session2.createSubscriber(topic, null, true);
-      TopicPublisher sender2 = session2.createPublisher(topic);
-
-      drainMessagesForTopic(subscriber1);
-      drainMessagesForTopic(subscriber2);
-
-      //send the message
-      sender1.publish(session1.createTextMessage("Message"));
-
-      assertTrue("Subscriber1 should not get a message", subscriber1.receiveNoWait() == null);
-      TextMessage msg = (TextMessage) subscriber2.receive(2000);
-      assertTrue("Subscriber2 should get a message, got " + msg, msg != null && msg.getText().equals("Message"));
-
-      //send it back
-      sender2.publish(msg);
-
-      msg = (TextMessage) subscriber1.receive(2000);
-      assertTrue("Subscriber1 should get a message, got " + msg, msg != null && msg.getText().equals("Message"));
-      assertTrue("Subscriber2 should not get a message", subscriber2.receiveNoWait() == null);
-
-      topicConnection1.stop();
-      topicConnection1.close();
-      topicConnection2.stop();
-      topicConnection2.close();
-
-      disconnect();
-      getLog().debug("TopicNoLocalBounce test passed");
-   }
-
-   /**
-    * Test subscribing to a topic with one selector, then changing to another
-    */
-   public void testTopicSelectorChange() throws Exception
-   {
-      getLog().debug("Starting TopicSelectorChange test");
-
-      getLog().debug("Create topic connection");
-      TopicConnectionFactory topicFactory = (TopicConnectionFactory) context.lookup(TOPIC_FACTORY);
-      topicConnection = topicFactory.createTopicConnection("john", "needle");
-      topicConnection.start();
-
-      try
-      {
-         getLog().debug("Retrieving Topic");
-         Topic topic = (Topic) context.lookup(TEST_DURABLE_TOPIC);
-
-         getLog().debug("Creating a send session");
-         TopicSession sendSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
-         TopicPublisher sender = sendSession.createPublisher(topic);
-
-         getLog().debug("Clearing the topic");
-         TopicSession subSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
-         TopicSubscriber subscriber = subSession.createDurableSubscriber(topic, "test");
-         Message message = subscriber.receive(50);
-         while (message != null)
-            message = subscriber.receive(50);
-         subSession.close();
-
-         getLog().debug("Subscribing to topic, looking for Value = 'A'");
-         subSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
-         subscriber = subSession.createDurableSubscriber(topic, "test", "Value = 'A'", false);
-
-         getLog().debug("Send some messages");
-         message = sendSession.createTextMessage("Message1");
-         message.setStringProperty("Value", "A");
-         sender.publish(message);
-         message = sendSession.createTextMessage("Message2");
-         message.setStringProperty("Value", "A");
-         sender.publish(message);
-         message = sendSession.createTextMessage("Message3");
-         message.setStringProperty("Value", "B");
-         sender.publish(message);
-
-         getLog().debug("Retrieving the A messages");
-         message = subscriber.receive(2000);
-         assertTrue("Expected message 1", message != null);
-         assertTrue("Should get an A", message.getStringProperty("Value").equals("A"));
-         message = subscriber.receive(2000);
-         assertTrue("Expected message 2", message != null);
-         assertTrue("Should get a second A", message.getStringProperty("Value").equals("A"));
-         assertTrue("That should be it for A", subscriber.receive(2000) == null);
-
-         getLog().debug("Closing the subscriber without acknowledgement");
-         subSession.close();
-
-         getLog().debug("Subscribing to topic, looking for Value = 'B'");
-         subSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
-         subscriber = subSession.createDurableSubscriber(topic, "test", "Value = 'B'", false);
-
-         getLog().debug("Retrieving the non-existent B messages");
-         assertTrue("B should not be there", subscriber.receive(2000) == null);
-
-         getLog().debug("Closing the subscriber.");
-         subSession.close();
-
-         getLog().debug("Subscribing to topic, looking for those Value = 'A'");
-         subSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
-         subscriber = subSession.createDurableSubscriber(topic, "test", "Value = 'A'", false);
-         assertTrue("Should not be any A the subscription was changed", subscriber.receive(2000) == null);
-         subSession.close();
-
-         getLog().debug("Subscribing to topic, looking for everything");
-         subSession = topicConnection.createTopicSession(false, Session.CLIENT_ACKNOWLEDGE);
-         subscriber = subSession.createDurableSubscriber(topic, "test", null, false);
-
-         message = sendSession.createTextMessage("Message4");
-         message.setStringProperty("Value", "A");
-         sender.publish(message);
-
-         message = subscriber.receive(2000);
-         assertTrue("Expected message 4", message != null);
-         assertTrue("Should be an A which we don't acknowledge", message.getStringProperty("Value").equals("A"));
-         subSession.close();
-
-         getLog().debug("Subscribing to topic, looking for the Value = 'A'");
-         subSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
-         subscriber = subSession.createDurableSubscriber(topic, "test", "Value = 'A'", false);
-         assertTrue(
-            "Should not be any A, the subscription was changed. Even though the old and new selectors match the message",
-            subscriber.receive(2000) == null);
-         subSession.close();
-
-         getLog().debug("Closing the send session");
-         sendSession.close();
-
-         getLog().debug("Removing the subscription");
-         subSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
-         subSession.unsubscribe("test");
-
-      }
-      finally
-      {
-         getLog().debug("Closing the connection");
-         topicConnection.close();
-      }
-
-      getLog().debug("TopicSelectorChange test passed");
-   }
-
-   /**
-    * Test subscribing to a topic with a null and empty selector
-    */
-   public void testTopicSelectorNullOrEmpty() throws Exception
-   {
-      getLog().debug("Starting TopicSelectorNullOrEmpty test");
-
-      getLog().debug("Create topic connection");
-      TopicConnectionFactory topicFactory = (TopicConnectionFactory) context.lookup(TOPIC_FACTORY);
-      topicConnection = topicFactory.createTopicConnection("john", "needle");
-      topicConnection.start();
-
-      try
-      {
-         getLog().debug("Retrieving Topic");
-         Topic topic = (Topic) context.lookup(TEST_DURABLE_TOPIC);
-
-         getLog().debug("Creating a send session");
-         TopicSession sendSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
-         TopicPublisher sender = sendSession.createPublisher(topic);
-
-         getLog().debug("Clearing the topic");
-         TopicSession subSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
-         TopicSubscriber subscriber = subSession.createDurableSubscriber(topic, "test");
-         TextMessage message = (TextMessage) subscriber.receive(50);
-         while (message != null)
-            message = (TextMessage) subscriber.receive(50);
-         subSession.close();
-
-         getLog().debug("Subscribing to topic, with null selector");
-         subSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
-         subscriber = subSession.createDurableSubscriber(topic, "test", null, false);
-
-         getLog().debug("Send a message");
-         message = sendSession.createTextMessage("Message1");
-         sender.publish(message);
-
-         getLog().debug("Retrieving the message");
-         message = (TextMessage) subscriber.receive(2000);
-         assertTrue("Expected message 1", message != null);
-         assertTrue("Should get Message1", message.getText().equals("Message1"));
-         getLog().debug("Closing the subscriber");
-         subSession.close();
-
-         getLog().debug("Subscribing to topic, with an empty selector");
-         subSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
-         subscriber = subSession.createDurableSubscriber(topic, "test", "   ", false);
-
-         getLog().debug("Send a message");
-         message = sendSession.createTextMessage("Message2");
-         sender.publish(message);
-
-         getLog().debug("Retrieving the message");
-         message = (TextMessage) subscriber.receive(2000);
-         assertTrue("Expected message 2", message != null);
-         assertTrue("Should get Message2", message.getText().equals("Message2"));
-         getLog().debug("Closing the subscriber");
-
-         getLog().debug("Removing the subscription");
-         subSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
-         subSession.unsubscribe("test");
-         subSession.close();
-
-      }
-      finally
-      {
-         getLog().debug("Closing the connection");
-         topicConnection.close();
-      }
-
-      getLog().debug("TopicSelectorNullOrEmpty test passed");
-   }
-
-   /**
-    * Test sending/receiving an outdated message
-    */
-   public void testSendReceiveOutdated() throws Exception
-   {
-      getLog().debug("Starting SendReceiveOutdated test");
-
-      connect();
-      try
-      {
-         queueConnection.start();
-         drainQueue();
-         queueConnection.stop();
-
-         QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
-         Queue queue = (Queue) context.lookup(TEST_QUEUE);
-         QueueSender sender = session.createSender(queue);
-         QueueReceiver receiver = session.createReceiver(queue);
-
-         // Send a message that has expired
-         TextMessage message = session.createTextMessage("Outdated");
-         sender.send(message, DeliveryMode.PERSISTENT, 4, 1);
-         Thread.sleep(100);
-
-         // Send a message that has not expired
-         message = session.createTextMessage("OK");
-         sender.send(message);
-
-         // Try to receive the message the not expired message
-         queueConnection.start();
-         message = (TextMessage) receiver.receiveNoWait();
-         assertEquals("OK", message.getText());
-
-         // Should be no more
-         assertTrue("Didn't expect anymore messages", receiver.receiveNoWait() == null);
-      }
-      finally
-      {
-         disconnect();
-      }
-
-      getLog().debug("SendReceiveOutdated test passed");
-   }
-
-   public void testSendReceiveExpired() throws Exception
-   {
-      getLog().debug("Starting testSendReceiveExpired test");
-
-      connect();
-      try
-      {
-         queueConnection.start();
-         drainQueue();
-
-         QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
-         Queue queue = (Queue) context.lookup(TEST_QUEUE);
-         QueueSender sender = session.createSender(queue);
-         QueueReceiver receiver = session.createReceiver(queue);
-
-         // Send a message that expires in 5 seconds
-         TextMessage message = session.createTextMessage("5 Second Expiration");
-         sender.send(message, DeliveryMode.PERSISTENT, 4, 5*1000);
-         // Send a message that has not expired
-         message = session.createTextMessage("OK");
-         sender.send(message);
-         // Sleep 6 seconds
-         Thread.sleep(6*1000);
-         // Try to receive the OK message
-         message = (TextMessage) receiver.receiveNoWait();
-         assertEquals("OK", message.getText());
-
-         // Should be no more
-         assertTrue("Didn't expect anymore messages", receiver.receiveNoWait() == null);
-
-         // Send a message that expires in 10 seconds
-         message = session.createTextMessage("10 Second Expiration");
-         sender.send(message, DeliveryMode.PERSISTENT, 4, 10*1000);
-         // Send a message that has not expired
-         message = session.createTextMessage("OK");
-         sender.send(message);
-         // Sleep 1 seconds
-         Thread.sleep(1*1000);
-         // Try to receive the messages
-         message = (TextMessage) receiver.receiveNoWait();
-         assertEquals("10 Second Expiration", message.getText());
-         message = (TextMessage) receiver.receiveNoWait();
-         assertEquals("OK", message.getText());
-
-         // Should be no more
-         assertTrue("Didn't expect anymore messages", receiver.receiveNoWait() == null);
-         
-         // Test that JMSExpiration has no affect
-         message = session.createTextMessage("5 Second Expiration");
-         message.setJMSExpiration(System.currentTimeMillis() + 5*1000);
-         sender.send(message, DeliveryMode.PERSISTENT, 4, 0);
-         // Send a message that has not expired
-         message = session.createTextMessage("OK");
-         sender.send(message);
-         // Sleep 6 seconds
-         Thread.sleep(6*1000);
-         // Try to receive the OK message
-         message = (TextMessage) receiver.receiveNoWait();
-         assertEquals("5 Second Expiration", message.getText());
-         message = (TextMessage) receiver.receiveNoWait();
-         assertEquals("OK", message.getText());
-         assertTrue("Didn't expect anymore messages", receiver.receiveNoWait() == null);
-      }
-      finally
-      {
-         disconnect();
-      }
-   }
-
-   class Synch
-   {
-      boolean waiting = false;
-      String text;
-      public synchronized void doWait(long timeout) throws InterruptedException
-      {
-         waiting = true;
-         this.wait(timeout);
-      }
-      public synchronized void doNotify() throws InterruptedException
-      {
-         while (waiting == false)
-            wait(100);
-         this.notifyAll();
-      }
-      public String getText()
-      {
-         return text;
-      }
-      public void setText(String text)
-      {
-         this.text = text;
-      }
-   }
-
-   /**
-    * Test sending/listening an outdated message
-    */
-   public void testSendListenOutdated() throws Exception
-   {
-      getLog().debug("Starting SendListenOutdated test");
-
-      connect();
-      try
-      {
-         queueConnection.start();
-         drainQueue();
-         queueConnection.stop();
-
-         QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
-         Queue queue = (Queue) context.lookup(TEST_QUEUE);
-         QueueSender sender = session.createSender(queue);
-         QueueReceiver receiver = session.createReceiver(queue);
-
-         // Send a message that has expired
-         TextMessage message = session.createTextMessage("Outdated");
-         sender.send(message, DeliveryMode.PERSISTENT, 4, 1);
-         Thread.sleep(100);
-
-         // Send a message that has not expired
-         message = session.createTextMessage("OK");
-         sender.send(message);
-
-         // Try to receive the message the not expired message
-         final Synch synch = new Synch();
-         MessageListener messagelistener = new MessageListener()
-         {
-            public void onMessage(Message message)
-            {
-               listenOutdated(message, synch);
-            }
-         };
-         receiver.setMessageListener(messagelistener);
-         queueConnection.start();
-
-         synch.doWait(10000);
-         assertEquals("OK", synch.getText());
-      }
-      finally
-      {
-         disconnect();
-      }
-
-      getLog().debug("SendListenOutdated test passed");
-   }
-
-   private void listenOutdated(Message message, Synch synch)
-   {
-      try
-      {
-         synch.setText(((TextMessage) message).getText());
-      }
-      catch (Throwable t)
-      {
-         log.error("Error:", t);
-      }
-      finally
-      {
-         try
-         {
-            synch.doNotify();
-         }
-         catch (Throwable t)
-         {
-            log.error("Error:", t);
-         }
-      }
-   }
-}

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossJMSUnitTestCase.java (from rev 66823, branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossJMSUnitTestCase.java)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossJMSUnitTestCase.java	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/test/JBossJMSUnitTestCase.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -0,0 +1,1317 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+package org.jboss.test.jbossmessaging.test;
+
+import java.util.Enumeration;
+
+import javax.jms.DeliveryMode;
+import javax.jms.InvalidDestinationException;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageListener;
+import javax.jms.Queue;
+import javax.jms.QueueBrowser;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueReceiver;
+import javax.jms.QueueRequestor;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.jms.ServerSession;
+import javax.jms.ServerSessionPool;
+import javax.jms.Session;
+import javax.jms.TemporaryQueue;
+import javax.jms.TemporaryTopic;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
+import javax.jms.TopicConnection;
+import javax.jms.TopicConnectionFactory;
+import javax.jms.TopicPublisher;
+import javax.jms.TopicSession;
+import javax.jms.TopicSubscriber;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+
+import org.jboss.logging.Logger;
+import org.jboss.test.jbossmessaging.JMSTestCase;
+
+import EDU.oswego.cs.dl.util.concurrent.CountDown;
+
+/**
+ * Basic jms tests.
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision: 64261 $
+ */
+public class JBossJMSUnitTestCase extends JMSTestCase
+{
+   /** The default TopicFactory jndi name */
+   static String TOPIC_FACTORY = "ConnectionFactory";
+   /** The default QueueFactory jndi name */
+   static String QUEUE_FACTORY = "ConnectionFactory";
+
+   static String TEST_QUEUE = "queue/testQueue";
+   static String TEST_TOPIC = "topic/testTopic";
+   static String TEST_DURABLE_TOPIC = "topic/testDurableTopic";
+
+   //JMSProviderAdapter providerAdapter;
+   static Context context;
+   static QueueConnection queueConnection;
+   static TopicConnection topicConnection;
+
+   public JBossJMSUnitTestCase(String name) throws Exception
+   {
+      super(name);
+   }
+
+   // Emptys out all the messages in a queue
+   protected void drainQueue() throws Exception
+   {
+      QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
+      Queue queue = (Queue) context.lookup(TEST_QUEUE);
+
+      QueueReceiver receiver = session.createReceiver(queue);
+      Message message = receiver.receive(50);
+      int c = 0;
+      while (message != null)
+      {
+         message = receiver.receive(50);
+         c++;
+      }
+
+      if (c != 0)
+         getLog().debug("  Drained " + c + " messages from the queue");
+
+      session.close();
+   }
+
+   protected void connect() throws Exception
+   {
+
+      if (context == null)
+      {
+
+         context = new InitialContext();
+
+      }
+      QueueConnectionFactory queueFactory = (QueueConnectionFactory) context.lookup(QUEUE_FACTORY);
+      queueConnection = queueFactory.createQueueConnection();
+
+      TopicConnectionFactory topicFactory = (TopicConnectionFactory) context.lookup(TOPIC_FACTORY);
+      topicConnection = topicFactory.createTopicConnection();
+
+      getLog().debug("Connection to spyderMQ established.");
+
+   }
+
+   protected void disconnect() throws Exception
+   {
+	  if (queueConnection != null)
+	  {
+	      queueConnection.close();
+	      queueConnection = null;
+	  }
+	  
+	  if (topicConnection != null)
+	  {
+	      topicConnection.close();
+	      topicConnection = null;
+	  }
+   }
+   
+   protected void tearDown() throws Exception
+   {
+	   super.tearDown();
+	   disconnect();
+   }
+
+   /**
+    * Test that messages are ordered by message arrival and priority.
+    * This also tests :
+    * 		Using a non-transacted AUTO_ACKNOWLEDGE session
+    *		Using a QueueReceiver
+    *		Using a QueueSender
+    *			Sending PERSITENT and NON_PERSISTENT text messages.
+    *		Using a QueueBrowser
+    */
+   public void testQueueMessageOrder() throws Exception
+   {
+
+      getLog().debug("Starting QueueMessageOrder test");
+
+      connect();
+
+      queueConnection.start();
+
+      drainQueue();
+
+      QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
+      Queue queue = (Queue) context.lookup(TEST_QUEUE);
+      QueueSender sender = session.createSender(queue);
+
+      TextMessage message = session.createTextMessage();
+      message.setText("Normal message");
+      sender.send(message, DeliveryMode.NON_PERSISTENT, 4, 0);
+      //sender.send(queue, message, DeliveryMode.NON_PERSISTENT, 4, 0);
+      message.setText("Persistent message");
+      sender.send(message, DeliveryMode.PERSISTENT, 4, 0);
+      //sender.send(queue, message, DeliveryMode.PERSISTENT, 4, 0);
+      message.setText("High Priority Persistent message");
+      sender.send(message, DeliveryMode.PERSISTENT, 9, 0);
+      //sender.send(queue, message, DeliveryMode.PERSISTENT, 10, 0);
+
+      //message.setText("Expiring Persistent message");
+      //sender.send(queue, message, DeliveryMode.NON_PERSISTENT, 4, 1);
+
+      QueueBrowser browser = session.createBrowser(queue);
+      Enumeration i = browser.getEnumeration();
+      //message = (TextMessage)enum.nextElement();
+      //if( !message.getText().equals("High Priority Persistent message") )
+      //	throw new Exception("Queue is not prioritizing messages correctly. Unexpected Message:"+message);
+      getLog().debug(message.getText());
+
+      message = (TextMessage) i.nextElement();
+      //if( !message.getText().equals("Normal message") )
+      //	throw new Exception("Queue is not ordering messages correctly. Unexpected Message:"+message);
+      getLog().debug(message.getText());
+
+      message = (TextMessage) i.nextElement();
+      //if( !message.getText().equals("Persistent message") )
+      //	throw new Exception("Queue is not ordering messages correctly. Unexpected Message:"+message);
+      getLog().debug(message.getText());
+
+      // if( enum.hasMoreElements() )
+      //	throw new Exception("Queue does not expire messages correctly. Unexpected Message:"+enum.nextElement());
+
+      disconnect();
+      getLog().debug("QueueMessageOrder passed");
+   }
+
+   /**
+    * Test that a using QueueRequestor works.
+    * this also tests that :
+    *		temporary queues work.
+    */
+   public void testRequestReplyQueue() throws Exception
+   {
+
+      getLog().debug("Starting RequestReplyQueue test");
+      connect();
+
+      {
+         queueConnection.start();
+         drainQueue();
+      }
+
+      Thread serverThread = new Thread()
+      {
+         public void run()
+         {
+            Logger log = Logger.getLogger(getClass().getName());
+            try
+            {
+               log.debug("Server Thread Started");
+               QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
+               Queue queue = (Queue) context.lookup(TEST_QUEUE);
+
+               QueueReceiver queueReceiver = session.createReceiver(queue);
+
+               boolean done = false;
+               while (!done)
+               {
+                  TextMessage message = (TextMessage) queueReceiver.receive();
+                  Queue tempQueue = (Queue) message.getJMSReplyTo();
+
+                  QueueSender replySender = session.createSender(tempQueue);
+                  TextMessage reply = session.createTextMessage();
+                  reply.setText("Request Processed");
+                  reply.setJMSCorrelationID(message.getJMSMessageID());
+                  replySender.send(reply);
+
+                  if (message.getText().equals("Quit"))
+                     done = true;
+               }
+
+               session.close();
+               log.debug("Server Thread Finished");
+
+            }
+            catch (Exception e)
+            {
+               log.error("Error", e);
+            }
+         }
+      };
+
+      serverThread.start();
+
+      QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
+      Queue queue = (Queue) context.lookup(TEST_QUEUE);
+
+      QueueRequestor queueRequestor = new QueueRequestor(session, queue);
+      TextMessage message = session.createTextMessage();
+      message.setText("Request Test");
+
+      for (int i = 0; i < 5; i++)
+      {
+
+         getLog().debug("Making client request #" + i);
+         TextMessage reply = (TextMessage) queueRequestor.request(message);
+         String replyID = new String(reply.getJMSCorrelationID());
+         if (!replyID.equals(message.getJMSMessageID()))
+            throw new Exception("REQUEST: ERROR: Reply does not match sent message");
+
+      }
+
+      getLog().debug("Making client request to shut server down.");
+      message.setText("Quit");
+      queueRequestor.request(message);
+
+      serverThread.join();
+      disconnect();
+
+      getLog().debug("RequestReplyQueue passed");
+   }
+
+   /**
+    * Test that temporary queues can be deleted.
+    */
+   public void testTemporaryQueueDelete() throws Exception
+   {
+
+      getLog().debug("Starting TemporaryQueueDelete test");
+      connect();
+
+      QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
+      TemporaryQueue queue = session.createTemporaryQueue();
+
+      queue.delete();
+
+      disconnect();
+
+      getLog().debug("TemporaryQueueDelete passed");
+   }
+
+   /**
+    * Test that temporary topics can be deleted.
+    */
+   public void testTemporaryTopicDelete() throws Exception
+   {
+
+      getLog().debug("Starting TemporaryTopicDelete test");
+      connect();
+
+      TopicSession session = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
+      TemporaryTopic topic = session.createTemporaryTopic();
+
+      topic.delete();
+
+      disconnect();
+
+      getLog().debug("TemporaryTopicDelete passed");
+   }
+
+   /**
+    * Test invalid destination trying to send a message.
+    */
+   public void testInvalidDestinationQueueSend() throws Exception
+   {
+
+      getLog().debug("Starting InvaidDestinationQueueSend test");
+      connect();
+
+      QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
+      TemporaryQueue queue = session.createTemporaryQueue();
+      QueueSender sender = session.createSender(queue);
+      queue.delete();
+
+      TextMessage message = session.createTextMessage("hello");
+      boolean caught = false;
+      try
+      {
+         sender.send(message);
+      }
+      catch (JMSException expected)
+      {
+         caught = true;
+      }
+
+      disconnect();
+
+      assertTrue("Expected a JMSException", caught);
+
+      getLog().debug("InvaldDestinationQueueSend passed");
+   }
+
+   /**
+    * Test invalid destination trying to browse a message.
+    */
+   public void testInvalidDestinationQueueBrowse() throws Exception
+   {
+
+      getLog().debug("Starting InvalidDestinationQueueBrowse test");
+      connect();
+
+      QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
+      TemporaryQueue queue = session.createTemporaryQueue();
+      QueueBrowser browser = session.createBrowser(queue);
+      queue.delete();
+
+      boolean caught = false;
+      try
+      {
+         browser.getEnumeration();
+      }
+      catch (JMSException expected)
+      {
+         caught = true;
+      }
+
+      disconnect();
+
+      assertTrue("Expected a JMSException", caught);
+
+      getLog().debug("InvalidDestinationQueueBrowse passed");
+   }
+
+   /**
+    * Test invalid destination trying to send a message.
+    */
+   public void testInvalidDestinationTopicPublish() throws Exception
+   {
+
+      getLog().debug("Starting InvaidDestinationTopicPublish test");
+      connect();
+
+      TopicSession session = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
+      TemporaryTopic topic = session.createTemporaryTopic();
+      TopicPublisher publisher = session.createPublisher(topic);
+      topic.delete();
+
+      TextMessage message = session.createTextMessage("hello");
+      boolean caught = false;
+      try
+      {
+         publisher.publish(message);
+      }
+      catch (JMSException expected)
+      {
+         caught = true;
+      }
+
+      disconnect();
+
+      assertTrue("Expected a JMSException", caught);
+
+      getLog().debug("InvaldDestinationTopicPublish passed");
+   }
+
+   /**
+    * Test errors trying on topic subscribe.
+    */
+   public void testErrorsTopicSubscribe() throws Exception
+   {
+
+      getLog().debug("Starting InvalidDestinationTopicSubscribe test");
+      connect();
+
+      try
+      {
+         TopicSession session = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
+         Topic topic = (Topic) context.lookup(TEST_TOPIC);
+         TemporaryTopic temp = session.createTemporaryTopic();
+
+         boolean caught = false;
+         try
+         {
+            session.createSubscriber(null);
+         }
+         catch (InvalidDestinationException expected)
+         {
+            caught = true;
+         }
+         assertTrue("Expected an InvalidDestinationException for a null topic", caught);
+
+         caught = false;
+         try
+         {
+            session.createSubscriber(null, null, true);
+         }
+         catch (InvalidDestinationException expected)
+         {
+            caught = true;
+         }
+         assertTrue("Expected an InvalidDestinationException for a null topic", caught);
+
+         caught = false;
+         try
+         {
+            session.createDurableSubscriber(null, "NotUsed");
+         }
+         catch (InvalidDestinationException expected)
+         {
+            caught = true;
+         }
+         assertTrue("Expected an InvalidDestinationException for a null topic", caught);
+
+         caught = false;
+         try
+         {
+            session.createDurableSubscriber(temp, "NotUsed");
+         }
+         catch (InvalidDestinationException expected)
+         {
+            caught = true;
+         }
+         assertTrue("Expected an InvalidDestinationException for a temporary topic", caught);
+
+         caught = false;
+         try
+         {
+            session.createDurableSubscriber(null, "NotUsed", null, true);
+         }
+         catch (InvalidDestinationException expected)
+         {
+            caught = true;
+         }
+         assertTrue("Expected an InvalidDestinationException for a null topic", caught);
+
+         caught = false;
+         try
+         {
+            session.createDurableSubscriber(temp, "NotUsed", null, true);
+         }
+         catch (InvalidDestinationException expected)
+         {
+            caught = true;
+         }
+         assertTrue("Expected an InvalidDestinationException for a temporary topic", caught);
+
+      }
+      finally
+      {
+         disconnect();
+      }
+
+      getLog().debug("InvalidDestinationTopicSubscriber passed");
+   }
+
+   /**
+    * Test create queue.
+    */
+   public void testCreateQueue() throws Exception
+   {
+
+      getLog().debug("Starting create queue test");
+      connect();
+
+      QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
+
+      Queue jndiQueue = (Queue) getInitialContext().lookup("queue/testQueue");
+      Queue createQueue = session.createQueue(jndiQueue.getQueueName());
+      assertTrue("Failed for " + QUEUE_FACTORY, jndiQueue.equals(createQueue));
+
+      getLog().debug("InvalidDestinationTopicSubscriber passed");
+   }
+
+   public void testMessageListener() throws Exception
+   {
+      getLog().debug("Starting create queue test");
+
+      connect();
+      queueConnection.start();
+      drainQueue();
+      final CountDown counter1 = new CountDown(3);
+
+      QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
+      Queue queue = (Queue) context.lookup(TEST_QUEUE);
+
+      QueueReceiver receiver = session.createReceiver(queue);
+      receiver.setMessageListener(new MessageListener()
+      {
+         public void onMessage(Message msg)
+         {
+            Logger log = Logger.getLogger(getClass().getName());
+            log.debug("ML");
+            try
+            {
+               if (msg instanceof TextMessage)
+               {
+                  log.debug(((TextMessage) msg).getText());
+                  counter1.release();
+               }
+            }
+            catch (Exception e)
+            {
+            }
+         }
+      });
+
+      QueueSender sender = session.createSender(queue);
+
+      TextMessage message = session.createTextMessage();
+      message.setText("Normal message");
+      sender.send(message, DeliveryMode.NON_PERSISTENT, 4, 0);
+      //sender.send(queue, message, DeliveryMode.NON_PERSISTENT, 4, 0);
+      message.setText("Persistent message");
+      sender.send(message, DeliveryMode.PERSISTENT, 4, 0);
+      //sender.send(queue, message, DeliveryMode.PERSISTENT, 4, 0);
+      message.setText("High Priority Persistent message");
+      sender.send(message, DeliveryMode.PERSISTENT, 9, 0);
+      //sender.send(queue, message, DeliveryMode.PERSISTENT, 10, 0);
+
+      // Wait for the msgs to be received
+      counter1.acquire();
+      log.debug("MessageListener1 received the TMs sent");
+
+      final CountDown counter2 = new CountDown(2);
+      receiver.setMessageListener(new MessageListener()
+      {
+         public void onMessage(Message msg)
+         {
+            Logger log = Logger.getLogger(getClass().getName());
+            log.debug("ML 2");
+            try
+            {
+               if (msg instanceof TextMessage)
+               {
+                  log.debug(((TextMessage) msg).getText());
+                  counter2.release();
+               }
+            }
+            catch (Exception e)
+            {
+            }
+         }
+      });
+
+      message.setText("Persistent message");
+      sender.send(message, DeliveryMode.PERSISTENT, 4, 0);
+      //sender.send(queue, message, DeliveryMode.PERSISTENT, 4, 0);
+      message.setText("High Priority Persistent message");
+      sender.send(message, DeliveryMode.PERSISTENT, 9, 0);
+      //sender.send(queue, message, DeliveryMode.PERSISTENT, 10, 0);
+
+      // Wait for the msgs to be received
+      counter2.acquire();
+      log.debug("MessageListener2 received the TMs sent");
+
+      receiver.setMessageListener(null);
+
+      message.setText("Persistent message");
+      sender.send(message, DeliveryMode.PERSISTENT, 4, 0);
+      //sender.send(queue, message, DeliveryMode.PERSISTENT, 4, 0);
+      message.setText("High Priority Persistent message");
+      sender.send(message, DeliveryMode.PERSISTENT, 9, 0);
+      //sender.send(queue, message, DeliveryMode.PERSISTENT, 10, 0);
+
+      sender.close();
+      drainQueue();
+      disconnect();
+      getLog().debug("MessageListener test passed");
+   }
+
+   public void testApplicationServerStuff() throws Exception
+   {
+      getLog().debug("Starting testing app server stuff");
+      connect();
+
+      Queue testQueue = (Queue) context.lookup(TEST_QUEUE);
+      final QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
+
+      session.setMessageListener(new MessageListener()
+      {
+         public void onMessage(Message mess)
+         {
+            Logger log = Logger.getLogger(getClass().getName());
+            log.debug("Processing message");
+            try
+            {
+               if (mess instanceof TextMessage)
+                  log.debug(((TextMessage) mess).getText());
+            }
+            catch (Exception e)
+            {
+               log.error("Error", e);
+            }
+         }
+      });
+
+      QueueSender sender = session.createSender(testQueue);
+      sender.send(session.createTextMessage("Hi"));
+      sender.send(session.createTextMessage("There"));
+      sender.send(session.createTextMessage("Guys"));
+      queueConnection.createConnectionConsumer(testQueue, null, new ServerSessionPool()
+      {
+         public ServerSession getServerSession()
+         {
+            Logger.getLogger(getClass().getName()).debug("Getting server session.");
+            return new ServerSession()
+            {
+               public Session getSession()
+               {
+                  return session;
+               }
+               public void start()
+               {
+                  Logger.getLogger(getClass().getName()).debug("Starting server session.");
+                  session.run();
+               }
+            };
+         }
+      }, 10);
+
+      queueConnection.start();
+
+      try
+      {
+         Thread.sleep(5 * 1000);
+      }
+      catch (Exception e)
+      {
+      }
+
+      disconnect();
+      getLog().debug("Testing app server stuff passed");
+   }
+
+   //simply put a few messages on the test queue for next time.
+   /*   public void testPM() throws Exception
+      {
+         getLog().debug("Starting testing pm");
+         connect();
+         
+         Queue testQueue = (Queue)context.lookup(TEST_QUEUE);
+         QueueSession session = queueConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
+         QueueSender sender = session.createSender(testQueue);
+         sender.send(session.createTextMessage("From last time"));
+         sender.send(session.createTextMessage("From last time"));
+         sender.send(session.createTextMessage("From last time"));
+         sender.close();
+         session.close();
+         disconnect();
+         getLog().debug("Testing pm stuff passed");
+      }
+   */
+   private void drainMessagesForTopic(TopicSubscriber sub) throws JMSException
+   {
+      Message msg = sub.receive(50);
+      int c = 0;
+      while (msg != null)
+      {
+         c++;
+         if (msg instanceof TextMessage)
+            getLog().debug(((TextMessage) msg).getText());
+         msg = sub.receive(50);
+      }
+      getLog().debug("Received " + c + " messages from topic.");
+   }
+
+   public void testTopics() throws Exception
+   {
+      getLog().debug("Starting Topic test");
+      connect();
+
+      TopicConnectionFactory topicFactory = (TopicConnectionFactory) context.lookup(TOPIC_FACTORY);
+      topicConnection = topicFactory.createTopicConnection("john", "needle");
+
+      topicConnection.start();
+
+      //set up some subscribers to the topic
+      TopicSession session = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
+      Topic topic = (Topic) context.lookup(TEST_TOPIC);
+
+      TopicSubscriber sub1 = session.createDurableSubscriber(topic, "sub1");
+      TopicSubscriber sub2 = session.createSubscriber(topic);
+      TopicSubscriber sub3 = session.createSubscriber(topic);
+
+      //Now a sender
+      TopicPublisher sender = session.createPublisher(topic);
+
+      //send some messages
+      sender.publish(session.createTextMessage("Message 1"));
+      sender.publish(session.createTextMessage("Message 2"));
+      sender.publish(session.createTextMessage("Message 3"));
+      drainMessagesForTopic(sub1);
+      drainMessagesForTopic(sub2);
+      drainMessagesForTopic(sub3);
+
+      //close some subscribers
+      sub1.close();
+      sub2.close();
+
+      //send some more messages
+      sender.publish(session.createTextMessage("Message 4"));
+      sender.publish(session.createTextMessage("Message 5"));
+      sender.publish(session.createTextMessage("Message 6"));
+
+      //give time for message 4 to be negatively acked (as it will be cause last receive timed out)
+      try
+      {
+         Thread.sleep(5 * 1000);
+      }
+      catch (InterruptedException e)
+      {
+      }
+
+      drainMessagesForTopic(sub3);
+
+      //open subscribers again.
+      sub1 = session.createDurableSubscriber(topic, "sub1");
+      sub2 = session.createSubscriber(topic);
+
+      //Send a final message
+      sender.publish(session.createTextMessage("Final message"));
+      sender.close();
+
+      drainMessagesForTopic(sub1);
+      drainMessagesForTopic(sub2);
+      drainMessagesForTopic(sub3);
+
+      sub1.close();
+      sub2.close();
+      sub3.close();
+
+      session.unsubscribe("sub1");
+
+      topicConnection.stop();
+      topicConnection.close();
+
+      disconnect();
+      getLog().debug("Topic test passed");
+   }
+
+   /**
+    * Test to seeif the NoLocal feature of topics works.
+    * Messages published from the same connection should not
+    * be received by Subscribers on the same connection.
+    */
+   public void testTopicNoLocal() throws Exception
+   {
+      getLog().debug("Starting TopicNoLocal test");
+      connect();
+
+      TopicConnectionFactory topicFactory = (TopicConnectionFactory) context.lookup(TOPIC_FACTORY);
+      TopicConnection topicConnection1 = topicFactory.createTopicConnection();
+      topicConnection1.start();
+      TopicConnection topicConnection2 = topicFactory.createTopicConnection();
+      topicConnection2.start();
+
+      // We don't want local messages on this topic.
+      TopicSession session1 = topicConnection1.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
+      Topic topic = (Topic) context.lookup(TEST_TOPIC);
+      TopicSubscriber subscriber1 = session1.createSubscriber(topic, null, true);
+      TopicPublisher sender1 = session1.createPublisher(topic);
+
+      //Now a sender
+      TopicSession session2 = topicConnection2.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
+      TopicPublisher sender2 = session2.createPublisher(topic);
+
+      drainMessagesForTopic(subscriber1);
+
+      //send some messages
+      sender1.publish(session1.createTextMessage("Local Message"));
+      sender2.publish(session2.createTextMessage("Remote Message"));
+
+      // Get the messages, we should get the remote message
+      // but not the local message
+      TextMessage msg1 = (TextMessage) subscriber1.receive(2000);
+      if (msg1 == null)
+      {
+         fail("Did not get any messages");
+      }
+      else
+      {
+         getLog().debug("Got message: " + msg1);
+         if (msg1.getText().equals("Local Message"))
+         {
+            fail("Got a local message");
+         }
+         TextMessage msg2 = (TextMessage) subscriber1.receive(2000);
+         if (msg2 != null)
+         {
+            getLog().debug("Got message: " + msg2);
+            fail("Got an extra message.  msg1:" + msg1 + ", msg2:" + msg2);
+         }
+      }
+
+      topicConnection1.stop();
+      topicConnection1.close();
+      topicConnection2.stop();
+      topicConnection2.close();
+
+      disconnect();
+      getLog().debug("TopicNoLocal test passed");
+   }
+
+   /**
+    * Test to see whether no local works if a message
+    * was created somewhere else.
+    */
+   public void testTopicNoLocalBounce() throws Exception
+   {
+      getLog().debug("Starting TopicNoLocalBounce test");
+      connect();
+
+      TopicConnectionFactory topicFactory = (TopicConnectionFactory) context.lookup(TOPIC_FACTORY);
+      TopicConnection topicConnection1 = topicFactory.createTopicConnection();
+      topicConnection1.start();
+      TopicConnection topicConnection2 = topicFactory.createTopicConnection();
+      topicConnection2.start();
+
+      // Session 1
+      TopicSession session1 = topicConnection1.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
+      Topic topic = (Topic) context.lookup(TEST_TOPIC);
+      TopicSubscriber subscriber1 = session1.createSubscriber(topic, null, true);
+      TopicPublisher sender1 = session1.createPublisher(topic);
+
+      // Session 2
+      TopicSession session2 = topicConnection2.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
+      TopicSubscriber subscriber2 = session2.createSubscriber(topic, null, true);
+      TopicPublisher sender2 = session2.createPublisher(topic);
+
+      drainMessagesForTopic(subscriber1);
+      drainMessagesForTopic(subscriber2);
+
+      //send the message
+      sender1.publish(session1.createTextMessage("Message"));
+
+      assertTrue("Subscriber1 should not get a message", subscriber1.receiveNoWait() == null);
+      TextMessage msg = (TextMessage) subscriber2.receive(2000);
+      assertTrue("Subscriber2 should get a message, got " + msg, msg != null && msg.getText().equals("Message"));
+
+      //send it back
+      sender2.publish(msg);
+
+      msg = (TextMessage) subscriber1.receive(2000);
+      assertTrue("Subscriber1 should get a message, got " + msg, msg != null && msg.getText().equals("Message"));
+      assertTrue("Subscriber2 should not get a message", subscriber2.receiveNoWait() == null);
+
+      topicConnection1.stop();
+      topicConnection1.close();
+      topicConnection2.stop();
+      topicConnection2.close();
+
+      disconnect();
+      getLog().debug("TopicNoLocalBounce test passed");
+   }
+
+   /**
+    * Test subscribing to a topic with one selector, then changing to another
+    */
+   public void testTopicSelectorChange() throws Exception
+   {
+      getLog().debug("Starting TopicSelectorChange test");
+
+      getLog().debug("Create topic connection");
+      TopicConnectionFactory topicFactory = (TopicConnectionFactory) context.lookup(TOPIC_FACTORY);
+      topicConnection = topicFactory.createTopicConnection("john", "needle");
+      topicConnection.start();
+
+      try
+      {
+         getLog().debug("Retrieving Topic");
+         Topic topic = (Topic) context.lookup(TEST_DURABLE_TOPIC);
+
+         getLog().debug("Creating a send session");
+         TopicSession sendSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
+         TopicPublisher sender = sendSession.createPublisher(topic);
+
+         getLog().debug("Clearing the topic");
+         TopicSession subSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
+         TopicSubscriber subscriber = subSession.createDurableSubscriber(topic, "test");
+         Message message = subscriber.receive(50);
+         while (message != null)
+            message = subscriber.receive(50);
+         subSession.close();
+
+         getLog().debug("Subscribing to topic, looking for Value = 'A'");
+         subSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
+         subscriber = subSession.createDurableSubscriber(topic, "test", "Value = 'A'", false);
+
+         getLog().debug("Send some messages");
+         message = sendSession.createTextMessage("Message1");
+         message.setStringProperty("Value", "A");
+         sender.publish(message);
+         message = sendSession.createTextMessage("Message2");
+         message.setStringProperty("Value", "A");
+         sender.publish(message);
+         message = sendSession.createTextMessage("Message3");
+         message.setStringProperty("Value", "B");
+         sender.publish(message);
+
+         getLog().debug("Retrieving the A messages");
+         message = subscriber.receive(2000);
+         assertTrue("Expected message 1", message != null);
+         assertTrue("Should get an A", message.getStringProperty("Value").equals("A"));
+         message = subscriber.receive(2000);
+         assertTrue("Expected message 2", message != null);
+         assertTrue("Should get a second A", message.getStringProperty("Value").equals("A"));
+         assertTrue("That should be it for A", subscriber.receive(2000) == null);
+
+         getLog().debug("Closing the subscriber without acknowledgement");
+         subSession.close();
+
+         getLog().debug("Subscribing to topic, looking for Value = 'B'");
+         subSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
+         subscriber = subSession.createDurableSubscriber(topic, "test", "Value = 'B'", false);
+
+         getLog().debug("Retrieving the non-existent B messages");
+         assertTrue("B should not be there", subscriber.receive(2000) == null);
+
+         getLog().debug("Closing the subscriber.");
+         subSession.close();
+
+         getLog().debug("Subscribing to topic, looking for those Value = 'A'");
+         subSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
+         subscriber = subSession.createDurableSubscriber(topic, "test", "Value = 'A'", false);
+         assertTrue("Should not be any A the subscription was changed", subscriber.receive(2000) == null);
+         subSession.close();
+
+         getLog().debug("Subscribing to topic, looking for everything");
+         subSession = topicConnection.createTopicSession(false, Session.CLIENT_ACKNOWLEDGE);
+         subscriber = subSession.createDurableSubscriber(topic, "test", null, false);
+
+         message = sendSession.createTextMessage("Message4");
+         message.setStringProperty("Value", "A");
+         sender.publish(message);
+
+         message = subscriber.receive(2000);
+         assertTrue("Expected message 4", message != null);
+         assertTrue("Should be an A which we don't acknowledge", message.getStringProperty("Value").equals("A"));
+         subSession.close();
+
+         getLog().debug("Subscribing to topic, looking for the Value = 'A'");
+         subSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
+         subscriber = subSession.createDurableSubscriber(topic, "test", "Value = 'A'", false);
+         assertTrue(
+            "Should not be any A, the subscription was changed. Even though the old and new selectors match the message",
+            subscriber.receive(2000) == null);
+         subSession.close();
+
+         getLog().debug("Closing the send session");
+         sendSession.close();
+
+         getLog().debug("Removing the subscription");
+         subSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
+         subSession.unsubscribe("test");
+
+      }
+      finally
+      {
+         getLog().debug("Closing the connection");
+         topicConnection.close();
+      }
+
+      getLog().debug("TopicSelectorChange test passed");
+   }
+
+   /**
+    * Test subscribing to a topic with a null and empty selector
+    */
+   public void testTopicSelectorNullOrEmpty() throws Exception
+   {
+      getLog().debug("Starting TopicSelectorNullOrEmpty test");
+
+      getLog().debug("Create topic connection");
+      TopicConnectionFactory topicFactory = (TopicConnectionFactory) context.lookup(TOPIC_FACTORY);
+      topicConnection = topicFactory.createTopicConnection("john", "needle");
+      topicConnection.start();
+
+      try
+      {
+         getLog().debug("Retrieving Topic");
+         Topic topic = (Topic) context.lookup(TEST_DURABLE_TOPIC);
+
+         getLog().debug("Creating a send session");
+         TopicSession sendSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
+         TopicPublisher sender = sendSession.createPublisher(topic);
+
+         getLog().debug("Clearing the topic");
+         TopicSession subSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
+         TopicSubscriber subscriber = subSession.createDurableSubscriber(topic, "test");
+         TextMessage message = (TextMessage) subscriber.receive(50);
+         while (message != null)
+            message = (TextMessage) subscriber.receive(50);
+         subscriber.close();
+         subSession.close();
+
+         getLog().debug("Subscribing to topic, with null selector");
+         subSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
+         subscriber = subSession.createDurableSubscriber(topic, "test", null, false);
+
+         getLog().debug("Send a message");
+         message = sendSession.createTextMessage("Message1");
+         sender.publish(message);
+
+         getLog().debug("Retrieving the message");
+         message = (TextMessage) subscriber.receive(2000);
+         assertTrue("Expected message 1", message != null);
+         assertTrue("Should get Message1", message.getText().equals("Message1"));
+         getLog().debug("Closing the subscriber");
+         subscriber.close();
+         subSession.close();
+
+         getLog().debug("Subscribing to topic, with an empty selector");
+         subSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
+         subscriber = subSession.createDurableSubscriber(topic, "test", "   ", false);
+
+         getLog().debug("Send a message");
+         message = sendSession.createTextMessage("Message2");
+         sender.publish(message);
+
+         getLog().debug("Retrieving the message");
+         message = (TextMessage) subscriber.receive(2000);
+         assertTrue("Expected message 2", message != null);
+         assertTrue("Should get Message2", message.getText().equals("Message2"));
+         getLog().debug("Closing the subscriber");
+         subscriber.close();
+
+         getLog().debug("Removing the subscription");
+         subSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
+         subSession.unsubscribe("test");
+         subSession.close();
+
+      }
+      finally
+      {
+         getLog().debug("Closing the connection");
+         topicConnection.close();
+      }
+
+      getLog().debug("TopicSelectorNullOrEmpty test passed");
+   }
+
+   /**
+    * Test sending/receiving an outdated message
+    */
+   public void testSendReceiveOutdated() throws Exception
+   {
+      getLog().debug("Starting SendReceiveOutdated test");
+
+      connect();
+      try
+      {
+         queueConnection.start();
+         drainQueue();
+         queueConnection.stop();
+
+         QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
+         Queue queue = (Queue) context.lookup(TEST_QUEUE);
+         QueueSender sender = session.createSender(queue);
+         QueueReceiver receiver = session.createReceiver(queue);
+
+         // Send a message that has expired
+         TextMessage message = session.createTextMessage("Outdated");
+         sender.send(message, DeliveryMode.PERSISTENT, 4, 1);
+         Thread.sleep(100);
+
+         // Send a message that has not expired
+         message = session.createTextMessage("OK");
+         sender.send(message);
+
+         // Try to receive the message the not expired message
+         queueConnection.start();
+         
+         // Receive nowait doesn't work on this case, as this could happen really fast right after the start, so it's better to wait a second, than just receiveNoWait
+         message = (TextMessage) receiver.receive(1000);
+         assertEquals("OK", message.getText());
+
+         // Should be no more
+         assertTrue("Didn't expect anymore messages", receiver.receiveNoWait() == null);
+      }
+      finally
+      {
+         disconnect();
+      }
+
+      getLog().debug("SendReceiveOutdated test passed");
+   }
+
+   public void testSendReceiveExpired() throws Exception
+   {
+      getLog().debug("Starting testSendReceiveExpired test");
+
+      connect();
+      try
+      {
+         queueConnection.start();
+         drainQueue();
+
+         QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
+         Queue queue = (Queue) context.lookup(TEST_QUEUE);
+         QueueSender sender = session.createSender(queue);
+         QueueReceiver receiver = session.createReceiver(queue);
+
+         // Send a message that expires in 5 seconds
+         TextMessage message = session.createTextMessage("5 Second Expiration");
+         sender.send(message, DeliveryMode.PERSISTENT, 4, 5*1000);
+         // Send a message that has not expired
+         message = session.createTextMessage("OK");
+         sender.send(message);
+         // Sleep 6 seconds
+         Thread.sleep(6*1000);
+         // Try to receive the OK message
+         message = (TextMessage) receiver.receiveNoWait();
+         assertEquals("OK", message.getText());
+
+         // Should be no more
+         assertTrue("Didn't expect anymore messages", receiver.receiveNoWait() == null);
+
+         // Send a message that expires in 10 seconds
+         message = session.createTextMessage("10 Second Expiration");
+         sender.send(message, DeliveryMode.PERSISTENT, 4, 10*1000);
+         // Send a message that has not expired
+         message = session.createTextMessage("OK");
+         sender.send(message);
+         // Sleep 1 seconds
+         Thread.sleep(1*1000);
+         // Try to receive the messages
+         message = (TextMessage) receiver.receiveNoWait();
+         assertEquals("10 Second Expiration", message.getText());
+         message = (TextMessage) receiver.receiveNoWait();
+         assertEquals("OK", message.getText());
+
+         // Should be no more
+         assertTrue("Didn't expect anymore messages", receiver.receiveNoWait() == null);
+         
+         // Test that JMSExpiration has no affect
+         message = session.createTextMessage("5 Second Expiration");
+         message.setJMSExpiration(System.currentTimeMillis() + 5*1000);
+         sender.send(message, DeliveryMode.PERSISTENT, 4, 0);
+         // Send a message that has not expired
+         message = session.createTextMessage("OK");
+         sender.send(message);
+         // Sleep 6 seconds
+         Thread.sleep(6*1000);
+         // Try to receive the OK message
+         message = (TextMessage) receiver.receiveNoWait();
+         assertEquals("5 Second Expiration", message.getText());
+         message = (TextMessage) receiver.receiveNoWait();
+         assertEquals("OK", message.getText());
+         assertTrue("Didn't expect anymore messages", receiver.receiveNoWait() == null);
+      }
+      finally
+      {
+         disconnect();
+      }
+   }
+
+   class Synch
+   {
+      boolean waiting = false;
+      String text;
+      public synchronized void doWait(long timeout) throws InterruptedException
+      {
+         waiting = true;
+         this.wait(timeout);
+      }
+      public synchronized void doNotify() throws InterruptedException
+      {
+         while (waiting == false)
+            wait(100);
+         this.notifyAll();
+      }
+      public String getText()
+      {
+         return text;
+      }
+      public void setText(String text)
+      {
+         this.text = text;
+      }
+   }
+
+   /**
+    * Test sending/listening an outdated message
+    */
+   public void testSendListenOutdated() throws Exception
+   {
+      getLog().debug("Starting SendListenOutdated test");
+
+      connect();
+      try
+      {
+         queueConnection.start();
+         drainQueue();
+         queueConnection.stop();
+
+         QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
+         Queue queue = (Queue) context.lookup(TEST_QUEUE);
+         QueueSender sender = session.createSender(queue);
+         QueueReceiver receiver = session.createReceiver(queue);
+
+         // Send a message that has expired
+         TextMessage message = session.createTextMessage("Outdated");
+         sender.send(message, DeliveryMode.PERSISTENT, 4, 1);
+         Thread.sleep(100);
+
+         // Send a message that has not expired
+         message = session.createTextMessage("OK");
+         sender.send(message);
+
+         // Try to receive the message the not expired message
+         final Synch synch = new Synch();
+         MessageListener messagelistener = new MessageListener()
+         {
+            public void onMessage(Message message)
+            {
+               listenOutdated(message, synch);
+            }
+         };
+         receiver.setMessageListener(messagelistener);
+         queueConnection.start();
+
+         synch.doWait(10000);
+         assertEquals("OK", synch.getText());
+      }
+      finally
+      {
+         disconnect();
+      }
+
+      getLog().debug("SendListenOutdated test passed");
+   }
+
+   private void listenOutdated(Message message, Synch synch)
+   {
+      try
+      {
+         synch.setText(((TextMessage) message).getText());
+      }
+      catch (Throwable t)
+      {
+         log.error("Error:", t);
+      }
+      finally
+      {
+         try
+         {
+            synch.doNotify();
+         }
+         catch (Throwable t)
+         {
+            log.error("Error:", t);
+         }
+      }
+   }
+}

Deleted: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/test/Jms11UnitTest.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jbossmessaging/test/Jms11UnitTest.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/test/Jms11UnitTest.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -1,1226 +0,0 @@
-/*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005, JBoss Inc., and individual contributors as indicated
-  * by the @authors tag. See the copyright.txt in the distribution for a
-  * full listing of individual contributors.
-  *
-  * This is free software; you can redistribute it and/or modify it
-  * under the terms of the GNU Lesser General Public License as
-  * published by the Free Software Foundation; either version 2.1 of
-  * the License, or (at your option) any later version.
-  *
-  * This software is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
-  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  * Lesser General Public License for more details.
-  *
-  * You should have received a copy of the GNU Lesser General Public
-  * License along with this software; if not, write to the Free
-  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-  */
-package org.jboss.test.jbossmessaging.test;
-
-import java.util.Enumeration;
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.DeliveryMode;
-import javax.jms.InvalidDestinationException;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.QueueBrowser;
-import javax.jms.ServerSession;
-import javax.jms.ServerSessionPool;
-import javax.jms.Session;
-import javax.jms.TemporaryQueue;
-import javax.jms.TemporaryTopic;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-import javax.jms.TopicConnection;
-import javax.jms.TopicConnectionFactory;
-import javax.jms.TopicSubscriber;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-
-import EDU.oswego.cs.dl.util.concurrent.CountDown;
-import org.jboss.logging.Logger;
-import org.jboss.test.jbossmessaging.JMSTestCase;
-import org.jboss.test.jbossmessaging.perf.JMSPerfStressTestCase;
-
-/**
- * Basic tests using the jms 1.1 producer/consumer apis.
- *
- * @author Scott.Stark at jboss.org
- * @version $Revision: 64261 $
- */
-public class Jms11UnitTest extends JMSTestCase
-{
-   /** The default TopicFactory jndi name */
-   static String TOPIC_FACTORY = "ConnectionFactory";
-   /** The default QueueFactory jndi name */
-   static String QUEUE_FACTORY = "ConnectionFactory";
-
-   static String TEST_QUEUE = "queue/testQueue";
-   static String TEST_TOPIC = "topic/testTopic";
-   static String TEST_DURABLE_TOPIC = "topic/testDurableTopic";
-
-   //JMSProviderAdapter providerAdapter;
-   static Context context;
-   static Connection queueConnection;
-   static Connection topicConnection;
-
-   public Jms11UnitTest(String name) throws Exception
-   {
-      super(name);
-   }
-
-   protected void tearDown() throws Exception
-   {
-	   super.tearDown();
-	   disconnect();
-	   
-   }
-   
-   // Emptys out all the messages in a queue
-   protected void drainQueue() throws Exception
-   {
-      Session session = queueConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-      Queue queue = (Queue) context.lookup(TEST_QUEUE);
-
-      MessageConsumer receiver = session.createConsumer(queue);
-      Message message = receiver.receive(50);
-      int c = 0;
-      while (message != null)
-      {
-         message = receiver.receive(50);
-         c++;
-      }
-
-      if (c != 0)
-         getLog().debug("  Drained " + c + " messages from the queue");
-
-      session.close();
-   }
-
-   protected void connect() throws Exception
-   {
-      if (context == null)
-      {
-         context = new InitialContext();
-      }
-      ConnectionFactory queueFactory = (ConnectionFactory) context.lookup(QUEUE_FACTORY);
-      queueConnection = queueFactory.createConnection();
-
-      ConnectionFactory topicFactory = (ConnectionFactory) context.lookup(TOPIC_FACTORY);
-      topicConnection = topicFactory.createConnection();
-      getLog().debug("Connection to JBossMQ established.");
-   }
-
-   protected void disconnect() throws Exception
-   {
-	  if (queueConnection!=null)
-	  {
-	      queueConnection.close();
-	      queueConnection = null;
-	  }
-      
-	  if (topicConnection != null)
-	  {
-	      topicConnection.close();
-	      topicConnection = null;
-	  }
-   }
-
-   /**
-    * Test that messages are ordered by message arrival and priority.
-    * This also tests :
-    * 		Using a non-transacted AUTO_ACKNOWLEDGE session
-    *		Using a MessageConsumer
-    *		Using a QueueSender
-    *			Sending PERSITENT and NON_PERSISTENT text messages.
-    *		Using a QueueBrowser
-    */
-   public void testQueueMessageOrder() throws Exception
-   {
-
-      getLog().debug("Starting QueueMessageOrder test");
-
-      connect();
-
-      queueConnection.start();
-
-      drainQueue();
-
-      Session session = queueConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-      Queue queue = (Queue) context.lookup(TEST_QUEUE);
-      MessageProducer sender = session.createProducer(queue);
-
-      TextMessage message = session.createTextMessage();
-      message.setText("Normal message");
-      sender.send(message, DeliveryMode.NON_PERSISTENT, 4, 0);
-      message.setText("Persistent message");
-      sender.send(message, DeliveryMode.PERSISTENT, 4, 0);
-      message.setText("High Priority Persistent message");
-      sender.send(message, DeliveryMode.PERSISTENT, 10, 0);
-
-      QueueBrowser browser = session.createBrowser(queue);
-      Enumeration i = browser.getEnumeration();
-      getLog().debug(message.getText());
-
-      message = (TextMessage) i.nextElement();
-      getLog().debug(message.getText());
-
-      message = (TextMessage) i.nextElement();
-      getLog().debug(message.getText());
-
-      disconnect();
-      getLog().debug("QueueMessageOrder passed");
-   }
-
-   /**
-    * Test that temporary queues can be deleted.
-    */
-   public void testTemporaryQueueDelete() throws Exception
-   {
-
-      getLog().debug("Starting TemporaryQueueDelete test");
-      connect();
-
-      Session session = queueConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-      TemporaryQueue queue = session.createTemporaryQueue();
-
-      queue.delete();
-
-      disconnect();
-
-      getLog().debug("TemporaryQueueDelete passed");
-   }
-
-   /**
-    * Test that temporary topics can be deleted.
-    */
-   public void testTemporaryTopicDelete() throws Exception
-   {
-
-      getLog().debug("Starting TemporaryTopicDelete test");
-      connect();
-
-      Session session = topicConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-      TemporaryTopic topic = session.createTemporaryTopic();
-
-      topic.delete();
-
-      disconnect();
-
-      getLog().debug("TemporaryTopicDelete passed");
-   }
-
-   /**
-    * Test invalid destination trying to send a message.
-    */
-   public void testInvalidDestinationQueueSend() throws Exception
-   {
-
-      getLog().debug("Starting InvaidDestinationQueueSend test");
-      connect();
-
-      Session session = queueConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-      TemporaryQueue queue = session.createTemporaryQueue();
-      MessageProducer sender = session.createProducer(queue);
-      queue.delete();
-
-      TextMessage message = session.createTextMessage("hello");
-      boolean caught = false;
-      try
-      {
-         sender.send(message);
-      }
-      catch (InvalidDestinationException expected)
-      {
-         caught = true;
-      }
-
-      disconnect();
-
-      assertTrue("Expected an InvalidDestinationException", caught);
-
-      getLog().debug("InvaldDestinationQueueSend passed");
-   }
-
-   /**
-    * Test invalid destination trying to browse a message.
-    */
-   public void testInvalidDestinationQueueBrowse() throws Exception
-   {
-
-      getLog().debug("Starting InvalidDestinationQueueBrowse test");
-      connect();
-
-      Session session = queueConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-      TemporaryQueue queue = session.createTemporaryQueue();
-      QueueBrowser browser = session.createBrowser(queue);
-      queue.delete();
-
-      boolean caught = false;
-      try
-      {
-         browser.getEnumeration();
-      }
-      catch (InvalidDestinationException expected)
-      {
-         caught = true;
-      }
-
-      disconnect();
-
-      assertTrue("Expected an InvalidDestinationException", caught);
-
-      getLog().debug("InvalidDestinationQueueBrowse passed");
-   }
-
-   /**
-    * Test invalid destination trying to send a message.
-    */
-   public void testInvalidDestinationTopicPublish() throws Exception
-   {
-
-      getLog().debug("Starting InvaidDestinationTopicPublish test");
-      connect();
-
-      Session session = topicConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-      TemporaryTopic topic = session.createTemporaryTopic();
-      MessageProducer publisher = session.createProducer(topic);
-      topic.delete();
-
-      TextMessage message = session.createTextMessage("hello");
-      boolean caught = false;
-      try
-      {
-         publisher.send(message);
-      }
-      catch (InvalidDestinationException expected)
-      {
-         caught = true;
-      }
-
-      disconnect();
-
-      assertTrue("Expected an InvalidDestinationException", caught);
-
-      getLog().debug("InvaldDestinationTopicPublish passed");
-   }
-
-   /**
-    * Test errors trying on topic subscribe.
-    */
-   public void testErrorsTopicSubscribe() throws Exception
-   {
-
-      getLog().debug("Starting InvalidDestinationTopicSubscribe test");
-      connect();
-
-      try
-      {
-         Session session = topicConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         Topic topic = (Topic) context.lookup(TEST_TOPIC);
-         TemporaryTopic temp = session.createTemporaryTopic();
-
-         boolean caught = false;
-         try
-         {
-            session.createConsumer(null);
-         }
-         catch (InvalidDestinationException expected)
-         {
-            caught = true;
-         }
-         assertTrue("Expected an InvalidDestinationException for a null topic", caught);
-
-         caught = false;
-         try
-         {
-            session.createConsumer(null, null, true);
-         }
-         catch (InvalidDestinationException expected)
-         {
-            caught = true;
-         }
-         assertTrue("Expected an InvalidDestinationException for a null topic", caught);
-
-         caught = false;
-         try
-         {
-            session.createDurableSubscriber(null, "NotUsed");
-         }
-         catch (InvalidDestinationException expected)
-         {
-            caught = true;
-         }
-         assertTrue("Expected an InvalidDestinationException for a null topic", caught);
-
-         caught = false;
-         try
-         {
-            session.createDurableSubscriber(temp, "NotUsed");
-         }
-         catch (InvalidDestinationException expected)
-         {
-            caught = true;
-         }
-         assertTrue("Expected an InvalidDestinationException for a temporary topic", caught);
-
-         caught = false;
-         try
-         {
-            session.createDurableSubscriber(null, "NotUsed", null, true);
-         }
-         catch (InvalidDestinationException expected)
-         {
-            caught = true;
-         }
-         assertTrue("Expected an InvalidDestinationException for a null topic", caught);
-
-         caught = false;
-         try
-         {
-            session.createDurableSubscriber(temp, "NotUsed", null, true);
-         }
-         catch (InvalidDestinationException expected)
-         {
-            caught = true;
-         }
-         assertTrue("Expected an InvalidDestinationException for a temporary topic", caught);
-
-         caught = false;
-         try
-         {
-            session.createDurableSubscriber(topic, null);
-         }
-         catch (Exception expected)
-         {
-            caught = true;
-         }
-         assertTrue("Expected a Exception for a null subscription", caught);
-
-         caught = false;
-         try
-         {
-            session.createDurableSubscriber(topic, null, null, false);
-         }
-         catch (Exception expected)
-         {
-            caught = true;
-         }
-         assertTrue("Expected a Exception for a null subscription", caught);
-
-         caught = false;
-         try
-         {
-            session.createDurableSubscriber(topic, "  ");
-         }
-         catch (Exception expected)
-         {
-            caught = true;
-         }
-         assertTrue("Expected a Exception for an empty subscription", caught);
-
-         caught = false;
-         try
-         {
-            session.createDurableSubscriber(topic, "  ", null, false);
-         }
-         catch (Exception expected)
-         {
-            caught = true;
-         }
-         assertTrue("Expected a Exception for an empty subscription", caught);
-      }
-      finally
-      {
-         disconnect();
-      }
-
-      getLog().debug("InvalidDestinationTopicSubscriber passed");
-   }
-
-   /**
-    * Test create queue.
-    */
-   public void testCreateQueue() throws Exception
-   {
-
-      getLog().debug("Starting create queue test");
-      connect();
-
-      Session session = queueConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-      Queue jndiQueue = (Queue) getInitialContext().lookup("queue/testQueue");
-      Queue createQueue = session.createQueue(jndiQueue.getQueueName());
-      assertTrue("Failed for " + QUEUE_FACTORY, jndiQueue.equals(createQueue));
-
-      getLog().debug("InvalidDestinationTopicSubscriber passed");
-   }
-
-   public void testMessageListener() throws Exception
-   {
-      getLog().debug("Starting create queue test");
-
-      connect();
-      queueConnection.start();
-      drainQueue();
-      final CountDown counter1 = new CountDown(3);
-
-      Session session = queueConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-      Queue queue = (Queue) context.lookup(TEST_QUEUE);
-
-      MessageConsumer receiver = session.createConsumer(queue);
-      receiver.setMessageListener(new MessageListener()
-      {
-         public void onMessage(Message msg)
-         {
-            Logger log = Logger.getLogger(getClass().getName());
-            log.debug("ML");
-            try
-            {
-               if (msg instanceof TextMessage)
-               {
-                  log.debug(((TextMessage) msg).getText());
-                  counter1.release();
-               }
-            }
-            catch (Exception e)
-            {
-            }
-         }
-      });
-
-      MessageProducer sender = session.createProducer(queue);
-
-      TextMessage message = session.createTextMessage();
-      message.setText("Normal message");
-      sender.send(message, DeliveryMode.NON_PERSISTENT, 4, 0);
-      //sender.send(queue, message, DeliveryMode.NON_PERSISTENT, 4, 0);
-      message.setText("Persistent message");
-      sender.send(message, DeliveryMode.PERSISTENT, 4, 0);
-      //sender.send(queue, message, DeliveryMode.PERSISTENT, 4, 0);
-      message.setText("High Priority Persistent message");
-      sender.send(message, DeliveryMode.PERSISTENT, 10, 0);
-      //sender.send(queue, message, DeliveryMode.PERSISTENT, 10, 0);
-
-      // Wait for the msgs to be received
-      counter1.acquire();
-      log.debug("MessageListener1 received the TMs sent");
-
-      final CountDown counter2 = new CountDown(2);
-      receiver.setMessageListener(new MessageListener()
-      {
-         public void onMessage(Message msg)
-         {
-            Logger log = Logger.getLogger(getClass().getName());
-            log.debug("ML 2");
-            try
-            {
-               if (msg instanceof TextMessage)
-               {
-                  log.debug(((TextMessage) msg).getText());
-                  counter2.release();
-               }
-            }
-            catch (Exception e)
-            {
-            }
-         }
-      });
-
-      message.setText("Persistent message");
-      sender.send(message, DeliveryMode.PERSISTENT, 4, 0);
-      //sender.send(queue, message, DeliveryMode.PERSISTENT, 4, 0);
-      message.setText("High Priority Persistent message");
-      sender.send(message, DeliveryMode.PERSISTENT, 10, 0);
-      //sender.send(queue, message, DeliveryMode.PERSISTENT, 10, 0);
-
-      // Wait for the msgs to be received
-      counter2.acquire();
-      log.debug("MessageListener2 received the TMs sent");
-
-      receiver.setMessageListener(null);
-
-      message.setText("Persistent message");
-      sender.send(message, DeliveryMode.PERSISTENT, 4, 0);
-      //sender.send(queue, message, DeliveryMode.PERSISTENT, 4, 0);
-      message.setText("High Priority Persistent message");
-      sender.send(message, DeliveryMode.PERSISTENT, 10, 0);
-      //sender.send(queue, message, DeliveryMode.PERSISTENT, 10, 0);
-
-      sender.close();
-      drainQueue();
-      disconnect();
-      getLog().debug("MessageListener test passed");
-   }
-
-   public void testApplicationServerStuff() throws Exception
-   {
-      getLog().debug("Starting testing app server stuff");
-      connect();
-
-      Queue testQueue = (Queue) context.lookup(TEST_QUEUE);
-      final Session session = queueConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-      session.setMessageListener(new MessageListener()
-      {
-         public void onMessage(Message mess)
-         {
-            Logger log = Logger.getLogger(getClass().getName());
-            log.debug("Processing message");
-            try
-            {
-               if (mess instanceof TextMessage)
-                  log.debug(((TextMessage) mess).getText());
-            }
-            catch (Exception e)
-            {
-               log.error("Error", e);
-            }
-         }
-      });
-
-      MessageProducer sender = session.createProducer(testQueue);
-      sender.send(session.createTextMessage("Hi"));
-      sender.send(session.createTextMessage("There"));
-      sender.send(session.createTextMessage("Guys"));
-      queueConnection.createConnectionConsumer(testQueue, null, new ServerSessionPool()
-      {
-         public ServerSession getServerSession()
-         {
-            Logger.getLogger(getClass().getName()).debug("Getting server session.");
-            return new ServerSession()
-            {
-               public Session getSession()
-               {
-                  return session;
-               }
-               public void start()
-               {
-                  Logger.getLogger(getClass().getName()).debug("Starting server session.");
-                  session.run();
-               }
-            };
-         }
-      }, 10);
-
-      queueConnection.start();
-
-      try
-      {
-         Thread.sleep(5 * 1000);
-      }
-      catch (Exception e)
-      {
-      }
-
-      disconnect();
-      getLog().debug("Testing app server stuff passed");
-   }
-
-   private void drainMessagesForTopic(MessageConsumer sub) throws JMSException
-   {
-      Message msg = sub.receive(50);
-      int c = 0;
-      while (msg != null)
-      {
-         c++;
-         if (msg instanceof TextMessage)
-            getLog().debug(((TextMessage) msg).getText());
-         msg = sub.receive(50);
-      }
-      getLog().debug("Received " + c + " messages from topic.");
-   }
-
-   public void testTopics() throws Exception
-   {
-      getLog().debug("Starting Topic test");
-      connect();
-
-      TopicConnectionFactory topicFactory = (TopicConnectionFactory) context.lookup(TOPIC_FACTORY);
-      topicConnection = topicFactory.createTopicConnection("john", "needle");
-
-      topicConnection.start();
-
-      //set up some subscribers to the topic
-      Session session = topicConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-      Topic topic = (Topic) context.lookup(TEST_TOPIC);
-
-      TopicSubscriber sub1 = session.createDurableSubscriber(topic, "sub1");
-      MessageConsumer sub2 = session.createConsumer(topic);
-      MessageConsumer sub3 = session.createConsumer(topic);
-
-      //Now a sender
-      MessageProducer sender = session.createProducer(topic);
-
-      //send some messages
-      sender.send(session.createTextMessage("Message 1"));
-      sender.send(session.createTextMessage("Message 2"));
-      sender.send(session.createTextMessage("Message 3"));
-      drainMessagesForTopic(sub1);
-      drainMessagesForTopic(sub2);
-      drainMessagesForTopic(sub3);
-
-      //close some subscribers
-      sub1.close();
-      sub2.close();
-
-      //send some more messages
-      sender.send(session.createTextMessage("Message 4"));
-      sender.send(session.createTextMessage("Message 5"));
-      sender.send(session.createTextMessage("Message 6"));
-
-      //give time for message 4 to be negatively acked (as it will be cause last receive timed out)
-      try
-      {
-         Thread.sleep(5 * 1000);
-      }
-      catch (InterruptedException e)
-      {
-      }
-
-      drainMessagesForTopic(sub3);
-
-      //open subscribers again.
-      sub1 = session.createDurableSubscriber(topic, "sub1");
-      sub2 = session.createConsumer(topic);
-
-      //Send a final message
-      sender.send(session.createTextMessage("Final message"));
-      sender.close();
-
-      drainMessagesForTopic(sub1);
-      drainMessagesForTopic(sub2);
-      drainMessagesForTopic(sub3);
-
-      sub1.close();
-      sub2.close();
-      sub3.close();
-
-      session.unsubscribe("sub1");
-
-      topicConnection.stop();
-      topicConnection.close();
-
-      disconnect();
-      getLog().debug("Topic test passed");
-   }
-
-   /**
-    * Test to seeif the NoLocal feature of topics works.
-    * Messages sended from the same connection should not
-    * be received by Subscribers on the same connection.
-    */
-   public void testTopicNoLocal() throws Exception
-   {
-      getLog().debug("Starting TopicNoLocal test");
-      connect();
-
-      TopicConnectionFactory topicFactory = (TopicConnectionFactory) context.lookup(TOPIC_FACTORY);
-      TopicConnection topicConnection1 = topicFactory.createTopicConnection();
-      topicConnection1.start();
-      TopicConnection topicConnection2 = topicFactory.createTopicConnection();
-      topicConnection2.start();
-
-      // We don't want local messages on this topic.
-      Session session1 = topicConnection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-      Topic topic = (Topic) context.lookup(TEST_TOPIC);
-      MessageConsumer subscriber1 = session1.createConsumer(topic, null, true);
-      MessageProducer sender1 = session1.createProducer(topic);
-
-      //Now a sender
-      Session session2 = topicConnection2.createSession(false, Session.AUTO_ACKNOWLEDGE);
-      MessageProducer sender2 = session2.createProducer(topic);
-
-      drainMessagesForTopic(subscriber1);
-
-      //send some messages
-      sender1.send(session1.createTextMessage("Local Message"));
-      sender2.send(session2.createTextMessage("Remote Message"));
-
-      // Get the messages, we should get the remote message
-      // but not the local message
-      TextMessage msg1 = (TextMessage) subscriber1.receive(2000);
-      if (msg1 == null)
-      {
-         fail("Did not get any messages");
-      }
-      else
-      {
-         getLog().debug("Got message: " + msg1);
-         if (msg1.getText().equals("Local Message"))
-         {
-            fail("Got a local message");
-         }
-         TextMessage msg2 = (TextMessage) subscriber1.receive(2000);
-         if (msg2 != null)
-         {
-            getLog().debug("Got message: " + msg2);
-            fail("Got an extra message.  msg1:" + msg1 + ", msg2:" + msg2);
-         }
-      }
-
-      topicConnection1.stop();
-      topicConnection1.close();
-      topicConnection2.stop();
-      topicConnection2.close();
-
-      disconnect();
-      getLog().debug("TopicNoLocal test passed");
-   }
-
-   /**
-    * Test to see whether no local works if a message
-    * was created somewhere else.
-    */
-   public void testTopicNoLocalBounce() throws Exception
-   {
-      getLog().debug("Starting TopicNoLocalBounce test");
-      connect();
-
-      TopicConnectionFactory topicFactory = (TopicConnectionFactory) context.lookup(TOPIC_FACTORY);
-      TopicConnection topicConnection1 = topicFactory.createTopicConnection();
-      topicConnection1.start();
-      TopicConnection topicConnection2 = topicFactory.createTopicConnection();
-      topicConnection2.start();
-
-      // Session 1
-      Session session1 = topicConnection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-      Topic topic = (Topic) context.lookup(TEST_TOPIC);
-      MessageConsumer subscriber1 = session1.createConsumer(topic, null, true);
-      MessageProducer sender1 = session1.createProducer(topic);
-
-      // Session 2
-      Session session2 = topicConnection2.createSession(false, Session.AUTO_ACKNOWLEDGE);
-      MessageConsumer subscriber2 = session2.createConsumer(topic, null, true);
-      MessageProducer sender2 = session2.createProducer(topic);
-
-      drainMessagesForTopic(subscriber1);
-      drainMessagesForTopic(subscriber2);
-
-      //send the message
-      sender1.send(session1.createTextMessage("Message"));
-
-      assertTrue("Subscriber1 should not get a message", subscriber1.receiveNoWait() == null);
-      TextMessage msg = (TextMessage) subscriber2.receive(2000);
-      assertTrue("Subscriber2 should get a message, got " + msg, msg != null && msg.getText().equals("Message"));
-
-      //send it back
-      sender2.send(msg);
-
-      msg = (TextMessage) subscriber1.receive(2000);
-      assertTrue("Subscriber1 should get a message, got " + msg, msg != null && msg.getText().equals("Message"));
-      assertTrue("Subscriber2 should not get a message", subscriber2.receiveNoWait() == null);
-
-      topicConnection1.stop();
-      topicConnection1.close();
-      topicConnection2.stop();
-      topicConnection2.close();
-
-      disconnect();
-      getLog().debug("TopicNoLocalBounce test passed");
-   }
-
-   /**
-    * Test subscribing to a topic with one selector, then changing to another
-    */
-   public void testTopicSelectorChange() throws Exception
-   {
-      getLog().debug("Starting TopicSelectorChange test");
-
-      getLog().debug("Create topic connection");
-      TopicConnectionFactory topicFactory = (TopicConnectionFactory) context.lookup(TOPIC_FACTORY);
-      topicConnection = topicFactory.createTopicConnection("john", "needle");
-      topicConnection.start();
-
-      try
-      {
-         getLog().debug("Retrieving Topic");
-         Topic topic = (Topic) context.lookup(TEST_DURABLE_TOPIC);
-
-         getLog().debug("Creating a send session");
-         Session sendSession = topicConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         MessageProducer sender = sendSession.createProducer(topic);
-
-         getLog().debug("Clearing the topic");
-         Session subSession = topicConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         MessageConsumer subscriber = subSession.createDurableSubscriber(topic, "test");
-         Message message = subscriber.receive(50);
-         while (message != null)
-            message = subscriber.receive(50);
-         subSession.close();
-
-         getLog().debug("Subscribing to topic, looking for Value = 'A'");
-         subSession = topicConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         subscriber = subSession.createDurableSubscriber(topic, "test", "Value = 'A'", false);
-
-         getLog().debug("Send some messages");
-         message = sendSession.createTextMessage("Message1");
-         message.setStringProperty("Value", "A");
-         sender.send(message);
-         message = sendSession.createTextMessage("Message2");
-         message.setStringProperty("Value", "A");
-         sender.send(message);
-         message = sendSession.createTextMessage("Message3");
-         message.setStringProperty("Value", "B");
-         sender.send(message);
-
-         getLog().debug("Retrieving the A messages");
-         message = subscriber.receive(2000);
-         assertTrue("Expected message 1", message != null);
-         assertTrue("Should get an A", message.getStringProperty("Value").equals("A"));
-         message = subscriber.receive(2000);
-         assertTrue("Expected message 2", message != null);
-         assertTrue("Should get a second A", message.getStringProperty("Value").equals("A"));
-         assertTrue("That should be it for A", subscriber.receive(2000) == null);
-
-         getLog().debug("Closing the subscriber without acknowledgement");
-         subSession.close();
-
-         getLog().debug("Subscribing to topic, looking for Value = 'B'");
-         subSession = topicConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         subscriber = subSession.createDurableSubscriber(topic, "test", "Value = 'B'", false);
-
-         getLog().debug("Retrieving the non-existent B messages");
-         assertTrue("B should not be there", subscriber.receive(2000) == null);
-
-         getLog().debug("Closing the subscriber.");
-         subSession.close();
-
-         getLog().debug("Subscribing to topic, looking for those Value = 'A'");
-         subSession = topicConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         subscriber = subSession.createDurableSubscriber(topic, "test", "Value = 'A'", false);
-         assertTrue("Should not be any A the subscription was changed", subscriber.receive(2000) == null);
-         subSession.close();
-
-         getLog().debug("Subscribing to topic, looking for everything");
-         subSession = topicConnection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-         subscriber = subSession.createDurableSubscriber(topic, "test", null, false);
-
-         message = sendSession.createTextMessage("Message4");
-         message.setStringProperty("Value", "A");
-         sender.send(message);
-
-         message = subscriber.receive(2000);
-         assertTrue("Expected message 4", message != null);
-         assertTrue("Should be an A which we don't acknowledge", message.getStringProperty("Value").equals("A"));
-         subSession.close();
-
-         getLog().debug("Subscribing to topic, looking for the Value = 'A'");
-         subSession = topicConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         subscriber = subSession.createDurableSubscriber(topic, "test", "Value = 'A'", false);
-         assertTrue(
-            "Should not be any A, the subscription was changed. Even though the old and new selectors match the message",
-            subscriber.receive(2000) == null);
-         subSession.close();
-
-         getLog().debug("Closing the send session");
-         sendSession.close();
-
-         getLog().debug("Removing the subscription");
-         subSession = topicConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         subSession.unsubscribe("test");
-
-      }
-      finally
-      {
-         getLog().debug("Closing the connection");
-         topicConnection.close();
-      }
-
-      getLog().debug("TopicSelectorChange test passed");
-   }
-
-   /**
-    * Test subscribing to a topic with a null and empty selector
-    */
-   public void testTopicSelectorNullOrEmpty() throws Exception
-   {
-      getLog().debug("Starting TopicSelectorNullOrEmpty test");
-
-      getLog().debug("Create topic connection");
-      TopicConnectionFactory topicFactory = (TopicConnectionFactory) context.lookup(TOPIC_FACTORY);
-      topicConnection = topicFactory.createTopicConnection("john", "needle");
-      topicConnection.start();
-
-      try
-      {
-         getLog().debug("Retrieving Topic");
-         Topic topic = (Topic) context.lookup(TEST_DURABLE_TOPIC);
-
-         getLog().debug("Creating a send session");
-         Session sendSession = topicConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         MessageProducer sender = sendSession.createProducer(topic);
-
-         getLog().debug("Clearing the topic");
-         Session subSession = topicConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         MessageConsumer subscriber = subSession.createDurableSubscriber(topic, "test");
-         TextMessage message = (TextMessage) subscriber.receive(50);
-         while (message != null)
-            message = (TextMessage) subscriber.receive(50);
-         subSession.close();
-
-         getLog().debug("Subscribing to topic, with null selector");
-         subSession = topicConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         subscriber = subSession.createDurableSubscriber(topic, "test", null, false);
-
-         getLog().debug("Send a message");
-         message = sendSession.createTextMessage("Message1");
-         sender.send(message);
-
-         getLog().debug("Retrieving the message");
-         message = (TextMessage) subscriber.receive(2000);
-         assertTrue("Expected message 1", message != null);
-         assertTrue("Should get Message1", message.getText().equals("Message1"));
-         getLog().debug("Closing the subscriber");
-         subSession.close();
-
-         getLog().debug("Subscribing to topic, with an empty selector");
-         subSession = topicConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         subscriber = subSession.createDurableSubscriber(topic, "test", "   ", false);
-
-         getLog().debug("Send a message");
-         message = sendSession.createTextMessage("Message2");
-         sender.send(message);
-
-         getLog().debug("Retrieving the message");
-         message = (TextMessage) subscriber.receive(2000);
-         assertTrue("Expected message 2", message != null);
-         assertTrue("Should get Message2", message.getText().equals("Message2"));
-         getLog().debug("Closing the subscriber");
-
-         getLog().debug("Removing the subscription");
-         subSession = topicConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         subSession.unsubscribe("test");
-         subSession.close();
-
-      }
-      finally
-      {
-         getLog().debug("Closing the connection");
-         topicConnection.close();
-      }
-
-      getLog().debug("TopicSelectorNullOrEmpty test passed");
-   }
-
-   /**
-    * Test sending/receiving an outdated message
-    */
-   public void testSendReceiveOutdated() throws Exception
-   {
-      getLog().debug("Starting SendReceiveOutdated test");
-
-      connect();
-      try
-      {
-         queueConnection.start();
-         drainQueue();
-         queueConnection.stop();
-
-         Session session = queueConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         Queue queue = (Queue) context.lookup(TEST_QUEUE);
-         MessageProducer sender = session.createProducer(queue);
-         MessageConsumer receiver = session.createConsumer(queue);
-
-         // Send a message that has expired
-         TextMessage message = session.createTextMessage("Outdated");
-         sender.send(message, DeliveryMode.PERSISTENT, 4, 1);
-         Thread.sleep(100);
-
-         // Send a message that has not expired
-         message = session.createTextMessage("OK");
-         sender.send(message);
-
-         // Try to receive the message the not expired message
-         queueConnection.start();
-         message = (TextMessage) receiver.receiveNoWait();
-         assertEquals("OK", message.getText());
-
-         // Should be no more
-         assertTrue("Didn't expect anymore messages", receiver.receiveNoWait() == null);
-      }
-      finally
-      {
-         disconnect();
-      }
-
-      getLog().debug("SendReceiveOutdated test passed");
-   }
-
-   public void testSendReceiveExpired() throws Exception
-   {
-      getLog().debug("Starting testSendReceiveExpired test");
-
-      connect();
-      try
-      {
-         queueConnection.start();
-         drainQueue();
-
-         Session session = queueConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         Queue queue = (Queue) context.lookup(TEST_QUEUE);
-         MessageProducer sender = session.createProducer(queue);
-         MessageConsumer receiver = session.createConsumer(queue);
-
-         // Send a message that expires in 5 seconds
-         TextMessage message = session.createTextMessage("5 Second Expiration");
-         sender.send(message, DeliveryMode.PERSISTENT, 4, 5*1000);
-         // Send a message that has not expired
-         message = session.createTextMessage("OK");
-         sender.send(message);
-         // Sleep 6 seconds
-         Thread.sleep(6*1000);
-         // Try to receive the OK message
-         message = (TextMessage) receiver.receiveNoWait();
-         assertEquals("OK", message.getText());
-
-         // Should be no more
-         assertTrue("Didn't expect anymore messages", receiver.receiveNoWait() == null);
-
-         // Send a message that expires in 10 seconds
-         message = session.createTextMessage("10 Second Expiration");
-         sender.send(message, DeliveryMode.PERSISTENT, 4, 10*1000);
-         // Send a message that has not expired
-         message = session.createTextMessage("OK");
-         sender.send(message);
-         // Sleep 1 seconds
-         Thread.sleep(1*1000);
-         // Try to receive the messages
-         message = (TextMessage) receiver.receiveNoWait();
-         assertEquals("10 Second Expiration", message.getText());
-         message = (TextMessage) receiver.receiveNoWait();
-         assertEquals("OK", message.getText());
-
-         // Should be no more
-         assertTrue("Didn't expect anymore messages", receiver.receiveNoWait() == null);
-         
-         // Test that JMSExpiration has no affect
-         message = session.createTextMessage("5 Second Expiration");
-         message.setJMSExpiration(System.currentTimeMillis() + 5*1000);
-         sender.send(message, DeliveryMode.PERSISTENT, 4, 0);
-         // Send a message that has not expired
-         message = session.createTextMessage("OK");
-         sender.send(message);
-         // Sleep 6 seconds
-         Thread.sleep(6*1000);
-         // Try to receive the OK message
-         message = (TextMessage) receiver.receiveNoWait();
-         assertEquals("5 Second Expiration", message.getText());
-         message = (TextMessage) receiver.receiveNoWait();
-         assertEquals("OK", message.getText());
-         assertTrue("Didn't expect anymore messages", receiver.receiveNoWait() == null);
-      }
-      finally
-      {
-         disconnect();
-      }
-   }
-
-   class Synch
-   {
-      boolean waiting = false;
-      String text;
-      public synchronized void doWait(long timeout) throws InterruptedException
-      {
-         waiting = true;
-         this.wait(timeout);
-      }
-      public synchronized void doNotify() throws InterruptedException
-      {
-         while (waiting == false)
-            wait(100);
-         this.notifyAll();
-      }
-      public String getText()
-      {
-         return text;
-      }
-      public void setText(String text)
-      {
-         this.text = text;
-      }
-   }
-
-   /**
-    * Test sending/listening an outdated message
-    */
-   public void testSendListenOutdated() throws Exception
-   {
-      getLog().debug("Starting SendListenOutdated test");
-
-      connect();
-      try
-      {
-         queueConnection.start();
-         drainQueue();
-         queueConnection.stop();
-
-         Session session = queueConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         Queue queue = (Queue) context.lookup(TEST_QUEUE);
-         MessageProducer sender = session.createProducer(queue);
-         MessageConsumer receiver = session.createConsumer(queue);
-
-         // Send a message that has expired
-         TextMessage message = session.createTextMessage("Outdated");
-         sender.send(message, DeliveryMode.PERSISTENT, 4, 1);
-         Thread.sleep(100);
-
-         // Send a message that has not expired
-         message = session.createTextMessage("OK");
-         sender.send(message);
-
-         // Try to receive the message the not expired message
-         final Synch synch = new Synch();
-         MessageListener messagelistener = new MessageListener()
-         {
-            public void onMessage(Message message)
-            {
-               listenOutdated(message, synch);
-            }
-         };
-         receiver.setMessageListener(messagelistener);
-         queueConnection.start();
-
-         synch.doWait(10000);
-         assertEquals("OK", synch.getText());
-      }
-      finally
-      {
-         disconnect();
-      }
-
-      getLog().debug("SendListenOutdated test passed");
-   }
-
-   private void listenOutdated(Message message, Synch synch)
-   {
-      try
-      {
-         synch.setText(((TextMessage) message).getText());
-      }
-      catch (Throwable t)
-      {
-         log.error("Error:", t);
-      }
-      finally
-      {
-         try
-         {
-            synch.doNotify();
-         }
-         catch (Throwable t)
-         {
-            log.error("Error:", t);
-         }
-      }
-   }
-}

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/test/SessionCloseStressTestCase.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jbossmessaging/test/SessionCloseStressTestCase.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jbossmessaging/test/SessionCloseStressTestCase.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -325,7 +325,7 @@
    public static Test suite() throws Exception
    {
        ClassLoader loader = Thread.currentThread().getContextClassLoader();
-       String resourceName = getJMSResourceRelativePathname("tests-destinations-service.xml") ;
+       String resourceName = getJMSResourceRelativePathname("test-destinations-service.xml") ;
 
        return getDeploySetup(SessionCloseStressTestCase.class,
                loader.getResource(resourceName).toString());

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jmx/xmbean/XMLAttributePersistenceManagerTestService.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/jmx/xmbean/XMLAttributePersistenceManagerTestService.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/jmx/xmbean/XMLAttributePersistenceManagerTestService.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -40,9 +40,9 @@
  * A test service that wraps an XMLAttributePersistenceManager
  * configured to write to a random directory containing a space
  * in its name, e.g. "./tmp/XmlApmXXXXXTest .dir"
- * 
+ *
  * @see org.jboss.test.jmx.test.MLAttributePersistenceManagerUnitTestCase
- * 
+ *
  * @author <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
  * @version $Revision$
  */
@@ -51,33 +51,33 @@
 {
    private AttributePersistenceManager apm;
    private File storeDir;
-   
+
    protected void startService()
       throws Exception
    {
       File tmpDir = ServerConfigLocator.locate().getServerTempDir();
       boolean result;
-      
+
       // Get a temporary file in the server tmp dir, with a space in its name
-      storeDir = File.createTempFile("XmlApm", "Test .dir", tmpDir);
-      
+      storeDir = File.createTempFile("XmlApm", "Test .directory", tmpDir);
+
       // Remove the tmp file
       result = storeDir.delete();
 
       // Recreate it as directory
       result = storeDir.mkdir();
       log.info("Created 'bad' store dir: " + storeDir + ", " + result);
-      
+
       String dirURL = storeDir.toURL().toString();
-      log.info("Dir URL: " + dirURL);      
-      
+      log.info("Dir URL: " + dirURL);
+
       apm = new XMLAttributePersistenceManager();
 
       // Initialize an XMLAttributePeristenceManager and
       // configure it to point to the "bad" directory
       apm.create(null, prepareConfig(dirURL));
    }
-   
+
    protected void stopService()
       throws Exception
    {
@@ -93,33 +93,33 @@
          log.info("Removed: " +  storeDir + ", " + result);
       }
    }
-   
+
    public void store(String id, AttributeList atlist) throws Exception
    {
       apm.store(id, atlist);
    }
-   
+
    public AttributeList load(String id) throws Exception
    {
       return apm.load(id);
    }
-   
+
    public void selftest() throws Exception
    {
       // Store some attributes under an id
       AttributeList alist = new AttributeList();
       String storeId = "bananarama";
-      
+
       Integer anInteger = new Integer(666);
       String aString = new String("Evil Test");
       alist.add(new Attribute("Attr1", anInteger));
       alist.add(new Attribute("Attr2", aString));
       apm.store(storeId, alist);
-      
+
       // Read them back
-      AttributeList alist2 = apm.load(storeId);      
+      AttributeList alist2 = apm.load(storeId);
    }
-   
+
    private Element prepareConfig(String dir) throws Exception
    {
       // build the config XML Element in memory using DOM
@@ -128,13 +128,13 @@
 
       // Create config element
       Element config = doc.createElement(XMLAttributePersistenceManager.DATA_DIR_ELEMENT);
-      
+
       // Insert a text node with the directory name
       Node text = doc.createTextNode(dir);
-      
+
       config.appendChild(text);
-      
+
       // Return the config
       return config;
-   }   
+   }
 }

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/timer/test/BasicTimerUnitTestCase.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/timer/test/BasicTimerUnitTestCase.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/timer/test/BasicTimerUnitTestCase.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -43,6 +43,7 @@
 import javax.naming.NamingException;
 
 import junit.framework.Test;
+
 import org.jboss.test.JBossTestCase;
 import org.jboss.test.timer.interfaces.TimerEntity;
 import org.jboss.test.timer.interfaces.TimerEntityHome;
@@ -313,6 +314,8 @@
     */
    public void testMDBTimer() throws Exception
    {
+      drainQueue("queue/A");
+      drainQueue("queue/B");
       InitialContext ctx = new InitialContext();
 
       Queue queueA = (Queue) ctx.lookup("queue/A");
@@ -467,6 +470,36 @@
    }
 
 
+   // Emptys out all the messages in a queue
+   protected void drainQueue(String queueName) throws Exception
+   {
+       
+      Connection conn = null;
+      
+      try
+      {
+          InitialContext ctx = new InitialContext();
+          ConnectionFactory cf = (ConnectionFactory)ctx.lookup("ConnectionFactory");
+          conn = cf.createConnection();
+          Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+          Queue queue = (Queue) ctx.lookup(queueName);
+    
+          MessageConsumer receiver = session.createConsumer(queue);
+          Message message = receiver.receive(50);
+          do
+          {
+              message = receiver.receive(200);
+          } while (message != null);
+      }
+      finally
+      {
+          try {conn.close();} catch (Exception ignored){}
+      }
+      
+      
+   }
+
+   
    private EJBHome getEJBHome(String pJNDIName)
       throws NamingException
    {

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/tm/ejb/TxTimeoutBean.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/tm/ejb/TxTimeoutBean.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/tm/ejb/TxTimeoutBean.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -30,7 +30,7 @@
 import org.jboss.tm.TxUtils;
 
 /**
- * @version $Revision:$
+ * @version $Revision$
  */
 public class TxTimeoutBean extends SessionSupport
 {

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/util/test/FileURLListerUnitTestCase.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/testsuite/src/main/org/jboss/test/util/test/FileURLListerUnitTestCase.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/main/org/jboss/test/util/test/FileURLListerUnitTestCase.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -30,7 +30,7 @@
 
 /**
  * FileURLLister tests
- * 
+ *
  * @author <a href="dimitris at jboss.org">Dimitris Andreadis</a>
  * @version $Revision$
 **/
@@ -44,87 +44,87 @@
    public void testListDeployLikeDirStructureDontRecurse() throws Exception
    {
       getLog().debug("+++ testListDeployLikeDirStructureDontRecurse");
-      
+
       String baseUrlString = super.getResourceURL("util/fileurllister/deploy/");
       URL baseUrl = new URL(baseUrlString);
-      
+
       FileURLLister lister = new FileURLLister();
       Collection files = lister.listMembers(baseUrl, "*", false);
-      
+
       logResult(files);
-      
+
       String[] expected = new String[] {
-            "dotted.sub.dir/",
+            "dotted.subdir/",
             "nondottedsubdir/",
             "one.xml",
             "two.xml"
       };
-      
+
       checkResult(files, baseUrlString, expected);
    }
-   
+
    public void testListDeployLikeDirStructureRecurse() throws Exception
    {
       getLog().debug("+++ testListDeployLikeDirStructureRecurse");
-      
+
       String baseUrlString = super.getResourceURL("util/fileurllister/deploy/");
       URL baseUrl = new URL(baseUrlString);
-      
+
       FileURLLister lister = new FileURLLister();
       Collection files = lister.listMembers(baseUrl, "*", true);
-      
+
       logResult(files);
-      
+
       String[] expected = new String[] {
-            "dotted.sub.dir/",
+            "dotted.subdir/",
             "nondottedsubdir/three.xml",
             "one.xml",
             "two.xml",
       };
-      
+
       checkResult(files, baseUrlString, expected);
    }
-   
+
    public void testListDeployLikeDirStructureDontRecurseWithFilter() throws Exception
    {
       getLog().debug("+++ testListDeployLikeDirStructureDontRecurseWithFilter");
-      
+
       String baseUrlString = super.getResourceURL("util/fileurllister/deploy/");
       URL baseUrl = new URL(baseUrlString);
-      
+
       FileURLLister lister = new FileURLLister();
       Collection files = lister.listMembers(baseUrl, "one.xml,nondottedsubdir,three.xml", false);
-      
+
       logResult(files);
-      
+
       String[] expected = new String[] {
             "nondottedsubdir/",
             "one.xml"
       };
-      
+
       checkResult(files, baseUrlString, expected);
    }
-   
+
    public void testListDeployLikeDirStructureRecurseWithFilter() throws Exception
    {
       getLog().debug("+++ testListDeployLikeDirStructureRecurseWithFilter");
-      
+
       String baseUrlString = super.getResourceURL("util/fileurllister/deploy/");
       URL baseUrl = new URL(baseUrlString);
-      
+
       FileURLLister lister = new FileURLLister();
       Collection files = lister.listMembers(baseUrl, "one.xml,nondottedsubdir,three.xml", true);
-      
+
       logResult(files);
-      
+
       String[] expected = new String[] {
             "nondottedsubdir/three.xml",
             "one.xml"
       };
-      
+
       checkResult(files, baseUrlString, expected);
    }
-   
+
    private void logResult(Collection result)
    {
       for (Iterator i = result.iterator(); i.hasNext(); )
@@ -133,12 +133,12 @@
          getLog().debug(url.toString());
       }
    }
-   
+
    private void checkResult(Collection result, String baseUrlString, String[] expected) throws Exception
    {
       assertTrue("result.size(" + result.size() + ") != expected.length(" + expected.length + ")",
             result.size() == expected.length);
-      
+
       for (int i = 0; i < expected.length; i++)
       {
          URL excepted = new URL(baseUrlString + expected[i]);

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/jbossmessaging/META-INF (from rev 67044, branches/JBPAPP_4_2/testsuite/src/resources/jbossmessaging/META-INF)

Deleted: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/jbossmessaging/META-INF/jboss-service.xml
===================================================================
--- branches/JBPAPP_4_2/testsuite/src/resources/jbossmessaging/META-INF/jboss-service.xml	2007-11-13 21:31:41 UTC (rev 67044)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/jbossmessaging/META-INF/jboss-service.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE server
-    PUBLIC "-//JBoss//DTD MBean Service 4.0//EN"
-    "http://www.jboss.org/j2ee/dtd/jboss-service_4_0.dtd">
-
-<server>
-
-   <mbean code="org.jboss.test.jbossmessaging.clustertest.killservice.KillService"
-      name="test:name=JBMKillService">
-   </mbean>
-
-</server>
\ No newline at end of file

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/jbossmessaging/META-INF/jboss-service.xml (from rev 67044, branches/JBPAPP_4_2/testsuite/src/resources/jbossmessaging/META-INF/jboss-service.xml)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/jbossmessaging/META-INF/jboss-service.xml	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/jbossmessaging/META-INF/jboss-service.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE server
+    PUBLIC "-//JBoss//DTD MBean Service 4.0//EN"
+    "http://www.jboss.org/j2ee/dtd/jboss-service_4_0.dtd">
+
+<server>
+
+   <mbean code="org.jboss.test.jbossmessaging.clustertest.killservice.KillService"
+      name="test:name=JBMKillService">
+   </mbean>
+
+</server>
\ No newline at end of file

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/jbossmessaging/test-clustered-destinations-full-service.xml (from rev 67044, branches/JBPAPP_4_2/testsuite/src/resources/jbossmessaging/test-clustered-destinations-full-service.xml)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/jbossmessaging/test-clustered-destinations-full-service.xml	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/jbossmessaging/test-clustered-destinations-full-service.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<server>
+
+   <mbean code="org.jboss.jms.server.destination.QueueService"
+      name="jboss.messaging.destination:service=Queue,name=testDistributedQueueA"
+      xmbean-dd="xmdesc/Queue-xmbean.xml">
+      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+      <depends>jboss.messaging:service=PostOffice</depends>
+      <attribute name="SecurityConfig">
+        <security>
+           <role name="guest" read="true" write="true"/>
+        </security>
+      </attribute>
+      <attribute name="Clustered">true</attribute>
+   </mbean>   
+
+   <mbean code="org.jboss.jms.server.destination.QueueService"
+      name="jboss.messaging.destination:service=Queue,name=testDistributedQueueB"
+      xmbean-dd="xmdesc/Queue-xmbean.xml">
+      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+      <depends>jboss.messaging:service=PostOffice</depends>
+      <attribute name="SecurityConfig">
+        <security>
+           <role name="guest" read="true" write="true"/>
+        </security>
+      </attribute>
+      <attribute name="Clustered">true</attribute>
+   </mbean>   
+
+   <mbean code="org.jboss.jms.server.destination.QueueService"
+      name="jboss.messaging.destination:service=Queue,name=testDistributedQueueC"
+      xmbean-dd="xmdesc/Queue-xmbean.xml">
+      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+      <depends>jboss.messaging:service=PostOffice</depends>
+      <attribute name="SecurityConfig">
+        <security>
+           <role name="guest" read="true" write="true"/>
+        </security>
+      </attribute>
+      <attribute name="Clustered">true</attribute>
+   </mbean>   
+
+   <mbean code="org.jboss.jms.server.destination.QueueService"
+      name="jboss.messaging.destination:service=Queue,name=testDistributedQueueD"
+      xmbean-dd="xmdesc/Queue-xmbean.xml">
+      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+      <depends>jboss.messaging:service=PostOffice</depends>
+      <attribute name="SecurityConfig">
+        <security>
+           <role name="guest" read="true" write="true"/>
+        </security>
+      </attribute>
+      <attribute name="Clustered">true</attribute>
+   </mbean>   
+
+   <mbean code="org.jboss.jms.server.destination.QueueService"
+      name="jboss.messaging.destination:service=Queue,name=testDistributedQueueE"
+      xmbean-dd="xmdesc/Queue-xmbean.xml">
+      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+      <depends>jboss.messaging:service=PostOffice</depends>
+      <attribute name="SecurityConfig">
+        <security>
+           <role name="guest" read="true" write="true"/>
+        </security>
+      </attribute>
+      <attribute name="Clustered">true</attribute>
+   </mbean>   
+
+   <mbean code="org.jboss.jms.server.destination.QueueService"
+      name="jboss.messaging.destination:service=Queue,name=testDistributedQueueF"
+      xmbean-dd="xmdesc/Queue-xmbean.xml">
+      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+      <depends>jboss.messaging:service=PostOffice</depends>
+      <attribute name="SecurityConfig">
+        <security>
+           <role name="guest" read="true" write="true"/>
+        </security>
+      </attribute>
+      <attribute name="Clustered">true</attribute>
+   </mbean>   
+
+
+</server>

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/jbossmessaging/test-destinations-service.xml (from rev 66834, branches/JBPAPP_4_2/testsuite/src/resources/jbossmessaging/test-destinations-service.xml)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/jbossmessaging/test-destinations-service.xml	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/jbossmessaging/test-destinations-service.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<server>
+
+   <mbean code="org.jboss.jms.server.destination.TopicService"
+      name="jboss.messaging.destination:service=Topic,name=testTopic"
+      xmbean-dd="xmdesc/Topic-xmbean.xml">
+      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+      <attribute name="SecurityConfig">
+         <security>
+            <role name="guest" read="true" write="true"/>
+            <role name="publisher" read="true" write="true" create="false"/>
+            <role name="durpublisher" read="true" write="true" create="true"/>
+         </security>
+      </attribute>
+   </mbean>
+
+   <mbean code="org.jboss.jms.server.destination.TopicService"
+         name="jboss.messaging.destination:service=Topic,name=securedTopic"
+         xmbean-dd="xmdesc/Topic-xmbean.xml">
+     <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+     <attribute name="SecurityConfig">
+        <security>
+           <role name="publisher" read="true" write="true" create="false"/>
+        </security>
+     </attribute>
+  </mbean>
+
+   <mbean code="org.jboss.jms.server.destination.TopicService"
+         name="jboss.messaging.destination:service=Topic,name=testDurableTopic"
+         xmbean-dd="xmdesc/Topic-xmbean.xml">
+     <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+     <attribute name="SecurityConfig">
+        <security>
+           <role name="guest" read="true" write="true"/>
+           <role name="publisher" read="true" write="true" create="false"/>
+           <role name="durpublisher" read="true" write="true" create="true"/>
+        </security>
+     </attribute>
+  </mbean>
+
+
+  <mbean code="org.jboss.jms.server.destination.QueueService"
+         name="jboss.messaging.destination:service=Queue,name=testQueue"
+         xmbean-dd="xmdesc/Queue-xmbean.xml">
+     <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+     <attribute name="SecurityConfig">
+        <security>
+           <role name="guest" read="true" write="true"/>
+           <role name="publisher" read="true" write="true" create="false"/>
+           <role name="noacc" read="false" write="false" create="false"/>
+        </security>
+     </attribute>
+  </mbean>
+
+</server>

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/test-configs/jbm-cluster1 (from rev 67044, branches/JBPAPP_4_2/testsuite/src/resources/test-configs/jbm-cluster1)

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/test-configs/jbm-cluster1/deploy (from rev 67044, branches/JBPAPP_4_2/testsuite/src/resources/test-configs/jbm-cluster1/deploy)

Deleted: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/test-configs/jbm-cluster1/deploy/hsqldb-ds.xml
===================================================================
--- branches/JBPAPP_4_2/testsuite/src/resources/test-configs/jbm-cluster1/deploy/hsqldb-ds.xml	2007-11-13 21:31:41 UTC (rev 67044)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/test-configs/jbm-cluster1/deploy/hsqldb-ds.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- The Hypersonic embedded database JCA connection factory config -->
-
-<!-- $Id: hsqldb-ds.xml 39791 2006-01-10 18:14:42Z dimitris $ -->
-
-<datasources>
-   <local-tx-datasource>
-
-      <!-- The jndi name of the DataSource, it is prefixed with java:/ -->
-      <!-- Datasources are not available outside the virtual machine -->
-      <jndi-name>DefaultDS</jndi-name>
-
-      <connection-url>jdbc:hsqldb:hsql://${jboss.bind.address}:1701</connection-url>
-
-      <!-- The driver class -->
-      <driver-class>org.hsqldb.jdbcDriver</driver-class>
-
-      <!-- The login and password -->
-      <user-name>sa</user-name>
-      <password></password>
-
-      <!--example of how to specify class that determines if exception means connection should be destroyed-->
-      <!--exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.DummyExceptionSorter</exception-sorter-class-name-->
-
-      <!-- this will be run before a managed connection is removed from the pool for use by a client-->
-      <!--<check-valid-connection-sql>select * from something</check-valid-connection-sql> -->
-
-      <!-- The minimum connections in a pool/sub-pool. Pools are lazily constructed on first use -->
-      <min-pool-size>5</min-pool-size>
-
-      <!-- The maximum connections in a pool/sub-pool -->
-      <max-pool-size>20</max-pool-size>
-
-      <!-- The time before an unused connection is destroyed -->
-      <!-- NOTE: This is the check period. It will be destroyed somewhere between 1x and 2x this timeout after last use -->
-      <!-- TEMPORARY FIX! - Disable idle connection removal, HSQLDB has a problem with not reaping threads on closed connections -->
-      <idle-timeout-minutes>0</idle-timeout-minutes>
-
-      <!-- sql to call when connection is created
-        <new-connection-sql>some arbitrary sql</new-connection-sql>
-      -->
-
-      <!-- sql to call on an existing pooled connection when it is obtained from pool 
-         <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
-      -->
-
-      <!-- example of how to specify a class that determines a connection is valid before it is handed out from the pool
-         <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.DummyValidConnectionChecker</valid-connection-checker-class-name>
-      -->
-
-      <!-- Whether to check all statements are closed when the connection is returned to the pool,
-           this is a debugging feature that should be turned off in production -->
-      <track-statements/>
-
-      <!-- Use the getConnection(user, pw) for logins
-        <application-managed-security/>
-      -->
-
-      <!-- Use the security domain defined in conf/login-config.xml -->
-      <security-domain>HsqlDbRealm</security-domain>
-
-      <!-- Use the security domain defined in conf/login-config.xml or the
-           getConnection(user, pw) for logins. The security domain takes precedence.
-        <security-domain-and-application>HsqlDbRealm</security-domain-and-application>
-      -->
-
-      <!-- HSQL DB benefits from prepared statement caching -->
-      <prepared-statement-cache-size>32</prepared-statement-cache-size>
-
-      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
-      <metadata>
-         <type-mapping>Hypersonic SQL</type-mapping>
-      </metadata>
-
-      <depends>jboss:service=Hypersonic</depends>
-   </local-tx-datasource>
-
-   <mbean code="org.jboss.jdbc.HypersonicDatabase" 
-     name="jboss:service=Hypersonic">
-     <attribute name="Port">1701</attribute>
-     <attribute name="BindAddress">${jboss.bind.address}</attribute>     
-     <attribute name="Silent">true</attribute>
-     <attribute name="Database">default</attribute>
-     <attribute name="Trace">false</attribute>
-     <attribute name="No_system_exit">true</attribute>
-   </mbean>
-
-</datasources>

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/test-configs/jbm-cluster1/deploy/hsqldb-ds.xml (from rev 67044, branches/JBPAPP_4_2/testsuite/src/resources/test-configs/jbm-cluster1/deploy/hsqldb-ds.xml)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/test-configs/jbm-cluster1/deploy/hsqldb-ds.xml	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/test-configs/jbm-cluster1/deploy/hsqldb-ds.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- The Hypersonic embedded database JCA connection factory config -->
+
+<!-- $Id: hsqldb-ds.xml 39791 2006-01-10 18:14:42Z dimitris $ -->
+
+<datasources>
+   <local-tx-datasource>
+
+      <!-- The jndi name of the DataSource, it is prefixed with java:/ -->
+      <!-- Datasources are not available outside the virtual machine -->
+      <jndi-name>DefaultDS</jndi-name>
+
+      <connection-url>jdbc:hsqldb:hsql://${jboss.bind.address}:1701</connection-url>
+
+      <!-- The driver class -->
+      <driver-class>org.hsqldb.jdbcDriver</driver-class>
+
+      <!-- The login and password -->
+      <user-name>sa</user-name>
+      <password></password>
+
+      <!--example of how to specify class that determines if exception means connection should be destroyed-->
+      <!--exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.DummyExceptionSorter</exception-sorter-class-name-->
+
+      <!-- this will be run before a managed connection is removed from the pool for use by a client-->
+      <!--<check-valid-connection-sql>select * from something</check-valid-connection-sql> -->
+
+      <!-- The minimum connections in a pool/sub-pool. Pools are lazily constructed on first use -->
+      <min-pool-size>5</min-pool-size>
+
+      <!-- The maximum connections in a pool/sub-pool -->
+      <max-pool-size>20</max-pool-size>
+
+      <!-- The time before an unused connection is destroyed -->
+      <!-- NOTE: This is the check period. It will be destroyed somewhere between 1x and 2x this timeout after last use -->
+      <!-- TEMPORARY FIX! - Disable idle connection removal, HSQLDB has a problem with not reaping threads on closed connections -->
+      <idle-timeout-minutes>0</idle-timeout-minutes>
+
+      <!-- sql to call when connection is created
+        <new-connection-sql>some arbitrary sql</new-connection-sql>
+      -->
+
+      <!-- sql to call on an existing pooled connection when it is obtained from pool 
+         <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
+      -->
+
+      <!-- example of how to specify a class that determines a connection is valid before it is handed out from the pool
+         <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.DummyValidConnectionChecker</valid-connection-checker-class-name>
+      -->
+
+      <!-- Whether to check all statements are closed when the connection is returned to the pool,
+           this is a debugging feature that should be turned off in production -->
+      <track-statements/>
+
+      <!-- Use the getConnection(user, pw) for logins
+        <application-managed-security/>
+      -->
+
+      <!-- Use the security domain defined in conf/login-config.xml -->
+      <security-domain>HsqlDbRealm</security-domain>
+
+      <!-- Use the security domain defined in conf/login-config.xml or the
+           getConnection(user, pw) for logins. The security domain takes precedence.
+        <security-domain-and-application>HsqlDbRealm</security-domain-and-application>
+      -->
+
+      <!-- HSQL DB benefits from prepared statement caching -->
+      <prepared-statement-cache-size>32</prepared-statement-cache-size>
+
+      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
+      <metadata>
+         <type-mapping>Hypersonic SQL</type-mapping>
+      </metadata>
+
+      <depends>jboss:service=Hypersonic</depends>
+   </local-tx-datasource>
+
+   <mbean code="org.jboss.jdbc.HypersonicDatabase" 
+     name="jboss:service=Hypersonic">
+     <attribute name="Port">1701</attribute>
+     <attribute name="BindAddress">${jboss.bind.address}</attribute>     
+     <attribute name="Silent">true</attribute>
+     <attribute name="Database">default</attribute>
+     <attribute name="Trace">false</attribute>
+     <attribute name="No_system_exit">true</attribute>
+   </mbean>
+
+</datasources>

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/test-configs/jbm-cluster2 (from rev 67044, branches/JBPAPP_4_2/testsuite/src/resources/test-configs/jbm-cluster2)

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/test-configs/jbm-cluster2/deploy (from rev 67044, branches/JBPAPP_4_2/testsuite/src/resources/test-configs/jbm-cluster2/deploy)

Deleted: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/test-configs/jbm-cluster2/deploy/hsqldb-ds.xml
===================================================================
--- branches/JBPAPP_4_2/testsuite/src/resources/test-configs/jbm-cluster2/deploy/hsqldb-ds.xml	2007-11-13 21:31:41 UTC (rev 67044)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/test-configs/jbm-cluster2/deploy/hsqldb-ds.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- The Hypersonic embedded database JCA connection factory config -->
-
-<!-- $Id: hsqldb-ds.xml 39791 2006-01-10 18:14:42Z dimitris $ -->
-
-<datasources>
-   <local-tx-datasource>
-
-      <!-- The jndi name of the DataSource, it is prefixed with java:/ -->
-      <!-- Datasources are not available outside the virtual machine -->
-      <jndi-name>DefaultDS</jndi-name>
-
-      <connection-url>jdbc:hsqldb:hsql://${jbossnode0}:1701</connection-url>
-
-      <!-- The driver class -->
-      <driver-class>org.hsqldb.jdbcDriver</driver-class>
-
-      <!-- The login and password -->
-      <user-name>sa</user-name>
-      <password></password>
-
-      <!--example of how to specify class that determines if exception means connection should be destroyed-->
-      <!--exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.DummyExceptionSorter</exception-sorter-class-name-->
-
-      <!-- this will be run before a managed connection is removed from the pool for use by a client-->
-      <!--<check-valid-connection-sql>select * from something</check-valid-connection-sql> -->
-
-      <!-- The minimum connections in a pool/sub-pool. Pools are lazily constructed on first use -->
-      <min-pool-size>5</min-pool-size>
-
-      <!-- The maximum connections in a pool/sub-pool -->
-      <max-pool-size>20</max-pool-size>
-
-      <!-- The time before an unused connection is destroyed -->
-      <!-- NOTE: This is the check period. It will be destroyed somewhere between 1x and 2x this timeout after last use -->
-      <!-- TEMPORARY FIX! - Disable idle connection removal, HSQLDB has a problem with not reaping threads on closed connections -->
-      <idle-timeout-minutes>0</idle-timeout-minutes>
-
-      <!-- sql to call when connection is created
-        <new-connection-sql>some arbitrary sql</new-connection-sql>
-      -->
-
-      <!-- sql to call on an existing pooled connection when it is obtained from pool 
-         <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
-      -->
-
-      <!-- example of how to specify a class that determines a connection is valid before it is handed out from the pool
-         <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.DummyValidConnectionChecker</valid-connection-checker-class-name>
-      -->
-
-      <!-- Whether to check all statements are closed when the connection is returned to the pool,
-           this is a debugging feature that should be turned off in production -->
-      <track-statements/>
-
-      <!-- Use the getConnection(user, pw) for logins
-        <application-managed-security/>
-      -->
-
-      <!-- Use the security domain defined in conf/login-config.xml -->
-      <security-domain>HsqlDbRealm</security-domain>
-
-      <!-- Use the security domain defined in conf/login-config.xml or the
-           getConnection(user, pw) for logins. The security domain takes precedence.
-        <security-domain-and-application>HsqlDbRealm</security-domain-and-application>
-      -->
-
-      <!-- HSQL DB benefits from prepared statement caching -->
-      <prepared-statement-cache-size>32</prepared-statement-cache-size>
-
-      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
-      <metadata>
-         <type-mapping>Hypersonic SQL</type-mapping>
-      </metadata>
-
-   </local-tx-datasource>
-
-</datasources>

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/test-configs/jbm-cluster2/deploy/hsqldb-ds.xml (from rev 67044, branches/JBPAPP_4_2/testsuite/src/resources/test-configs/jbm-cluster2/deploy/hsqldb-ds.xml)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/test-configs/jbm-cluster2/deploy/hsqldb-ds.xml	                        (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/test-configs/jbm-cluster2/deploy/hsqldb-ds.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- The Hypersonic embedded database JCA connection factory config -->
+
+<!-- $Id: hsqldb-ds.xml 39791 2006-01-10 18:14:42Z dimitris $ -->
+
+<datasources>
+   <local-tx-datasource>
+
+      <!-- The jndi name of the DataSource, it is prefixed with java:/ -->
+      <!-- Datasources are not available outside the virtual machine -->
+      <jndi-name>DefaultDS</jndi-name>
+
+      <connection-url>jdbc:hsqldb:hsql://${jbossnode0}:1701</connection-url>
+
+      <!-- The driver class -->
+      <driver-class>org.hsqldb.jdbcDriver</driver-class>
+
+      <!-- The login and password -->
+      <user-name>sa</user-name>
+      <password></password>
+
+      <!--example of how to specify class that determines if exception means connection should be destroyed-->
+      <!--exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.DummyExceptionSorter</exception-sorter-class-name-->
+
+      <!-- this will be run before a managed connection is removed from the pool for use by a client-->
+      <!--<check-valid-connection-sql>select * from something</check-valid-connection-sql> -->
+
+      <!-- The minimum connections in a pool/sub-pool. Pools are lazily constructed on first use -->
+      <min-pool-size>5</min-pool-size>
+
+      <!-- The maximum connections in a pool/sub-pool -->
+      <max-pool-size>20</max-pool-size>
+
+      <!-- The time before an unused connection is destroyed -->
+      <!-- NOTE: This is the check period. It will be destroyed somewhere between 1x and 2x this timeout after last use -->
+      <!-- TEMPORARY FIX! - Disable idle connection removal, HSQLDB has a problem with not reaping threads on closed connections -->
+      <idle-timeout-minutes>0</idle-timeout-minutes>
+
+      <!-- sql to call when connection is created
+        <new-connection-sql>some arbitrary sql</new-connection-sql>
+      -->
+
+      <!-- sql to call on an existing pooled connection when it is obtained from pool 
+         <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
+      -->
+
+      <!-- example of how to specify a class that determines a connection is valid before it is handed out from the pool
+         <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.DummyValidConnectionChecker</valid-connection-checker-class-name>
+      -->
+
+      <!-- Whether to check all statements are closed when the connection is returned to the pool,
+           this is a debugging feature that should be turned off in production -->
+      <track-statements/>
+
+      <!-- Use the getConnection(user, pw) for logins
+        <application-managed-security/>
+      -->
+
+      <!-- Use the security domain defined in conf/login-config.xml -->
+      <security-domain>HsqlDbRealm</security-domain>
+
+      <!-- Use the security domain defined in conf/login-config.xml or the
+           getConnection(user, pw) for logins. The security domain takes precedence.
+        <security-domain-and-application>HsqlDbRealm</security-domain-and-application>
+      -->
+
+      <!-- HSQL DB benefits from prepared statement caching -->
+      <prepared-statement-cache-size>32</prepared-statement-cache-size>
+
+      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
+      <metadata>
+         <type-mapping>Hypersonic SQL</type-mapping>
+      </metadata>
+
+   </local-tx-datasource>
+
+</datasources>

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/util/fileurllister/deploy/dotted.subdir (from rev 68159, branches/JBPAPP_4_2/testsuite/src/resources/util/fileurllister/deploy/dotted.subdir)

Deleted: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/util/fileurllister/deploy/dotted.subdir/four.xml
===================================================================

Copied: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/testsuite/src/resources/util/fileurllister/deploy/dotted.subdir/four.xml (from rev 68159, branches/JBPAPP_4_2/testsuite/src/resources/util/fileurllister/deploy/dotted.subdir/four.xml)
===================================================================


Property changes on: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/thirdparty
___________________________________________________________________
Name: svn:ignore
   - antlr
apache-addressing
apache-avalon
apache-avalon-logkit
apache-bcel
apache-beanutils
apache-bsf
apache-codec
apache-collections
apache-digester
apache-discovery
apache-fileupload
apache-httpclient
apache-jaxme
apache-lang
apache-log4j
apache-logging
apache-modeler
apache-myfaces
apache-pool
apache-scout
apache-slide
apache-tomcat
apache-velocity
apache-wss4j
apache-xalan
apache-xerces
apache-xmlsec
beanshell
cglib
commons-el
dom4j
gjt-jpl-util
gnu-getopt
hibernate
hibernate-annotations
hibernate-entitymanager
hsqldb
ibm-wsdl4j
jacorb
javassist
jaxen
jboss
jfreechart
jgroups
joesnmp
juddi
junit
junitejb
licenses
objectweb-joramtests
odmg
oswego-concurrent
qdox
quartz
sleepycat
sun-jaf
sun-javacc
sun-javamail
sun-jaxb
sun-servlet
trove
wutka-dtdparser
xdoclet
xml-sax
libraries.ent
jbpm
testsuite-libraries.ent
sun-jsf
sun-jstl
sun-opends
stax-api
woodstox
apache-xml-commons
snmptrapappender

   + antlr
apache-addressing
apache-avalon
apache-avalon-logkit
apache-bcel
apache-beanutils
apache-bsf
apache-codec
apache-collections
apache-digester
apache-discovery
apache-fileupload
apache-httpclient
apache-jaxme
apache-lang
apache-log4j
apache-logging
apache-modeler
apache-myfaces
apache-pool
apache-scout
apache-slide
apache-tomcat
apache-velocity
apache-wss4j
apache-xalan
apache-xerces
apache-xmlsec
beanshell
cglib
commons-el
dom4j
gjt-jpl-util
gnu-getopt
hibernate
hibernate-annotations
hibernate-entitymanager
hsqldb
ibm-wsdl4j
jacorb
javassist
jaxen
jboss
jfreechart
jgroups
joesnmp
juddi
junit
junitejb
licenses
objectweb-joramtests
odmg
oswego-concurrent
qdox
quartz
sleepycat
sun-jaf
sun-javacc
sun-javamail
sun-jaxb
sun-servlet
trove
wutka-dtdparser
xdoclet
xml-sax
libraries.ent
jbpm
testsuite-libraries.ent
sun-jsf
sun-jstl
sun-opends
stax-api
woodstox
apache-xml-commons
snmptrapappender
sun-jaxws
wscommons-policy


Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/tomcat/src/main/org/jboss/web/tomcat/service/session/JBossCacheWrapper.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/tomcat/src/main/org/jboss/web/tomcat/service/session/JBossCacheWrapper.java	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/tomcat/src/main/org/jboss/web/tomcat/service/session/JBossCacheWrapper.java	2008-01-16 20:55:40 UTC (rev 69046)
@@ -32,13 +32,6 @@
 
 public class JBossCacheWrapper 
 {
-   static final Option GRAVITATE_OPTION = new Option();
-
-   static
-   {
-      GRAVITATE_OPTION.setForceDataGravitation(true);
-   }
-         
    private static final int RETRY = 3;
    private PojoCacheMBean proxy_;
 
@@ -75,9 +68,15 @@
          {
             Object value = null;
             if (gravitate)
-               value = proxy_.get(fqn, id, GRAVITATE_OPTION);
+            {
+               Option option = new Option();
+               option.setForceDataGravitation(true);
+               value = proxy_.get(fqn, id, option);
+            }
             else
+            {
                value = proxy_.get(fqn, id);
+            }
             return value;
          }
          catch (TimeoutException e)

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/tools/etc/buildmagic/buildmagic.ent
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/tools/etc/buildmagic/buildmagic.ent	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/tools/etc/buildmagic/buildmagic.ent	2008-01-16 20:55:40 UTC (rev 69046)
@@ -101,7 +101,7 @@
   <property name="version.major" value="4"/>
   <property name="version.minor" value="3"/>
   <property name="version.revision" value="0"/>
-  <property name="version.tag" value="GA_CP01"/>
+  <property name="version.tag" value="GA"/>
   <property name="version.name" value="Trinity"/>
   <!-- This must be set to the CVS tag for any release -->
   <property name="version.cvstag" value="JBoss_${version.major}_${version.minor}_${version.revision}_${version.tag}" />

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/tools/etc/buildmagic/version-info.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/tools/etc/buildmagic/version-info.xml	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/tools/etc/buildmagic/version-info.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -17,7 +17,7 @@
     <property name="version.major" value="4"/>
     <property name="version.minor" value="3"/>
     <property name="version.revision" value="0"/>
-    <property name="version.tag" value="GA_CP01"/>
+    <property name="version.tag" value="GA"/>
     <property name="version.name" value="Trinity"/>
     <!-- This must be set to the CVS tag for any release -->
     <property name="version.cvstag" value="JBoss_${version.major}_${version.minor}_${version.revision}_${version.tag}"/>

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/varia/src/resources/services/binding/sample-bindings.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/varia/src/resources/services/binding/sample-bindings.xml	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/varia/src/resources/services/binding/sample-bindings.xml	2008-01-16 20:55:40 UTC (rev 69046)
@@ -153,7 +153,7 @@
       <!-- ********************* hajndi-jms-ds.xml **************** -->
 
       <!-- The JMS provider loader -->
-      <service-config name="jboss.mq:service=JMSProviderLoader,name=HAJNDIJMSProvider"
+      <service-config name="jboss.jms:service=JMSProviderLoader,name=HAJNDIJMSProvider"
          delegateClass="org.jboss.services.binding.AttributeMappingDelegate">
          <!--
               MAKE SURE java.naming.provider.url
@@ -404,26 +404,53 @@
                       delegateClass="org.jboss.services.binding.AttributeMappingDelegate">
          <delegate-config>
             <attribute name="Configuration"><![CDATA[
-               <config>
-                  <invoker transport="bisocket">
-                     <attribute name="marshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
-                     <attribute name="unmarshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
-                     <attribute name="dataType" isParam="true">jms</attribute>
-                     <attribute name="socket.check_connection" isParam="true">false</attribute>
-                     <attribute name="timeout" isParam="true">0</attribute>
-                     <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
-                     <attribute name="serverBindPort">4457</attribute>
-                     <attribute name="leasePeriod">10000</attribute>
-                     <attribute name="clientSocketClass" isParam="true">org.jboss.jms.client.remoting.ClientSocketWrapper</attribute>
-                     <attribute name="serverSocketClass">org.jboss.jms.server.remoting.ServerSocketWrapper</attribute>
-                     <attribute name="numberOfRetries" isParam="true">1</attribute>
-                     <attribute name="numberOfCallRetries" isParam="true">1</attribute>
-                     <attribute name="clientMaxPoolSize" isParam="true">50</attribute>
-                  </invoker>
-                 <handlers>
-                    <handler subsystem="JMS">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>
-                 </handlers>
-              </config>
+ at 43CONF
+         <config>
+            <invoker transport="bisocket">
+               <attribute name="marshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
+               <attribute name="unmarshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
+               <attribute name="dataType" isParam="true">jms</attribute>
+               <attribute name="socket.check_connection" isParam="true">false</attribute>
+               <attribute name="timeout" isParam="true">0</attribute>
+               <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
+               <attribute name="serverBindPort">4457</attribute>
+               <attribute name="clientSocketClass" isParam="true">org.jboss.jms.client.remoting.ClientSocketWrapper</attribute>
+               <attribute name="serverSocketClass">org.jboss.jms.server.remoting.ServerSocketWrapper</attribute>
+               <attribute name="numberOfCallRetries" isParam="true">1</attribute>
+               <attribute name="pingFrequency" isParam="true">214748364</attribute>
+               <attribute name="pingWindowFactor" isParam="true">10</attribute>
+               <attribute name="onewayThreadPool">org.jboss.jms.server.remoting.DirectThreadPool</attribute>
+               <attribute name="clientLeasePeriod" isParam="true">10000</attribute>
+               <attribute name="numberOfRetries" isParam="true">10</attribute>
+               <attribute name="JBM_clientMaxPoolSize" isParam="true">200</attribute>
+            </invoker>
+            <handlers>
+               <handler subsystem="JMS">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>
+            </handlers>
+         </config>
+ at END43CONF
+ at 42CONF
+         <config>
+            <invoker transport="bisocket">
+               <attribute name="marshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
+               <attribute name="unmarshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
+               <attribute name="dataType" isParam="true">jms</attribute>
+               <attribute name="socket.check_connection" isParam="true">false</attribute>
+               <attribute name="timeout" isParam="true">0</attribute>
+               <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
+               <attribute name="serverBindPort">4457</attribute>
+               <attribute name="leasePeriod">10000</attribute>
+               <attribute name="clientSocketClass" isParam="true">org.jboss.jms.client.remoting.ClientSocketWrapper</attribute>
+               <attribute name="serverSocketClass">org.jboss.jms.server.remoting.ServerSocketWrapper</attribute>
+               <attribute name="numberOfRetries" isParam="true">1</attribute>
+               <attribute name="numberOfCallRetries" isParam="true">1</attribute>
+               <attribute name="clientMaxPoolSize" isParam="true">50</attribute>
+            </invoker>
+            <handlers>
+               <handler subsystem="JMS">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>
+            </handlers>
+         </config>
+ at END42CONF
          ]]></attribute>
          </delegate-config>
          <binding port="4457"/>
@@ -809,26 +836,53 @@
                       delegateClass="org.jboss.services.binding.AttributeMappingDelegate">
          <delegate-config>
             <attribute name="Configuration"><![CDATA[
-               <config>
-                  <invoker transport="bisocket">
-                     <attribute name="marshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
-                     <attribute name="unmarshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
-                     <attribute name="dataType" isParam="true">jms</attribute>
-                     <attribute name="socket.check_connection" isParam="true">false</attribute>
-                     <attribute name="timeout" isParam="true">0</attribute>
-                     <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
-                     <attribute name="serverBindPort">4557</attribute>
-                     <attribute name="leasePeriod">10000</attribute>
-                     <attribute name="clientSocketClass" isParam="true">org.jboss.jms.client.remoting.ClientSocketWrapper</attribute>
-                     <attribute name="serverSocketClass">org.jboss.jms.server.remoting.ServerSocketWrapper</attribute>
-                     <attribute name="numberOfRetries" isParam="true">1</attribute>
-                     <attribute name="numberOfCallRetries" isParam="true">1</attribute>
-                     <attribute name="clientMaxPoolSize" isParam="true">50</attribute>
-                  </invoker>
-                 <handlers>
-                    <handler subsystem="JMS">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>
-                 </handlers>
-              </config>
+ at 43CONF
+         <config>
+            <invoker transport="bisocket">
+               <attribute name="marshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
+               <attribute name="unmarshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
+               <attribute name="dataType" isParam="true">jms</attribute>
+               <attribute name="socket.check_connection" isParam="true">false</attribute>
+               <attribute name="timeout" isParam="true">0</attribute>
+               <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
+               <attribute name="serverBindPort">4557</attribute>
+               <attribute name="clientSocketClass" isParam="true">org.jboss.jms.client.remoting.ClientSocketWrapper</attribute>
+               <attribute name="serverSocketClass">org.jboss.jms.server.remoting.ServerSocketWrapper</attribute>
+               <attribute name="numberOfCallRetries" isParam="true">1</attribute>
+               <attribute name="pingFrequency" isParam="true">214748364</attribute>
+               <attribute name="pingWindowFactor" isParam="true">10</attribute>
+               <attribute name="onewayThreadPool">org.jboss.jms.server.remoting.DirectThreadPool</attribute>
+               <attribute name="clientLeasePeriod" isParam="true">10000</attribute>
+               <attribute name="numberOfRetries" isParam="true">10</attribute>
+               <attribute name="JBM_clientMaxPoolSize" isParam="true">200</attribute>
+            </invoker>
+            <handlers>
+               <handler subsystem="JMS">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>
+            </handlers>
+         </config>
+ at END43CONF
+ at 42CONF
+         <config>
+           <invoker transport="bisocket">
+              <attribute name="marshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
+              <attribute name="unmarshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
+              <attribute name="dataType" isParam="true">jms</attribute>
+              <attribute name="socket.check_connection" isParam="true">false</attribute>
+              <attribute name="timeout" isParam="true">0</attribute>
+              <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
+              <attribute name="serverBindPort">4557</attribute>
+              <attribute name="leasePeriod">10000</attribute>
+              <attribute name="clientSocketClass" isParam="true">org.jboss.jms.client.remoting.ClientSocketWrapper</attribute>
+              <attribute name="serverSocketClass">org.jboss.jms.server.remoting.ServerSocketWrapper</attribute>
+              <attribute name="numberOfRetries" isParam="true">1</attribute>
+              <attribute name="numberOfCallRetries" isParam="true">1</attribute>
+              <attribute name="clientMaxPoolSize" isParam="true">50</attribute>
+           </invoker>
+           <handlers>
+              <handler subsystem="JMS">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>
+           </handlers>
+         </config>
+ at END42CONF
          ]]></attribute>
          </delegate-config>
          <binding port="4557"/>
@@ -1215,26 +1269,53 @@
                       delegateClass="org.jboss.services.binding.AttributeMappingDelegate">
          <delegate-config>
             <attribute name="Configuration"><![CDATA[
-               <config>
-                  <invoker transport="bisocket">
-                     <attribute name="marshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
-                     <attribute name="unmarshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
-                     <attribute name="dataType" isParam="true">jms</attribute>
-                     <attribute name="socket.check_connection" isParam="true">false</attribute>
-                     <attribute name="timeout" isParam="true">0</attribute>
-                     <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
-                     <attribute name="serverBindPort">4657</attribute>
-                     <attribute name="leasePeriod">10000</attribute>
-                     <attribute name="clientSocketClass" isParam="true">org.jboss.jms.client.remoting.ClientSocketWrapper</attribute>
-                     <attribute name="serverSocketClass">org.jboss.jms.server.remoting.ServerSocketWrapper</attribute>
-                     <attribute name="numberOfRetries" isParam="true">1</attribute>
-                     <attribute name="numberOfCallRetries" isParam="true">1</attribute>
-                     <attribute name="clientMaxPoolSize" isParam="true">50</attribute>
-                  </invoker>
-                 <handlers>
-                    <handler subsystem="JMS">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>
-                 </handlers>
-              </config>
+ at 43CONF
+         <config>
+            <invoker transport="bisocket">
+               <attribute name="marshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
+               <attribute name="unmarshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
+               <attribute name="dataType" isParam="true">jms</attribute>
+               <attribute name="socket.check_connection" isParam="true">false</attribute>
+               <attribute name="timeout" isParam="true">0</attribute>
+               <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
+               <attribute name="serverBindPort">4657</attribute>
+               <attribute name="clientSocketClass" isParam="true">org.jboss.jms.client.remoting.ClientSocketWrapper</attribute>
+               <attribute name="serverSocketClass">org.jboss.jms.server.remoting.ServerSocketWrapper</attribute>
+               <attribute name="numberOfCallRetries" isParam="true">1</attribute>
+               <attribute name="pingFrequency" isParam="true">214748364</attribute>
+               <attribute name="pingWindowFactor" isParam="true">10</attribute>
+               <attribute name="onewayThreadPool">org.jboss.jms.server.remoting.DirectThreadPool</attribute>
+               <attribute name="clientLeasePeriod" isParam="true">10000</attribute>
+               <attribute name="numberOfRetries" isParam="true">10</attribute>
+               <attribute name="JBM_clientMaxPoolSize" isParam="true">200</attribute>
+            </invoker>
+            <handlers>
+               <handler subsystem="JMS">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>
+            </handlers>
+         </config>
+ at END43CONF
+ at 42CONF
+         <config>
+            <invoker transport="bisocket">
+               <attribute name="marshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
+               <attribute name="unmarshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
+               <attribute name="dataType" isParam="true">jms</attribute>
+               <attribute name="socket.check_connection" isParam="true">false</attribute>
+               <attribute name="timeout" isParam="true">0</attribute>
+               <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
+               <attribute name="serverBindPort">4657</attribute>
+               <attribute name="leasePeriod">10000</attribute>
+               <attribute name="clientSocketClass" isParam="true">org.jboss.jms.client.remoting.ClientSocketWrapper</attribute>
+               <attribute name="serverSocketClass">org.jboss.jms.server.remoting.ServerSocketWrapper</attribute>
+               <attribute name="numberOfRetries" isParam="true">1</attribute>
+               <attribute name="numberOfCallRetries" isParam="true">1</attribute>
+               <attribute name="clientMaxPoolSize" isParam="true">50</attribute>
+            </invoker>
+            <handlers>
+               <handler subsystem="JMS">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>
+            </handlers>
+         </config>
+ at END42CONF
          ]]></attribute>
          </delegate-config>
          <binding port="4657"/>
@@ -1578,26 +1659,53 @@
                       delegateClass="org.jboss.services.binding.AttributeMappingDelegate">
          <delegate-config>
             <attribute name="Configuration"><![CDATA[
-               <config>
-                  <invoker transport="bisocket">
-                     <attribute name="marshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
-                     <attribute name="unmarshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
-                     <attribute name="dataType" isParam="true">jms</attribute>
-                     <attribute name="socket.check_connection" isParam="true">false</attribute>
-                     <attribute name="timeout" isParam="true">0</attribute>
-                     <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
-                     <attribute name="serverBindPort">4757</attribute>
-                     <attribute name="leasePeriod">10000</attribute>
-                     <attribute name="clientSocketClass" isParam="true">org.jboss.jms.client.remoting.ClientSocketWrapper</attribute>
-                     <attribute name="serverSocketClass">org.jboss.jms.server.remoting.ServerSocketWrapper</attribute>
-                     <attribute name="numberOfRetries" isParam="true">1</attribute>
-                     <attribute name="numberOfCallRetries" isParam="true">1</attribute>
-                     <attribute name="clientMaxPoolSize" isParam="true">50</attribute>
-                  </invoker>
-                 <handlers>
-                    <handler subsystem="JMS">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>
-                 </handlers>
-              </config>
+ at 43CONF
+         <config>
+            <invoker transport="bisocket">
+               <attribute name="marshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
+               <attribute name="unmarshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
+               <attribute name="dataType" isParam="true">jms</attribute>
+               <attribute name="socket.check_connection" isParam="true">false</attribute>
+               <attribute name="timeout" isParam="true">0</attribute>
+               <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
+               <attribute name="serverBindPort">4757</attribute>
+               <attribute name="clientSocketClass" isParam="true">org.jboss.jms.client.remoting.ClientSocketWrapper</attribute>
+               <attribute name="serverSocketClass">org.jboss.jms.server.remoting.ServerSocketWrapper</attribute>
+               <attribute name="numberOfCallRetries" isParam="true">1</attribute>
+               <attribute name="pingFrequency" isParam="true">214748364</attribute>
+               <attribute name="pingWindowFactor" isParam="true">10</attribute>
+               <attribute name="onewayThreadPool">org.jboss.jms.server.remoting.DirectThreadPool</attribute>
+               <attribute name="clientLeasePeriod" isParam="true">10000</attribute>
+               <attribute name="numberOfRetries" isParam="true">10</attribute>
+               <attribute name="JBM_clientMaxPoolSize" isParam="true">200</attribute>
+            </invoker>
+            <handlers>
+               <handler subsystem="JMS">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>
+            </handlers>
+         </config>
+ at END43CONF
+ at 42CONF
+        <config>
+           <invoker transport="bisocket">
+              <attribute name="marshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
+              <attribute name="unmarshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
+              <attribute name="dataType" isParam="true">jms</attribute>
+              <attribute name="socket.check_connection" isParam="true">false</attribute>
+              <attribute name="timeout" isParam="true">0</attribute>
+              <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
+              <attribute name="serverBindPort">4757</attribute>
+              <attribute name="leasePeriod">10000</attribute>
+              <attribute name="clientSocketClass" isParam="true">org.jboss.jms.client.remoting.ClientSocketWrapper</attribute>
+              <attribute name="serverSocketClass">org.jboss.jms.server.remoting.ServerSocketWrapper</attribute>
+              <attribute name="numberOfRetries" isParam="true">1</attribute>
+              <attribute name="numberOfCallRetries" isParam="true">1</attribute>
+              <attribute name="clientMaxPoolSize" isParam="true">50</attribute>
+           </invoker>
+           <handlers>
+              <handler subsystem="JMS">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>
+           </handlers>
+         </config>
+ at END42CONF
          ]]></attribute>
          </delegate-config>
          <binding port="4757"/>

Modified: branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/varia/src/resources/services/snmp/deploy/attributes.mib
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/varia/src/resources/services/snmp/deploy/attributes.mib	2008-01-16 20:46:08 UTC (rev 69045)
+++ branches/JBPAPP_4_2_0_GA_CP_4_3_MERGE/varia/src/resources/services/snmp/deploy/attributes.mib	2008-01-16 20:55:40 UTC (rev 69046)
@@ -2,7 +2,7 @@
 -- Example MIB for the delivered attributes.xml
 -- This file is only an example. The provided values will change in the future.
 -- See also <a href="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossOIDs">The Wiki</a>
--- $Id:$
+-- $Id$
 -- <a href="mailto:hwr at pilhuhn.de>Heiko W. Rupp</a>
 
 JBOSS-AS-MIB DEFINITIONS ::=BEGIN




More information about the jboss-cvs-commits mailing list