generated from quarkiverse/quarkiverse-template
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
quarkus-cxf-saaj native compilation fails when the extension is used …
…in isolation
- Loading branch information
Showing
9 changed files
with
254 additions
and
1 deletion.
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
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,122 @@ | ||
<?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>3.16.0-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>quarkus-cxf-integration-test-saaj</artifactId> | ||
|
||
<name>Quarkus CXF - Integration Test - SAAJ</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-resteasy</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkiverse.cxf</groupId> | ||
<artifactId>quarkus-cxf-saaj</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>io.quarkiverse.cxf</groupId> | ||
<artifactId>quarkus-cxf-test-util</artifactId> | ||
<scope>test</scope> | ||
</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> | ||
<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> | ||
<property> | ||
<name>native</name> | ||
</property> | ||
</activation> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<configuration> | ||
<skipTests>${native.surefire.skip}</skipTests> | ||
</configuration> | ||
</plugin> | ||
<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>virtualDependencies</id> | ||
<activation> | ||
<property> | ||
<name>!noVirtualDependencies</name> | ||
</property> | ||
</activation> | ||
<dependencies> | ||
<!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory --> | ||
<dependency> | ||
<groupId>io.quarkiverse.cxf</groupId> | ||
<artifactId>quarkus-cxf-saaj-deployment</artifactId> | ||
<version>${project.version}</version> | ||
<type>pom</type> | ||
<scope>test</scope> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>*</groupId> | ||
<artifactId>*</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
</dependencies> | ||
</profile> | ||
</profiles> | ||
</project> |
66 changes: 66 additions & 0 deletions
66
integration-tests/saaj/src/main/java/io/quarkiverse/saaj/it/SaajResource.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,66 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.quarkiverse.saaj.it; | ||
|
||
import java.io.ByteArrayOutputStream; | ||
import java.io.IOException; | ||
import java.security.KeyStoreException; | ||
import java.security.NoSuchAlgorithmException; | ||
import java.security.cert.CertificateException; | ||
|
||
import jakarta.enterprise.context.ApplicationScoped; | ||
import jakarta.ws.rs.POST; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.PathParam; | ||
import jakarta.ws.rs.Produces; | ||
import jakarta.ws.rs.core.MediaType; | ||
import jakarta.xml.soap.MessageFactory; | ||
import jakarta.xml.soap.SOAPBody; | ||
import jakarta.xml.soap.SOAPElement; | ||
import jakarta.xml.soap.SOAPEnvelope; | ||
import jakarta.xml.soap.SOAPMessage; | ||
import jakarta.xml.soap.SOAPPart; | ||
|
||
@Path("/saaj") | ||
@ApplicationScoped | ||
public class SaajResource { | ||
|
||
public SaajResource() throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException { | ||
} | ||
|
||
@POST | ||
@Produces(MediaType.TEXT_XML) | ||
@Path("/hello/{person}") | ||
public byte[] hello(@PathParam("person") String person) throws Exception { | ||
MessageFactory messageFactory = MessageFactory.newInstance(); | ||
SOAPMessage soapMessage = messageFactory.createMessage(); | ||
SOAPPart soapPart = soapMessage.getSOAPPart(); | ||
|
||
// Creating envelope and adding content | ||
SOAPEnvelope envelope = soapPart.getEnvelope(); | ||
envelope.addNamespaceDeclaration("hello", "http://saaj.quarkiverse.io/hello"); | ||
|
||
SOAPBody soapBody = envelope.getBody(); | ||
SOAPElement soapBodyElem = soapBody.addChildElement("hello", "hello"); | ||
soapBodyElem.addChildElement("person").addTextNode(person); | ||
soapMessage.saveChanges(); | ||
ByteArrayOutputStream out = new ByteArrayOutputStream(); | ||
soapMessage.writeTo(out); | ||
return out.toByteArray(); | ||
} | ||
|
||
} |
Empty file.
7 changes: 7 additions & 0 deletions
7
integration-tests/saaj/src/test/java/io/quarkiverse/saaj/it/SaajIT.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,7 @@ | ||
package io.quarkiverse.saaj.it; | ||
|
||
import io.quarkus.test.junit.QuarkusIntegrationTest; | ||
|
||
@QuarkusIntegrationTest | ||
public class SaajIT extends SaajTest { | ||
} |
29 changes: 29 additions & 0 deletions
29
integration-tests/saaj/src/test/java/io/quarkiverse/saaj/it/SaajTest.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,29 @@ | ||
package io.quarkiverse.saaj.it; | ||
|
||
import static io.quarkiverse.cxf.test.QuarkusCxfClientTestUtil.anyNs; | ||
import static io.restassured.RestAssured.given; | ||
|
||
import org.hamcrest.CoreMatchers; | ||
import org.hamcrest.Matchers; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import io.quarkus.test.junit.QuarkusTest; | ||
|
||
@QuarkusTest | ||
public class SaajTest { | ||
|
||
@Test | ||
public void ping() { | ||
given() | ||
.when() | ||
.post("/saaj/hello/Joe") | ||
.then() | ||
.statusCode(200) | ||
.body( | ||
Matchers.hasXPath( | ||
anyNs("Envelope", "Body", "hello", "person") | ||
+ "/text()", | ||
CoreMatchers.is("Joe"))); | ||
} | ||
|
||
} |
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,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<PurchaseOrder xmlns="urn:example:po"> | ||
<Items> | ||
<Item Code="001-001-001" Quantity="1"> | ||
spade | ||
</Item> | ||
<Item Code="001-001-002" Quantity="1"> | ||
shovel | ||
</Item> | ||
</Items> | ||
<ShippingAddress> | ||
Dig PLC, 1 First Ave, Dublin 1, Ireland | ||
</ShippingAddress> | ||
<PaymentInfo> | ||
<BillingAddress> | ||
Dig PLC, 1 First Ave, Dublin 1, Ireland | ||
</BillingAddress> | ||
<CreditCard Type="Amex"> | ||
<Name>Foo B Baz</Name> | ||
<Number>1234 567890 12345</Number> | ||
<Expires Month="1" Year="2005" /> | ||
</CreditCard> | ||
</PaymentInfo> | ||
</PurchaseOrder> |