QPIDJMS-207 Fix MessageProducer getDeliveryDelay, add 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/4550dac6
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/4550dac6
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/4550dac6

Branch: refs/heads/master
Commit: 4550dac6c87b8d721d1c5a22e92848a4af30e4d4
Parents: fd2bc18
Author: Timothy Bish <tabish...@gmail.com>
Authored: Tue Sep 20 14:23:53 2016 -0400
Committer: Timothy Bish <tabish...@gmail.com>
Committed: Tue Sep 20 14:23:53 2016 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/qpid/jms/JmsMessageProducer.java    | 2 +-
 .../org/apache/qpid/jms/producer/JmsMessageProducerTest.java | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/4550dac6/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsMessageProducer.java
----------------------------------------------------------------------
diff --git 
a/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsMessageProducer.java 
b/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsMessageProducer.java
index 6e9c96d..64cdf8b 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsMessageProducer.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsMessageProducer.java
@@ -114,7 +114,7 @@ public class JmsMessageProducer implements AutoCloseable, 
MessageProducer {
     @Override
     public long getDeliveryDelay() throws JMSException {
         checkClosed();
-        return deliveryMode;
+        return deliveryDelay;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/4550dac6/qpid-jms-client/src/test/java/org/apache/qpid/jms/producer/JmsMessageProducerTest.java
----------------------------------------------------------------------
diff --git 
a/qpid-jms-client/src/test/java/org/apache/qpid/jms/producer/JmsMessageProducerTest.java
 
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/producer/JmsMessageProducerTest.java
index a2629a9..319ce3f 100644
--- 
a/qpid-jms-client/src/test/java/org/apache/qpid/jms/producer/JmsMessageProducerTest.java
+++ 
b/qpid-jms-client/src/test/java/org/apache/qpid/jms/producer/JmsMessageProducerTest.java
@@ -133,6 +133,14 @@ public class JmsMessageProducerTest extends 
JmsConnectionTestSupport {
     }
 
     @Test(timeout = 10000)
+    public void testDeliveryDelayConfiguration() throws Exception {
+        MessageProducer producer = session.createProducer(null);
+        assertEquals(Message.DEFAULT_DELIVERY_DELAY, 
producer.getDeliveryDelay());
+        producer.setDeliveryDelay(2000);
+        assertEquals(2000, producer.getDeliveryDelay());
+    }
+
+    @Test(timeout = 10000)
     public void 
testAnonymousProducerThrowsUOEWhenExplictDestinationNotProvided() throws 
Exception {
         JmsMessageProducer producer = (JmsMessageProducer) 
session.createProducer(null);
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org

Reply via email to