Support exit command
@@ -408,13 +408,10 @@ public class DevMojo extends StartDebugMojoSupport {
@Override
public void runTests(boolean waitForApplicationUpdate, int messageOccurrences, ThreadPoolExecutor executor,
boolean forceSkipUTs) {
+ if (!skipTests) {
File logFile = serverTask.getLogFile();
String regexp = UPDATED_APP_MESSAGE_REGEXP + DevMojo.this.project.getArtifactId();
- if (skipTests) {
- return;
- }
-
try {
Thread.sleep(500);
} catch (InterruptedException e) {
@@ -491,9 +488,10 @@ public class DevMojo extends StartDebugMojoSupport {
}
}
}
+ }
- // start watching for hotkey presses if not already started
- util.runHotkeyReaderThread(executor);
+ // finally, start watching for hotkey presses if not already started
+ util.runHotkeyReaderThread(executor, skipTests);
}
@Override
@@ -609,15 +607,12 @@ public class DevMojo extends StartDebugMojoSupport {
List<String> artifactPaths = new ArrayList<String>();
util.getArtifacts(artifactPaths);
- // run tests at startup
- if (testSourceDirectory.exists()) {
- if (hotTests) {
- // if hot testing, run tests and watch for keypresses
+ if (hotTests && testSourceDirectory.exists()) {
+ // if hot testing, run tests on startup and then watch for keypresses
util.runTestThread(false, executor, -1, false, false);
} else {
- // else watch for key presses here
- util.runHotkeyReaderThread(executor);
- }
+ // else watch for keypresses immediately
+ util.runHotkeyReaderThread(executor, skipTests);
}
// pom.xml
