-
Notifications
You must be signed in to change notification settings - Fork 0
re-work integration tests #162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,45 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
|
|
||
| <parent> | ||
| <groupId>io.github.bmarwell.keyserver</groupId> | ||
| <artifactId>keyserver</artifactId> | ||
| <version>0.1.0-SNAPSHOT</version> | ||
| </parent> | ||
|
|
||
| <groupId>io.github.bmarwell.keyserver</groupId> | ||
| <artifactId>keyserver-ear</artifactId> | ||
| <version>0.1.0-SNAPSHOT</version> | ||
| <packaging>ear</packaging> | ||
|
|
||
| <name>Java Keyserver :: EAR</name> | ||
|
|
||
| <dependencies> | ||
| <dependency> | ||
| <groupId>io.github.bmarwell.keyserver</groupId> | ||
| <artifactId>keyserver-openpgp-keyserver-protocol</artifactId> | ||
| <version>0.1.0-SNAPSHOT</version> | ||
| <type>war</type> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>io.github.bmarwell.keyserver</groupId> | ||
| <artifactId>keyserver-web-rest</artifactId> | ||
| <version>0.1.0-SNAPSHOT</version> | ||
| <type>war</type> | ||
| </dependency> | ||
| </dependencies> | ||
|
|
||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-ear-plugin</artifactId> | ||
| <configuration> | ||
| <skinnyWars>true</skinnyWars> | ||
| <defaultLibBundleDir>lib</defaultLibBundleDir> | ||
| </configuration> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| </project> |
This file contains hidden or 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 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <application xmlns="https://jakarta.ee/xml/ns/jakartaee" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/application_11.xsd" | ||
| version="11"> | ||
| <display-name>Java Keyserver</display-name> | ||
|
|
||
| <module> | ||
| <web> | ||
| <web-uri>keyserver-openpgp-keyserver-protocol-0.1.0-SNAPSHOT.war</web-uri> | ||
| <context-root>/pks</context-root> | ||
| </web> | ||
| </module> | ||
|
|
||
| <module> | ||
| <web> | ||
| <web-uri>keyserver-web-rest-0.1.0-SNAPSHOT.war</web-uri> | ||
| <context-root>/api</context-root> | ||
| </web> | ||
| </module> | ||
| </application> | ||
This file contains hidden or 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,112 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
|
|
||
| <parent> | ||
| <groupId>io.github.bmarwell.keyserver</groupId> | ||
| <artifactId>keyserver-integration-tests</artifactId> | ||
| <version>0.1.0-SNAPSHOT</version> | ||
| </parent> | ||
|
|
||
| <artifactId>keyserver-integration-tests-helper</artifactId> | ||
| <name>Java Keyserver :: Integration Tests :: helper</name> | ||
|
|
||
| <dependencies> | ||
| <dependency> | ||
| <groupId>org.testcontainers</groupId> | ||
| <artifactId>testcontainers</artifactId> | ||
| <scope>compile</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.testcontainers</groupId> | ||
| <artifactId>postgresql</artifactId> | ||
| <scope>compile</scope> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>org.junit.jupiter</groupId> | ||
| <artifactId>junit-jupiter-api</artifactId> | ||
| <scope>compile</scope> | ||
| </dependency> | ||
|
|
||
| <!-- PostgreSQL JDBC driver — used for direct DB access in seed/verify steps --> | ||
| <dependency> | ||
| <groupId>org.postgresql</groupId> | ||
| <artifactId>postgresql</artifactId> | ||
| <scope>runtime</scope> | ||
| </dependency> | ||
|
|
||
| <!-- Logging backend for Testcontainers' Slf4jLogConsumer --> | ||
| <dependency> | ||
| <groupId>ch.qos.logback</groupId> | ||
| <artifactId>logback-classic</artifactId> | ||
| <scope>runtime</scope> | ||
| </dependency> | ||
|
|
||
| <!-- JAX-RS Client API for the test runtime --> | ||
| <dependency> | ||
| <groupId>jakarta.ws.rs</groupId> | ||
| <artifactId>jakarta.ws.rs-api</artifactId> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
|
bmarwell marked this conversation as resolved.
|
||
| <dependency> | ||
| <groupId>org.apache.cxf</groupId> | ||
| <artifactId>cxf-rt-rs-client</artifactId> | ||
| <scope>runtime</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.bouncycastle</groupId> | ||
| <artifactId>bcprov-jdk18on</artifactId> | ||
| <scope>compile</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.bouncycastle</groupId> | ||
| <artifactId>bcpg-jdk18on</artifactId> | ||
| <scope>compile</scope> | ||
| </dependency> | ||
| </dependencies> | ||
|
|
||
| <profiles> | ||
| <!-- | ||
| Activate with -P run-its to run integration tests. Requires Docker or | ||
| Podman. Not run by default to keep the standard PR build fast. | ||
| --> | ||
| <profile> | ||
| <id>run-its</id> | ||
| <build> | ||
| <plugins> | ||
| <!-- | ||
| Copy the PostgreSQL JDBC driver to a predictable path so the | ||
| container build can include it in the Liberty image. | ||
| --> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-dependency-plugin</artifactId> | ||
| <executions> | ||
| <execution> | ||
| <id>copy-pgsql-driver</id> | ||
| <goals> | ||
| <goal>copy</goal> | ||
| </goals> | ||
| <phase>pre-integration-test</phase> | ||
| <configuration> | ||
| <artifactItems> | ||
| <artifactItem> | ||
| <groupId>org.postgresql</groupId> | ||
| <artifactId>postgresql</artifactId> | ||
| <version>${postgresql.version}</version> | ||
| <outputDirectory>${project.build.directory}/libs</outputDirectory> | ||
| <destFileName>postgresql.jar</destFileName> | ||
| </artifactItem> | ||
| </artifactItems> | ||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
|
|
||
| </plugins> | ||
| </build> | ||
| </profile> | ||
| </profiles> | ||
|
|
||
| </project> | ||
28 changes: 28 additions & 0 deletions
28
...on-tests/helper/src/main/java/io/github/bmarwell/keyserver/it/extension/DatabaseSeed.java
This file contains hidden or 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,28 @@ | ||
| /* | ||
| * Copyright (C) 2023-2026 The java-keyserver project team. | ||
| * | ||
| * SPDX-License-Identifier: EUPL-1.2 OR Apache-2.0 | ||
| */ | ||
| package io.github.bmarwell.keyserver.it.extension; | ||
|
|
||
| import java.lang.annotation.ElementType; | ||
| import java.lang.annotation.Inherited; | ||
| import java.lang.annotation.Retention; | ||
| import java.lang.annotation.RetentionPolicy; | ||
| import java.lang.annotation.Target; | ||
|
|
||
| /** | ||
| * Seeds the shared test database before a test class runs. | ||
| * | ||
| * <p>When omitted, the shared PostgreSQL instance starts empty and the test class | ||
| * is responsible for creating its own data. | ||
| */ | ||
| @Target(ElementType.TYPE) | ||
| @Retention(RetentionPolicy.RUNTIME) | ||
| @Inherited | ||
| public @interface DatabaseSeed { | ||
|
|
||
| String[] value() default {}; | ||
|
|
||
| String[] truncateAfter() default {}; | ||
| } |
21 changes: 21 additions & 0 deletions
21
...tests/helper/src/main/java/io/github/bmarwell/keyserver/it/extension/KeyserverAccess.java
This file contains hidden or 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 @@ | ||
| /* | ||
| * Copyright (C) 2023-2026 The java-keyserver project team. | ||
| * | ||
| * SPDX-License-Identifier: EUPL-1.2 OR Apache-2.0 | ||
| */ | ||
| package io.github.bmarwell.keyserver.it.extension; | ||
|
|
||
| import java.net.URI; | ||
|
|
||
| public interface KeyserverAccess { | ||
|
|
||
| URI pksBaseUri(); | ||
|
|
||
| URI apiBaseUri(); | ||
|
|
||
| String jdbcUrl(); | ||
|
|
||
| String dbUser(); | ||
|
|
||
| String dbPassword(); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.