generated from quarkiverse/quarkiverse-template
-
Notifications
You must be signed in to change notification settings - Fork 62
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
Multiple test modules #488
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
740fe07
Prepare for multiple test modules
ppalaga de43725
Move client tests to a separate module, test against a container
ppalaga 2eb1fbe
Move code-first ClientGreetingClientTest to the client test module
ppalaga 9527e07
Rename HelloResource to HelloBean to avoid the impression that it is …
ppalaga 82a3478
@Inject-ed fields are typically package-visible
ppalaga 9385eb2
Test the WS service endpoints without RESTeasy. This is to avoid risk…
ppalaga 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 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,96 @@ | ||
<?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.quarkiverse.cxf</groupId> | ||
<artifactId>quarkus-cxf-integration-tests</artifactId> | ||
<version>1.5.0-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>quarkus-cxf-integration-test-basic</artifactId> | ||
|
||
<name>Quarkus CXF Extension - Integration Test - Basic</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.quarkiverse.cxf</groupId> | ||
<artifactId>quarkus-cxf</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> | ||
<dependency> | ||
<groupId>org.assertj</groupId> | ||
<artifactId>assertj-core</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<!-- provides CXF logging feature --> | ||
<dependency> | ||
<groupId>org.apache.cxf</groupId> | ||
<artifactId>cxf-rt-features-logging</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>build</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<profiles> | ||
<profile> | ||
<id>native</id> | ||
<activation> | ||
<activeByDefault>false</activeByDefault> | ||
</activation> | ||
<properties> | ||
<quarkus.package.type>native</quarkus.package.type> | ||
<quarkus.native.report-errors-at-runtime>true</quarkus.native.report-errors-at-runtime> | ||
</properties> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-failsafe-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>integration-test</goal> | ||
<goal>verify</goal> | ||
</goals> | ||
<configuration> | ||
<systemProperties> | ||
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path> | ||
</systemProperties> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
</profiles> | ||
|
||
</project> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
37 changes: 37 additions & 0 deletions
37
integration-tests/basic/src/test/java/io/quarkiverse/it/cxf/ClientTestUtil.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,37 @@ | ||
package io.quarkiverse.it.cxf; | ||
|
||
import java.net.MalformedURLException; | ||
import java.net.URL; | ||
|
||
import javax.xml.namespace.QName; | ||
import javax.xml.ws.Service; | ||
|
||
import org.eclipse.microprofile.config.Config; | ||
import org.eclipse.microprofile.config.ConfigProvider; | ||
|
||
import io.quarkus.runtime.LaunchMode; | ||
|
||
public class ClientTestUtil { | ||
|
||
private ClientTestUtil() { | ||
} | ||
|
||
public static <T> T getClient(Class<T> serviceInterface) { | ||
try { | ||
final URL serviceUrl = new URL(getServerUrl() + "/soap/greeting?wsdl"); | ||
final Service service = javax.xml.ws.Service.create(serviceUrl, | ||
new QName("http://cxf.it.quarkiverse.io/", serviceInterface.getSimpleName())); | ||
return service.getPort(serviceInterface); | ||
} catch (MalformedURLException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
|
||
public static String getServerUrl() { | ||
Config config = ConfigProvider.getConfig(); | ||
final int port = LaunchMode.current().equals(LaunchMode.TEST) ? config.getValue("quarkus.http.test-port", Integer.class) | ||
: config.getValue("quarkus.http.port", Integer.class); | ||
return String.format("http://localhost:%d", port); | ||
} | ||
|
||
} |
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,29 @@ | ||
= Quarkus CXF client tests | ||
|
||
These are pure client tests - i.e. there are intentionally no services implemented in the test application. | ||
All clients access services running in containers. | ||
|
||
== Maintenenance notes | ||
|
||
=== `CalculatorService.wsdl` | ||
|
||
`src/main/cxf-codegen-resources/wsdl/CalculatorService.wsdl` is a static copy of the WSDL served by the testing container. | ||
It is used solely by `cxf-codegen-plugin`. | ||
It would be too complicated to start the container before running the plugin, so we rather keep the static copy. | ||
|
||
There is `io.quarkiverse.cxf.client.it.CxfClientTest.wsdlUpToDate()` to ensure that it is up to date. | ||
|
||
To update `CalculatorService.wsdl` manually, first start the container | ||
|
||
[shource,shell] | ||
---- | ||
$ docker pull quay.io/l2x6/calculator-ws:1.0 | ||
$ docker run -p 8080:8080 quay.io/l2x6/calculator-ws:1.0 | ||
---- | ||
|
||
And then overwrite the existing file with the new content from the container: | ||
|
||
[shource,shell] | ||
---- | ||
curl http://localhost:8080/calculator-ws/CalculatorService?wsdl --output src/main/cxf-codegen-resources/wsdl/CalculatorService.wsdl | ||
---- |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: Why not
-f integration-tests
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cd
tends to be safer for some buggy plugins (e.g. assuming thatPaths.get(".")
always returns${basedir}
). Maybe we do not have any such here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably don't but in the end I don't mind
cd
.