activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r387385 [2/2] - in /incubator/activemq/trunk/activemq-core: ./ src/main/java/org/apache/activemq/command/ src/main/java/org/apache/activemq/openwire/v1/ src/main/java/org/apache/activemq/transport/ src/main/java/org/apache/activemq/transpor...
Date Tue, 21 Mar 2006 02:49:05 GMT
Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/JournalTransactionTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/JournalTransactionTest.java?rev=387385&r1=387384&r2=387385&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/JournalTransactionTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/JournalTransactionTest.java
Mon Mar 20 18:49:00 2006
@@ -33,7 +33,7 @@
  *        under src/gram/script and then use maven openwire:generate to regenerate 
  *        this file.
  *
- * @version $Revision: $
+ * @version $Revision$
  */
 public class JournalTransactionTest extends DataFileGeneratorTestSupport {
 

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/KeepAliveInfoTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/KeepAliveInfoTest.java?rev=387385&r1=387384&r2=387385&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/KeepAliveInfoTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/KeepAliveInfoTest.java
Mon Mar 20 18:49:00 2006
@@ -33,7 +33,7 @@
  *        under src/gram/script and then use maven openwire:generate to regenerate 
  *        this file.
  *
- * @version $Revision: $
+ * @version $Revision$
  */
 public class KeepAliveInfoTest extends DataFileGeneratorTestSupport {
 

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/LastPartialCommandTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/LastPartialCommandTest.java?rev=387385&r1=387384&r2=387385&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/LastPartialCommandTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/LastPartialCommandTest.java
Mon Mar 20 18:49:00 2006
@@ -35,7 +35,7 @@
  *
  * @version $Revision$
  */
-public class LastPartialCommandTest extends BaseCommandTestSupport {
+public class LastPartialCommandTest extends PartialCommandTest {
 
 
     public static LastPartialCommandTest SINGLETON = new LastPartialCommandTest();

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/LocalTransactionIdTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/LocalTransactionIdTest.java?rev=387385&r1=387384&r2=387385&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/LocalTransactionIdTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/LocalTransactionIdTest.java
Mon Mar 20 18:49:00 2006
@@ -33,7 +33,7 @@
  *        under src/gram/script and then use maven openwire:generate to regenerate 
  *        this file.
  *
- * @version $Revision: $
+ * @version $Revision$
  */
 public class LocalTransactionIdTest extends TransactionIdTestSupport {
 

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/MessageAckTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/MessageAckTest.java?rev=387385&r1=387384&r2=387385&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/MessageAckTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/MessageAckTest.java
Mon Mar 20 18:49:00 2006
@@ -33,7 +33,7 @@
  *        under src/gram/script and then use maven openwire:generate to regenerate 
  *        this file.
  *
- * @version $Revision: $
+ * @version $Revision$
  */
 public class MessageAckTest extends BaseCommandTestSupport {
 

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/MessageDispatchNotificationTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/MessageDispatchNotificationTest.java?rev=387385&r1=387384&r2=387385&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/MessageDispatchNotificationTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/MessageDispatchNotificationTest.java
Mon Mar 20 18:49:00 2006
@@ -33,7 +33,7 @@
  *        under src/gram/script and then use maven openwire:generate to regenerate 
  *        this file.
  *
- * @version $Revision: $
+ * @version $Revision$
  */
 public class MessageDispatchNotificationTest extends BaseCommandTestSupport {
 

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/MessageDispatchTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/MessageDispatchTest.java?rev=387385&r1=387384&r2=387385&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/MessageDispatchTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/MessageDispatchTest.java
Mon Mar 20 18:49:00 2006
@@ -33,7 +33,7 @@
  *        under src/gram/script and then use maven openwire:generate to regenerate 
  *        this file.
  *
- * @version $Revision: $
+ * @version $Revision$
  */
 public class MessageDispatchTest extends BaseCommandTestSupport {
 

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/MessageIdTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/MessageIdTest.java?rev=387385&r1=387384&r2=387385&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/MessageIdTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/MessageIdTest.java
Mon Mar 20 18:49:00 2006
@@ -33,7 +33,7 @@
  *        under src/gram/script and then use maven openwire:generate to regenerate 
  *        this file.
  *
- * @version $Revision: $
+ * @version $Revision$
  */
 public class MessageIdTest extends DataFileGeneratorTestSupport {
 

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/MessageTestSupport.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/MessageTestSupport.java?rev=387385&r1=387384&r2=387385&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/MessageTestSupport.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/MessageTestSupport.java
Mon Mar 20 18:49:00 2006
@@ -33,7 +33,7 @@
  *        under src/gram/script and then use maven openwire:generate to regenerate 
  *        this file.
  *
- * @version $Revision: $
+ * @version $Revision$
  */
 public abstract class MessageTestSupport extends BaseCommandTestSupport {
 

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/ProducerIdTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/ProducerIdTest.java?rev=387385&r1=387384&r2=387385&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/ProducerIdTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/ProducerIdTest.java
Mon Mar 20 18:49:00 2006
@@ -33,7 +33,7 @@
  *        under src/gram/script and then use maven openwire:generate to regenerate 
  *        this file.
  *
- * @version $Revision: $
+ * @version $Revision$
  */
 public class ProducerIdTest extends DataFileGeneratorTestSupport {
 

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/ProducerInfoTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/ProducerInfoTest.java?rev=387385&r1=387384&r2=387385&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/ProducerInfoTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/ProducerInfoTest.java
Mon Mar 20 18:49:00 2006
@@ -33,7 +33,7 @@
  *        under src/gram/script and then use maven openwire:generate to regenerate 
  *        this file.
  *
- * @version $Revision: $
+ * @version $Revision$
  */
 public class ProducerInfoTest extends BaseCommandTestSupport {
 

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/RemoveInfoTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/RemoveInfoTest.java?rev=387385&r1=387384&r2=387385&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/RemoveInfoTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/RemoveInfoTest.java
Mon Mar 20 18:49:00 2006
@@ -33,7 +33,7 @@
  *        under src/gram/script and then use maven openwire:generate to regenerate 
  *        this file.
  *
- * @version $Revision: $
+ * @version $Revision$
  */
 public class RemoveInfoTest extends BaseCommandTestSupport {
 

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/RemoveSubscriptionInfoTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/RemoveSubscriptionInfoTest.java?rev=387385&r1=387384&r2=387385&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/RemoveSubscriptionInfoTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/RemoveSubscriptionInfoTest.java
Mon Mar 20 18:49:00 2006
@@ -33,7 +33,7 @@
  *        under src/gram/script and then use maven openwire:generate to regenerate 
  *        this file.
  *
- * @version $Revision: $
+ * @version $Revision$
  */
 public class RemoveSubscriptionInfoTest extends BaseCommandTestSupport {
 

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/ReplayCommandTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/ReplayCommandTest.java?rev=387385&r1=387384&r2=387385&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/ReplayCommandTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/ReplayCommandTest.java
Mon Mar 20 18:49:00 2006
@@ -33,7 +33,7 @@
  *        under src/gram/script and then use maven openwire:generate to regenerate 
  *        this file.
  *
- * @version $Revision: $
+ * @version $Revision$
  */
 public class ReplayCommandTest extends BaseCommandTestSupport {
 

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/ResponseTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/ResponseTest.java?rev=387385&r1=387384&r2=387385&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/ResponseTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/ResponseTest.java
Mon Mar 20 18:49:00 2006
@@ -33,7 +33,7 @@
  *        under src/gram/script and then use maven openwire:generate to regenerate 
  *        this file.
  *
- * @version $Revision: $
+ * @version $Revision$
  */
 public class ResponseTest extends BaseCommandTestSupport {
 

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/SessionIdTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/SessionIdTest.java?rev=387385&r1=387384&r2=387385&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/SessionIdTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/SessionIdTest.java
Mon Mar 20 18:49:00 2006
@@ -33,7 +33,7 @@
  *        under src/gram/script and then use maven openwire:generate to regenerate 
  *        this file.
  *
- * @version $Revision: $
+ * @version $Revision$
  */
 public class SessionIdTest extends DataFileGeneratorTestSupport {
 

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/SessionInfoTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/SessionInfoTest.java?rev=387385&r1=387384&r2=387385&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/SessionInfoTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/SessionInfoTest.java
Mon Mar 20 18:49:00 2006
@@ -33,7 +33,7 @@
  *        under src/gram/script and then use maven openwire:generate to regenerate 
  *        this file.
  *
- * @version $Revision: $
+ * @version $Revision$
  */
 public class SessionInfoTest extends BaseCommandTestSupport {
 

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/ShutdownInfoTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/ShutdownInfoTest.java?rev=387385&r1=387384&r2=387385&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/ShutdownInfoTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/ShutdownInfoTest.java
Mon Mar 20 18:49:00 2006
@@ -33,7 +33,7 @@
  *        under src/gram/script and then use maven openwire:generate to regenerate 
  *        this file.
  *
- * @version $Revision: $
+ * @version $Revision$
  */
 public class ShutdownInfoTest extends BaseCommandTestSupport {
 

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/SubscriptionInfoTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/SubscriptionInfoTest.java?rev=387385&r1=387384&r2=387385&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/SubscriptionInfoTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/SubscriptionInfoTest.java
Mon Mar 20 18:49:00 2006
@@ -33,7 +33,7 @@
  *        under src/gram/script and then use maven openwire:generate to regenerate 
  *        this file.
  *
- * @version $Revision: $
+ * @version $Revision$
  */
 public class SubscriptionInfoTest extends DataFileGeneratorTestSupport {
 

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/TransactionIdTestSupport.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/TransactionIdTestSupport.java?rev=387385&r1=387384&r2=387385&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/TransactionIdTestSupport.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/TransactionIdTestSupport.java
Mon Mar 20 18:49:00 2006
@@ -33,7 +33,7 @@
  *        under src/gram/script and then use maven openwire:generate to regenerate 
  *        this file.
  *
- * @version $Revision: $
+ * @version $Revision$
  */
 public abstract class TransactionIdTestSupport extends DataFileGeneratorTestSupport {
 

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/TransactionInfoTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/TransactionInfoTest.java?rev=387385&r1=387384&r2=387385&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/TransactionInfoTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/TransactionInfoTest.java
Mon Mar 20 18:49:00 2006
@@ -33,7 +33,7 @@
  *        under src/gram/script and then use maven openwire:generate to regenerate 
  *        this file.
  *
- * @version $Revision: $
+ * @version $Revision$
  */
 public class TransactionInfoTest extends BaseCommandTestSupport {
 

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/WireFormatInfoTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/WireFormatInfoTest.java?rev=387385&r1=387384&r2=387385&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/WireFormatInfoTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/WireFormatInfoTest.java
Mon Mar 20 18:49:00 2006
@@ -33,7 +33,7 @@
  *        under src/gram/script and then use maven openwire:generate to regenerate 
  *        this file.
  *
- * @version $Revision: $
+ * @version $Revision$
  */
 public class WireFormatInfoTest extends DataFileGeneratorTestSupport {
 

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/XATransactionIdTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/XATransactionIdTest.java?rev=387385&r1=387384&r2=387385&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/XATransactionIdTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/XATransactionIdTest.java
Mon Mar 20 18:49:00 2006
@@ -33,7 +33,7 @@
  *        under src/gram/script and then use maven openwire:generate to regenerate 
  *        this file.
  *
- * @version $Revision: $
+ * @version $Revision$
  */
 public class XATransactionIdTest extends TransactionIdTestSupport {
 

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/udp/UdpTestSupport.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/udp/UdpTestSupport.java?rev=387385&r1=387384&r2=387385&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/udp/UdpTestSupport.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/udp/UdpTestSupport.java
Mon Mar 20 18:49:00 2006
@@ -21,6 +21,8 @@
 import org.apache.activemq.command.ActiveMQTextMessage;
 import org.apache.activemq.command.Command;
 import org.apache.activemq.command.ConsumerInfo;
+import org.apache.activemq.command.KeepAliveInfo;
+import org.apache.activemq.command.ProducerInfo;
 import org.apache.activemq.command.Response;
 import org.apache.activemq.command.WireFormatInfo;
 import org.apache.activemq.transport.Transport;
@@ -48,6 +50,9 @@
     protected TransportServer server;
     protected boolean large;
 
+    // You might want to set this to massive number if debugging
+    protected int waitForCommandTimeout = 40000;
+
     public void testSendingSmallMessage() throws Exception {
         ConsumerInfo expected = new ConsumerInfo();
         expected.setSelector("Cheese");
@@ -85,7 +90,8 @@
         assertSendTextMessage(destination, text);
     }
 
-    protected void assertSendTextMessage(ActiveMQDestination destination, String text) throws
MessageNotWriteableException {
+    protected void assertSendTextMessage(ActiveMQDestination destination, String text)
+            throws MessageNotWriteableException {
         large = true;
 
         ActiveMQTextMessage expected = new ActiveMQTextMessage();
@@ -97,13 +103,21 @@
             System.out.println("About to send message of type: " + expected.getClass());
             producer.oneway(expected);
 
+            // lets send a dummy command to ensure things don't block if we
+            // discard the last one
+            // keepalive does not have a commandId...
+            // producer.oneway(new KeepAliveInfo());
+            producer.oneway(new ProducerInfo());
+            producer.oneway(new ProducerInfo());
+
             Command received = assertCommandReceived();
-            assertTrue("Should have received a ActiveMQTextMessage but was: " + received,
received instanceof ActiveMQTextMessage);
+            assertTrue("Should have received a ActiveMQTextMessage but was: " + received,
+                    received instanceof ActiveMQTextMessage);
             ActiveMQTextMessage actual = (ActiveMQTextMessage) received;
 
             assertEquals("getDestination", expected.getDestination(), actual.getDestination());
             assertEquals("getText", expected.getText(), actual.getText());
-            
+
             System.out.println("Received text message with: " + actual.getText().length()
+ " character(s)");
         }
         catch (Exception e) {
@@ -157,6 +171,7 @@
 
             public void onException(IOException error) {
                 System.out.println("Producer exception: " + error);
+                error.printStackTrace();
             }
 
             public void transportInterupted() {
@@ -192,21 +207,27 @@
 
             }
             if (large) {
-                System.out.println("### Received command: " + command.getClass() + " with
id: " + command.getCommandId());
+                System.out.println("### Received command: " + command.getClass() + " with
id: "
+                        + command.getCommandId());
             }
             else {
                 System.out.println("### Received command: " + command);
             }
 
             synchronized (lock) {
-                receivedCommand = command;
+                if (receivedCommand == null) {
+                    receivedCommand = command;
+                }
+                else {
+                    System.out.println("Ignoring superfluous command: " + command);
+                }
                 lock.notifyAll();
             }
         }
     }
 
     protected void sendResponse(Command command) {
-        Response response = new Response();                
+        Response response = new Response();
         response.setCorrelationId(command.getCommandId());
         try {
             consumer.oneway(response);
@@ -220,6 +241,7 @@
 
     public void onException(IOException error) {
         System.out.println("### Received error: " + error);
+        error.printStackTrace();
     }
 
     public void transportInterupted() {
@@ -235,7 +257,7 @@
         synchronized (lock) {
             answer = receivedCommand;
             if (answer == null) {
-                lock.wait(5000);
+                lock.wait(waitForCommandTimeout);
             }
             answer = receivedCommand;
         }



Mime
View raw message