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 2021/10/04 16:08:45 UTC

[qpid-proton-j] branch main updated (becb100 -> 6b7f211)

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

robbie pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-proton-j.git.


    from becb100  NO-JIRA: update GHA build to use Temurin, use JDK 17 instead of 16
     new a204b5d  PROTON-2437 fixed decoding of label for ARRAY8
     new 6b7f211  PROTON-2437: add some testing

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/qpid/proton/codec/EncodingCodes.java    |   4 +-
 .../qpid/proton/codec/EncodingCodesTest.java       | 103 +++++++++++++++++++++
 2 files changed, 105 insertions(+), 2 deletions(-)
 create mode 100644 proton-j/src/test/java/org/apache/qpid/proton/codec/EncodingCodesTest.java

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


[qpid-proton-j] 01/02: PROTON-2437 fixed decoding of label for ARRAY8

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

robbie pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-proton-j.git

commit a204b5db6ff8b78a9776e0b4edf2065a5861ac57
Author: Erwin Dondorp <er...@cgi.com>
AuthorDate: Sat Oct 2 10:15:04 2021 +0100

    PROTON-2437 fixed decoding of label for ARRAY8
---
 proton-j/src/main/java/org/apache/qpid/proton/codec/EncodingCodes.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/proton-j/src/main/java/org/apache/qpid/proton/codec/EncodingCodes.java b/proton-j/src/main/java/org/apache/qpid/proton/codec/EncodingCodes.java
index bd08ab9..c2b573f 100644
--- a/proton-j/src/main/java/org/apache/qpid/proton/codec/EncodingCodes.java
+++ b/proton-j/src/main/java/org/apache/qpid/proton/codec/EncodingCodes.java
@@ -166,7 +166,7 @@ public interface EncodingCodes
             case MAP32:
                 return "MAP32:0xd1";
             case ARRAY8:
-                return "ARRAY32:0xe0";
+                return "ARRAY8:0xe0";
             case ARRAY32:
                 return "ARRAY32:0xf0";
             default:

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


[qpid-proton-j] 02/02: PROTON-2437: add some testing

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

robbie pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-proton-j.git

commit 6b7f21121ec2496dfaacea889a8a1618ad43b6ff
Author: Robbie Gemmell <ro...@apache.org>
AuthorDate: Mon Oct 4 16:58:01 2021 +0100

    PROTON-2437: add some testing
---
 .../apache/qpid/proton/codec/EncodingCodes.java    |   2 +-
 .../qpid/proton/codec/EncodingCodesTest.java       | 103 +++++++++++++++++++++
 2 files changed, 104 insertions(+), 1 deletion(-)

diff --git a/proton-j/src/main/java/org/apache/qpid/proton/codec/EncodingCodes.java b/proton-j/src/main/java/org/apache/qpid/proton/codec/EncodingCodes.java
index c2b573f..362eedd 100644
--- a/proton-j/src/main/java/org/apache/qpid/proton/codec/EncodingCodes.java
+++ b/proton-j/src/main/java/org/apache/qpid/proton/codec/EncodingCodes.java
@@ -170,7 +170,7 @@ public interface EncodingCodes
             case ARRAY32:
                 return "ARRAY32:0xf0";
             default:
-                return "Unknown-Type:" + String.format("0x%02X ", encoding);
+                return "Unknown-Type:" + String.format("0x%02X", encoding);
         }
     }
 }
diff --git a/proton-j/src/test/java/org/apache/qpid/proton/codec/EncodingCodesTest.java b/proton-j/src/test/java/org/apache/qpid/proton/codec/EncodingCodesTest.java
new file mode 100644
index 0000000..36535a0
--- /dev/null
+++ b/proton-j/src/test/java/org/apache/qpid/proton/codec/EncodingCodesTest.java
@@ -0,0 +1,103 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.proton.codec;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+public class EncodingCodesTest {
+
+    @Test
+    public void testEncodingCodeLabels() {
+        doEncodingCodeLabelTestImpl((byte) 0x00, EncodingCodes.DESCRIBED_TYPE_INDICATOR, "DESCRIBED_TYPE_INDICATOR");
+
+        doEncodingCodeLabelTestImpl((byte) 0x40, EncodingCodes.NULL, "NULL");
+
+        doEncodingCodeLabelTestImpl((byte) 0x56, EncodingCodes.BOOLEAN, "BOOLEAN");
+        doEncodingCodeLabelTestImpl((byte) 0x41, EncodingCodes.BOOLEAN_TRUE, "BOOLEAN_TRUE");
+        doEncodingCodeLabelTestImpl((byte) 0x42, EncodingCodes.BOOLEAN_FALSE, "BOOLEAN_FALSE");
+
+        doEncodingCodeLabelTestImpl((byte) 0x50, EncodingCodes.UBYTE, "UBYTE");
+
+        doEncodingCodeLabelTestImpl((byte) 0x60, EncodingCodes.USHORT, "USHORT");
+
+        doEncodingCodeLabelTestImpl((byte) 0x70, EncodingCodes.UINT, "UINT");
+        doEncodingCodeLabelTestImpl((byte) 0x52, EncodingCodes.SMALLUINT, "SMALLUINT");
+        doEncodingCodeLabelTestImpl((byte) 0x43, EncodingCodes.UINT0, "UINT0");
+
+        doEncodingCodeLabelTestImpl((byte) 0x80, EncodingCodes.ULONG, "ULONG");
+        doEncodingCodeLabelTestImpl((byte) 0x53, EncodingCodes.SMALLULONG, "SMALLULONG");
+        doEncodingCodeLabelTestImpl((byte) 0x44, EncodingCodes.ULONG0, "ULONG0");
+
+        doEncodingCodeLabelTestImpl((byte) 0x51, EncodingCodes.BYTE, "BYTE");
+
+        doEncodingCodeLabelTestImpl((byte) 0x61, EncodingCodes.SHORT, "SHORT");
+
+        doEncodingCodeLabelTestImpl((byte) 0x71, EncodingCodes.INT, "INT");
+        doEncodingCodeLabelTestImpl((byte) 0x54, EncodingCodes.SMALLINT, "SMALLINT");
+
+        doEncodingCodeLabelTestImpl((byte) 0x81, EncodingCodes.LONG, "LONG");
+        doEncodingCodeLabelTestImpl((byte) 0x55, EncodingCodes.SMALLLONG, "SMALLLONG");
+
+        doEncodingCodeLabelTestImpl((byte) 0x72, EncodingCodes.FLOAT, "FLOAT");
+
+        doEncodingCodeLabelTestImpl((byte) 0x82, EncodingCodes.DOUBLE, "DOUBLE");
+
+        doEncodingCodeLabelTestImpl((byte) 0x74, EncodingCodes.DECIMAL32, "DECIMAL32");
+
+        doEncodingCodeLabelTestImpl((byte) 0x84, EncodingCodes.DECIMAL64, "DECIMAL64");
+
+        doEncodingCodeLabelTestImpl((byte) 0x94, EncodingCodes.DECIMAL128, "DECIMAL128");
+
+        doEncodingCodeLabelTestImpl((byte) 0x73, EncodingCodes.CHAR, "CHAR");
+
+        doEncodingCodeLabelTestImpl((byte) 0x83, EncodingCodes.TIMESTAMP, "TIMESTAMP");
+
+        doEncodingCodeLabelTestImpl((byte) 0x98, EncodingCodes.UUID, "UUID");
+
+        doEncodingCodeLabelTestImpl((byte) 0xa0, EncodingCodes.VBIN8, "VBIN8");
+        doEncodingCodeLabelTestImpl((byte) 0xb0, EncodingCodes.VBIN32, "VBIN32");
+
+        doEncodingCodeLabelTestImpl((byte) 0xa1, EncodingCodes.STR8, "STR8");
+        doEncodingCodeLabelTestImpl((byte) 0xb1, EncodingCodes.STR32, "STR32");
+
+        doEncodingCodeLabelTestImpl((byte) 0xa3, EncodingCodes.SYM8, "SYM8");
+        doEncodingCodeLabelTestImpl((byte) 0xb3, EncodingCodes.SYM32, "SYM32");
+
+        doEncodingCodeLabelTestImpl((byte) 0x45, EncodingCodes.LIST0, "LIST0");
+        doEncodingCodeLabelTestImpl((byte) 0xc0, EncodingCodes.LIST8, "LIST8");
+        doEncodingCodeLabelTestImpl((byte) 0xd0, EncodingCodes.LIST32, "LIST32");
+
+        doEncodingCodeLabelTestImpl((byte) 0xc1, EncodingCodes.MAP8, "MAP8");
+        doEncodingCodeLabelTestImpl((byte) 0xd1, EncodingCodes.MAP32, "MAP32");
+
+        doEncodingCodeLabelTestImpl((byte) 0xe0, EncodingCodes.ARRAY8, "ARRAY8");
+        doEncodingCodeLabelTestImpl((byte) 0xf0, EncodingCodes.ARRAY32, "ARRAY32");
+
+        assertEquals("Unknown-Type:0xEE", EncodingCodes.toString((byte) 0xEE));
+    }
+
+    public void doEncodingCodeLabelTestImpl(byte expectedCode, byte actualCode, String name) {
+        assertEquals("Unexpected constant value for " + name, expectedCode, actualCode);
+        assertEquals(name + ":0x" + String.format("%02x", expectedCode), EncodingCodes.toString(actualCode));
+    }
+}

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