You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2022/09/29 09:26:14 UTC
[plc4x] branch develop updated: refactor(plc4j/ads): Continued testing the new ADS drivers Write abilities.
This is an automated email from the ASF dual-hosted git repository.
cdutz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git
The following commit(s) were added to refs/heads/develop by this push:
new f03243a62 refactor(plc4j/ads): Continued testing the new ADS drivers Write abilities.
f03243a62 is described below
commit f03243a6231735c6a4c6a9da06139b1c81bbd0b9
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Thu Sep 29 11:26:05 2022 +0200
refactor(plc4j/ads): Continued testing the new ADS drivers Write abilities.
---
.../org/apache/plc4x/java/ads/protocol/AdsProtocolLogic.java | 2 +-
.../org/apache/plc4x/protocol/ads/ManualAdsDriverTest.java | 10 ++++++----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/plc4j/drivers/ads/src/main/java/org/apache/plc4x/java/ads/protocol/AdsProtocolLogic.java b/plc4j/drivers/ads/src/main/java/org/apache/plc4x/java/ads/protocol/AdsProtocolLogic.java
index 28bf8ac3e..61324cba8 100644
--- a/plc4j/drivers/ads/src/main/java/org/apache/plc4x/java/ads/protocol/AdsProtocolLogic.java
+++ b/plc4j/drivers/ads/src/main/java/org/apache/plc4x/java/ads/protocol/AdsProtocolLogic.java
@@ -946,7 +946,7 @@ public class AdsProtocolLogic extends Plc4xProtocolBase<AmsTCPPacket> implements
transaction.endRequest();
}));
} catch (Exception e) {
- future.completeExceptionally(new PlcException("Error"));
+ future.completeExceptionally(new PlcException("Error", e));
}
return future;
}
diff --git a/plc4j/drivers/ads/src/test/java/org/apache/plc4x/protocol/ads/ManualAdsDriverTest.java b/plc4j/drivers/ads/src/test/java/org/apache/plc4x/protocol/ads/ManualAdsDriverTest.java
index 792afed65..55ca4651f 100644
--- a/plc4j/drivers/ads/src/test/java/org/apache/plc4x/protocol/ads/ManualAdsDriverTest.java
+++ b/plc4j/drivers/ads/src/test/java/org/apache/plc4x/protocol/ads/ManualAdsDriverTest.java
@@ -108,10 +108,10 @@ public class ManualAdsDriverTest extends ManualTest {
//test.addTestCase("MAIN.hurz_DT", new PlcDT("1972-03-29T00:00"));
Map<String, PlcValue> children = new HashMap<>();
children.put("hurz_BOOL", new PlcBOOL(true));
- children.put("hurz_BYTE", new PlcBYTE(42));
- children.put("hurz_WORD", new PlcWORD(42424));
- children.put("hurz_DWORD", new PlcDWORD(4242442424L));
- children.put("hurz_LDWORD", new PlcLWORD(4242442424242424242L));
+ children.put("hurz_BYTE", new PlcBYTE(1));
+ children.put("hurz_WORD", new PlcWORD(2));
+ children.put("hurz_DWORD", new PlcDWORD(3));
+ children.put("hurz_LWORD", new PlcLWORD(4));
children.put("hurz_SINT", new PlcSINT(5));
children.put("hurz_USINT", new PlcUSINT(6));
children.put("hurz_INT", new PlcINT(7));
@@ -128,7 +128,9 @@ public class ManualAdsDriverTest extends ManualTest {
children.put("hurz_LTIME", new PlcLTIME(Duration.parse("PT24015H23M12.034002044S")));
children.put("hurz_DATE", new PlcDATE(LocalDate.parse("1978-03-28")));
children.put("hurz_TIME_OF_DAY", new PlcTIME_OF_DAY(LocalTime.parse("15:36:30.123")));
+ children.put("hurz_TOD", new PlcTIME_OF_DAY(LocalTime.parse("15:36:30.123")));
children.put("hurz_DATE_AND_TIME", new PlcDATE_AND_TIME(LocalDateTime.parse("1996-05-06T15:36:30")));
+ children.put("hurz_DT", new PlcDATE_AND_TIME(LocalDateTime.parse("1996-05-06T15:36:30")));
test.addTestCase("MAIN.hurz_Struct", new PlcStruct(children));
test.run();
}