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/07 20:14:52 UTC

[incubator-plc4x] branch feature/Beckhoff_ADS_protocol updated: fixed test by letting the TcpHexDumper perform a gentle shutdown

This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/feature/Beckhoff_ADS_protocol by this push:
     new e01a7b5  fixed test by letting the TcpHexDumper perform a gentle shutdown
e01a7b5 is described below

commit e01a7b5197071720e29a2cdeae60d0fe554d8df8
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Wed Feb 7 21:14:47 2018 +0100

    fixed test by letting the TcpHexDumper perform a gentle shutdown
---
 .../test/java/org/apache/plc4x/java/ads/util/TcpHexDumper.java   | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/plc4j/protocols/ads/src/test/java/org/apache/plc4x/java/ads/util/TcpHexDumper.java b/plc4j/protocols/ads/src/test/java/org/apache/plc4x/java/ads/util/TcpHexDumper.java
index 72d1d7a..c0b0449 100644
--- a/plc4j/protocols/ads/src/test/java/org/apache/plc4x/java/ads/util/TcpHexDumper.java
+++ b/plc4j/protocols/ads/src/test/java/org/apache/plc4x/java/ads/util/TcpHexDumper.java
@@ -48,7 +48,7 @@ public class TcpHexDumper implements BeforeEachCallback, AfterEachCallback, Para
 
     public void init(int port) throws IOException, InterruptedException {
         if (serverSocket != null) {
-            stop();
+            stop(true);
         }
         serverSocket = new ServerSocket(port);
         logger.info("Starting pool");
@@ -90,16 +90,17 @@ public class TcpHexDumper implements BeforeEachCallback, AfterEachCallback, Para
 
     public void stop(boolean await) throws IOException, InterruptedException {
         serverSocket.close();
-        if (await)
+        if (await) {
             pool.awaitTermination(shutdownTimeout, TimeUnit.SECONDS);
-        else
+        } else {
             pool.shutdownNow();
+        }
         logger.info("Stopped");
     }
 
     @Override
     public void afterEach(ExtensionContext context) throws Exception {
-        stop();
+        stop(true);
     }
 
     @Override

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