diff --git a/core/deployment/src/main/java/io/quarkus/deployment/console/ConsoleStateManager.java b/core/deployment/src/main/java/io/quarkus/deployment/console/ConsoleStateManager.java index 4be52a8848ed94..daf17c252795a8 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/console/ConsoleStateManager.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/console/ConsoleStateManager.java @@ -106,8 +106,14 @@ void installBuiltins(DevModeType devModeType) { } })); commands.add(new ConsoleCommand('l', "Toggle live reload", - new ConsoleCommand.HelpState(() -> RuntimeUpdatesProcessor.INSTANCE.isLiveReloadEnabled()), - () -> RuntimeUpdatesProcessor.INSTANCE.toggleLiveReloadEnabled())); + new ConsoleCommand.HelpState(() -> RuntimeUpdatesProcessor.INSTANCE.isLiveReloadEnabled()), () -> { + // TODO: same hack as above + if (TestSupport.instance().isPresent()) { + TestSupport.instance().get().toggleLiveReloadEnabled(); + } else { + RuntimeUpdatesProcessor.INSTANCE.toggleLiveReloadEnabled(); + } + })); } ConsoleContext context = createContext("System"); diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/RuntimeUpdatesProcessor.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/RuntimeUpdatesProcessor.java index 862e9808c6858c..6455ce1daaf6fe 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/dev/RuntimeUpdatesProcessor.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/dev/RuntimeUpdatesProcessor.java @@ -479,8 +479,13 @@ public boolean doScan(boolean userInitiated, boolean forceRestart) { || (IsolatedDevModeMain.deploymentProblem != null && userInitiated) || configFileRestartNeeded); if (restartNeeded) { String changeString = changedFilesForRestart.stream().map(Path::getFileName).map(Object::toString) - .collect(Collectors.joining(", ")) + "."; - log.infof("Restarting quarkus due to changes in " + changeString); + .collect(Collectors.joining(", ")); + if (!changeString.isEmpty()) { + log.infof("Restarting quarkus due to changes in %s.", changeString); + } else if (forceRestart && userInitiated) { + log.info("Restarting as requested by the user."); + } + restartCallback.accept(filesChanged, changedClassResults); long timeNanoSeconds = System.nanoTime() - startNanoseconds; log.infof("Live reload total time: %ss ", Timing.convertToBigDecimalSeconds(timeNanoSeconds)); diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/testing/TestController.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/testing/TestController.java index 623acc95d2d1c1..df94d325369b75 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/dev/testing/TestController.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/dev/testing/TestController.java @@ -45,6 +45,13 @@ public interface TestController { */ boolean toggleInstrumentation(); + /** + * Toggles instrumentation based reload. + * + * @return true if this change to do instrumentation based reload + */ + boolean toggleLiveReloadEnabled(); + /** * Print the current results and failures */ diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/testing/TestListener.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/testing/TestListener.java index f8f8540654a3f3..b91a0ae3bc7815 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/dev/testing/TestListener.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/dev/testing/TestListener.java @@ -31,6 +31,10 @@ default void setInstrumentationBasedReload(boolean ibr) { } + default void setLiveReloadEnabled(boolean lre) { + + } + default void testCompileFailed(String message) { } diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/testing/TestSupport.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/testing/TestSupport.java index 8f26c6291c5209..59cd0ffd5d6179 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/dev/testing/TestSupport.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/dev/testing/TestSupport.java @@ -308,6 +308,18 @@ public boolean toggleInstrumentation() { return ibr; } + @Override + public boolean toggleLiveReloadEnabled() { + + boolean lr = RuntimeUpdatesProcessor.INSTANCE.toggleLiveReloadEnabled(); + + for (TestListener i : testListeners) { + i.setLiveReloadEnabled(lr); + } + + return lr; + } + @Override public void printFullResults() { if (currentState().getFailingClasses().isEmpty()) { diff --git a/core/devmode-spi/src/main/java/io/quarkus/dev/testing/ContinuousTestingWebsocketListener.java b/core/devmode-spi/src/main/java/io/quarkus/dev/testing/ContinuousTestingWebsocketListener.java index 288743df732a61..29cd9c4a315ca7 100644 --- a/core/devmode-spi/src/main/java/io/quarkus/dev/testing/ContinuousTestingWebsocketListener.java +++ b/core/devmode-spi/src/main/java/io/quarkus/dev/testing/ContinuousTestingWebsocketListener.java @@ -6,7 +6,7 @@ public class ContinuousTestingWebsocketListener { private static Consumer stateListener; - private static volatile State lastState = new State(false, false, 0, 0, 0, 0, false, false, false); + private static volatile State lastState = new State(false, false, 0, 0, 0, 0, false, false, false, true); public static Consumer getStateListener() { return stateListener; @@ -35,7 +35,7 @@ public static void setInProgress(boolean inProgress) { State state = lastState; if (state != null) { setLastState(new State(state.running, inProgress, state.run, state.passed, state.failed, state.skipped, - state.isBrokenOnly, state.isTestOutput, state.isInstrumentationBasedReload)); + state.isBrokenOnly, state.isTestOutput, state.isInstrumentationBasedReload, state.isLiveReload)); } } @@ -43,7 +43,7 @@ public static void setRunning(boolean running) { State state = lastState; if (state != null) { setLastState(new State(running, running && state.inProgress, state.run, state.passed, state.failed, state.skipped, - state.isBrokenOnly, state.isTestOutput, state.isInstrumentationBasedReload)); + state.isBrokenOnly, state.isTestOutput, state.isInstrumentationBasedReload, state.isLiveReload)); } } @@ -51,7 +51,7 @@ public static void setBrokenOnly(boolean brokenOnly) { State state = lastState; if (state != null) { setLastState(new State(state.running, state.inProgress, state.run, state.passed, state.failed, state.skipped, - brokenOnly, state.isTestOutput, state.isInstrumentationBasedReload)); + brokenOnly, state.isTestOutput, state.isInstrumentationBasedReload, state.isLiveReload)); } } @@ -59,7 +59,7 @@ public static void setTestOutput(boolean testOutput) { State state = lastState; if (state != null) { setLastState(new State(state.running, state.inProgress, state.run, state.passed, state.failed, state.skipped, - state.isBrokenOnly, testOutput, state.isInstrumentationBasedReload)); + state.isBrokenOnly, testOutput, state.isInstrumentationBasedReload, state.isLiveReload)); } } @@ -67,7 +67,15 @@ public static void setInstrumentationBasedReload(boolean instrumentationBasedRel State state = lastState; if (state != null) { setLastState(new State(state.running, state.inProgress, state.run, state.passed, state.failed, state.skipped, - state.isBrokenOnly, state.isTestOutput, instrumentationBasedReload)); + state.isBrokenOnly, state.isTestOutput, instrumentationBasedReload, state.isLiveReload)); + } + } + + public static void setLiveReloadEnabled(boolean liveReload) { + State state = lastState; + if (state != null) { + setLastState(new State(state.running, state.inProgress, state.run, state.passed, state.failed, state.skipped, + state.isBrokenOnly, state.isTestOutput, state.isInstrumentationBasedReload, liveReload)); } } @@ -81,9 +89,10 @@ public static class State { public final boolean isBrokenOnly; public final boolean isTestOutput; public final boolean isInstrumentationBasedReload; + public final boolean isLiveReload; public State(boolean running, boolean inProgress, long run, long passed, long failed, long skipped, - boolean isBrokenOnly, boolean isTestOutput, boolean isInstrumentationBasedReload) { + boolean isBrokenOnly, boolean isTestOutput, boolean isInstrumentationBasedReload, boolean isLiveReload) { this.running = running; this.inProgress = inProgress; this.run = run; @@ -93,6 +102,7 @@ public State(boolean running, boolean inProgress, long run, long passed, long fa this.isBrokenOnly = isBrokenOnly; this.isTestOutput = isTestOutput; this.isInstrumentationBasedReload = isInstrumentationBasedReload; + this.isLiveReload = isLiveReload; } } } diff --git a/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/console/ContinuousTestingWebSocketListener.java b/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/console/ContinuousTestingWebSocketListener.java index 86a5b7d8f05afc..703dfe9514f448 100644 --- a/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/console/ContinuousTestingWebSocketListener.java +++ b/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/console/ContinuousTestingWebSocketListener.java @@ -22,7 +22,7 @@ public void listenerRegistered(TestController testController) { public void testsEnabled() { ContinuousTestingWebsocketListener .setLastState( - new ContinuousTestingWebsocketListener.State(true, true, 0L, 0L, 0L, 0L, false, false, false)); + new ContinuousTestingWebsocketListener.State(true, true, 0L, 0L, 0L, 0L, false, false, false, true)); } @Override @@ -55,7 +55,8 @@ public void runComplete(TestRunResults testRunResults) { testRunResults.getFailedCount(), testRunResults.getSkippedCount(), ContinuousTestingWebsocketListener.getLastState().isBrokenOnly, ContinuousTestingWebsocketListener.getLastState().isTestOutput, - ContinuousTestingWebsocketListener.getLastState().isInstrumentationBasedReload)); + ContinuousTestingWebsocketListener.getLastState().isInstrumentationBasedReload, + ContinuousTestingWebsocketListener.getLastState().isLiveReload)); } @Override @@ -86,4 +87,9 @@ public void setInstrumentationBasedReload(boolean ibr) { ContinuousTestingWebsocketListener.setInstrumentationBasedReload(ibr); } + @Override + public void setLiveReloadEnabled(boolean lre) { + ContinuousTestingWebsocketListener.setLiveReloadEnabled(lre); + } + } diff --git a/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/tests/TestsProcessor.java b/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/tests/TestsProcessor.java index 68b8eb17d414c4..3f96c3cb51dba3 100644 --- a/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/tests/TestsProcessor.java +++ b/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/tests/TestsProcessor.java @@ -12,6 +12,7 @@ import io.quarkus.deployment.annotations.ExecutionTime; import io.quarkus.deployment.annotations.Record; import io.quarkus.deployment.builditem.LaunchModeBuildItem; +import io.quarkus.deployment.dev.RuntimeUpdatesProcessor; import io.quarkus.deployment.dev.testing.TestClassResult; import io.quarkus.deployment.dev.testing.TestListenerBuildItem; import io.quarkus.deployment.dev.testing.TestRunResults; @@ -73,7 +74,7 @@ DevConsoleRouteBuildItem handleTestStatus(LaunchModeBuildItem launchModeBuildIte //DISABLED, RUNNING (run id), RUN (run id, start time, nextRunQueued) //GET tests/results - return new DevConsoleRouteBuildItem("tests/status", "GET", new Handler() { + return new DevConsoleRouteBuildItem("tests/status", "GET", new Handler<>() { @Override public void handle(RoutingContext event) { jsonResponse(event); @@ -106,7 +107,7 @@ void toggleTestRunner(LaunchModeBuildItem launchModeBuildItem, BuildProducer() { + routeProducer.produce(new DevConsoleRouteBuildItem("tests/toggle", "POST", new Handler<>() { @Override public void handle(RoutingContext event) { if (ts.get().isStarted()) { @@ -120,7 +121,7 @@ public void handle(RoutingContext event) { event.response().putHeader("Content-Type", "application/json; charset=utf-8").end(object.build()); } })); - routeProducer.produce(new DevConsoleRouteBuildItem("tests/toggle-broken-only", "POST", new Handler() { + routeProducer.produce(new DevConsoleRouteBuildItem("tests/toggle-broken-only", "POST", new Handler<>() { @Override public void handle(RoutingContext event) { boolean brokenOnlyMode = ts.get().toggleBrokenOnlyMode(); @@ -132,7 +133,7 @@ public void handle(RoutingContext event) { } private boolean testsDisabled(LaunchModeBuildItem launchModeBuildItem, Optional ts) { - return !ts.isPresent() || launchModeBuildItem.getDevModeType().orElse(null) != DevModeType.LOCAL; + return ts.isEmpty() || launchModeBuildItem.getDevModeType().orElse(null) != DevModeType.LOCAL; } @BuildStep(onlyIf = IsDevelopment.class) @@ -141,7 +142,7 @@ DevConsoleRouteBuildItem runAllTests(LaunchModeBuildItem launchModeBuildItem) { if (testsDisabled(launchModeBuildItem, ts)) { return null; } - return new DevConsoleRouteBuildItem("tests/runall", "POST", new Handler() { + return new DevConsoleRouteBuildItem("tests/runall", "POST", new Handler<>() { @Override public void handle(RoutingContext event) { ts.get().runAllTests(); @@ -150,12 +151,12 @@ public void handle(RoutingContext event) { } @BuildStep(onlyIf = IsDevelopment.class) - DevConsoleRouteBuildItem runFailedTests(LaunchModeBuildItem launchModeBuildItem) { + DevConsoleRouteBuildItem toggleTestOutput(LaunchModeBuildItem launchModeBuildItem) { Optional ts = TestSupport.instance(); if (testsDisabled(launchModeBuildItem, ts)) { return null; } - return new DevConsoleRouteBuildItem("tests/toggle-test-output", "POST", new Handler() { + return new DevConsoleRouteBuildItem("tests/toggle-test-output", "POST", new Handler<>() { @Override public void handle(RoutingContext event) { @@ -168,12 +169,12 @@ public void handle(RoutingContext event) { } @BuildStep(onlyIf = IsDevelopment.class) - DevConsoleRouteBuildItem toggleTestOutput(LaunchModeBuildItem launchModeBuildItem) { + DevConsoleRouteBuildItem runFailedTests(LaunchModeBuildItem launchModeBuildItem) { Optional ts = TestSupport.instance(); if (testsDisabled(launchModeBuildItem, ts)) { return null; } - return new DevConsoleRouteBuildItem("tests/runfailed", "POST", new Handler() { + return new DevConsoleRouteBuildItem("tests/runfailed", "POST", new Handler<>() { @Override public void handle(RoutingContext event) { ts.get().runFailedTests(); @@ -187,7 +188,7 @@ DevConsoleRouteBuildItem printfailures(LaunchModeBuildItem launchModeBuildItem) if (testsDisabled(launchModeBuildItem, ts)) { return null; } - return new DevConsoleRouteBuildItem("tests/printfailures", "POST", new Handler() { + return new DevConsoleRouteBuildItem("tests/printfailures", "POST", new Handler<>() { @Override public void handle(RoutingContext event) { ts.get().printFullResults(); @@ -201,7 +202,7 @@ DevConsoleRouteBuildItem toggleInstrumentation(LaunchModeBuildItem launchModeBui if (testsDisabled(launchModeBuildItem, ts)) { return null; } - return new DevConsoleRouteBuildItem("tests/toggle-instrumentation", "POST", new Handler() { + return new DevConsoleRouteBuildItem("tests/toggle-instrumentation", "POST", new Handler<>() { @Override public void handle(RoutingContext event) { boolean instrumentationEnabled = ts.get().toggleInstrumentation(); @@ -212,6 +213,36 @@ public void handle(RoutingContext event) { }); } + @BuildStep(onlyIf = IsDevelopment.class) + DevConsoleRouteBuildItem toggleLiveReloadEnabled(LaunchModeBuildItem launchModeBuildItem) { + Optional ts = TestSupport.instance(); + if (testsDisabled(launchModeBuildItem, ts)) { + return null; + } + return new DevConsoleRouteBuildItem("tests/toggle-live-reload", "POST", new Handler<>() { + @Override + public void handle(RoutingContext event) { + boolean liveReloadEnabled = ts.get().toggleLiveReloadEnabled(); + Json.JsonObjectBuilder object = Json.object(); + object.put("liveReloadEnabled", liveReloadEnabled); + event.response().putHeader("Content-Type", "application/json; charset=utf-8").end(object.build()); + } + }); + } + + @BuildStep(onlyIf = IsDevelopment.class) + DevConsoleRouteBuildItem forceRestart(LaunchModeBuildItem launchModeBuildItem) { + if (testsDisabled(launchModeBuildItem, TestSupport.instance())) { + return null; + } + return new DevConsoleRouteBuildItem("tests/force-restart", "POST", new Handler<>() { + @Override + public void handle(RoutingContext event) { + RuntimeUpdatesProcessor.INSTANCE.doScan(true, true); + } + }); + } + @BuildStep(onlyIf = IsDevelopment.class) DevConsoleRouteBuildItem handleTestResult(LaunchModeBuildItem launchModeBuildItem) { Optional ts = TestSupport.instance(); @@ -219,7 +250,7 @@ DevConsoleRouteBuildItem handleTestResult(LaunchModeBuildItem launchModeBuildIte return null; } - return new DevConsoleRouteBuildItem("tests/result", "GET", new Handler() { + return new DevConsoleRouteBuildItem("tests/result", "GET", new Handler<>() { @Override public void handle(RoutingContext event) { TestRunResults testRunResults = ts.get().getResults(); diff --git a/extensions/vertx-http/deployment/src/main/resources/dev-static/js/tests.js b/extensions/vertx-http/deployment/src/main/resources/dev-static/js/tests.js index f9f2b948cacb98..2a6a99f59e944f 100644 --- a/extensions/vertx-http/deployment/src/main/resources/dev-static/js/tests.js +++ b/extensions/vertx-http/deployment/src/main/resources/dev-static/js/tests.js @@ -97,6 +97,14 @@ function addTestsBtnListeners(){ $(".btnToggleInstrumentationBasedReload").on("click", function(e) { toggleInstrumentationReload(); }); + + $(".btnToggleLiveReload").on("click", function(e) { + toggleLiveReload(); + }); + + $(".btnForceRestart").on("click", function(e) { + forceRestart(); + }); $(".btnDisplayTestHelp").on("click", function(e) { displayTestsHelp(); @@ -113,7 +121,9 @@ function addTestsKeyListeners(){ var d = 68; // Disable tests var h = 72; // Display this help var p = 80; // Pause tests - + var s = 83; // force restart + var l = 76; // toggle live reload + $(document).keydown(function (e) { if (e.target.tagName === "BODY") { if (e.keyCode === r){ @@ -136,6 +146,10 @@ function addTestsKeyListeners(){ displayTestsHelp(); } else if (e.keyCode === p){ pauseTests(); + } else if (e.keyCode === s){ + forceRestart(); + } else if (e.keyCode === l){ + toggleLiveReload(); } } }); @@ -218,6 +232,24 @@ function toggleInstrumentationReload(){ } } +function toggleLiveReload(){ + if(!testsInProgress){ + $.post(testBackendUrl + "toggle-live-reload", function(data){ + if(data.liveReloadEnabled){ + switchOnLiveReload(); + }else{ + switchOffLiveReload(); + } + }); + } +} + +function forceRestart(){ + if(!testsInProgress){ + $.post(testBackendUrl + "force-restart"); + } +} + function displayTestsHelp(){ $('#testsHelpModal').modal('show'); } @@ -256,22 +288,25 @@ function switchOnTesting(json){ $('.btnPowerOnOffButton, .btnTestsResults i').addClass("text-danger"); $('.btnRerunFailedTests, .btnPrintFailuresTests').removeClass("d-none"); } - + + console.log(json); + setBrokenOnly(json.isBrokenOnly); setTestOutput(json.isTestOutput); setInstrumentationBasedReload(json.isInstrumentationBasedReload); + setLiveReload(json.isLiveReload); document.dispatchEvent(messageReceivedEvent); testsIsRunning = true; } function showRunningToolbar(){ - $(".btnRerunAllTests,.btnRerunFailedTests,.btnBrokenOnlyTests,.btnPrintFailuresTests,.btnToggleTestOutput,.btnToggleInstrumentationBasedReload, .btnTestsResults, .btnTestsGuide").each(function(){ + $(".btnRerunAllTests,.btnRerunFailedTests,.btnBrokenOnlyTests,.btnPrintFailuresTests,.btnToggleTestOutput,.btnToggleInstrumentationBasedReload, .btnToggleLiveReload, .btnForceRestart, .btnTestsResults, .btnTestsGuide").each(function(){ $(this).removeClass("d-none"); }); } function hideRunningToolbar(){ - $(".btnRerunAllTests,.btnRerunFailedTests,.btnBrokenOnlyTests,.btnPrintFailuresTests,.btnToggleTestOutput,.btnToggleInstrumentationBasedReload, .btnTestsResults, .btnTestsGuide").each(function(){ + $(".btnRerunAllTests,.btnRerunFailedTests,.btnBrokenOnlyTests,.btnPrintFailuresTests,.btnToggleTestOutput,.btnToggleInstrumentationBasedReload, .btnToggleLiveReload, .btnForceRestart, .btnTestsResults, .btnTestsGuide").each(function(){ $(this).addClass("d-none"); }); } @@ -346,3 +381,22 @@ function switchOffInstrumentation(){ $('.btnToggleInstrumentationBasedReload i').removeClass("text-success"); } +function switchOnLiveReload(){ + $('.btnToggleLiveReload i').removeClass("text-secondary"); + $('.btnToggleLiveReload i').addClass("text-success"); +} + +function switchOffLiveReload(){ + $('.btnToggleLiveReload i').addClass("text-secondary"); + $('.btnToggleLiveReload i').removeClass("text-success"); +} + +function setLiveReload(isLiveReload) { + if(isLiveReload) { + switchOnLiveReload(); + }else{ + switchOffLiveReload(); + } +} + + diff --git a/extensions/vertx-http/deployment/src/main/resources/dev-templates/io.quarkus.quarkus-vertx-http/tests.html b/extensions/vertx-http/deployment/src/main/resources/dev-templates/io.quarkus.quarkus-vertx-http/tests.html index 308901749d0fbe..f5e8c77ca9141b 100644 --- a/extensions/vertx-http/deployment/src/main/resources/dev-templates/io.quarkus.quarkus-vertx-http/tests.html +++ b/extensions/vertx-http/deployment/src/main/resources/dev-templates/io.quarkus.quarkus-vertx-http/tests.html @@ -38,6 +38,12 @@ .btnToggleInstrumentationBasedReload i::after { content: " Toggle instrumentation based reload"; } + .btnToggleLiveReload i::after { + content: " Toggle live reload enabled"; + } + .btnForceRestart i::after { + content: " Force restart"; + } .btnTestsResults{ display: none; } diff --git a/extensions/vertx-http/deployment/src/main/resources/dev-templates/testsModals.html b/extensions/vertx-http/deployment/src/main/resources/dev-templates/testsModals.html index 89549a553ab394..6c9ba81d6f7e70 100644 --- a/extensions/vertx-http/deployment/src/main/resources/dev-templates/testsModals.html +++ b/extensions/vertx-http/deployment/src/main/resources/dev-templates/testsModals.html @@ -51,6 +51,19 @@ +
  • + l Toggle live reload enabled + + + + +
  • +
  • + s Force restart + + + +
  • h Display this help @@ -59,4 +72,4 @@ - \ No newline at end of file + diff --git a/extensions/vertx-http/deployment/src/main/resources/dev-templates/testsNav.html b/extensions/vertx-http/deployment/src/main/resources/dev-templates/testsNav.html index 6709c3bf39e9e0..5924d6ef6418e8 100644 --- a/extensions/vertx-http/deployment/src/main/resources/dev-templates/testsNav.html +++ b/extensions/vertx-http/deployment/src/main/resources/dev-templates/testsNav.html @@ -30,6 +30,14 @@ + + + + + + + + @@ -47,4 +55,4 @@ - \ No newline at end of file + diff --git a/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/devmode/ContinuousTestWebSocketHandler.java b/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/devmode/ContinuousTestWebSocketHandler.java index 3eebc59f3d9244..a221397d1c9f26 100644 --- a/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/devmode/ContinuousTestWebSocketHandler.java +++ b/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/devmode/ContinuousTestWebSocketHandler.java @@ -21,7 +21,7 @@ public class ContinuousTestWebSocketHandler implements Handler { private static volatile String lastMessage; static { - ContinuousTestingWebsocketListener.setStateListener(new Consumer() { + ContinuousTestingWebsocketListener.setStateListener(new Consumer<>() { @Override public void accept(ContinuousTestingWebsocketListener.State state) { Json.JsonObjectBuilder response = Json.object(); @@ -34,6 +34,7 @@ public void accept(ContinuousTestingWebsocketListener.State state) { response.put("isBrokenOnly", state.isBrokenOnly); response.put("isTestOutput", state.isTestOutput); response.put("isInstrumentationBasedReload", state.isInstrumentationBasedReload); + response.put("isLiveReload", state.isLiveReload); lastMessage = response.build(); for (ServerWebSocket i : sockets) { @@ -47,7 +48,7 @@ public void accept(ContinuousTestingWebsocketListener.State state) { public void handle(RoutingContext event) { if ("websocket".equalsIgnoreCase(event.request().getHeader(HttpHeaderNames.UPGRADE))) { - event.request().toWebSocket(new Handler>() { + event.request().toWebSocket(new Handler<>() { @Override public void handle(AsyncResult event) { if (event.succeeded()) {