This is an automated email from the ASF dual-hosted git repository.

kpvdr pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-interop-test.git

commit 302c3b495f38ba686bf73349537767890bd6dff0
Author: Kim van der Riet <kvand...@redhat.com>
AuthorDate: Tue Apr 27 15:34:50 2021 -0400

    A change to RHEA's processing of timestamps from ulongs to Date objects 
requires a fix to the javascript receive shim.
---
 shims/rhea-js/amqp_types_test/Receiver.js | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/shims/rhea-js/amqp_types_test/Receiver.js 
b/shims/rhea-js/amqp_types_test/Receiver.js
index b445f73..390a255 100755
--- a/shims/rhea-js/amqp_types_test/Receiver.js
+++ b/shims/rhea-js/amqp_types_test/Receiver.js
@@ -59,8 +59,8 @@ function Receiver(brokerAddr, brokerPort, queueName, 
amqpType, numTestValues) {
         case "ulong":
         case "decimal32":
         case "decimal64":
-        case "decimal128":
-        case "timestamp": 
this.receivedValueList.push(this.decodeUnsigned(msgBody)); break;
+        case "decimal128": 
this.receivedValueList.push(this.decodeUnsigned(msgBody)); break;
+        case "timestamp": 
this.receivedValueList.push(this.decodeTimestamp(msgBody)); break;
         case "byte":
         case "short":
         case "int":
@@ -91,6 +91,10 @@ function Receiver(brokerAddr, brokerPort, queueName, 
amqpType, numTestValues) {
         return "0x" +   msgBody.toString(Buffer.isBuffer(msgBody) ? 'hex' : 
16);
     };
 
+    this.decodeTimestamp = function(msgBody) {
+        return "0x" + msgBody.getTime().toString('hex')
+    }
+
     this.decodeSigned = function(msgBody) {
         if (Buffer.isBuffer(msgBody)) {
             if (msgBody[0] & 0x80) { // sign bit set
@@ -175,7 +179,7 @@ function Receiver(brokerAddr, brokerPort, queueName, 
amqpType, numTestValues) {
             }
         }
     });
-    
+
     this.container.on('disconnected', function(context){
        console.error('Unable to connet to broker')
     });

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

Reply via email to