This is an automated email from the ASF dual-hosted git repository.
cdutz pushed a commit to branch feature/alternate-PLC4X-108
in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git
The following commit(s) were added to refs/heads/feature/alternate-PLC4X-108 by
this push:
new cc7bc95 PLC4X-108 - Add ping() method to PlcConnection
cc7bc95 is described below
commit cc7bc95b90f01736fd818cd7362d0c3389a5dd8f
Author: Christofer Dutz <[email protected]>
AuthorDate: Thu Apr 4 08:49:09 2019 +0200
PLC4X-108 - Add ping() method to PlcConnection
- Fixed two broken driver implementations (Dummy and Mock Driver)
---
.../main/java/org/apache/plc4x/java/mock/PlcMockConnection.java | 7 +++++++
.../java/utils/connectionpool/PooledPlcDriverManagerTest.java | 7 +++++++
2 files changed, 14 insertions(+)
diff --git
a/plc4j/protocols/driver-bases/test/src/main/java/org/apache/plc4x/java/mock/PlcMockConnection.java
b/plc4j/protocols/driver-bases/test/src/main/java/org/apache/plc4x/java/mock/PlcMockConnection.java
index 9dc802f..3ef1cab 100644
---
a/plc4j/protocols/driver-bases/test/src/main/java/org/apache/plc4x/java/mock/PlcMockConnection.java
+++
b/plc4j/protocols/driver-bases/test/src/main/java/org/apache/plc4x/java/mock/PlcMockConnection.java
@@ -66,6 +66,13 @@ public class PlcMockConnection implements PlcConnection,
PlcReader, PlcWriter, P
}
@Override
+ public CompletableFuture<Void> ping() {
+ CompletableFuture<Void> future = new CompletableFuture<>();
+ future.completeExceptionally(new UnsupportedOperationException());
+ return future;
+ }
+
+ @Override
public boolean isConnected() {
return device != null;
}
diff --git
a/plc4j/utils/connection-pool/src/test/java/org/apache/plc4x/java/utils/connectionpool/PooledPlcDriverManagerTest.java
b/plc4j/utils/connection-pool/src/test/java/org/apache/plc4x/java/utils/connectionpool/PooledPlcDriverManagerTest.java
index 2c015a5..5103012 100644
---
a/plc4j/utils/connection-pool/src/test/java/org/apache/plc4x/java/utils/connectionpool/PooledPlcDriverManagerTest.java
+++
b/plc4j/utils/connection-pool/src/test/java/org/apache/plc4x/java/utils/connectionpool/PooledPlcDriverManagerTest.java
@@ -299,6 +299,13 @@ class PooledPlcDriverManagerTest implements WithAssertions
{
}
@Override
+ public CompletableFuture<Void> ping() {
+ CompletableFuture<Void> future = new CompletableFuture<>();
+ future.completeExceptionally(new UnsupportedOperationException());
+ return future;
+ }
+
+ @Override
public boolean isConnected() {
return connected;
}