mirror of https://github.com/apache/activemq.git
fix for https://issues.apache.org/activemq/browse/AMQ-2282 - ibm jdk test failures
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@782037 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7b78c36485
commit
fee7f6a710
|
@ -79,7 +79,7 @@ public class QueueConsumerPriorityTest extends TestCase {
|
||||||
Message msg = senderSession.createTextMessage("test");
|
Message msg = senderSession.createTextMessage("test");
|
||||||
for (int i =0; i< 10000;i++) {
|
for (int i =0; i< 10000;i++) {
|
||||||
producer.send(msg);
|
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));
|
Assert.assertNull( lowConsumer.receive(500));
|
||||||
|
|
||||||
|
|
|
@ -314,7 +314,12 @@ public class MBeanTest extends EmbeddedBrokerTestSupport {
|
||||||
assertComplexData(i, cdata, "JMSType", "MyType");
|
assertComplexData(i, cdata, "JMSType", "MyType");
|
||||||
assertComplexData(i, cdata, "JMSCorrelationID", "MyCorrId");
|
assertComplexData(i, cdata, "JMSCorrelationID", "MyCorrId");
|
||||||
assertComplexData(i, cdata, "JMSDeliveryMode", "NON-PERSISTENT");
|
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);
|
Map intProperties = CompositeDataHelper.getTabularMap(cdata, CompositeDataConstants.INT_PROPERTIES);
|
||||||
assertEquals("intProperties size()", 1, intProperties.size());
|
assertEquals("intProperties size()", 1, intProperties.size());
|
||||||
|
|
|
@ -140,7 +140,7 @@ public class SimpleNetworkTest extends TestCase {
|
||||||
doSetUp();
|
doSetUp();
|
||||||
remoteConsumer = remoteSession.createDurableSubscriber(included, consumerName);
|
remoteConsumer = remoteSession.createDurableSubscriber(included, consumerName);
|
||||||
for (int i = 0; i < MESSAGE_COUNT; i++) {
|
for (int i = 0; i < MESSAGE_COUNT; i++) {
|
||||||
assertNotNull("message count: " + i, remoteConsumer.receive(1000));
|
assertNotNull("message count: " + i, remoteConsumer.receive(2500));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,6 +89,25 @@ public class StompTest extends CombinationTestSupport {
|
||||||
+ "}}";
|
+ "}}";
|
||||||
|
|
||||||
protected void setUp() throws Exception {
|
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 = BrokerFactory.createBroker(new URI(confUri));
|
||||||
broker.start();
|
broker.start();
|
||||||
|
|
||||||
|
@ -170,7 +189,7 @@ public class StompTest extends CombinationTestSupport {
|
||||||
|
|
||||||
stompConnection.sendFrame(frame);
|
stompConnection.sendFrame(frame);
|
||||||
|
|
||||||
TextMessage message = (TextMessage)consumer.receive(1000);
|
TextMessage message = (TextMessage)consumer.receive(2500);
|
||||||
assertNotNull(message);
|
assertNotNull(message);
|
||||||
assertEquals("Hello World", message.getText());
|
assertEquals("Hello World", message.getText());
|
||||||
|
|
||||||
|
@ -195,7 +214,7 @@ public class StompTest extends CombinationTestSupport {
|
||||||
|
|
||||||
stompConnection.sendFrame(frame);
|
stompConnection.sendFrame(frame);
|
||||||
|
|
||||||
TextMessage message = (TextMessage)consumer.receive(1000);
|
TextMessage message = (TextMessage)consumer.receive(2500);
|
||||||
assertNotNull(message);
|
assertNotNull(message);
|
||||||
assertEquals("TEST", ((ActiveMQTextMessage)message).getGroupID());
|
assertEquals("TEST", ((ActiveMQTextMessage)message).getGroupID());
|
||||||
}
|
}
|
||||||
|
@ -214,7 +233,7 @@ public class StompTest extends CombinationTestSupport {
|
||||||
|
|
||||||
stompConnection.sendFrame(frame);
|
stompConnection.sendFrame(frame);
|
||||||
|
|
||||||
TextMessage message = (TextMessage)consumer.receive(1000);
|
TextMessage message = (TextMessage)consumer.receive(2500);
|
||||||
assertNotNull(message);
|
assertNotNull(message);
|
||||||
assertEquals("Hello World", message.getText());
|
assertEquals("Hello World", message.getText());
|
||||||
assertEquals("foo", "abc", message.getStringProperty("foo"));
|
assertEquals("foo", "abc", message.getStringProperty("foo"));
|
||||||
|
@ -236,7 +255,7 @@ public class StompTest extends CombinationTestSupport {
|
||||||
|
|
||||||
stompConnection.sendFrame(frame);
|
stompConnection.sendFrame(frame);
|
||||||
|
|
||||||
TextMessage message = (TextMessage)consumer.receive(1000);
|
TextMessage message = (TextMessage)consumer.receive(2500);
|
||||||
assertNotNull(message);
|
assertNotNull(message);
|
||||||
assertEquals("Hello World", message.getText());
|
assertEquals("Hello World", message.getText());
|
||||||
assertEquals("JMSCorrelationID", "c123", message.getJMSCorrelationID());
|
assertEquals("JMSCorrelationID", "c123", message.getJMSCorrelationID());
|
||||||
|
@ -411,7 +430,7 @@ public class StompTest extends CombinationTestSupport {
|
||||||
|
|
||||||
// message should be received since message was not acknowledged
|
// message should be received since message was not acknowledged
|
||||||
MessageConsumer consumer = session.createConsumer(queue);
|
MessageConsumer consumer = session.createConsumer(queue);
|
||||||
TextMessage message = (TextMessage)consumer.receive(1000);
|
TextMessage message = (TextMessage)consumer.receive(2500);
|
||||||
assertNotNull(message);
|
assertNotNull(message);
|
||||||
assertTrue(message.getJMSRedelivered());
|
assertTrue(message.getJMSRedelivered());
|
||||||
}
|
}
|
||||||
|
@ -472,7 +491,7 @@ public class StompTest extends CombinationTestSupport {
|
||||||
|
|
||||||
waitForFrameToTakeEffect();
|
waitForFrameToTakeEffect();
|
||||||
|
|
||||||
TextMessage message = (TextMessage)consumer.receive(1000);
|
TextMessage message = (TextMessage)consumer.receive(2500);
|
||||||
assertNotNull("Should have received a message", message);
|
assertNotNull("Should have received a message", message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -508,7 +527,7 @@ public class StompTest extends CombinationTestSupport {
|
||||||
waitForFrameToTakeEffect();
|
waitForFrameToTakeEffect();
|
||||||
|
|
||||||
// only second msg should be received since first msg was rolled back
|
// 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);
|
assertNotNull(message);
|
||||||
assertEquals("second message", message.getText().trim());
|
assertEquals("second message", message.getText().trim());
|
||||||
}
|
}
|
||||||
|
@ -599,7 +618,7 @@ public class StompTest extends CombinationTestSupport {
|
||||||
|
|
||||||
stompConnection.sendFrame(frame);
|
stompConnection.sendFrame(frame);
|
||||||
|
|
||||||
TextMessage message = (TextMessage)consumer.receive(1000);
|
TextMessage message = (TextMessage)consumer.receive(2500);
|
||||||
assertNotNull(message);
|
assertNotNull(message);
|
||||||
assertEquals("Hello World", message.getText());
|
assertEquals("Hello World", message.getText());
|
||||||
}
|
}
|
||||||
|
@ -617,7 +636,7 @@ public class StompTest extends CombinationTestSupport {
|
||||||
|
|
||||||
stompConnection.sendFrame(frame);
|
stompConnection.sendFrame(frame);
|
||||||
|
|
||||||
TextMessage message = (TextMessage)consumer.receive(1000);
|
TextMessage message = (TextMessage)consumer.receive(2500);
|
||||||
assertNotNull(message);
|
assertNotNull(message);
|
||||||
assertNotNull(message.getStringProperty(Stomp.Headers.TRANSFORMATION_ERROR));
|
assertNotNull(message.getStringProperty(Stomp.Headers.TRANSFORMATION_ERROR));
|
||||||
assertEquals("Hello World", message.getText());
|
assertEquals("Hello World", message.getText());
|
||||||
|
@ -636,7 +655,7 @@ public class StompTest extends CombinationTestSupport {
|
||||||
|
|
||||||
stompConnection.sendFrame(frame);
|
stompConnection.sendFrame(frame);
|
||||||
|
|
||||||
ObjectMessage message = (ObjectMessage)consumer.receive(1000);
|
ObjectMessage message = (ObjectMessage)consumer.receive(2500);
|
||||||
assertNotNull(message);
|
assertNotNull(message);
|
||||||
SamplePojo object = (SamplePojo)message.getObject();
|
SamplePojo object = (SamplePojo)message.getObject();
|
||||||
assertEquals("Dejan", object.getName());
|
assertEquals("Dejan", object.getName());
|
||||||
|
@ -655,7 +674,7 @@ public class StompTest extends CombinationTestSupport {
|
||||||
|
|
||||||
stompConnection.sendFrame(frame);
|
stompConnection.sendFrame(frame);
|
||||||
|
|
||||||
ObjectMessage message = (ObjectMessage)consumer.receive(1000);
|
ObjectMessage message = (ObjectMessage)consumer.receive(2500);
|
||||||
assertNotNull(message);
|
assertNotNull(message);
|
||||||
SamplePojo object = (SamplePojo)message.getObject();
|
SamplePojo object = (SamplePojo)message.getObject();
|
||||||
assertEquals("Dejan", object.getName());
|
assertEquals("Dejan", object.getName());
|
||||||
|
@ -788,7 +807,7 @@ public class StompTest extends CombinationTestSupport {
|
||||||
|
|
||||||
stompConnection.sendFrame(frame);
|
stompConnection.sendFrame(frame);
|
||||||
|
|
||||||
MapMessage message = (MapMessage) consumer.receive(1000);
|
MapMessage message = (MapMessage) consumer.receive(2500);
|
||||||
assertNotNull(message);
|
assertNotNull(message);
|
||||||
assertEquals(message.getString("name"), "Dejan");
|
assertEquals(message.getString("name"), "Dejan");
|
||||||
}
|
}
|
||||||
|
@ -806,7 +825,7 @@ public class StompTest extends CombinationTestSupport {
|
||||||
|
|
||||||
stompConnection.sendFrame(frame);
|
stompConnection.sendFrame(frame);
|
||||||
|
|
||||||
MapMessage message = (MapMessage) consumer.receive(1000);
|
MapMessage message = (MapMessage) consumer.receive(2500);
|
||||||
assertNotNull(message);
|
assertNotNull(message);
|
||||||
assertEquals(message.getString("name"), "Dejan");
|
assertEquals(message.getString("name"), "Dejan");
|
||||||
}
|
}
|
||||||
|
@ -883,7 +902,7 @@ public class StompTest extends CombinationTestSupport {
|
||||||
stompConnection.sendFrame(frame);
|
stompConnection.sendFrame(frame);
|
||||||
// wait a bit for MBean to get refreshed
|
// wait a bit for MBean to get refreshed
|
||||||
try {
|
try {
|
||||||
Thread.sleep(200);
|
Thread.sleep(400);
|
||||||
} catch (InterruptedException e){}
|
} catch (InterruptedException e){}
|
||||||
|
|
||||||
assertEquals(view.getDurableTopicSubscribers().length, 1);
|
assertEquals(view.getDurableTopicSubscribers().length, 1);
|
||||||
|
@ -891,7 +910,7 @@ public class StompTest extends CombinationTestSupport {
|
||||||
frame = "DISCONNECT\nclient-id:test\n\n" + Stomp.NULL;
|
frame = "DISCONNECT\nclient-id:test\n\n" + Stomp.NULL;
|
||||||
stompConnection.sendFrame(frame);
|
stompConnection.sendFrame(frame);
|
||||||
try {
|
try {
|
||||||
Thread.sleep(200);
|
Thread.sleep(400);
|
||||||
} catch (InterruptedException e){}
|
} catch (InterruptedException e){}
|
||||||
|
|
||||||
//reconnect
|
//reconnect
|
||||||
|
|
Loading…
Reference in New Issue