Skip to content

Commit

Permalink
Merge pull request #26754 from glefloch/fix/working-directory-test
Browse files Browse the repository at this point in the history
Add test for custom working directory in devmode
  • Loading branch information
glefloch authored Jul 15, 2022
2 parents 10ecfc8 + 360a4d2 commit fee39a6
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 0 deletions.
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'
}

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test.value=from-custom-file
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
quarkusPlatformArtifactId=quarkus-bom
quarkusPlatformGroupId=io.quarkus
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'


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;
}
}
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");
}
}

0 comments on commit fee39a6

Please sign in to comment.