mirror of
https://github.com/jlengrand/quarkus.git
synced 2026-03-10 08:41:22 +00:00
Add tests for initial compilation of quarkus:dev
This commit is contained in:
@@ -15,7 +15,7 @@ public class KogitoDevModeIT extends RunAndCheckMojoTestBase {
|
||||
@Test
|
||||
public void testThatTheKogitoApplicationRuns() throws MavenInvocationException, IOException {
|
||||
testDir = getTargetDir("projects/simple-kogito");
|
||||
run("-e");
|
||||
run(false, "-e");
|
||||
|
||||
await()
|
||||
.pollDelay(1, TimeUnit.SECONDS)
|
||||
|
||||
@@ -19,7 +19,7 @@ public class KotlinDevModeIT extends RunAndCheckMojoTestBase {
|
||||
@Test
|
||||
public void testThatTheApplicationIsReloadedOnKotlinChange() throws MavenInvocationException, IOException {
|
||||
testDir = initProject("projects/classic-kotlin", "projects/project-classic-run-kotlin-change");
|
||||
runAndCheck();
|
||||
runAndCheck(false);
|
||||
|
||||
// Edit the "Hello" message.
|
||||
File jaxRsResource = new File(testDir, "src/main/kotlin/org/acme/HelloResource.kt");
|
||||
|
||||
@@ -53,7 +53,7 @@ public class DevMojoIT extends RunAndCheckMojoTestBase {
|
||||
@Test
|
||||
public void testThatResteasyWithoutUndertowCanRun() throws MavenInvocationException, IOException {
|
||||
testDir = initProject("projects/classic-no-undertow", "projects/project-classic-no-undertow-run");
|
||||
run();
|
||||
run(false);
|
||||
|
||||
//make sure that a simple HTTP GET request always works
|
||||
IntStream.range(0, 10).forEach(i -> {
|
||||
@@ -286,7 +286,7 @@ public class DevMojoIT extends RunAndCheckMojoTestBase {
|
||||
@Test
|
||||
public void testSourceModificationBeforeFirstCallWorks() throws MavenInvocationException, IOException {
|
||||
testDir = initProject("projects/classic", "projects/project-classic-source-modification-before-first-call");
|
||||
run();
|
||||
run(true);
|
||||
|
||||
File source = new File(testDir, "src/main/java/org/acme/HelloResource.java");
|
||||
// Edit the "Hello" message and provide a random string.
|
||||
@@ -384,7 +384,7 @@ public class DevMojoIT extends RunAndCheckMojoTestBase {
|
||||
.pollInterval(1, TimeUnit.SECONDS)
|
||||
.until(configurationFile::isFile);
|
||||
|
||||
run();
|
||||
run(true);
|
||||
|
||||
// Wait until we get "uuid"
|
||||
await()
|
||||
|
||||
@@ -29,11 +29,13 @@ public class RunAndCheckMojoTestBase extends MojoTestBase {
|
||||
awaitUntilServerDown();
|
||||
}
|
||||
|
||||
protected void run(String... options) throws FileNotFoundException, MavenInvocationException {
|
||||
protected void run(boolean performCompile, String... options) throws FileNotFoundException, MavenInvocationException {
|
||||
assertThat(testDir).isDirectory();
|
||||
running = new RunningInvoker(testDir, false);
|
||||
final List<String> args = new ArrayList<>(2 + options.length);
|
||||
args.add("compile");
|
||||
if (performCompile) {
|
||||
args.add("compile");
|
||||
}
|
||||
args.add("quarkus:dev");
|
||||
boolean hasDebugOptions = false;
|
||||
for (String option : options) {
|
||||
@@ -56,7 +58,12 @@ public class RunAndCheckMojoTestBase extends MojoTestBase {
|
||||
}
|
||||
|
||||
protected void runAndCheck(String... options) throws FileNotFoundException, MavenInvocationException {
|
||||
run(options);
|
||||
runAndCheck(true, options);
|
||||
}
|
||||
|
||||
protected void runAndCheck(boolean performCompile, String... options)
|
||||
throws FileNotFoundException, MavenInvocationException {
|
||||
run(performCompile, options);
|
||||
|
||||
String resp = getHttpResponse();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user