From 0a15f873afbe11a9609ab8a1acfe5563db832723 Mon Sep 17 00:00:00 2001 From: mposolda Date: Thu, 17 Jul 2014 10:14:35 +0200 Subject: [PATCH] Minor improvement in AbstractKeycloakRule.stopServer() --- .../org/keycloak/testsuite/rule/AbstractKeycloakRule.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/rule/AbstractKeycloakRule.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/rule/AbstractKeycloakRule.java index 7a5db77c6a..149a6388c6 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/rule/AbstractKeycloakRule.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/rule/AbstractKeycloakRule.java @@ -163,8 +163,9 @@ public abstract class AbstractKeycloakRule extends ExternalResource { @Override public void run() { try { - new Socket(server.getConfig().getHost(), server.getConfig().getPort()); - throw new RuntimeException(); + Socket s = new Socket(server.getConfig().getHost(), server.getConfig().getPort()); + s.close(); + throw new IllegalStateException("Server still running"); } catch (IOException expected) { } }