This is an automated email from the ASF dual-hosted git repository. sruehl pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/plc4x.git
commit adfe11e4633db5f01ab4d016b61d68e10a952664 Author: Sebastian Rühl <[email protected]> AuthorDate: Mon Jul 13 08:57:48 2026 +0200 fix(plc4j): Updated DefaultPlcValueHandlerTest to match the new multi-value handling for non-array tags. Since a2dbb6bfc0 multiple values for a tag without array metadata are intentionally converted into a PlcList (drivers like OPC UA don't encode array size in the tag address) instead of throwing a PlcRuntimeException. The test still asserted the old behavior. --- .../apache/plc4x/java/spi/values/DefaultPlcValueHandlerTest.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plc4j/spi/values/src/test/java/org/apache/plc4x/java/spi/values/DefaultPlcValueHandlerTest.java b/plc4j/spi/values/src/test/java/org/apache/plc4x/java/spi/values/DefaultPlcValueHandlerTest.java index 9fa754d092..b806636f6c 100644 --- a/plc4j/spi/values/src/test/java/org/apache/plc4x/java/spi/values/DefaultPlcValueHandlerTest.java +++ b/plc4j/spi/values/src/test/java/org/apache/plc4x/java/spi/values/DefaultPlcValueHandlerTest.java @@ -118,8 +118,13 @@ class DefaultPlcValueHandlerTest { void testNewPlcValue_MultipleValuesForNonArray() { PlcTag tag = createMockTag(PlcValueType.INT, Collections.emptyList()); - assertThrows(PlcRuntimeException.class, () -> - handler.newPlcValue(tag, new Object[]{1, 2})); + // Some drivers (e.g. OPC UA) don't encode array information in the tag address, + // so multiple values for a tag without array metadata are treated as an array write. + PlcValue result = handler.newPlcValue(tag, new Object[]{(short) 1, (short) 2}); + + assertNotNull(result); + assertTrue(result instanceof PlcList); + assertEquals(2, result.getLength()); } @Test
