Posted by sr...@apache.org.
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.
[incubator-plc4x] 01/03: removed debug log statements
Posted by sr...@apache.org.
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 52a88997ec16fd056471e734af86027f04f2136a
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Sat Feb 17 09:34:53 2018 +0100
removed debug log statements
---
.../ads/src/main/java/org/apache/plc4x/java/ads/netty/ADSProtocol.java | 2 --
1 file changed, 2 deletions(-)
diff --git a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/netty/ADSProtocol.java b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/netty/ADSProtocol.java
index 8993751..bafb5a0 100644
--- a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/netty/ADSProtocol.java
+++ b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/netty/ADSProtocol.java
@@ -145,9 +145,7 @@ public class ADSProtocol extends MessageToMessageCodec<ByteBuf, AMSTCPPacket> {
case ADS_Write_Control:
if (stateId.isRequest()) {
ADSState adsState = ADSState.of(commandBuffer);
- LOGGER.info("" + adsState);
DeviceState deviceState = DeviceState.of(commandBuffer);
- LOGGER.info("" + deviceState);
Length length = Length.of(commandBuffer);
if (length.getAsLong() > Integer.MAX_VALUE) {
throw new IllegalStateException("Overflow in datalength: " + length.getAsLong());
--
To stop receiving notification emails like this one, please contact
sruehl@apache.org.
[incubator-plc4x] 02/03: remove unnecessary flush
Posted by sr...@apache.org.
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 0740b303469cc22ae396970f96e4cb934710e371
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Sat Feb 17 09:39:34 2018 +0100
remove unnecessary flush
---
.../src/main/java/org/apache/plc4x/java/ads/api/commands/types/Data.java | 1 -
.../test/java/org/apache/plc4x/java/ads/netty/Plc4XADSProtocolTest.java | 1 -
2 files changed, 2 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 7b83308..d2e0a5d 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
@@ -50,7 +50,6 @@ public class Data extends ByteValue {
public String dump() {
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) {
HexDump.dump(value, 0, byteArrayOutputStream, 0);
- byteArrayOutputStream.flush();
return toString() + HexDump.EOL + byteArrayOutputStream.toString();
} catch (IOException e) {
throw new RuntimeException(e);
diff --git a/plc4j/protocols/ads/src/test/java/org/apache/plc4x/java/ads/netty/Plc4XADSProtocolTest.java b/plc4j/protocols/ads/src/test/java/org/apache/plc4x/java/ads/netty/Plc4XADSProtocolTest.java
index 0fa59f8..79ed81e 100644
--- a/plc4j/protocols/ads/src/test/java/org/apache/plc4x/java/ads/netty/Plc4XADSProtocolTest.java
+++ b/plc4j/protocols/ads/src/test/java/org/apache/plc4x/java/ads/netty/Plc4XADSProtocolTest.java
@@ -128,7 +128,6 @@ public class Plc4XADSProtocolTest {
try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) {
byte[] bytes = amstcpPacket.getByteBuf().array();
HexDump.dump(bytes, 0, byteArrayOutputStream, 0);
- byteArrayOutputStream.flush();
LOGGER.info("{}\nHexDump:\n{}", amstcpPacket, byteArrayOutputStream);
}
SUT.decode(null, amstcpPacket, out);
--
To stop receiving notification emails like this one, please contact
sruehl@apache.org.