From 90f06a307997a9179781e73ca4c6d4498ddeecab Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Tue, 27 Jul 2021 12:44:42 +0300 Subject: [PATCH] Add force restart and toggle live reload options to DevUI Resolves: #19011 --- .../console/ConsoleStateManager.java | 10 +++- .../dev/RuntimeUpdatesProcessor.java | 9 ++- .../dev/testing/TestController.java | 7 +++ .../deployment/dev/testing/TestListener.java | 4 ++ .../deployment/dev/testing/TestSupport.java | 12 ++++ .../ContinuousTestingWebsocketListener.java | 24 +++++--- .../ContinuousTestingWebSocketListener.java | 10 +++- .../devmode/tests/TestsProcessor.java | 55 +++++++++++++---- .../src/main/resources/dev-static/js/tests.js | 60 +++++++++++++++++-- .../io.quarkus.quarkus-vertx-http/tests.html | 6 ++ .../resources/dev-templates/testsModals.html | 15 ++++- .../resources/dev-templates/testsNav.html | 10 +++- .../ContinuousTestWebSocketHandler.java | 3 +- 13 files changed, 193 insertions(+), 32 deletions(-) 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 af7bdc993fbdc..61ecd0c30682e 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 @@ -108,8 +108,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 862e9808c6858..6455ce1daaf6f 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 623acc95d2d1c..df94d325369b7 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 f8f8540654a3f..b91a0ae3bc781 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 8230a37aa381f..bbbf37d8acbb0 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 @@ -312,6 +312,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 45a3b21d0d3eb..bc272a58a1db5 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 86a5b7d8f05af..703dfe9514f44 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 417e00f80f2b2..fe0a98105eb8b 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 @@ -13,6 +13,7 @@ import io.quarkus.deployment.annotations.Record; import io.quarkus.deployment.builditem.LaunchModeBuildItem; import io.quarkus.deployment.builditem.ShutdownContextBuildItem; +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; @@ -75,7 +76,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); @@ -108,7 +109,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()) { @@ -122,7 +123,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(); @@ -134,7 +135,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) @@ -143,7 +144,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(); @@ -152,12 +153,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) { @@ -170,12 +171,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(); @@ -189,7 +190,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(); @@ -203,7 +204,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(); @@ -214,6 +215,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(); @@ -221,7 +252,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 f9f2b948cacb9..6f62c4022a1e1 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,23 @@ function switchOnTesting(json){ $('.btnPowerOnOffButton, .btnTestsResults i').addClass("text-danger"); $('.btnRerunFailedTests, .btnPrintFailuresTests').removeClass("d-none"); } - + 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 +379,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 308901749d0fb..f5e8c77ca9141 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 89549a553ab39..6c9ba81d6f7e7 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 6709c3bf39e9e..5924d6ef6418e 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 e7b9ba8301457..683ddf8eafc93 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 @@ -33,6 +33,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) { @@ -44,7 +45,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()) {