diff --git a/test-framework/junit/src/main/java/org/jboss/shamrock/junit/ShamrockTest.java b/test-framework/junit/src/main/java/org/jboss/shamrock/junit/ShamrockTest.java index bb29d49e3cf24..b4d350cc2cd12 100644 --- a/test-framework/junit/src/main/java/org/jboss/shamrock/junit/ShamrockTest.java +++ b/test-framework/junit/src/main/java/org/jboss/shamrock/junit/ShamrockTest.java @@ -71,7 +71,7 @@ public void testStarted(Description description) { runtimeRunner.run(); } catch (RuntimeException e) { failed = true; - throw e; + throw new RuntimeException("Failed to boot Shamrock during @ShamrockTest runner!", e); } } } diff --git a/undertow/runtime/src/main/java/org/jboss/shamrock/undertow/runtime/UndertowDeploymentTemplate.java b/undertow/runtime/src/main/java/org/jboss/shamrock/undertow/runtime/UndertowDeploymentTemplate.java index 14d6f787e0914..ad42757e607c0 100644 --- a/undertow/runtime/src/main/java/org/jboss/shamrock/undertow/runtime/UndertowDeploymentTemplate.java +++ b/undertow/runtime/src/main/java/org/jboss/shamrock/undertow/runtime/UndertowDeploymentTemplate.java @@ -126,18 +126,23 @@ public void addServletContextParameter(@ContextObject("deploymentInfo") Deployme public void startUndertow(StartupContext startupContext, @ContextObject("servletHandler") HttpHandler handler, String port) throws ServletException { if (undertow == null) { - log.log(Level.INFO, "Starting Undertow on port " + port); - undertow = Undertow.builder() - .addHttpListener(Integer.parseInt(port), "localhost") - .setHandler(new CanonicalPathHandler(ROOT_HANDLER)) - .build(); - undertow.start(); + try { + log.log(Level.INFO, "Starting Undertow on port " + port); + undertow = Undertow.builder() + .addHttpListener(Integer.parseInt(port), "localhost") + .setHandler(new CanonicalPathHandler(ROOT_HANDLER)) + .build(); + undertow.start(); + } + catch (Exception e) { + log.log(Level.SEVERE, "Failed to start Undertow", e); + } } currentRoot = handler; // startupContext.addCloseable(new Closeable() { // @Override // public void close() throws IOException { -// val.stop(); +// undertow.stop(); // } // }); }