Skip to content

Commit

Permalink
Add tests for initial compilation of quarkus:dev
Browse files Browse the repository at this point in the history
  • Loading branch information
geoand committed Feb 3, 2020
1 parent 79f169a commit 49b4b00
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void testThatClassAppCanRun() throws MavenInvocationException, IOExceptio
@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 -> {
Expand Down Expand Up @@ -286,7 +286,7 @@ public void testThatClassFileAreCleanedUp() throws MavenInvocationException, IOE
@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.
Expand Down Expand Up @@ -384,7 +384,7 @@ public void testThatExternalConfigOverridesConfigInJar() throws MavenInvocationE
.pollInterval(1, TimeUnit.SECONDS)
.until(configurationFile::isFile);

run();
run(true);

// Wait until we get "uuid"
await()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ public void cleanup() throws IOException {
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) {
Expand All @@ -56,7 +58,12 @@ protected void run(String... options) throws FileNotFoundException, MavenInvocat
}

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();

Expand Down

0 comments on commit 49b4b00

Please sign in to comment.