forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test for APT processor support in DevMojo
Related to quarkusio#1502
- Loading branch information
Showing
19 changed files
with
634 additions
and
0 deletions.
There are no files selected for viewing
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
1 change: 1 addition & 0 deletions
1
...n-tests/maven/src/test/resources-filtered/projects/apt-in-annotation-processor-paths/.env
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 @@ | ||
OTHER_GREETING=Hola |
108 changes: 108 additions & 0 deletions
108
...ests/maven/src/test/resources-filtered/projects/apt-in-annotation-processor-paths/pom.xml
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,108 @@ | ||
<?xml version="1.0"?> | ||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.acme</groupId> | ||
<artifactId>acme</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<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> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<maven.compiler.source>${maven.compiler.source}</maven.compiler.source> | ||
<maven.compiler.target>${maven.compiler.target}</maven.compiler.target> | ||
<querydsl.version>5.0.0</querydsl.version> | ||
</properties> | ||
<dependencyManagement> | ||
<dependencies> | ||
<!-- insert managed dependencies here --> | ||
<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> | ||
</dependencies> | ||
</dependencyManagement> | ||
<dependencies> | ||
<!-- insert test dependencies here --> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-resteasy-reactive</artifactId> | ||
</dependency> | ||
<!-- Use this rather than quarkus-hibernate-orm which would force us to define a datasource we don't need --> | ||
<dependency> | ||
<groupId>jakarta.persistence</groupId> | ||
<artifactId>jakarta.persistence-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.querydsl</groupId> | ||
<artifactId>querydsl-jpa</artifactId> | ||
<version>\${querydsl.version}</version> | ||
</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-compiler-plugin</artifactId> | ||
<version>\${compiler-plugin.version}</version> | ||
<configuration> | ||
<annotationProcessorPaths> | ||
<path> | ||
<groupId>org.hibernate.orm</groupId> | ||
<artifactId>hibernate-jpamodelgen</artifactId> | ||
</path> | ||
<path> | ||
<groupId>com.querydsl</groupId> | ||
<artifactId>querydsl-apt</artifactId> | ||
<version>\${querydsl.version}</version> | ||
<classifier>jakarta</classifier> | ||
</path> | ||
</annotationProcessorPaths> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-maven-plugin</artifactId> | ||
<version>\${quarkus-plugin.version}</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>generate-code</goal> | ||
<goal>generate-code-tests</goal> | ||
<goal>build</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<profiles> | ||
<profile> | ||
<id>native</id> | ||
<properties> | ||
<quarkus.package.type>native</quarkus.package.type> | ||
</properties> | ||
</profile> | ||
<profile> | ||
<id>customOutputDir</id> | ||
<build> | ||
<directory>target-other</directory> | ||
</build> | ||
</profile> | ||
</profiles> | ||
</project> |
16 changes: 16 additions & 0 deletions
16
...ered/projects/apt-in-annotation-processor-paths/src/main/java/org/acme/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,16 @@ | ||
package org.acme; | ||
|
||
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 { | ||
|
||
@GET | ||
@Produces(MediaType.TEXT_PLAIN) | ||
public String hello() { | ||
return MyEntity_.FIELD+"/"+QMyEntity.myEntity.field; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...-filtered/projects/apt-in-annotation-processor-paths/src/main/java/org/acme/MyEntity.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,11 @@ | ||
package org.acme; | ||
|
||
import jakarta.persistence.Id; | ||
import jakarta.persistence.Entity; | ||
|
||
@Entity | ||
public class MyEntity { | ||
public String field; | ||
@Id | ||
public String id; | ||
} |
6 changes: 6 additions & 0 deletions
6
...ered/projects/apt-in-annotation-processor-paths/src/main/resources/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,6 @@ | ||
# Configuration file | ||
quarkus.log.level=INFO | ||
quarkus.log.file.enable=false | ||
quarkus.log.console.format=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c{3.}] (%t) %s%e%n | ||
quarkus.log.file.format=%d{yyyy-MM-dd HH:mm:ss,SSS} %h %N[%i] %-5p [%c{3.}] (%t) %s%e%n | ||
quarkus.log.category."io.quarkus".level=INFO |
21 changes: 21 additions & 0 deletions
21
.../projects/apt-in-annotation-processor-paths/src/test/java/org/acme/HelloResourceTest.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; | ||
|
||
import io.quarkus.test.junit.QuarkusTest; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static io.restassured.RestAssured.given; | ||
import static org.hamcrest.CoreMatchers.is; | ||
|
||
@QuarkusTest | ||
public class HelloResourceTest { | ||
|
||
@Test | ||
public void testHelloEndpoint() { | ||
given() | ||
.when().get("/app/hello") | ||
.then() | ||
.statusCode(200) | ||
.body(is("hello")); | ||
} | ||
|
||
} |
1 change: 1 addition & 0 deletions
1
...ration-tests/maven/src/test/resources-filtered/projects/apt-in-annotation-processors/.env
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 @@ | ||
OTHER_GREETING=Hola |
Oops, something went wrong.