activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dflo...@apache.org
Subject svn commit: r386808 - in /incubator/activemq/trunk: activemq-core/src/test/java/org/apache/activemq/test/ assembly/ assembly/src/test/resources/org/apache/activemq/config/ jmeter/src/java/org/activemq/sampler/ jmeter/src/java/org/activemq/util/connection/
Date Sat, 18 Mar 2006 04:31:19 GMT
Author: dflores
Date: Fri Mar 17 20:31:17 2006
New Revision: 386808

URL: http://svn.apache.org/viewcvs?rev=386808&view=rev
Log: (empty)

Modified:
    incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/JmsSendReceiveTestSupport.java
    incubator/activemq/trunk/assembly/project.xml
    incubator/activemq/trunk/assembly/src/test/resources/org/apache/activemq/config/example.xml
    incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/Consumer.java
    incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/ConsumerSysTest.java
    incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/Producer.java
    incubator/activemq/trunk/jmeter/src/java/org/activemq/util/connection/ServerConnectionFactory.java

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/JmsSendReceiveTestSupport.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/JmsSendReceiveTestSupport.java?rev=386808&r1=386807&r2=386808&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/JmsSendReceiveTestSupport.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/JmsSendReceiveTestSupport.java
Fri Mar 17 20:31:17 2006
@@ -107,7 +107,7 @@
         
         for (int i = 0; i < data.length; i++) {
             Message message = session.createTextMessage(data[i]);
-            
+            Thread.sleep(200);
             if (verbose) {
                 log.info("About to send a message: " + message + " with text: " + data[i]);
             }

Modified: incubator/activemq/trunk/assembly/project.xml
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/assembly/project.xml?rev=386808&r1=386807&r2=386808&view=diff
==============================================================================
--- incubator/activemq/trunk/assembly/project.xml (original)
+++ incubator/activemq/trunk/assembly/project.xml Fri Mar 17 20:31:17 2006
@@ -321,8 +321,6 @@
         <include>**/*Test.*</include>
       </includes>
       <excludes>
-          <!-- http://jira.activemq.org/jira/browse/AMQ-586: fails on Windows 2003 -->
-          <exclude>**/TwoBrokerTopicSendReceiveTest.*</exclude>
           <!-- http://jira.activemq.org/jira/browse/AMQ-537 --> 
           <exclude>**/PublishOnQueueConsumedMessageUsingActivemqXMLTest.*</exclude>
           <!-- http://jira.activemq.org/jira/browse/AMQ-538 --> 

Modified: incubator/activemq/trunk/assembly/src/test/resources/org/apache/activemq/config/example.xml
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/assembly/src/test/resources/org/apache/activemq/config/example.xml?rev=386808&r1=386807&r2=386808&view=diff
==============================================================================
--- incubator/activemq/trunk/assembly/src/test/resources/org/apache/activemq/config/example.xml
(original)
+++ incubator/activemq/trunk/assembly/src/test/resources/org/apache/activemq/config/example.xml
Fri Mar 17 20:31:17 2006
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <!--
     Copyright 2005-2006 The Apache Software Foundation
    

Modified: incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/Consumer.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/Consumer.java?rev=386808&r1=386807&r2=386808&view=diff
==============================================================================
--- incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/Consumer.java (original)
+++ incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/Consumer.java Fri Mar 17
20:31:17 2006
@@ -137,7 +137,6 @@
             if ((ServerConnectionFactory.JORAM_SERVER.equals(this.getMQServer())) ||
                 (ServerConnectionFactory.MANTARAY_SERVER.equals(this.getMQServer()))) {
                 //Id set by server
-
             } else {
                 IdGenerator idGenerator = new IdGenerator();
                 connection.setClientID(idGenerator.generateId());
@@ -145,8 +144,7 @@
         }
 
         //start connection before receiving messages.
-        connection.start();
-
+//        connection.start();
         Session session = ServerConnectionFactory.createSession(connection,
                                                                 this.getTransacted(),
                                                                 this.getMQServer(),
@@ -159,6 +157,7 @@
                                                                             this.getTopic());
 
         MessageConsumer consumer = null;
+        connection.start();
 
         if (ServerConnectionFactory.OPENJMS_SERVER.equals(this.getMQServer())) {
             if (this.getTopic()) {
@@ -214,7 +213,6 @@
         try {
             TextMessage textMessage = (TextMessage) message;
             Session session;
-
             // lets force the content to be deserialized
             String text = textMessage.getText();
             count(1);

Modified: incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/ConsumerSysTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/ConsumerSysTest.java?rev=386808&r1=386807&r2=386808&view=diff
==============================================================================
--- incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/ConsumerSysTest.java (original)
+++ incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/ConsumerSysTest.java Fri
Mar 17 20:31:17 2006
@@ -172,7 +172,6 @@
                                                                             ACTIVEMQ_SERVER,
                                                                             this.getTopic());
 
-
         if (this.getDurable() && this.getTopic()) {
             consumer = session.createDurableSubscriber((Topic) destination, getClass().getName());
         } else {
@@ -191,10 +190,12 @@
     protected void publishConfirmMessage() throws JMSException {
         MessageProducer publisher = null;
         String text = PUBLISH_MSG;
+
         Connection connection = ServerConnectionFactory.createConnectionFactory(this.getURL(),
                                                                                 ACTIVEMQ_SERVER,
                                                                                 this.getTopic(),
                                                                                 this.getEmbeddedBroker());
+
         if (this.getDurable()) {
             IdGenerator idGenerator = new IdGenerator();
             connection.setClientID(idGenerator.generateId());
@@ -247,13 +248,10 @@
      * @throws JMSException
      */
     public void run() throws JMSException {
-
         // Receives the config message
         suscribeConfigMessage();
-
         // Create subscriber
         subscribe();
-
         // Publish confirm messages
         publishConfirmMessage();
     }

Modified: incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/Producer.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/Producer.java?rev=386808&r1=386807&r2=386808&view=diff
==============================================================================
--- incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/Producer.java (original)
+++ incubator/activemq/trunk/jmeter/src/java/org/activemq/sampler/Producer.java Fri Mar 17
20:31:17 2006
@@ -278,7 +278,6 @@
      * @throws Exception
      */
     public void run() throws Exception {
-
         start();
         publish();
     }

Modified: incubator/activemq/trunk/jmeter/src/java/org/activemq/util/connection/ServerConnectionFactory.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/jmeter/src/java/org/activemq/util/connection/ServerConnectionFactory.java?rev=386808&r1=386807&r2=386808&view=diff
==============================================================================
--- incubator/activemq/trunk/jmeter/src/java/org/activemq/util/connection/ServerConnectionFactory.java
(original)
+++ incubator/activemq/trunk/jmeter/src/java/org/activemq/util/connection/ServerConnectionFactory.java
Fri Mar 17 20:31:17 2006
@@ -94,6 +94,10 @@
     private static int mantarayProducerPortCount = 0;
     private static int mantarayConsumerPortCount = 0;
 
+    protected static String user = ActiveMQConnection.DEFAULT_USER;
+    protected static String pwd = ActiveMQConnection.DEFAULT_PASSWORD;
+
+
     /**
      * Closes the connection passed through the parameter
      *
@@ -199,9 +203,8 @@
         } else {
             //Used to create a session from the default MQ server ActiveMQConnectionFactory.
             ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(url);
-            factory.setUseAsyncSend(true);
-            
             ActiveMQConnection c = (ActiveMQConnection) factory.createConnection();
+            factory.setUseAsyncSend(true);
 
             c.getPrefetchPolicy().setQueuePrefetch(1000);
             c.getPrefetchPolicy().setQueueBrowserPrefetch(1000);
@@ -276,6 +279,7 @@
                                         boolean isTransacted,
                                         String mqServer,
                                         boolean isTopic) throws JMSException {
+
         if (OPENJMS_SERVER.equals(mqServer) || MANTARAY_SERVER.equals(mqServer)) {
             if (isTransacted) {
                 if (isTopic) {
@@ -305,9 +309,29 @@
         } else {
             // check when to use Transacted or Non-Transacted type.
             if (isTransacted) {
-                return connection.createSession(true, Session.SESSION_TRANSACTED);
+                if (isTopic) {
+                    TopicSession session = ((TopicConnection) connection).createTopicSession(false,
Session.SESSION_TRANSACTED);
+
+                    return ((Session) session);
+
+                } else {
+                    QueueSession session = ((QueueConnection) connection).createQueueSession(false,
Session.SESSION_TRANSACTED);
+
+                    return ((Session) session);
+
+                }
             } else {
-                return connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+                if (isTopic) {
+                    TopicSession session = ((TopicConnection) connection).createTopicSession(false,
Session.AUTO_ACKNOWLEDGE);
+
+                    return ((Session) session);
+
+                } else {
+                    QueueSession session = ((QueueConnection) connection).createQueueSession(false,
Session.AUTO_ACKNOWLEDGE);
+
+                    return ((Session) session);
+
+                }
             }
         }
     }



Mime
View raw message