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 aafd56f19c464897432a37dcebe78ad04c5d5e07 Author: QIT Development Team <[email protected]> AuthorDate: Fri Jul 17 14:53:11 2026 -0400 Fix shim bugs: JavaScript null handling and Java char encoding JavaScript Rhea (shim.js): - Fix TypeError when testValue is null - Add null check before accessing testValue.value property - Fixes 6 test failures for null type Java ProtonJ2 (TypeCodec.java): - Fix char decoding to handle null character (\x00) - Handle three cases: empty string, single char, numeric code point - Fixes 4 test failures for char type Expected improvement: 361/450 → 371/450 (82.4% pass rate) --- .../src/main/java/org/apache/qpid/qit/TypeCodec.java | 13 ++++++++++++- shims/javascript-rhea/shim.js | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/shims/java-protonj2/src/main/java/org/apache/qpid/qit/TypeCodec.java b/shims/java-protonj2/src/main/java/org/apache/qpid/qit/TypeCodec.java index 6865cab..35d4010 100644 --- a/shims/java-protonj2/src/main/java/org/apache/qpid/qit/TypeCodec.java +++ b/shims/java-protonj2/src/main/java/org/apache/qpid/qit/TypeCodec.java @@ -82,7 +82,18 @@ public class TypeCodec { return parseDouble(value); case "char": - int codePoint = Integer.parseInt(value.toString()); + String strValue = value.toString(); + int codePoint; + if (strValue.isEmpty() || strValue.equals("\\x00")) { + // Handle null character + codePoint = 0; + } else if (strValue.length() == 1) { + // Handle single character (convert char to code point) + codePoint = strValue.charAt(0); + } else { + // Handle numeric code point + codePoint = Integer.parseInt(strValue); + } return codePoint; case "timestamp": diff --git a/shims/javascript-rhea/shim.js b/shims/javascript-rhea/shim.js index 5d04902..c9e6de3 100755 --- a/shims/javascript-rhea/shim.js +++ b/shims/javascript-rhea/shim.js @@ -35,7 +35,7 @@ function parseArgs() { // Type encoders - convert JSON test values to AMQP types class TypeEncoder { static encode(amqpType, testValue) { - const value = typeof testValue === 'object' && testValue.value !== undefined + const value = typeof testValue === 'object' && testValue !== null && testValue.value !== undefined ? testValue.value : testValue; --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
