activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r786593 - in /activemq/sandbox/activemq-flow: activemq-client/src/test/java/org/apache/activemq/apollo/ activemq-client/src/test/java/org/apache/activemq/legacy/ activemq-client/src/test/java/org/apache/activemq/legacy/test1/ activemq-clien...
Date Fri, 19 Jun 2009 17:27:34 GMT
Author: chirino
Date: Fri Jun 19 17:27:33 2009
New Revision: 786593

URL: http://svn.apache.org/viewvc?rev=786593&view=rev
Log:
more legacy tests are passing move them out of the legacy package..  

Added:
    activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/ActiveMQConnectionFactoryTest.java
      - copied, changed from r786540, activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/ActiveMQConnectionFactoryTest.java
    activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/JmsConsumerResetActiveListenerTest.java
      - copied, changed from r786540, activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/JmsConsumerResetActiveListenerTest.java
    activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/JmsSessionRecoverTest.java
      - copied, changed from r786540, activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/JmsSessionRecoverTest.java
Removed:
    activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/ActiveMQConnectionFactoryTest.java
    activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/JmsConsumerResetActiveListenerTest.java
    activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/JmsSessionRecoverTest.java
    activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/broker/
Modified:
    activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/JmsRedeliveredTest.java
    activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/JmsTempDestinationTest.java
    activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test1/JmsBenchmark.java
    activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test1/JmsTestSupport.java
    activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test1/LoadTestBurnIn.java
    activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test1/MessageGroupDelayedTest.java
    activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test1/ProducerFlowControlSendFailTest.java
    activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test1/ProducerFlowControlTest.java
    activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test2/JmsTopicSendReceiveWithTwoConnectionsTest.java
    activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test3/JmsResourceProvider.java
    activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test3/JmsTopicSendReceiveWithTwoConnectionsTest.java
    activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test3/JmsTransactionTestSupport.java
    activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test3/TestSupport.java
    activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test6/JmsMultipleClientsTestSupport.java
    activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/BrokerBenchmark.java

Copied: activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/ActiveMQConnectionFactoryTest.java
(from r786540, activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/ActiveMQConnectionFactoryTest.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/ActiveMQConnectionFactoryTest.java?p2=activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/ActiveMQConnectionFactoryTest.java&p1=activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/ActiveMQConnectionFactoryTest.java&r1=786540&r2=786593&rev=786593&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/ActiveMQConnectionFactoryTest.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/ActiveMQConnectionFactoryTest.java
Fri Jun 19 17:27:33 2009
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.activemq.legacy;
+package org.apache.activemq.apollo;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;

Copied: activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/JmsConsumerResetActiveListenerTest.java
(from r786540, activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/JmsConsumerResetActiveListenerTest.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/JmsConsumerResetActiveListenerTest.java?p2=activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/JmsConsumerResetActiveListenerTest.java&p1=activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/JmsConsumerResetActiveListenerTest.java&r1=786540&r2=786593&rev=786593&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/JmsConsumerResetActiveListenerTest.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/JmsConsumerResetActiveListenerTest.java
Fri Jun 19 17:27:33 2009
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.activemq.legacy;
+package org.apache.activemq.apollo;
 
 import java.util.Vector;
 import java.util.concurrent.CountDownLatch;
@@ -43,7 +43,7 @@
     private ActiveMQConnectionFactory factory;
    
     protected void setUp() throws Exception {
-        factory = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
+        factory = new ActiveMQConnectionFactory("vm://localhost?broker=jaxb:classpath:non-persistent-activemq.xml");
         connection = factory.createConnection();
     }
 

Copied: activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/JmsSessionRecoverTest.java
(from r786540, activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/JmsSessionRecoverTest.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/JmsSessionRecoverTest.java?p2=activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/JmsSessionRecoverTest.java&p1=activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/JmsSessionRecoverTest.java&r1=786540&r2=786593&rev=786593&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/JmsSessionRecoverTest.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/apollo/JmsSessionRecoverTest.java
Fri Jun 19 17:27:33 2009
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.activemq.legacy;
+package org.apache.activemq.apollo;
 
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
@@ -51,7 +51,7 @@
      * @see junit.framework.TestCase#setUp()
      */
     protected void setUp() throws Exception {
-        factory = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
+        factory = new ActiveMQConnectionFactory("vm://localhost?broker=jaxb:classpath:non-persistent-activemq.xml");
         connection = factory.createConnection();
     }
 

Modified: activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/JmsRedeliveredTest.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/JmsRedeliveredTest.java?rev=786593&r1=786592&r2=786593&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/JmsRedeliveredTest.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/JmsRedeliveredTest.java
Fri Jun 19 17:27:33 2009
@@ -68,7 +68,7 @@
      */
     protected Connection createConnection() throws Exception {
         ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(
-                                                                          "vm://localhost?broker.persistent=false");
+                                                                          "vm://localhost?broker=jaxb:classpath:non-persistent-activemq.xml");
         return factory.createConnection();
     }
 

Modified: activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/JmsTempDestinationTest.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/JmsTempDestinationTest.java?rev=786593&r1=786592&r2=786593&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/JmsTempDestinationTest.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/JmsTempDestinationTest.java
Fri Jun 19 17:27:33 2009
@@ -51,7 +51,7 @@
     protected List<Connection> connections = Collections.synchronizedList(new ArrayList<Connection>());
 
     protected void setUp() throws Exception {
-        factory = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
+        factory = new ActiveMQConnectionFactory("vm://localhost?broker=jaxb:classpath:non-persistent-activemq.xml");
         factory.setAlwaysSyncSend(true);
         connection = factory.createConnection();
         connections.add(connection);

Modified: activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test1/JmsBenchmark.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test1/JmsBenchmark.java?rev=786593&r1=786592&r2=786593&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test1/JmsBenchmark.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test1/JmsBenchmark.java
Fri Jun 19 17:27:33 2009
@@ -39,11 +39,11 @@
 import junit.framework.Test;
 
 import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.apollo.broker.Broker;
 import org.apache.activemq.command.ActiveMQDestination;
 import org.apache.activemq.command.ActiveMQQueue;
-import org.apache.activemq.legacy.broker.BrokerFactory;
-import org.apache.activemq.legacy.broker.BrokerService;
-import org.apache.activemq.legacy.broker.TransportConnector;
+import org.apache.activemq.transport.TransportFactory;
+import org.apache.activemq.transport.TransportServer;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -78,12 +78,15 @@
         addCombinationValues("destination", new Object[] {new ActiveMQQueue("TEST")});
     }
 
-    protected BrokerService createBroker() throws Exception {
-        return BrokerFactory.createBroker(new URI("broker://(tcp://localhost:0)?persistent=false"));
+    protected Broker createBroker() throws Exception {
+    	Broker broker = super.createBroker();
+    	broker.addTransportServer(TransportFactory.bind(new URI("tcp://localhost:0")));
+        return broker;
     }
 
     protected ConnectionFactory createConnectionFactory() throws URISyntaxException, IOException
{
-        return new ActiveMQConnectionFactory(((TransportConnector)broker.getTransportConnectors().get(0)).getServer().getConnectURI());
+    	TransportServer server = broker.getTransportServers().get(0);
+        return new ActiveMQConnectionFactory(server.getConnectURI());
     }
 
     /**

Modified: activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test1/JmsTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test1/JmsTestSupport.java?rev=786593&r1=786592&r2=786593&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test1/JmsTestSupport.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test1/JmsTestSupport.java
Fri Jun 19 17:27:33 2009
@@ -36,9 +36,9 @@
 import org.apache.activemq.ActiveMQConnection;
 import org.apache.activemq.ActiveMQConnectionFactory;
 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.legacy.broker.BrokerFactory;
-import org.apache.activemq.legacy.broker.BrokerService;
 
 /**
  * Test cases used to test the JMS message consumer.
@@ -53,7 +53,7 @@
 
     protected ConnectionFactory factory;
     protected ActiveMQConnection connection;
-    protected BrokerService broker;
+    protected Broker broker;
 
     protected List<Connection> connections = Collections.synchronizedList(new ArrayList<Connection>());
 
@@ -108,8 +108,8 @@
         return new ActiveMQConnectionFactory("vm://localhost");
     }
 
-    protected BrokerService createBroker() throws Exception {
-        return BrokerFactory.createBroker(new URI("broker://()/localhost?persistent=false"));
+    protected Broker createBroker() throws Exception {
+        return BrokerFactory.createBroker(new URI("vm://localhost?broker=jaxb:classpath:non-persistent-activemq.xml"));
     }
 
     protected void setUp() throws Exception {
@@ -128,8 +128,8 @@
     }
 
     protected void tearDown() throws Exception {
-        for (Iterator iter = connections.iterator(); iter.hasNext();) {
-            Connection conn = (Connection)iter.next();
+        for (Iterator<Connection> iter = connections.iterator(); iter.hasNext();) {
+            Connection conn = iter.next();
             try {
                 conn.close();
             } catch (Throwable e) {

Modified: activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test1/LoadTestBurnIn.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test1/LoadTestBurnIn.java?rev=786593&r1=786592&r2=786593&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test1/LoadTestBurnIn.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test1/LoadTestBurnIn.java
Fri Jun 19 17:27:33 2009
@@ -36,10 +36,12 @@
 import junit.framework.Test;
 
 import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.apollo.broker.Broker;
 import org.apache.activemq.command.ActiveMQDestination;
 import org.apache.activemq.legacy.broker.BrokerFactory;
-import org.apache.activemq.legacy.broker.BrokerService;
 import org.apache.activemq.legacy.broker.TransportConnector;
+import org.apache.activemq.transport.TransportFactory;
+import org.apache.activemq.transport.TransportServer;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -83,16 +85,18 @@
         junit.textui.TestRunner.run(suite());
     }
 
-    protected BrokerService createBroker() throws Exception {
-        return BrokerFactory.createBroker(new URI("broker://(tcp://localhost:0)?useJmx=true"));
-        // return BrokerFactory.createBroker(new
-        // URI("xbean:org/apache/activemq/broker/store/loadtester.xml"));
+    
+    protected Broker createBroker() throws Exception {
+    	Broker broker = super.createBroker();
+    	broker.addTransportServer(TransportFactory.bind(new URI("tcp://localhost:0")));
+        return broker;
     }
 
     protected ConnectionFactory createConnectionFactory() throws URISyntaxException, IOException
{
-        return new ActiveMQConnectionFactory(((TransportConnector)broker.getTransportConnectors().get(0))
-            .getServer().getConnectURI());
+    	TransportServer server = broker.getTransportServers().get(0);
+        return new ActiveMQConnectionFactory(server.getConnectURI());
     }
+    
 
     public void initCombosForTestSendReceive() {
         addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT),

Modified: activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test1/MessageGroupDelayedTest.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test1/MessageGroupDelayedTest.java?rev=786593&r1=786592&r2=786593&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test1/MessageGroupDelayedTest.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test1/MessageGroupDelayedTest.java
Fri Jun 19 17:27:33 2009
@@ -16,6 +16,7 @@
  */
 package org.apache.activemq.legacy.test1;
 
+import java.net.URI;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Set;
@@ -31,11 +32,10 @@
 import junit.framework.Test;
 
 import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.apollo.broker.Broker;
 import org.apache.activemq.command.ActiveMQQueue;
-import org.apache.activemq.legacy.broker.BrokerService;
-import org.apache.activemq.legacy.broker.TransportConnector;
-import org.apache.activemq.legacy.broker.region.policy.PolicyEntry;
-import org.apache.activemq.legacy.broker.region.policy.PolicyMap;
+import org.apache.activemq.transport.TransportFactory;
+import org.apache.activemq.transport.TransportServer;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -51,8 +51,7 @@
   public int consumersBeforeDispatchStarts;
   public int timeBeforeDispatchStarts;
   
-  BrokerService broker;
-  protected TransportConnector connector;
+  Broker broker;
   
   protected HashMap<String, Integer> messageCount = new HashMap<String, Integer>();
   protected HashMap<String, Set<String>> messageGroups = new HashMap<String,
Set<String>>();
@@ -68,7 +67,9 @@
   public void setUp() throws Exception {
 	broker = createBroker();  
 	broker.start();
-    ActiveMQConnectionFactory connFactory = new ActiveMQConnectionFactory(connector.getConnectUri()
+ "?jms.prefetchPolicy.all=1");
+	
+	TransportServer server = broker.getTransportServers().get(0);
+    ActiveMQConnectionFactory connFactory = new ActiveMQConnectionFactory(server.getConnectURI()
+ "?jms.prefetchPolicy.all=1");
     connection = connFactory.createConnection();
     session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
     destination = new ActiveMQQueue("test-queue2");
@@ -76,22 +77,21 @@
     connection.start();
   }
   
-  protected BrokerService createBroker() throws Exception {
-      BrokerService service = new BrokerService();
-      service.setPersistent(false);
-      service.setUseJmx(false);
-
+  protected Broker createBroker() throws Exception {
+      Broker broker = super.createBroker();
+      broker.addTransportServer(TransportFactory.bind(new URI("tcp://localhost:0")));
+      
       // Setup a destination policy where it takes only 1 message at a time.
-      PolicyMap policyMap = new PolicyMap();
-      PolicyEntry policy = new PolicyEntry();
-      log.info("testing with consumersBeforeDispatchStarts=" + consumersBeforeDispatchStarts
+ " and timeBeforeDispatchStarts=" + timeBeforeDispatchStarts);
-      policy.setConsumersBeforeDispatchStarts(consumersBeforeDispatchStarts);
-      policy.setTimeBeforeDispatchStarts(timeBeforeDispatchStarts);
-      policyMap.setDefaultEntry(policy);
-      service.setDestinationPolicy(policyMap);
+// TODO:      
+//      PolicyMap policyMap = new PolicyMap();
+//      PolicyEntry policy = new PolicyEntry();
+//      log.info("testing with consumersBeforeDispatchStarts=" + consumersBeforeDispatchStarts
+ " and timeBeforeDispatchStarts=" + timeBeforeDispatchStarts);
+//      policy.setConsumersBeforeDispatchStarts(consumersBeforeDispatchStarts);
+//      policy.setTimeBeforeDispatchStarts(timeBeforeDispatchStarts);
+//      policyMap.setDefaultEntry(policy);
+//      service.setDestinationPolicy(policyMap);
 
-      connector = service.addConnector("tcp://localhost:0");
-      return service;
+      return broker;
   }
   
   public void tearDown() throws Exception {

Modified: activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test1/ProducerFlowControlSendFailTest.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test1/ProducerFlowControlSendFailTest.java?rev=786593&r1=786592&r2=786593&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test1/ProducerFlowControlSendFailTest.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test1/ProducerFlowControlSendFailTest.java
Fri Jun 19 17:27:33 2009
@@ -16,8 +16,8 @@
  */
 package org.apache.activemq.legacy.test1;
 
+import java.net.URI;
 import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicLong;
 
 import javax.jms.ConnectionFactory;
 import javax.jms.ExceptionListener;
@@ -30,32 +30,29 @@
 
 import org.apache.activemq.ActiveMQConnection;
 import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.legacy.broker.BrokerService;
-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.VMPendingQueueMessageStoragePolicy;
-import org.apache.activemq.legacy.broker.region.policy.VMPendingSubscriberMessageStoragePolicy;
+import org.apache.activemq.apollo.broker.Broker;
+import org.apache.activemq.transport.TransportFactory;
+import org.apache.activemq.transport.TransportServer;
 
 public class ProducerFlowControlSendFailTest extends ProducerFlowControlTest {
 
-    protected BrokerService createBroker() throws Exception {
-        BrokerService service = new BrokerService();
-        service.setPersistent(false);
-        service.setUseJmx(false);
+    protected Broker createBroker() throws Exception {
+        Broker broker = super.createBroker();
+        broker.addTransportServer(TransportFactory.bind(new URI("tcp://localhost:0")));
 
         // Setup a destination policy where it takes only 1 message at a time.
-        PolicyMap policyMap = new PolicyMap();
-        PolicyEntry policy = new PolicyEntry();
-        policy.setMemoryLimit(1);
-        policy.setPendingSubscriberPolicy(new VMPendingSubscriberMessageStoragePolicy());
-        policy.setPendingQueuePolicy(new VMPendingQueueMessageStoragePolicy());
-        policyMap.setDefaultEntry(policy);
-        service.setDestinationPolicy(policyMap);
-        
-        service.getSystemUsage().setSendFailIfNoSpace(true);
+// TODO:        
+//        PolicyMap policyMap = new PolicyMap();
+//        PolicyEntry policy = new PolicyEntry();
+//        policy.setMemoryLimit(1);
+//        policy.setPendingSubscriberPolicy(new VMPendingSubscriberMessageStoragePolicy());
+//        policy.setPendingQueuePolicy(new VMPendingQueueMessageStoragePolicy());
+//        policyMap.setDefaultEntry(policy);
+//        service.setDestinationPolicy(policyMap);
+//        
+//        service.getSystemUsage().setSendFailIfNoSpace(true);
 
-        connector = service.addConnector("tcp://localhost:0");
-        return service;
+        return broker;
     }
     
     @Override
@@ -113,7 +110,8 @@
     
 	@Override
 	protected ConnectionFactory createConnectionFactory() throws Exception {
-		ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(connector.getConnectUri());
+    	TransportServer server = broker.getTransportServers().get(0);
+		ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(server.getConnectURI());
 		connectionFactory.setExceptionListener(new ExceptionListener() {
 				public void onException(JMSException arg0) {
 					if (arg0 instanceof ResourceAllocationException) {

Modified: activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test1/ProducerFlowControlTest.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test1/ProducerFlowControlTest.java?rev=786593&r1=786592&r2=786593&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test1/ProducerFlowControlTest.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test1/ProducerFlowControlTest.java
Fri Jun 19 17:27:33 2009
@@ -17,6 +17,7 @@
 package org.apache.activemq.legacy.test1;
 
 import java.io.IOException;
+import java.net.URI;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
@@ -31,20 +32,16 @@
 
 import org.apache.activemq.ActiveMQConnection;
 import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.apollo.broker.Broker;
 import org.apache.activemq.command.ActiveMQQueue;
-import org.apache.activemq.legacy.broker.BrokerService;
-import org.apache.activemq.legacy.broker.TransportConnector;
-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.VMPendingQueueMessageStoragePolicy;
-import org.apache.activemq.legacy.broker.region.policy.VMPendingSubscriberMessageStoragePolicy;
+import org.apache.activemq.transport.TransportFactory;
+import org.apache.activemq.transport.TransportServer;
 import org.apache.activemq.transport.tcp.TcpTransport;
 
 public class ProducerFlowControlTest extends JmsTestSupport {
 
     ActiveMQQueue queueA = new ActiveMQQueue("QUEUE.A");
     ActiveMQQueue queueB = new ActiveMQQueue("QUEUE.B");
-    protected TransportConnector connector;
     protected ActiveMQConnection connection;
     // used to test sendFailIfNoSpace on SystemUsage 
     protected final AtomicBoolean gotResourceException = new AtomicBoolean(false);
@@ -260,22 +257,21 @@
         return done;
     }
 
-    protected BrokerService createBroker() throws Exception {
-        BrokerService service = new BrokerService();
-        service.setPersistent(false);
-        service.setUseJmx(false);
-
-        // Setup a destination policy where it takes only 1 message at a time.
-        PolicyMap policyMap = new PolicyMap();
-        PolicyEntry policy = new PolicyEntry();
-        policy.setMemoryLimit(1);
-        policy.setPendingSubscriberPolicy(new VMPendingSubscriberMessageStoragePolicy());
-        policy.setPendingQueuePolicy(new VMPendingQueueMessageStoragePolicy());
-        policyMap.setDefaultEntry(policy);
-        service.setDestinationPolicy(policyMap);
+    protected Broker createBroker() throws Exception {
+        Broker broker = super.createBroker();
+        broker.addTransportServer(TransportFactory.bind(new URI("tcp://localhost:0")));
+        
+// TODO:
+//        // Setup a destination policy where it takes only 1 message at a time.
+//        PolicyMap policyMap = new PolicyMap();
+//        PolicyEntry policy = new PolicyEntry();
+//        policy.setMemoryLimit(1);
+//        policy.setPendingSubscriberPolicy(new VMPendingSubscriberMessageStoragePolicy());
+//        policy.setPendingQueuePolicy(new VMPendingQueueMessageStoragePolicy());
+//        policyMap.setDefaultEntry(policy);
+//        service.setDestinationPolicy(policyMap);
 
-        connector = service.addConnector("tcp://localhost:0");
-        return service;
+        return broker;
     }
 
     public void setUp() throws Exception {
@@ -293,6 +289,7 @@
     }
 
     protected ConnectionFactory createConnectionFactory() throws Exception {
-        return new ActiveMQConnectionFactory(connector.getConnectUri());
+    	TransportServer server = broker.getTransportServers().get(0);
+        return new ActiveMQConnectionFactory(server.getConnectURI());
     }
 }

Modified: activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test2/JmsTopicSendReceiveWithTwoConnectionsTest.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test2/JmsTopicSendReceiveWithTwoConnectionsTest.java?rev=786593&r1=786592&r2=786593&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test2/JmsTopicSendReceiveWithTwoConnectionsTest.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test2/JmsTopicSendReceiveWithTwoConnectionsTest.java
Fri Jun 19 17:27:33 2009
@@ -95,7 +95,7 @@
     }
 
     protected ActiveMQConnectionFactory createConnectionFactory() throws Exception {
-        return new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
+        return new ActiveMQConnectionFactory("vm://localhost?broker=jaxb:classpath:non-persistent-activemq.xml");
     }
 
     protected void tearDown() throws Exception {

Modified: activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test3/JmsResourceProvider.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test3/JmsResourceProvider.java?rev=786593&r1=786592&r2=786593&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test3/JmsResourceProvider.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test3/JmsResourceProvider.java
Fri Jun 19 17:27:33 2009
@@ -35,7 +35,7 @@
  */
 public class JmsResourceProvider {
 
-    private String serverUri = "vm://localhost?broker.persistent=false";
+    private String serverUri = "vm://localhost?broker=jaxb:classpath:non-persistent-activemq.xml";
     private boolean transacted;
     private int ackMode = Session.AUTO_ACKNOWLEDGE;
     private boolean isTopic;

Modified: activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test3/JmsTopicSendReceiveWithTwoConnectionsTest.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test3/JmsTopicSendReceiveWithTwoConnectionsTest.java?rev=786593&r1=786592&r2=786593&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test3/JmsTopicSendReceiveWithTwoConnectionsTest.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test3/JmsTopicSendReceiveWithTwoConnectionsTest.java
Fri Jun 19 17:27:33 2009
@@ -128,6 +128,6 @@
      * @see org.apache.activemq.legacy.test3.TestSupport#createConnectionFactory()
      */
     protected ActiveMQConnectionFactory createConnectionFactory() throws Exception {
-        return new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
+        return new ActiveMQConnectionFactory("vm://localhost?broker=jaxb:classpath:non-persistent-activemq.xml");
     }
 }

Modified: activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test3/JmsTransactionTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test3/JmsTransactionTestSupport.java?rev=786593&r1=786592&r2=786593&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test3/JmsTransactionTestSupport.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test3/JmsTransactionTestSupport.java
Fri Jun 19 17:27:33 2009
@@ -113,7 +113,7 @@
     /**
      */
     protected BrokerService createBroker() throws Exception, URISyntaxException {
-        return BrokerFactory.createBroker(new URI("broker://()/localhost?persistent=false"));
+        return BrokerFactory.createBroker(new URI("vm://localhost?broker=jaxb:classpath:non-persistent-activemq.xml"));
     }
 
     /*

Modified: activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test3/TestSupport.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test3/TestSupport.java?rev=786593&r1=786592&r2=786593&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test3/TestSupport.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test3/TestSupport.java
Fri Jun 19 17:27:33 2009
@@ -177,7 +177,7 @@
      * @throws Exception
      */
     protected ActiveMQConnectionFactory createConnectionFactory() throws Exception {
-        return new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
+        return new ActiveMQConnectionFactory("vm://localhost?broker=jaxb:classpath:non-persistent-activemq.xml");
     }
 
     /**

Modified: activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test6/JmsMultipleClientsTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test6/JmsMultipleClientsTestSupport.java?rev=786593&r1=786592&r2=786593&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test6/JmsMultipleClientsTestSupport.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-client/src/test/java/org/apache/activemq/legacy/test6/JmsMultipleClientsTestSupport.java
Fri Jun 19 17:27:33 2009
@@ -211,7 +211,7 @@
     }
 
     protected BrokerService createBroker() throws Exception {
-        return BrokerFactory.createBroker(new URI("broker://()/localhost?persistent=false&useJmx=true"));
+        return BrokerFactory.createBroker(new URI("vm://localhost?broker=jaxb:classpath:non-persistent-activemq.xml"));
     }
 
     protected void setUp() throws Exception {

Modified: activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/BrokerBenchmark.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/BrokerBenchmark.java?rev=786593&r1=786592&r2=786593&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/BrokerBenchmark.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/legacy/openwireprotocol/BrokerBenchmark.java
Fri Jun 19 17:27:33 2009
@@ -55,9 +55,8 @@
 
     public void initCombosForTestPerformance() {
         addCombinationValues("destination", new Object[] {new ActiveMQQueue("TEST"), new
ActiveMQTopic("TEST")});
-        addCombinationValues("PRODUCER_COUNT", new Object[] {new Integer("1"), new Integer("10")});
-        addCombinationValues("CONSUMER_COUNT", new Object[] {new Integer("1"), new Integer("10")});
-        addCombinationValues("CONSUMER_COUNT", new Object[] {new Integer("1"), new Integer("10")});
+        addCombinationValues("prodcuerCount", new Object[] {new Integer("1"), new Integer("10")});
+        addCombinationValues("consumerCount", new Object[] {new Integer("1"), new Integer("10")});
         addCombinationValues("deliveryMode", new Object[] {Boolean.TRUE});
     }
 



Mime
View raw message