mirror of https://github.com/apache/activemq.git
added another attempt to reproduce AMQ-715
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@408640 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c172b50ccc
commit
deff26029f
|
@ -112,6 +112,7 @@ public class JmsSendReceiveTestSupport extends TestSupport implements MessageLis
|
||||||
|
|
||||||
for (int i = 0; i < data.length; i++) {
|
for (int i = 0; i < data.length; i++) {
|
||||||
Message message = session.createTextMessage(data[i]);
|
Message message = session.createTextMessage(data[i]);
|
||||||
|
configureMessage(message);
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
log.info("About to send a message: " + message + " with text: " + data[i]);
|
log.info("About to send a message: " + message + " with text: " + data[i]);
|
||||||
}
|
}
|
||||||
|
@ -123,6 +124,14 @@ public class JmsSendReceiveTestSupport extends TestSupport implements MessageLis
|
||||||
log.info("" + data.length + " messages(s) received, closing down connections");
|
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
|
* Waits to receive the messages and performs the test if all messages have been received and
|
||||||
* are in sequential order.
|
* are in sequential order.
|
||||||
|
|
|
@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -18,6 +18,8 @@ package org.apache.activemq.test;
|
||||||
|
|
||||||
import javax.jms.Connection;
|
import javax.jms.Connection;
|
||||||
import javax.jms.DeliveryMode;
|
import javax.jms.DeliveryMode;
|
||||||
|
import javax.jms.JMSException;
|
||||||
|
import javax.jms.MessageConsumer;
|
||||||
import javax.jms.Session;
|
import javax.jms.Session;
|
||||||
|
|
||||||
import org.apache.activemq.ActiveMQConnectionFactory;
|
import org.apache.activemq.ActiveMQConnectionFactory;
|
||||||
|
@ -82,12 +84,16 @@ public class JmsTopicSendReceiveWithTwoConnectionsTest extends JmsSendReceiveTes
|
||||||
log.info("Created consumer destination: " + consumerDestination + " of type: " + consumerDestination.getClass());
|
log.info("Created consumer destination: " + consumerDestination + " of type: " + consumerDestination.getClass());
|
||||||
log.info("Created producer destination: " + producerDestination + " of type: " + producerDestination.getClass());
|
log.info("Created producer destination: " + producerDestination + " of type: " + producerDestination.getClass());
|
||||||
|
|
||||||
consumer = receiveSession.createConsumer(consumerDestination);
|
consumer = createConsumer();
|
||||||
consumer.setMessageListener(this);
|
consumer.setMessageListener(this);
|
||||||
|
|
||||||
log.info("Started connections");
|
log.info("Started connections");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected MessageConsumer createConsumer() throws JMSException {
|
||||||
|
return receiveSession.createConsumer(consumerDestination);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @see junit.framework.TestCase#tearDown()
|
* @see junit.framework.TestCase#tearDown()
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue