Skip to content

Commit

Permalink
test wip
Browse files Browse the repository at this point in the history
  • Loading branch information
aloubyansky committed Jan 26, 2024
1 parent 3bc72ee commit 872717b
Show file tree
Hide file tree
Showing 15 changed files with 348 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,20 @@ public void testThatTheApplicationIsReloadedOnPomChange() throws MavenInvocation
.until(() -> devModeClient.getHttpResponse("/q/openapi").contains("hello"));
}

@Test
public void testNonReloadableContagiousness() throws MavenInvocationException, IOException {
testDir = getTargetDir("projects/non-reloadable-contagiousness");
run(true);
String greeting = devModeClient.getHttpResponse("/app/hello");
assertThat(greeting).contains("hello");

final List<String> artifacts = getNonReloadableArtifacts(
Files.readAllLines(testDir.toPath().resolve("build-non-reloadable-contagiousness.log")));
assertTrue(artifacts.contains("- org.acme:acme-common:1.0-SNAPSHOT"));

Check failure on line 556 in integration-tests/maven/src/test/java/io/quarkus/maven/it/DevMojoIT.java

View workflow job for this annotation

GitHub Actions / Build summary for 872717bff198fe565ae1be6e40ae841fce236964

Maven Tests - JDK 17

org.opentest4j.AssertionFailedError: expected: <true> but was: <false> at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151) at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
Raw output
org.opentest4j.AssertionFailedError: expected: <true> but was: <false>
	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
	at org.junit.jupiter.api.AssertTrue.failNotTrue(AssertTrue.java:63)
	at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:36)
	at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:31)
	at org.junit.jupiter.api.Assertions.assertTrue(Assertions.java:183)
	at io.quarkus.maven.it.DevMojoIT.testNonReloadableContagiousness(DevMojoIT.java:556)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)

Check failure on line 556 in integration-tests/maven/src/test/java/io/quarkus/maven/it/DevMojoIT.java

View workflow job for this annotation

GitHub Actions / Build summary for 872717bff198fe565ae1be6e40ae841fce236964

Maven Tests - JDK 17

org.opentest4j.AssertionFailedError: expected: <true> but was: <false> at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151) at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
Raw output
org.opentest4j.AssertionFailedError: expected: <true> but was: <false>
	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
	at org.junit.jupiter.api.AssertTrue.failNotTrue(AssertTrue.java:63)
	at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:36)
	at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:31)
	at org.junit.jupiter.api.Assertions.assertTrue(Assertions.java:183)
	at io.quarkus.maven.it.DevMojoIT.testNonReloadableContagiousness(DevMojoIT.java:556)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)

Check failure on line 556 in integration-tests/maven/src/test/java/io/quarkus/maven/it/DevMojoIT.java

View workflow job for this annotation

GitHub Actions / Build summary for 872717bff198fe565ae1be6e40ae841fce236964

Maven Tests - JDK 17 Windows

org.opentest4j.AssertionFailedError: expected: <true> but was: <false> at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151) at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
Raw output
org.opentest4j.AssertionFailedError: expected: <true> but was: <false>
	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
	at org.junit.jupiter.api.AssertTrue.failNotTrue(AssertTrue.java:63)
	at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:36)
	at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:31)
	at org.junit.jupiter.api.Assertions.assertTrue(Assertions.java:183)
	at io.quarkus.maven.it.DevMojoIT.testNonReloadableContagiousness(DevMojoIT.java:556)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)

Check failure on line 556 in integration-tests/maven/src/test/java/io/quarkus/maven/it/DevMojoIT.java

View workflow job for this annotation

GitHub Actions / Build summary for 872717bff198fe565ae1be6e40ae841fce236964

Maven Tests - JDK 17 Windows

org.opentest4j.AssertionFailedError: expected: <true> but was: <false> at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151) at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
Raw output
org.opentest4j.AssertionFailedError: expected: <true> but was: <false>
	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
	at org.junit.jupiter.api.AssertTrue.failNotTrue(AssertTrue.java:63)
	at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:36)
	at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:31)
	at org.junit.jupiter.api.Assertions.assertTrue(Assertions.java:183)
	at io.quarkus.maven.it.DevMojoIT.testNonReloadableContagiousness(DevMojoIT.java:556)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
assertTrue(artifacts.contains("- org.acme:acme-common-transitive:1.0-SNAPSHOT"));
assertEquals(4, artifacts.size());
}

@Test
public void testProjectWithExtension() throws MavenInvocationException, IOException {
testDir = getTargetDir("projects/project-with-extension");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.acme</groupId>
<artifactId>quarkus-quickstart-multimodule-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<groupId>org.acme</groupId>
<artifactId>acme-common-transitive</artifactId>
<version>1.0-SNAPSHOT</version>

<dependencies>
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.acme;

import jakarta.enterprise.context.ApplicationScoped;

@ApplicationScoped
public class CommonTransitiveBean {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.acme</groupId>
<artifactId>quarkus-quickstart-multimodule-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>org.acme</groupId>
<artifactId>acme-common</artifactId>
<version>1.0-SNAPSHOT</version>

<dependencies>
<dependency>
<groupId>org.acme</groupId>
<artifactId>acme-common-transitive</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.acme;

import jakarta.enterprise.context.ApplicationScoped;

@ApplicationScoped
public class CommonBean {

private final CommonTransitiveBean bean;

public CommonBean(CommonTransitiveBean bean) {
this.bean = java.util.Objects.requireNonNull(bean);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.acme</groupId>
<artifactId>quarkus-quickstart-multimodule-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>org.acme</groupId>
<artifactId>acme-library</artifactId>
<version>1.0-SNAPSHOT</version>

<dependencies>
<dependency>
<groupId>org.acme</groupId>
<artifactId>acme-common-transitive</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.acme;

import jakarta.enterprise.context.ApplicationScoped;

@ApplicationScoped
public class LibraryBean {

private final CommonTransitiveBean bean;

public LibraryBean(CommonTransitiveBean bean) {
this.bean = java.util.Objects.requireNonNull(bean);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>

<groupId>org.acme</groupId>
<artifactId>quarkus-quickstart-multimodule-parent</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>

<properties>
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.version>@project.version@</quarkus.platform.version>
<quarkus-plugin.version>@project.version@</quarkus-plugin.version>
<compiler-plugin.version>${compiler-plugin.version}</compiler-plugin.version>
<surefire-plugin.version>${version.surefire.plugin}</surefire-plugin.version>
<maven.compiler.source>${maven.compiler.source}</maven.compiler.source>
<maven.compiler.target>${maven.compiler.target}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<modules>
<module>common</module>
<module>common-transitive</module>
<module>library</module>
<module>runner</module>
</modules>

<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>\${compiler-plugin.version}</version>
<configuration>
<compilerArgs>
<arg>-parameters</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<version>\${quarkus-plugin.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>\${quarkus.platform.group-id}</groupId>
<artifactId>\${quarkus.platform.artifact-id}</artifactId>
<version>\${quarkus.platform.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.acme</groupId>
<artifactId>acme-common-transitive</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.acme</groupId>
<artifactId>acme-common</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.acme</groupId>
<artifactId>acme-library</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.acme</groupId>
<artifactId>acme-quarkus-ext</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</dependencyManagement>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.acme</groupId>
<artifactId>quarkus-quickstart-multimodule-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>org.acme</groupId>
<artifactId>quarkus-quickstart-multimodule-main</artifactId>
<version>1.0-SNAPSHOT</version>


<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy</artifactId>
</dependency>
<dependency>
<groupId>org.acme</groupId>
<artifactId>acme-common</artifactId>
</dependency>
<dependency>
<groupId>org.acme</groupId>
<artifactId>acme-library</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>\${surefire-plugin.version}</version>
<configuration>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>\${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<version>\${quarkus-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>


<profiles>
<profile>
<id>native</id>
<activation>
<property>
<name>native</name>
</property>
</activation>
<properties>
<quarkus.package.type>native</quarkus.package.type>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>\${native.surefire.skip}</skipTests>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>\${surefire-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<systemPropertyVariables>
<native.image.path>\${project.build.directory}/\${project.build.finalName}-runner</native.image.path>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>\${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package org.acme;

import org.eclipse.microprofile.config.inject.ConfigProperty;


import jakarta.inject.Inject;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;

@Path("/hello")
public class HelloResource {

final CommonBean common;
final LibraryBean library;

@Inject
@ConfigProperty(name = "greeting")
String greeting;

public HelloResource(CommonBean common, LibraryBean library) {
this.common = java.util.Objects.requireNonNull(common);
this.library = java.util.Objects.requireNonNull(library);
}

@GET
@Produces(MediaType.TEXT_PLAIN)
public String hello() {
return "hello";
}

@GET
@Path("/greeting")
@Produces(MediaType.TEXT_PLAIN)
public String greeting() {
return greeting;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package org.acme;

import jakarta.ws.rs.ApplicationPath;
import jakarta.ws.rs.core.Application;

@ApplicationPath("/app")
public class MyApplication extends Application {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
greeting=bonjour

0 comments on commit 872717b

Please sign in to comment.