You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by js...@apache.org on 2006/05/22 13:00:42 UTC

svn commit: r408640 - in /incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test: JmsSendReceiveTestSupport.java JmsTopicSendReceiveWithTwoConnectionsAndByteSelectorTest.java JmsTopicSendReceiveWithTwoConnectionsTest.java

Author: jstrachan
Date: Mon May 22 04:00:42 2006
New Revision: 408640

URL: http://svn.apache.org/viewvc?rev=408640&view=rev
Log:
added another attempt to reproduce AMQ-715

Added:
    incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithTwoConnectionsAndByteSelectorTest.java   (with props)
Modified:
    incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/JmsSendReceiveTestSupport.java
    incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithTwoConnectionsTest.java

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/JmsSendReceiveTestSupport.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/JmsSendReceiveTestSupport.java?rev=408640&r1=408639&r2=408640&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 Mon May 22 04:00:42 2006
@@ -112,6 +112,7 @@
         
         for (int i = 0; i < data.length; i++) {
             Message message = session.createTextMessage(data[i]);
+            configureMessage(message);
             if (verbose) {
                 log.info("About to send a message: " + message + " with text: " + data[i]);
             }
@@ -122,6 +123,14 @@
         assertMessagesAreReceived();
         log.info("" + data.length + " messages(s) received, closing down connections");
     }
+
+    /**
+     * A hook to allow the message to be configured such as adding extra headers
+     * @throws JMSException 
+     */
+    protected void configureMessage(Message message) throws JMSException {
+    }
+
 
     /**
      * Waits to receive the messages and performs the test if all messages have been received and 

Added: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithTwoConnectionsAndByteSelectorTest.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithTwoConnectionsAndByteSelectorTest.java?rev=408640&view=auto
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithTwoConnectionsAndByteSelectorTest.java (added)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithTwoConnectionsAndByteSelectorTest.java Mon May 22 04:00:42 2006
@@ -0,0 +1,37 @@
+/**
+ *
+ * Copyright 2005-2006 The Apache Software Foundation
+ *
+ * Licensed 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.test;
+
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+
+/**
+ * @version $Revision$
+ */
+public class JmsTopicSendReceiveWithTwoConnectionsAndByteSelectorTest extends JmsTopicSendReceiveWithTwoConnectionsTest {
+    
+
+    protected void configureMessage(Message message) throws JMSException {
+        message.setByteProperty("dummy", (byte) 33);
+    }
+
+    protected MessageConsumer createConsumer() throws JMSException {
+        return receiveSession.createConsumer(consumerDestination, "dummy = 33", false);
+    }
+
+}
\ No newline at end of file

Propchange: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithTwoConnectionsAndByteSelectorTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithTwoConnectionsAndByteSelectorTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithTwoConnectionsAndByteSelectorTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithTwoConnectionsTest.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithTwoConnectionsTest.java?rev=408640&r1=408639&r2=408640&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithTwoConnectionsTest.java (original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithTwoConnectionsTest.java Mon May 22 04:00:42 2006
@@ -18,6 +18,8 @@
 
 import javax.jms.Connection;
 import javax.jms.DeliveryMode;
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
 import javax.jms.Session;
 
 import org.apache.activemq.ActiveMQConnectionFactory;
@@ -82,10 +84,14 @@
         log.info("Created  consumer destination: " + consumerDestination + " of type: " + consumerDestination.getClass());
         log.info("Created  producer destination: " + producerDestination + " of type: " + producerDestination.getClass());
 
-        consumer = receiveSession.createConsumer(consumerDestination);
+        consumer = createConsumer();
         consumer.setMessageListener(this);
 
         log.info("Started connections");
+    }
+
+    protected MessageConsumer createConsumer() throws JMSException {
+        return receiveSession.createConsumer(consumerDestination);
     }
     
     /*