You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2015/09/03 17:22:00 UTC
qpid-jms git commit: QPIDJMS-106: have the validatePropertyNames
option also act for messages being created to send,
as originally intended (fix broken test)
Repository: qpid-jms
Updated Branches:
refs/heads/master 4d3aecebf -> 51525ca31
QPIDJMS-106: have the validatePropertyNames option also act for messages being created to send, as originally intended (fix broken test)
Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/51525ca3
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/51525ca3
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/51525ca3
Branch: refs/heads/master
Commit: 51525ca312e7400cddb27b7dd6309495b1074594
Parents: 4d3aece
Author: Robert Gemmell <ro...@apache.org>
Authored: Thu Sep 3 16:08:08 2015 +0100
Committer: Robert Gemmell <ro...@apache.org>
Committed: Thu Sep 3 16:08:08 2015 +0100
----------------------------------------------------------------------
.../src/main/java/org/apache/qpid/jms/JmsSession.java | 1 +
.../qpid/jms/integration/MessageIntegrationTest.java | 10 ++++++----
2 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/51525ca3/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsSession.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsSession.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsSession.java
index ca63436..7b17932 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsSession.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsSession.java
@@ -925,6 +925,7 @@ public class JmsSession implements Session, QueueSession, TopicSession, JmsMessa
private <T extends JmsMessage> T init(T message) {
message.setConnection(connection);
+ message.setValidatePropertyNames(connection.isValidatePropertyNames());
return message;
}
http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/51525ca3/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/MessageIntegrationTest.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/MessageIntegrationTest.java b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/MessageIntegrationTest.java
index b7d7127..bd991c1 100644
--- a/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/MessageIntegrationTest.java
+++ b/qpid-jms-client/src/test/java/org/apache/qpid/jms/integration/MessageIntegrationTest.java
@@ -287,10 +287,6 @@ public class MessageIntegrationTest extends QpidJmsTestCase
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
Queue queue = session.createQueue("myQueue");
- testPeer.expectSenderAttach();
-
- MessageProducer producer = session.createProducer(queue);
-
Message message = session.createMessage();
if (!disableValidation) {
@@ -301,6 +297,8 @@ public class MessageIntegrationTest extends QpidJmsTestCase
// expected
}
} else {
+ message.setStringProperty(invalidPropName, value);
+
MessageHeaderSectionMatcher headersMatcher = new MessageHeaderSectionMatcher(true);
MessageAnnotationsSectionMatcher msgAnnotationsMatcher = new MessageAnnotationsSectionMatcher(true);
MessagePropertiesSectionMatcher propsMatcher = new MessagePropertiesSectionMatcher(true);
@@ -312,6 +310,10 @@ public class MessageIntegrationTest extends QpidJmsTestCase
messageMatcher.setMessageAnnotationsMatcher(msgAnnotationsMatcher);
messageMatcher.setPropertiesMatcher(propsMatcher);
+ testPeer.expectSenderAttach();
+
+ MessageProducer producer = session.createProducer(queue);
+
testPeer.expectTransfer(messageMatcher);
producer.send(message);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org