-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26754 from glefloch/fix/working-directory-test
Add test for custom working directory in devmode
- Loading branch information
Showing
6 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
integration-tests/gradle/src/main/resources/custom-working-dir-app/build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
plugins { | ||
id 'java' | ||
id 'io.quarkus' | ||
} | ||
|
||
group = 'com.quarkus.demo' | ||
version = '1.0' | ||
|
||
repositories { | ||
mavenLocal { | ||
content { | ||
includeGroupByRegex 'io.quarkus.*' | ||
} | ||
} | ||
mavenCentral() | ||
} | ||
|
||
quarkusDev { | ||
workingDir = rootProject.projectDir | ||
} | ||
|
||
dependencies { | ||
implementation enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}") | ||
implementation 'io.quarkus:quarkus-resteasy' | ||
} | ||
|
1 change: 1 addition & 0 deletions
1
...tion-tests/gradle/src/main/resources/custom-working-dir-app/config/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
test.value=from-custom-file |
2 changes: 2 additions & 0 deletions
2
integration-tests/gradle/src/main/resources/custom-working-dir-app/gradle.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
quarkusPlatformArtifactId=quarkus-bom | ||
quarkusPlatformGroupId=io.quarkus |
19 changes: 19 additions & 0 deletions
19
integration-tests/gradle/src/main/resources/custom-working-dir-app/settings.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
pluginManagement { | ||
repositories { | ||
mavenLocal { | ||
content { | ||
includeGroupByRegex 'io.quarkus.*' | ||
} | ||
} | ||
mavenCentral() | ||
gradlePluginPortal() | ||
} | ||
//noinspection GroovyAssignabilityCheck | ||
plugins { | ||
id 'io.quarkus' version "${quarkusPluginVersion}" | ||
} | ||
} | ||
|
||
rootProject.name = 'quarkus-dependency-constraint' | ||
|
||
|
21 changes: 21 additions & 0 deletions
21
...resources/custom-working-dir-app/src/main/java/org/acme/quarkus/sample/HelloResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.acme.quarkus.sample; | ||
|
||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.core.MediaType; | ||
|
||
import org.eclipse.microprofile.config.inject.ConfigProperty; | ||
|
||
@Path("/hello") | ||
public class HelloResource { | ||
|
||
@ConfigProperty(name = "test.value") | ||
String message; | ||
|
||
@GET | ||
@Produces(MediaType.TEXT_PLAIN) | ||
public String hello() { | ||
return message; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...ion-tests/gradle/src/test/java/io/quarkus/gradle/devmode/CustomWorkingDirDevModeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package io.quarkus.gradle.devmode; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
public class CustomWorkingDirDevModeTest extends QuarkusDevGradleTestBase { | ||
|
||
@Override | ||
protected String projectDirectoryName() { | ||
return "custom-working-dir-app"; | ||
} | ||
|
||
@Override | ||
protected String[] buildArguments() { | ||
return new String[] { "clean", "quarkusDev" }; | ||
} | ||
|
||
protected void testDevMode() throws Exception { | ||
assertThat(getHttpResponse("/hello")).contains("from-custom-file"); | ||
} | ||
} |