activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r786051 - in /activemq/sandbox/activemq-flow: activemq-all/src/test/java/org/apache/activemq/legacy/ activemq-all/src/test/java/org/apache/activemq/legacy/demo/ activemq-all/src/test/java/org/apache/activemq/legacy/test/rollback/ activemq-a...
Date Thu, 18 Jun 2009 13:22:32 GMT
Author: chirino
Date: Thu Jun 18 13:22:31 2009
New Revision: 786051

URL: http://svn.apache.org/viewvc?rev=786051&view=rev
Log:
moving some highly openwire related tests to the openwire module.


Added:
    activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/test4/rollback/
      - copied from r786032, activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/test/rollback/
    activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/test4/rollback/CloseRollbackRedeliveryQueueTest.java
      - copied, changed from r786040, activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/test/rollback/CloseRollbackRedeliveryQueueTest.java
    activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/test4/rollback/RollbacksWhileConsumingLargeQueueTest.java
      - copied, changed from r786040, activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/test/rollback/RollbacksWhileConsumingLargeQueueTest.java
    activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/demo/
      - copied from r786032, activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/demo/
    activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/demo/Main.java
      - copied, changed from r786040, activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/Main.java
    activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/
    activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/AdvisoryBrokerTest.java
      - copied, changed from r786040, activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/advisory/AdvisoryBrokerTest.java
    activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/BrokerBenchmark.java
      - copied, changed from r786040, activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/BrokerBenchmark.java
    activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/BrokerRestartTestSupport.java
      - copied, changed from r786040, activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/BrokerRestartTestSupport.java
    activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/BrokerTest.java
      - copied, changed from r786040, activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/BrokerTest.java
    activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/BrokerTestSupport.java
      - copied, changed from r786040, activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/BrokerTestSupport.java
    activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/ConcurrentConnectSimulationTest.java
      - copied, changed from r786040, activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/ConcurrentConnectSimulationTest.java
    activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/MarshallingBrokerTest.java
      - copied, changed from r786040, activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/MarshallingBrokerTest.java
    activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/MessageExpirationTest.java
      - copied, changed from r786040, activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/MessageExpirationTest.java
    activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/ProgressPrinter.java
      - copied, changed from r786040, activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/ProgressPrinter.java
    activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/RecoveryBrokerTest.java
      - copied, changed from r786040, activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/RecoveryBrokerTest.java
    activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/StubConnection.java
    activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/XARecoveryBrokerTest.java
      - copied, changed from r786040, activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/XARecoveryBrokerTest.java
Removed:
    activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/Main.java
    activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/demo/
    activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/test/rollback/
    activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/broker/
    activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/BrokerBenchmark.java
    activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/BrokerRestartTestSupport.java
    activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/BrokerTest.java
    activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/BrokerTestSupport.java
    activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/ConcurrentConnectSimulationTest.java
    activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/MarshallingBrokerTest.java
    activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/MessageExpirationTest.java
    activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/ProgressPrinter.java
    activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/RecoveryBrokerTest.java
    activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/StubBroker.java
    activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/StubConnection.java
    activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/XARecoveryBrokerTest.java
    activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/advisory/
Modified:
    activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/test4/rollback/DelegatingTransactionalMessageListener.java
    activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/test5/ClientTestSupport.java
    activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/transport/TransportBrokerTestSupport.java
    activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/transport/tcp/SslBrokerServiceTest.java
    activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/broker/Broker.java
    activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/demo/DefaultQueueSender.java
    activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/demo/SimpleConsumer.java
    activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/demo/SimpleProducer.java
    activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/demo/SimpleQueueReceiver.java
    activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/demo/SimpleQueueSender.java

Copied: activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/test4/rollback/CloseRollbackRedeliveryQueueTest.java (from r786040, activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/test/rollback/CloseRollbackRedeliveryQueueTest.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/test4/rollback/CloseRollbackRedeliveryQueueTest.java?p2=activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/test4/rollback/CloseRollbackRedeliveryQueueTest.java&p1=activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/test/rollback/CloseRollbackRedeliveryQueueTest.java&r1=786040&r2=786051&rev=786051&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/test/rollback/CloseRollbackRedeliveryQueueTest.java (original)
+++ activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/test4/rollback/CloseRollbackRedeliveryQueueTest.java Thu Jun 18 13:22:31 2009
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.activemq.legacy.test.rollback;
+package org.apache.activemq.legacy.test4.rollback;
 
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;

Modified: activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/test4/rollback/DelegatingTransactionalMessageListener.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/test4/rollback/DelegatingTransactionalMessageListener.java?rev=786051&r1=786032&r2=786051&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/test4/rollback/DelegatingTransactionalMessageListener.java (original)
+++ activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/test4/rollback/DelegatingTransactionalMessageListener.java Thu Jun 18 13:22:31 2009
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.activemq.legacy.test.rollback;
+package org.apache.activemq.legacy.test4.rollback;
 
 import javax.jms.Connection;
 import javax.jms.Destination;

Copied: activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/test4/rollback/RollbacksWhileConsumingLargeQueueTest.java (from r786040, activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/test/rollback/RollbacksWhileConsumingLargeQueueTest.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/test4/rollback/RollbacksWhileConsumingLargeQueueTest.java?p2=activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/test4/rollback/RollbacksWhileConsumingLargeQueueTest.java&p1=activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/test/rollback/RollbacksWhileConsumingLargeQueueTest.java&r1=786040&r2=786051&rev=786051&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/test/rollback/RollbacksWhileConsumingLargeQueueTest.java (original)
+++ activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/test4/rollback/RollbacksWhileConsumingLargeQueueTest.java Thu Jun 18 13:22:31 2009
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.activemq.legacy.test.rollback;
+package org.apache.activemq.legacy.test4.rollback;
 
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;

Modified: activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/test5/ClientTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/test5/ClientTestSupport.java?rev=786051&r1=786050&r2=786051&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/test5/ClientTestSupport.java (original)
+++ activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/test5/ClientTestSupport.java Thu Jun 18 13:22:31 2009
@@ -40,8 +40,8 @@
 import org.apache.activemq.legacy.broker.Broker;
 import org.apache.activemq.legacy.broker.BrokerFactory;
 import org.apache.activemq.legacy.broker.BrokerService;
-import org.apache.activemq.legacy.broker.StubConnection;
 import org.apache.activemq.legacy.broker.TransportConnector;
+import org.apache.activemq.legacy.openwireprotocol.StubConnection;
 import org.apache.activemq.transport.TransportFactory;
 
 public class ClientTestSupport extends TestCase {

Modified: activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/transport/TransportBrokerTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/transport/TransportBrokerTestSupport.java?rev=786051&r1=786050&r2=786051&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/transport/TransportBrokerTestSupport.java (original)
+++ activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/transport/TransportBrokerTestSupport.java Thu Jun 18 13:22:31 2009
@@ -21,10 +21,11 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 
+import org.apache.activemq.apollo.broker.Broker;
 import org.apache.activemq.legacy.broker.BrokerService;
-import org.apache.activemq.legacy.broker.BrokerTest;
-import org.apache.activemq.legacy.broker.StubConnection;
 import org.apache.activemq.legacy.broker.TransportConnector;
+import org.apache.activemq.legacy.openwireprotocol.BrokerTest;
+import org.apache.activemq.legacy.openwireprotocol.StubConnection;
 import org.apache.activemq.transport.Transport;
 import org.apache.activemq.transport.TransportFactory;
 
@@ -37,7 +38,7 @@
         super.setUp();
     }
 
-    protected BrokerService createBroker() throws Exception {
+    protected Broker createBroker() throws Exception {
         BrokerService service = super.createBroker();
         connector = service.addConnector(getBindLocation());
         return service;

Modified: activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/transport/tcp/SslBrokerServiceTest.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/transport/tcp/SslBrokerServiceTest.java?rev=786051&r1=786050&r2=786051&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/transport/tcp/SslBrokerServiceTest.java (original)
+++ activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/transport/tcp/SslBrokerServiceTest.java Thu Jun 18 13:22:31 2009
@@ -30,6 +30,7 @@
 import junit.framework.Test;
 import junit.textui.TestRunner;
 
+import org.apache.activemq.apollo.broker.Broker;
 import org.apache.activemq.legacy.broker.BrokerService;
 import org.apache.activemq.legacy.transport.TransportBrokerTestSupport;
 import org.apache.activemq.transport.TransportFactory;
@@ -42,7 +43,7 @@
     }
     
     @Override
-    protected BrokerService createBroker() throws Exception {
+    protected Broker createBroker() throws Exception {
         BrokerService service = new BrokerService();
         service.setPersistent(false);
         

Modified: activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/broker/Broker.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/broker/Broker.java?rev=786051&r1=786050&r2=786051&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/broker/Broker.java (original)
+++ activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/broker/Broker.java Thu Jun 18 13:22:31 2009
@@ -403,5 +403,11 @@
 	public void setDataDirectory(File dataDirectory) {
 		this.dataDirectory = dataDirectory;
 	}
+
+	public void waitUntilStopped() throws InterruptedException {
+		while( state.get() != State.STOPPED ) {
+			Thread.sleep(500);
+		}
+	}
    
 }
\ No newline at end of file

Modified: activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/demo/DefaultQueueSender.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/demo/DefaultQueueSender.java?rev=786051&r1=786032&r2=786051&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/demo/DefaultQueueSender.java (original)
+++ activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/demo/DefaultQueueSender.java Thu Jun 18 13:22:31 2009
@@ -24,7 +24,7 @@
  * program.  By default, the program sends one message.  Specify
  * a number after the queue name to send that number of messages.
  */
-package org.apache.activemq.legacy.demo;
+package org.apache.activemq.apollo.demo;
 
 // START SNIPPET: demo
 

Copied: activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/demo/Main.java (from r786040, activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/Main.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/demo/Main.java?p2=activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/demo/Main.java&p1=activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/Main.java&r1=786040&r2=786051&rev=786051&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-all/src/test/java/org/apache/activemq/legacy/Main.java (original)
+++ activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/demo/Main.java Thu Jun 18 13:22:31 2009
@@ -14,17 +14,18 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.activemq.legacy;
+package org.apache.activemq.apollo.demo;
+
+import java.net.URI;
 
 import javax.jms.Connection;
-import javax.jms.MessageConsumer;
 import javax.jms.Session;
 
 import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.broker.jmx.ManagementContext;
+import org.apache.activemq.apollo.broker.Broker;
+import org.apache.activemq.broker.store.memory.MemoryStore;
 import org.apache.activemq.command.ActiveMQQueue;
-import org.apache.activemq.legacy.broker.BrokerService;
-import org.apache.activemq.legacy.demo.DefaultQueueSender;
+import org.apache.activemq.transport.TransportFactory;
 
 /**
  * A helper class which can be handy for running a broker in your IDE from the
@@ -43,23 +44,9 @@
      */
     public static void main(String[] args) {
         try {
-            // TODO - this seems to break interceptors for some reason
-            // BrokerService broker = BrokerFactory.createBroker(new
-            // URI(brokerURI));
-            BrokerService broker = new BrokerService();
-            broker.setPersistent(false);
-
-            // for running on Java 5 without mx4j
-            ManagementContext managementContext = broker.getManagementContext();
-            managementContext.setFindTigerMbeanServer(true);
-            managementContext.setUseMBeanServer(true);
-            managementContext.setCreateConnector(false);
-
-            broker.setUseJmx(true);
-            // broker.setPlugins(new BrokerPlugin[] { new
-            // ConnectionDotFilePlugin(), new UDPTraceBrokerPlugin() });
-            broker.addConnector("tcp://localhost:61616");
-            broker.addConnector("stomp://localhost:61613");
+            Broker broker = new Broker();
+            broker.getDefaultVirtualHost().setStore(new MemoryStore());
+            broker.addTransportServer(TransportFactory.bind(new URI("tcp://localhost:61616")));
             broker.start();
 
             // lets publish some messages so that there is some stuff to browse

Modified: activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/demo/SimpleConsumer.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/demo/SimpleConsumer.java?rev=786051&r1=786032&r2=786051&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/demo/SimpleConsumer.java (original)
+++ activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/demo/SimpleConsumer.java Thu Jun 18 13:22:31 2009
@@ -22,7 +22,7 @@
  * with SimpleQueueSender.  Specify a queue name on the command
  * line when you run the program.
  */
-package org.apache.activemq.legacy.demo;
+package org.apache.activemq.apollo.demo;
 
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;

Modified: activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/demo/SimpleProducer.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/demo/SimpleProducer.java?rev=786051&r1=786032&r2=786051&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/demo/SimpleProducer.java (original)
+++ activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/demo/SimpleProducer.java Thu Jun 18 13:22:31 2009
@@ -24,7 +24,7 @@
  * program.  By default, the program sends one message.  Specify
  * a number after the queue name to send that number of messages.
  */
-package org.apache.activemq.legacy.demo;
+package org.apache.activemq.apollo.demo;
 
 // START SNIPPET: demo
 

Modified: activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/demo/SimpleQueueReceiver.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/demo/SimpleQueueReceiver.java?rev=786051&r1=786032&r2=786051&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/demo/SimpleQueueReceiver.java (original)
+++ activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/demo/SimpleQueueReceiver.java Thu Jun 18 13:22:31 2009
@@ -22,7 +22,7 @@
  * with SimpleQueueSender.  Specify a queue name on the command
  * line when you run the program.
  */
-package org.apache.activemq.legacy.demo;
+package org.apache.activemq.apollo.demo;
 
 import javax.jms.JMSException;
 import javax.jms.Message;

Modified: activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/demo/SimpleQueueSender.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/demo/SimpleQueueSender.java?rev=786051&r1=786032&r2=786051&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/demo/SimpleQueueSender.java (original)
+++ activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/demo/SimpleQueueSender.java Thu Jun 18 13:22:31 2009
@@ -24,7 +24,7 @@
  * program.  By default, the program sends one message.  Specify
  * a number after the queue name to send that number of messages.
  */
-package org.apache.activemq.legacy.demo;
+package org.apache.activemq.apollo.demo;
 
 // START SNIPPET: demo
 

Copied: activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/AdvisoryBrokerTest.java (from r786040, activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/advisory/AdvisoryBrokerTest.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/AdvisoryBrokerTest.java?p2=activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/AdvisoryBrokerTest.java&p1=activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/advisory/AdvisoryBrokerTest.java&r1=786040&r2=786051&rev=786051&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/advisory/AdvisoryBrokerTest.java (original)
+++ activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/AdvisoryBrokerTest.java Thu Jun 18 13:22:31 2009
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.activemq.legacy.broker.advisory;
+package org.apache.activemq.legacy.openwireprotocol;
 
 import junit.framework.Test;
 
@@ -27,8 +27,6 @@
 import org.apache.activemq.command.ProducerInfo;
 import org.apache.activemq.command.RemoveInfo;
 import org.apache.activemq.command.SessionInfo;
-import org.apache.activemq.legacy.broker.BrokerTestSupport;
-import org.apache.activemq.legacy.broker.StubConnection;
 
 public class AdvisoryBrokerTest extends BrokerTestSupport {
      

Copied: activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/BrokerBenchmark.java (from r786040, activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/BrokerBenchmark.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/BrokerBenchmark.java?p2=activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/BrokerBenchmark.java&p1=activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/BrokerBenchmark.java&r1=786040&r2=786051&rev=786051&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/BrokerBenchmark.java (original)
+++ activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/BrokerBenchmark.java Thu Jun 18 13:22:31 2009
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.activemq.legacy.broker;
+package org.apache.activemq.legacy.openwireprotocol;
 
 import java.util.concurrent.Semaphore;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -84,7 +84,7 @@
                     try {
 
                         // Consume the messages
-                        StubConnection connection = new StubConnection(broker);
+                        StubConnection connection = createConnection();
                         ConnectionInfo connectionInfo = createConnectionInfo();
                         connection.send(connectionInfo);
 
@@ -146,7 +146,7 @@
             new Thread() {
                 public void run() {
                     try {
-                        StubConnection connection = new StubConnection(broker);
+                        StubConnection connection = createConnection();;
                         ConnectionInfo connectionInfo = createConnectionInfo();
                         connection.send(connectionInfo);
 

Copied: activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/BrokerRestartTestSupport.java (from r786040, activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/BrokerRestartTestSupport.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/BrokerRestartTestSupport.java?p2=activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/BrokerRestartTestSupport.java&p1=activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/BrokerRestartTestSupport.java&r1=786040&r2=786051&rev=786051&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/BrokerRestartTestSupport.java (original)
+++ activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/BrokerRestartTestSupport.java Thu Jun 18 13:22:31 2009
@@ -14,20 +14,21 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.activemq.legacy.broker;
+package org.apache.activemq.legacy.openwireprotocol;
 
-import org.apache.activemq.legacy.broker.BrokerService;
-import org.apache.activemq.legacy.store.PersistenceAdapter;
+import java.io.IOException;
+import java.net.URISyntaxException;
+
+import org.apache.activemq.apollo.broker.Broker;
+import org.apache.activemq.broker.store.Store;
 
 public class BrokerRestartTestSupport extends BrokerTestSupport {
 
-    private PersistenceAdapter persistenceAdapter;
+	private Store store;
 
-    protected BrokerService createBroker() throws Exception {
-        BrokerService broker = new BrokerService();
-        //broker.setPersistent(false);
-        broker.setDeleteAllMessagesOnStartup(true);
-        persistenceAdapter = broker.getPersistenceAdapter();
+    protected Broker createBroker() throws Exception {
+    	Broker broker = super.createBroker();
+        store = broker.getDefaultVirtualHost().getDatabase().getStore();
         return broker;
     }
 
@@ -35,9 +36,9 @@
      * @return
      * @throws Exception
      */
-    protected BrokerService createRestartedBroker() throws Exception {
-        BrokerService broker = new BrokerService();
-        //broker.setPersistenceAdapter(persistenceAdapter);
+    protected Broker createRestartedBroker() throws Exception {
+    	Broker broker = super.createBroker();
+    	broker.getDefaultVirtualHost().setStore(store);
         return broker;
     }
 

Copied: activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/BrokerTest.java (from r786040, activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/BrokerTest.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/BrokerTest.java?p2=activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/BrokerTest.java&p1=activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/BrokerTest.java&r1=786040&r2=786051&rev=786051&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/BrokerTest.java (original)
+++ activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/BrokerTest.java Thu Jun 18 13:22:31 2009
@@ -14,14 +14,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.activemq.legacy.broker;
+package org.apache.activemq.legacy.openwireprotocol;
 
 import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.TimeUnit;
 
 import javax.jms.DeliveryMode;
-import javax.jms.JMSException;
 
 import junit.framework.Test;
 
@@ -30,7 +29,6 @@
 import org.apache.activemq.command.ActiveMQTopic;
 import org.apache.activemq.command.ConnectionInfo;
 import org.apache.activemq.command.ConsumerInfo;
-import org.apache.activemq.command.DestinationInfo;
 import org.apache.activemq.command.LocalTransactionId;
 import org.apache.activemq.command.Message;
 import org.apache.activemq.command.MessageAck;

Copied: activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/BrokerTestSupport.java (from r786040, activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/BrokerTestSupport.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/BrokerTestSupport.java?p2=activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/BrokerTestSupport.java&p1=activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/BrokerTestSupport.java&r1=786040&r2=786051&rev=786051&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/BrokerTestSupport.java (original)
+++ activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/BrokerTestSupport.java Thu Jun 18 13:22:31 2009
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.activemq.legacy.broker;
+package org.apache.activemq.legacy.openwireprotocol;
 
 import java.io.ByteArrayOutputStream;
 import java.io.DataOutputStream;
@@ -28,16 +28,10 @@
 import javax.jms.DeliveryMode;
 import javax.jms.MessageNotWriteableException;
 
-import org.apache.activemq.legacy.broker.BrokerFactory;
-import org.apache.activemq.legacy.broker.BrokerService;
-import org.apache.activemq.legacy.broker.region.RegionBroker;
-import org.apache.activemq.legacy.broker.region.policy.FixedCountSubscriptionRecoveryPolicy;
-import org.apache.activemq.legacy.broker.region.policy.PolicyEntry;
-import org.apache.activemq.legacy.broker.region.policy.PolicyMap;
-import org.apache.activemq.legacy.broker.region.policy.RoundRobinDispatchPolicy;
-import org.apache.activemq.legacy.store.PersistenceAdapter;
-import org.apache.activemq.legacy.usage.SystemUsage;
+
 import org.apache.activemq.apollo.CombinationTestSupport;
+import org.apache.activemq.apollo.broker.Broker;
+import org.apache.activemq.apollo.broker.BrokerFactory;
 import org.apache.activemq.command.ActiveMQDestination;
 import org.apache.activemq.command.ActiveMQTextMessage;
 import org.apache.activemq.command.ConnectionId;
@@ -55,8 +49,7 @@
 import org.apache.activemq.command.TransactionId;
 import org.apache.activemq.command.TransactionInfo;
 import org.apache.activemq.command.XATransactionId;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.activemq.transport.TransportFactory;
 
 public class BrokerTestSupport extends CombinationTestSupport {
 
@@ -66,45 +59,30 @@
      */
     public static final boolean FAST_NO_MESSAGE_LEFT_ASSERT = System.getProperty("FAST_NO_MESSAGE_LEFT_ASSERT", "true").equals("true");
 
-    protected RegionBroker regionBroker;
-    protected BrokerService broker;
+    protected Broker broker;
     protected long idGenerator;
     protected int msgIdGenerator;
     protected int txGenerator;
     protected int tempDestGenerator;
-    protected PersistenceAdapter persistenceAdapter;
 
     protected int maxWait = 4000;
-
-    protected SystemUsage memoryManager;
-
+    String PIPE_URI = "pipe://broker";
+	
     protected void setUp() throws Exception {
         super.setUp();
         broker = createBroker();
-        PolicyMap policyMap = new PolicyMap();
-        policyMap.setDefaultEntry(getDefaultPolicy());
-        broker.setDestinationPolicy(policyMap);
         broker.start();
     }
 
-    protected PolicyEntry getDefaultPolicy() {
-        PolicyEntry policy = new PolicyEntry();
-        policy.setDispatchPolicy(new RoundRobinDispatchPolicy());
-        policy.setSubscriptionRecoveryPolicy(new FixedCountSubscriptionRecoveryPolicy());
-        return policy;
-    }
-
-    protected BrokerService createBroker() throws Exception {
-        BrokerService broker = BrokerFactory.createBroker(new URI("broker:()/localhost?persistent=false"));
+    protected Broker createBroker() throws Exception {
+    	Broker broker = BrokerFactory.createBroker(new URI("jaxb:classpath:non-persistent-activemq.xml"));
+    	broker.addTransportServer(TransportFactory.bind(new URI(PIPE_URI)));
         return broker;
     }
 
     protected void tearDown() throws Exception {
         broker.stop();
         broker = null;
-        regionBroker = null;
-        persistenceAdapter = null;
-        memoryManager = null;
         super.tearDown();
     }
 
@@ -160,10 +138,6 @@
         return ack;
     }
 
-    protected void gc() {
-        regionBroker.gc();
-    }
-
     protected void profilerPause(String prompt) throws IOException {
         if (System.getProperty("profiler") != null) {
             System.out.println();
@@ -309,7 +283,7 @@
     }
 
     protected StubConnection createConnection() throws Exception {
-        return new StubConnection(broker);
+        return new StubConnection(TransportFactory.connect(new URI(PIPE_URI)));
     }
 
     /**

Copied: activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/ConcurrentConnectSimulationTest.java (from r786040, activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/ConcurrentConnectSimulationTest.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/ConcurrentConnectSimulationTest.java?p2=activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/ConcurrentConnectSimulationTest.java&p1=activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/ConcurrentConnectSimulationTest.java&r1=786040&r2=786051&rev=786051&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/ConcurrentConnectSimulationTest.java (original)
+++ activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/ConcurrentConnectSimulationTest.java Thu Jun 18 13:22:31 2009
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.activemq.legacy.broker;
+package org.apache.activemq.legacy.openwireprotocol;
 
 import junit.framework.Test;
 

Copied: activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/MarshallingBrokerTest.java (from r786040, activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/MarshallingBrokerTest.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/MarshallingBrokerTest.java?p2=activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/MarshallingBrokerTest.java&p1=activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/MarshallingBrokerTest.java&r1=786040&r2=786051&rev=786051&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/MarshallingBrokerTest.java (original)
+++ activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/MarshallingBrokerTest.java Thu Jun 18 13:22:31 2009
@@ -14,15 +14,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.activemq.legacy.broker;
+package org.apache.activemq.legacy.openwireprotocol;
 
-import java.io.IOException;
+import java.net.URI;
 
 import junit.framework.Test;
 
-import org.apache.activemq.command.Command;
-import org.apache.activemq.command.Response;
 import org.apache.activemq.openwire.OpenWireFormat;
+import org.apache.activemq.transport.TransportFactory;
 import org.apache.activemq.wireformat.WireFormat;
 
 /**
@@ -45,23 +44,7 @@
     }
 
     protected StubConnection createConnection() throws Exception {
-        return new StubConnection(broker) {
-            public Response request(Command command) throws Exception {
-                Response r = super.request((Command)wireFormat.unmarshal(wireFormat.marshal(command)));
-                if (r != null) {
-                    r = (Response)wireFormat.unmarshal(wireFormat.marshal(r));
-                }
-                return r;
-            }
-
-            public void send(Command command) throws Exception {
-                super.send((Command)wireFormat.unmarshal(wireFormat.marshal(command)));
-            }
-
-            protected void dispatch(Command command) throws InterruptedException, IOException {
-                super.dispatch((Command)wireFormat.unmarshal(wireFormat.marshal(command)));
-            };
-        };
+        return new StubConnection(TransportFactory.connect(new URI(PIPE_URI+"?marshall=true")));
     }
 
     public static Test suite() {

Copied: activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/MessageExpirationTest.java (from r786040, activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/MessageExpirationTest.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/MessageExpirationTest.java?p2=activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/MessageExpirationTest.java&p1=activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/MessageExpirationTest.java&r1=786040&r2=786051&rev=786051&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/MessageExpirationTest.java (original)
+++ activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/MessageExpirationTest.java Thu Jun 18 13:22:31 2009
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.activemq.legacy.broker;
+package org.apache.activemq.legacy.openwireprotocol;
 
 import javax.jms.DeliveryMode;
 
@@ -28,9 +28,6 @@
 import org.apache.activemq.command.MessageAck;
 import org.apache.activemq.command.ProducerInfo;
 import org.apache.activemq.command.SessionInfo;
-import org.apache.activemq.legacy.broker.BrokerService;
-import org.apache.activemq.legacy.broker.region.policy.PolicyEntry;
-import org.apache.activemq.legacy.broker.region.policy.VMPendingSubscriberMessageStoragePolicy;
 
 public class MessageExpirationTest extends BrokerTestSupport {
 
@@ -54,19 +51,13 @@
                                                               Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TOPIC_TYPE)});
     }
 
-    @Override
-    protected BrokerService createBroker() throws Exception {
-        BrokerService broker = new BrokerService();
-        broker.setPersistent(false);
-        return broker;
-    }
-
-    protected PolicyEntry getDefaultPolicy() {
-        PolicyEntry policy = super.getDefaultPolicy();
-        // disable spooling
-        policy.setPendingSubscriberPolicy(new VMPendingSubscriberMessageStoragePolicy());
-        return policy;
-    }
+//    TODO:
+//    protected PolicyEntry getDefaultPolicy() {
+//        PolicyEntry policy = super.getDefaultPolicy();
+//        // disable spooling
+//        policy.setPendingSubscriberPolicy(new VMPendingSubscriberMessageStoragePolicy());
+//        return policy;
+//    }
 
     public void XtestMessagesWaitingForUssageDecreaseExpire() throws Exception {
 
@@ -93,7 +84,8 @@
 
         // Reduce the limit so that only 1 message can flow through the broker
         // at a time.
-        broker.getSystemUsage().getMemoryUsage().setLimit(1);
+// TODO:        
+//        broker.getSystemUsage().getMemoryUsage().setLimit(1);
 
         final Message m1 = createMessage(producerInfo, destination, deliveryMode);
         final Message m2 = createMessage(producerInfo, destination, deliveryMode, 1000);

Copied: activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/ProgressPrinter.java (from r786040, activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/ProgressPrinter.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/ProgressPrinter.java?p2=activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/ProgressPrinter.java&p1=activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/ProgressPrinter.java&r1=786040&r2=786051&rev=786051&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/ProgressPrinter.java (original)
+++ activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/ProgressPrinter.java Thu Jun 18 13:22:31 2009
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.activemq.legacy.broker;
+package org.apache.activemq.legacy.openwireprotocol;
 
 public class ProgressPrinter {
 

Copied: activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/RecoveryBrokerTest.java (from r786040, activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/RecoveryBrokerTest.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/RecoveryBrokerTest.java?p2=activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/RecoveryBrokerTest.java&p1=activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/RecoveryBrokerTest.java&r1=786040&r2=786051&rev=786051&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/RecoveryBrokerTest.java (original)
+++ activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/RecoveryBrokerTest.java Thu Jun 18 13:22:31 2009
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.activemq.legacy.broker;
+package org.apache.activemq.legacy.openwireprotocol;
 
 import java.util.ArrayList;
 

Added: activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/StubConnection.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/StubConnection.java?rev=786051&view=auto
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/StubConnection.java (added)
+++ activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/StubConnection.java Thu Jun 18 13:22:31 2009
@@ -0,0 +1,123 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.legacy.openwireprotocol;
+
+import java.io.IOException;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.atomic.AtomicReference;
+
+import org.apache.activemq.Service;
+import org.apache.activemq.command.Command;
+import org.apache.activemq.command.ExceptionResponse;
+import org.apache.activemq.command.Message;
+import org.apache.activemq.command.Response;
+import org.apache.activemq.command.ShutdownInfo;
+
+import org.apache.activemq.transport.DefaultTransportListener;
+import org.apache.activemq.transport.Transport;
+import org.apache.activemq.transport.TransportListener;
+import org.apache.activemq.util.JMSExceptionSupport;
+import org.apache.activemq.util.ServiceSupport;
+
+public class StubConnection implements Service {
+
+    private final BlockingQueue<Object> dispatchQueue = new LinkedBlockingQueue<Object>();
+    private Transport transport;
+    private TransportListener listener;
+    public AtomicReference<Throwable> error = new AtomicReference<Throwable>();
+
+    public StubConnection(Transport transport) throws Exception {
+        this.transport = transport;
+        transport.setTransportListener(new DefaultTransportListener() {
+            public void onCommand(Object command) {
+                try {
+                    StubConnection.this.dispatch(command);
+                } catch (Exception e) {
+                    onException(new IOException("" + e));
+                }
+            }
+
+            public void onException(IOException e) {
+                if (listener != null) {
+                    listener.onException(e);
+                }
+                error.set(e);
+            }
+        });
+        transport.start();
+    }
+
+    protected void dispatch(Object command) throws InterruptedException, IOException {
+        if (listener != null) {
+            listener.onCommand(command);
+        }
+        dispatchQueue.put(command);
+    }
+
+    public BlockingQueue<Object> getDispatchQueue() {
+        return dispatchQueue;
+    }
+
+    public void send(Command command) throws Exception {
+        if (command instanceof Message) {
+            Message message = (Message)command;
+            message.setProducerId(message.getMessageId().getProducerId());
+        }
+        command.setResponseRequired(false);
+        transport.oneway(command);
+    }
+
+    public Response request(Command command) throws Exception {
+        if (command instanceof Message) {
+            Message message = (Message)command;
+            message.setProducerId(message.getMessageId().getProducerId());
+        }
+        command.setResponseRequired(true);
+        Response response = (Response)transport.request(command);
+        if (response != null && response.isException()) {
+            ExceptionResponse er = (ExceptionResponse)response;
+            throw JMSExceptionSupport.create(er.getException());
+        }
+        return response;
+    }
+
+    public Transport getTransport() {
+        return transport;
+    }
+
+    public void start() throws Exception {
+    }
+
+    public void stop() throws Exception {
+        if (transport != null) {
+            try {
+                transport.oneway(new ShutdownInfo());
+            } catch (IOException e) {
+            }
+            ServiceSupport.dispose(transport);
+        }
+    }
+
+    public TransportListener getListener() {
+        return listener;
+    }
+
+    public void setListener(TransportListener listener) {
+        this.listener = listener;
+    }
+}

Copied: activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/XARecoveryBrokerTest.java (from r786040, activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/XARecoveryBrokerTest.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/XARecoveryBrokerTest.java?p2=activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/XARecoveryBrokerTest.java&p1=activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/XARecoveryBrokerTest.java&r1=786040&r2=786051&rev=786051&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/XARecoveryBrokerTest.java (original)
+++ activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/XARecoveryBrokerTest.java Thu Jun 18 13:22:31 2009
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.activemq.legacy.broker;
+package org.apache.activemq.legacy.openwireprotocol;
 
 import junit.framework.Test;
 



Mime
View raw message