activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject svn commit: r782037 - in /activemq/trunk/activemq-core/src/test/java/org/apache/activemq: QueueConsumerPriorityTest.java broker/jmx/MBeanTest.java network/SimpleNetworkTest.java transport/stomp/StompTest.java
Date Fri, 05 Jun 2009 15:08:25 GMT
Author: dejanb
Date: Fri Jun  5 15:08:24 2009
New Revision: 782037

URL: http://svn.apache.org/viewvc?rev=782037&view=rev
Log:
fix for https://issues.apache.org/activemq/browse/AMQ-2282 - ibm jdk test failures

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/QueueConsumerPriorityTest.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/jmx/MBeanTest.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/SimpleNetworkTest.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/QueueConsumerPriorityTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/QueueConsumerPriorityTest.java?rev=782037&r1=782036&r2=782037&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/QueueConsumerPriorityTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/QueueConsumerPriorityTest.java
Fri Jun  5 15:08:24 2009
@@ -79,7 +79,7 @@
             Message msg = senderSession.createTextMessage("test");
             for (int i =0; i< 10000;i++) {
                 producer.send(msg);
-                Assert.assertNotNull("null on iteration: " + i, highConsumer.receive(100));
+                Assert.assertNotNull("null on iteration: " + i, highConsumer.receive(200));
             }
             Assert.assertNull( lowConsumer.receive(500));
             

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/jmx/MBeanTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/jmx/MBeanTest.java?rev=782037&r1=782036&r2=782037&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/jmx/MBeanTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/jmx/MBeanTest.java
Fri Jun  5 15:08:24 2009
@@ -314,7 +314,12 @@
             assertComplexData(i, cdata, "JMSType", "MyType");
             assertComplexData(i, cdata, "JMSCorrelationID", "MyCorrId");
             assertComplexData(i, cdata, "JMSDeliveryMode", "NON-PERSISTENT");
-            assertComplexData(i, cdata, "PropertiesText", "{MyStringHeader=StringHeader"
+ i + ", MyHeader=" + i + "}");
+            String expected = "{MyStringHeader=StringHeader" + i + ", MyHeader=" + i + "}";
+            // The order of the properties is different when using the ibm jdk.
+            if (System.getProperty("java.vendor").equals("IBM Corporation")) {
+                expected = "{MyHeader=" + i + ", MyStringHeader=StringHeader" + i + "}";
+            }
+            assertComplexData(i, cdata, "PropertiesText", expected);
 
             Map intProperties = CompositeDataHelper.getTabularMap(cdata, CompositeDataConstants.INT_PROPERTIES);
             assertEquals("intProperties size()", 1, intProperties.size());

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/SimpleNetworkTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/SimpleNetworkTest.java?rev=782037&r1=782036&r2=782037&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/SimpleNetworkTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/SimpleNetworkTest.java
Fri Jun  5 15:08:24 2009
@@ -140,7 +140,7 @@
         doSetUp();
         remoteConsumer = remoteSession.createDurableSubscriber(included, consumerName);
         for (int i = 0; i < MESSAGE_COUNT; i++) {
-            assertNotNull("message count: " + i, remoteConsumer.receive(1000));
+            assertNotNull("message count: " + i, remoteConsumer.receive(2500));
         }
     }
 

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java?rev=782037&r1=782036&r2=782037&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java
Fri Jun  5 15:08:24 2009
@@ -89,6 +89,25 @@
         + "}}";
 
     protected void setUp() throws Exception {
+        // The order of the entries is different when using the ibm jdk.
+        if (System.getProperty("java.vendor").equals("IBM Corporation")) {
+            xmlMap = "<map>\n" 
+                + "  <entry>\n" 
+                + "    <string>city</string>\n"
+                + "    <string>Belgrade</string>\n" 
+                + "  </entry>\n" 
+                + "  <entry>\n"
+                + "    <string>name</string>\n" 
+                + "    <string>Dejan</string>\n"
+                + "  </entry>\n" 
+                + "</map>\n";
+            jsonMap = "{\"map\":{" 
+                + "\"entry\":["
+                + "{\"string\":[\"city\",\"Belgrade\"]}," 
+                + "{\"string\":[\"name\",\"Dejan\"]}"
+                + "]" 
+                + "}}";
+        }
         broker = BrokerFactory.createBroker(new URI(confUri));
         broker.start();
 
@@ -170,7 +189,7 @@
 
         stompConnection.sendFrame(frame);
 
-        TextMessage message = (TextMessage)consumer.receive(1000);
+        TextMessage message = (TextMessage)consumer.receive(2500);
         assertNotNull(message);
         assertEquals("Hello World", message.getText());
 
@@ -195,7 +214,7 @@
 
         stompConnection.sendFrame(frame);
 
-        TextMessage message = (TextMessage)consumer.receive(1000);
+        TextMessage message = (TextMessage)consumer.receive(2500);
         assertNotNull(message);
         assertEquals("TEST", ((ActiveMQTextMessage)message).getGroupID());
     }
@@ -214,7 +233,7 @@
 
         stompConnection.sendFrame(frame);
 
-        TextMessage message = (TextMessage)consumer.receive(1000);
+        TextMessage message = (TextMessage)consumer.receive(2500);
         assertNotNull(message);
         assertEquals("Hello World", message.getText());
         assertEquals("foo", "abc", message.getStringProperty("foo"));
@@ -236,7 +255,7 @@
 
         stompConnection.sendFrame(frame);
 
-        TextMessage message = (TextMessage)consumer.receive(1000);
+        TextMessage message = (TextMessage)consumer.receive(2500);
         assertNotNull(message);
         assertEquals("Hello World", message.getText());
         assertEquals("JMSCorrelationID", "c123", message.getJMSCorrelationID());
@@ -411,7 +430,7 @@
 
         // message should be received since message was not acknowledged
         MessageConsumer consumer = session.createConsumer(queue);
-        TextMessage message = (TextMessage)consumer.receive(1000);
+        TextMessage message = (TextMessage)consumer.receive(2500);
         assertNotNull(message);
         assertTrue(message.getJMSRedelivered());
     }
@@ -472,7 +491,7 @@
 
         waitForFrameToTakeEffect();
 
-        TextMessage message = (TextMessage)consumer.receive(1000);
+        TextMessage message = (TextMessage)consumer.receive(2500);
         assertNotNull("Should have received a message", message);
     }
 
@@ -508,7 +527,7 @@
         waitForFrameToTakeEffect();
 
         // only second msg should be received since first msg was rolled back
-        TextMessage message = (TextMessage)consumer.receive(1000);
+        TextMessage message = (TextMessage)consumer.receive(2500);
         assertNotNull(message);
         assertEquals("second message", message.getText().trim());
     }
@@ -599,7 +618,7 @@
 
         stompConnection.sendFrame(frame);
 
-        TextMessage message = (TextMessage)consumer.receive(1000);
+        TextMessage message = (TextMessage)consumer.receive(2500);
         assertNotNull(message);
         assertEquals("Hello World", message.getText());  	
     }
@@ -617,7 +636,7 @@
 
         stompConnection.sendFrame(frame);
 
-        TextMessage message = (TextMessage)consumer.receive(1000);
+        TextMessage message = (TextMessage)consumer.receive(2500);
         assertNotNull(message);
         assertNotNull(message.getStringProperty(Stomp.Headers.TRANSFORMATION_ERROR));
         assertEquals("Hello World", message.getText());  	
@@ -636,7 +655,7 @@
 
         stompConnection.sendFrame(frame);
 
-        ObjectMessage message = (ObjectMessage)consumer.receive(1000);
+        ObjectMessage message = (ObjectMessage)consumer.receive(2500);
         assertNotNull(message);
         SamplePojo object = (SamplePojo)message.getObject();
         assertEquals("Dejan", object.getName());
@@ -655,7 +674,7 @@
 
         stompConnection.sendFrame(frame);
 
-        ObjectMessage message = (ObjectMessage)consumer.receive(1000);
+        ObjectMessage message = (ObjectMessage)consumer.receive(2500);
         assertNotNull(message);
         SamplePojo object = (SamplePojo)message.getObject();
         assertEquals("Dejan", object.getName());
@@ -788,7 +807,7 @@
 
         stompConnection.sendFrame(frame);
 
-        MapMessage message = (MapMessage) consumer.receive(1000);
+        MapMessage message = (MapMessage) consumer.receive(2500);
         assertNotNull(message);
         assertEquals(message.getString("name"), "Dejan");
     }
@@ -806,7 +825,7 @@
 
         stompConnection.sendFrame(frame);
 
-        MapMessage message = (MapMessage) consumer.receive(1000);
+        MapMessage message = (MapMessage) consumer.receive(2500);
         assertNotNull(message);
         assertEquals(message.getString("name"), "Dejan");
     }
@@ -883,7 +902,7 @@
         stompConnection.sendFrame(frame);
         // wait a bit for MBean to get refreshed
         try {
-        	Thread.sleep(200);
+        	Thread.sleep(400);
         } catch (InterruptedException e){}
         
         assertEquals(view.getDurableTopicSubscribers().length, 1);
@@ -891,7 +910,7 @@
         frame = "DISCONNECT\nclient-id:test\n\n" + Stomp.NULL;
         stompConnection.sendFrame(frame);
         try {
-        	Thread.sleep(200);
+        	Thread.sleep(400);
         } catch (InterruptedException e){}
         
         //reconnect



Mime
View raw message