Fix failing test cases.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@580475 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2007-09-28 20:16:08 +00:00
parent 3d024d6b4f
commit 7bd8fb6754
3 changed files with 11 additions and 1 deletions

View File

@ -31,8 +31,10 @@ import org.apache.activemq.command.ConnectionInfo;
import org.apache.activemq.command.LocalTransactionId;
import org.apache.activemq.command.Message;
import org.apache.activemq.command.MessageAck;
import org.apache.activemq.command.ProducerInfo;
import org.apache.activemq.command.TransactionId;
import org.apache.activemq.command.XATransactionId;
import org.apache.activemq.state.ProducerState;
import org.apache.activemq.store.TransactionRecoveryListener;
import org.apache.activemq.store.TransactionStore;
import org.apache.activemq.transaction.LocalTransaction;
@ -84,6 +86,7 @@ public class TransactionBroker extends BrokerFilter {
final ProducerBrokerExchange producerExchange = new ProducerBrokerExchange();
producerExchange.setMutable(true);
producerExchange.setConnectionContext(context);
producerExchange.setProducerState(new ProducerState(new ProducerInfo()));
final ConsumerBrokerExchange consumerExchange = new ConsumerBrokerExchange();
consumerExchange.setConnectionContext(context);
transactionStore.recover(new TransactionRecoveryListener() {

View File

@ -27,6 +27,7 @@ import javax.jms.DeliveryMode;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.MapMessage;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.MessageEOFException;
import javax.jms.MessageProducer;

View File

@ -23,6 +23,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.atomic.AtomicLong;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
@ -43,6 +44,7 @@ import org.apache.activemq.command.ActiveMQDestination;
*/
public class JmsTestSupport extends CombinationTestSupport {
static final private AtomicLong TEST_COUNTER = new AtomicLong();
public String userName;
public String password;
@ -58,7 +60,11 @@ public class JmsTestSupport extends CombinationTestSupport {
//
// /////////////////////////////////////////////////////////////////
protected ActiveMQDestination createDestination(Session session, byte type) throws JMSException {
String name = "TEST." + getClass().getName() + "." + getName();
String testMethod = getName();
if( testMethod.indexOf(" ")>0 ) {
testMethod = testMethod.substring(0, testMethod.indexOf(" "));
}
String name = "TEST." + getClass().getName() + "." +testMethod+"."+TEST_COUNTER.getAndIncrement();
switch (type) {
case ActiveMQDestination.QUEUE_TYPE:
return (ActiveMQDestination)session.createQueue(name);