You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2018/02/17 09:02:56 UTC

[incubator-plc4x] 03/03: fixed build as the toString() from Device.java would include non printable chars into
This is an automated email from the ASF dual-hosted git repository.

sruehl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git

commit 0a4ed9204e473277ffe9895a75613bc8170690e6
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Sat Feb 17 10:02:48 2018 +0100

    fixed build as the toString() from Device.java would include non printable
    chars into <testcase name= in surefire plugin. This could be a bug with
    surefire because it should escape non-printable chars here too (might be
    the problem of junit4-parameterized too).
---
 .../main/java/org/apache/plc4x/java/ads/api/commands/types/Data.java | 1 +
 .../java/org/apache/plc4x/java/ads/api/commands/types/Device.java    | 1 +
 .../test/java/org/apache/plc4x/java/ads/netty/ADSProtocolTest.java   | 5 +----
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/api/commands/types/Data.java b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/api/commands/types/Data.java
index d2e0a5d..6091cfc 100644
--- a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/api/commands/types/Data.java
+++ b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/api/commands/types/Data.java
@@ -58,6 +58,7 @@ public class Data extends ByteValue {
 
     @Override
     public String toString() {
+        // TODO: maybe we could find a way to implement this to string
         return "Data{" + value.length + "bytes} ";
     }
 }
diff --git a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/api/commands/types/Device.java b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/api/commands/types/Device.java
index 109df81..e4eeb91 100644
--- a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/api/commands/types/Device.java
+++ b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/api/commands/types/Device.java
@@ -57,6 +57,7 @@ public class Device extends ByteValue {
 
     @Override
     public String toString() {
+        // TODO: this might break some outputs like surefire if this id can contain non printable characters
         return "Device{" + new String(value) + "} " + super.toString();
     }
 }
diff --git a/plc4j/protocols/ads/src/test/java/org/apache/plc4x/java/ads/netty/ADSProtocolTest.java b/plc4j/protocols/ads/src/test/java/org/apache/plc4x/java/ads/netty/ADSProtocolTest.java
index 07f3512..e09bd81 100644
--- a/plc4j/protocols/ads/src/test/java/org/apache/plc4x/java/ads/netty/ADSProtocolTest.java
+++ b/plc4j/protocols/ads/src/test/java/org/apache/plc4x/java/ads/netty/ADSProtocolTest.java
@@ -99,10 +99,7 @@ public class ADSProtocolTest {
                 MajorVersion.of((byte) 1),
                 MinorVersion.of((byte) 2),
                 Version.of(3),
-                Device.of(
-                    (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8,
-                    (byte) 9, (byte) 10, (byte) 11, (byte) 12, (byte) 13, (byte) 14, (byte) 15, (byte) 16
-                )
+                Device.of("Random DeviceId")
             ),
             ADSReadRequest.of(
                 targetAmsNetId, targetAmsPort, sourceAmsNetId, sourceAmsPort, invokeId,

-- 
To stop receiving notification emails like this one, please contact
sruehl@apache.org.