activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r580475 - in /activemq/trunk/activemq-core/src: main/java/org/apache/activemq/broker/TransactionBroker.java test/java/org/apache/activemq/JMSMessageTest.java test/java/org/apache/activemq/JmsTestSupport.java
Date Fri, 28 Sep 2007 20:16:09 GMT
Author: chirino
Date: Fri Sep 28 13:16:08 2007
New Revision: 580475

URL: http://svn.apache.org/viewvc?rev=580475&view=rev
Log:
Fix failing test cases.

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransactionBroker.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSMessageTest.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTestSupport.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransactionBroker.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransactionBroker.java?rev=580475&r1=580474&r2=580475&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransactionBroker.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransactionBroker.java
Fri Sep 28 13:16:08 2007
@@ -31,8 +31,10 @@
 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 @@
             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() {

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSMessageTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSMessageTest.java?rev=580475&r1=580474&r2=580475&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSMessageTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSMessageTest.java Fri
Sep 28 13:16:08 2007
@@ -27,6 +27,7 @@
 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;

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTestSupport.java?rev=580475&r1=580474&r2=580475&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTestSupport.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTestSupport.java Fri
Sep 28 13:16:08 2007
@@ -23,6 +23,7 @@
 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 @@
  */
 public class JmsTestSupport extends CombinationTestSupport {
 
+    static final private AtomicLong TEST_COUNTER = new AtomicLong();
     public String userName;
     public String password;
 
@@ -58,7 +60,11 @@
     //
     // /////////////////////////////////////////////////////////////////
     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);



Mime
View raw message