-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
66 changed files
with
1,812 additions
and
28 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
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
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,37 @@ | ||
## Podman, databases | ||
|
||
Having trouble with TestContainers and Podman? Take a look: https://quarkus.io/blog/quarkus-devservices-testcontainers-podman/ | ||
|
||
## What is this? | ||
|
||
A demo app comprising various dependencies to intentionally | ||
add slightly more work for the compiler. Each component is | ||
covered with a rudimentary test and each dependency has a simple example so as it doesn't get optimized away. | ||
|
||
## Testing | ||
|
||
``` | ||
$ mvn clean verify -Dquarkus.version=2.13.3.Final -Pnative -Dquarkus.profile=test | ||
``` | ||
|
||
## Databases | ||
|
||
Databases are started and stopped automatically via Quarkus devservices using testcontainers. If you need to work with those manually, you can start them e.g. as: | ||
|
||
``` | ||
podman run --network=host --ulimit memlock=-1:-1 -it -d --rm=true --name quarkus_test_db -e POSTGRES_USER=quarkus -e POSTGRES_PASSWORD=quarkus -e POSTGRES_DB=db1 quay.io/debezium/postgres:15 | ||
podman run -it -d --name mariadb -p 49157:3306 --env MARIADB_USER=quarkus --env MARIADB_PASSWORD=quarkus --env MARIADB_ROOT_PASSWORD=quarkus --env MARIADB_DATABASE=db2 mariadb:10.3 | ||
``` | ||
|
||
## Sources | ||
|
||
Various demo endpoints and ideas inspired by: | ||
|
||
* https://github.com/Karm/fuzz | ||
* https://github.com/quarkusio/quarkus-quickstarts | ||
* https://github.com/quarkusio/quarkus/tree/main/integration-tests/awt | ||
* https://github.com/quarkusio/quarkus-quickstarts/pull/1154 | ||
* https://github.com/eclipse/microprofile-starter/tree/main/src/it | ||
|
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,257 @@ | ||
<?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> | ||
|
||
<parent> | ||
<groupId>org.graalvm.tests.integration</groupId> | ||
<artifactId>parent</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
<relativePath>../../pom.xml</relativePath> | ||
</parent> | ||
|
||
<groupId>org.acme</groupId> | ||
<artifactId>mp-orm-dbs-awt</artifactId> | ||
|
||
<properties> | ||
<maven.compiler.release>17</maven.compiler.release> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
<quarkus.version>${global.quarkus.version}</quarkus.version> | ||
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id> | ||
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id> | ||
<quarkus.platform.version>${quarkus.version}</quarkus.platform.version> | ||
<vertx.auth.jwt.version>4.0.3</vertx.auth.jwt.version> | ||
<apache.pdfbox.version>3.0.0</apache.pdfbox.version> | ||
<final.name>${final.name}</final.name> | ||
</properties> | ||
<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> | ||
</dependencies> | ||
</dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>io.vertx</groupId> | ||
<artifactId>vertx-auth-jwt</artifactId> | ||
<version>${vertx.auth.jwt.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.pdfbox</groupId> | ||
<artifactId>pdfbox</artifactId> | ||
<version>${apache.pdfbox.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-resteasy-reactive</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-resteasy-reactive-qute</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-rest-client-reactive-jsonb</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-resteasy-reactive-jsonb</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-rest-client-reactive</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-hibernate-orm-panache</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-smallrye-graphql</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-arc</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-hibernate-orm</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-jdbc-mariadb</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-jdbc-postgresql</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-smallrye-fault-tolerance</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-smallrye-jwt</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-smallrye-metrics</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-smallrye-health</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-smallrye-openapi</artifactId> | ||
</dependency> | ||
<!--<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-opentelemetry</artifactId> | ||
</dependency>--> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-smallrye-opentracing</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-awt</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> | ||
<finalName>${final.name}</finalName> | ||
<plugins> | ||
<plugin> | ||
<groupId>${quarkus.platform.group-id}</groupId> | ||
<artifactId>quarkus-maven-plugin</artifactId> | ||
<version>${quarkus.platform.version}</version> | ||
<extensions>true</extensions> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>build</goal> | ||
<goal>generate-code</goal> | ||
<goal>generate-code-tests</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>${maven.compiler.version}</version> | ||
<configuration> | ||
<compilerArgs> | ||
<arg>-parameters</arg> | ||
</compilerArgs> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>${maven.surefire.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> | ||
<artifactId>maven-failsafe-plugin</artifactId> | ||
<version>${maven.surefire.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> | ||
<profiles> | ||
<profile> | ||
<id>native</id> | ||
<activation> | ||
<property> | ||
<name>native</name> | ||
</property> | ||
</activation> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-failsafe-plugin</artifactId> | ||
<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> | ||
<properties> | ||
<quarkus.package.type>native</quarkus.package.type> | ||
</properties> | ||
</profile> | ||
<profile> | ||
<id>custom-final-name-not-set</id> | ||
<activation> | ||
<property> | ||
<name>!custom.final.name</name> | ||
</property> | ||
</activation> | ||
<properties> | ||
<final.name>mp-orm-dbs-awt</final.name> | ||
</properties> | ||
</profile> | ||
<profile> | ||
<id>custom-final-name-set</id> | ||
<activation> | ||
<property> | ||
<name>custom.final.name</name> | ||
</property> | ||
</activation> | ||
<properties> | ||
<final.name>${custom.final.name}</final.name> | ||
</properties> | ||
</profile> | ||
</profiles> | ||
</project> |
40 changes: 40 additions & 0 deletions
40
apps/quarkus-mp-orm-dbs-awt/src/main/java/quarkus/awt/AWTApplication.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,40 @@ | ||
package quarkus.awt; | ||
|
||
import io.quarkus.runtime.Startup; | ||
|
||
import javax.annotation.PostConstruct; | ||
import javax.enterprise.context.ApplicationScoped; | ||
import javax.imageio.ImageIO; | ||
import java.awt.Font; | ||
import java.awt.FontFormatException; | ||
import java.awt.GraphicsEnvironment; | ||
import java.awt.image.BufferedImage; | ||
import java.io.IOException; | ||
import java.util.Objects; | ||
|
||
@Startup | ||
@ApplicationScoped | ||
public class AWTApplication { | ||
|
||
private BufferedImage quarkusIco = null; | ||
|
||
@PostConstruct | ||
public void init() throws IOException, FontFormatException { | ||
final GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); | ||
// Original font source: https://ftp.gnu.org/gnu/freefont/ | ||
// Application packages them locally in ./src/main/resources | ||
ge.registerFont(Font.createFont(Font.TRUETYPE_FONT, Objects.requireNonNull( | ||
AWTApplication.class.getResourceAsStream("/MyFreeMono.ttf"), | ||
"MyFreeMono.ttf not found."))); | ||
ge.registerFont(Font.createFont(Font.TRUETYPE_FONT, Objects.requireNonNull( | ||
AWTApplication.class.getResourceAsStream("/MyFreeSerif.ttf"), | ||
"MyFreeSerif.ttf not found."))); | ||
quarkusIco = ImageIO.read(Objects.requireNonNull( | ||
AWTApplication.class.getResourceAsStream("/quarkus-icon.png"), | ||
"quarkus-icon.png was not found. Watermarking will not work.")); | ||
} | ||
|
||
public BufferedImage quarkusIco() { | ||
return quarkusIco; | ||
} | ||
} |
Oops, something went wrong.