-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing Jaxb unmarshalling error with native compilation
- Loading branch information
Showing
5 changed files
with
98 additions
and
3 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
24 changes: 24 additions & 0 deletions
24
integration-tests/jaxb/src/main/java/io/quarkus/it/jaxb/BookIBANField.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,24 @@ | ||
package io.quarkus.it.jaxb; | ||
|
||
import jakarta.xml.bind.annotation.XmlAccessType; | ||
import jakarta.xml.bind.annotation.XmlAccessorType; | ||
import jakarta.xml.bind.annotation.XmlElement; | ||
import jakarta.xml.bind.annotation.XmlTransient; | ||
|
||
@XmlAccessorType(XmlAccessType.FIELD) | ||
@XmlTransient | ||
public abstract class BookIBANField { | ||
@XmlElement | ||
private String IBAN; | ||
|
||
public BookIBANField() { | ||
} | ||
|
||
public void setIBAN(String IBAN) { | ||
this.IBAN = IBAN; | ||
} | ||
|
||
public String getIBAN() { | ||
return IBAN; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
integration-tests/jaxb/src/main/java/io/quarkus/it/jaxb/BookWithParent.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,27 @@ | ||
package io.quarkus.it.jaxb; | ||
|
||
import jakarta.xml.bind.annotation.XmlElement; | ||
import jakarta.xml.bind.annotation.XmlRootElement; | ||
import jakarta.xml.bind.annotation.XmlType; | ||
|
||
@XmlRootElement | ||
@XmlType(propOrder = { "IBAN", "title" }) | ||
public class BookWithParent extends BookIBANField { | ||
@XmlElement | ||
private String title; | ||
|
||
public BookWithParent() { | ||
} | ||
|
||
public BookWithParent(String title) { | ||
this.title = title; | ||
} | ||
|
||
public String getTitle() { | ||
return title; | ||
} | ||
|
||
public void setTitle(String title) { | ||
this.title = title; | ||
} | ||
} |
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
18 changes: 17 additions & 1 deletion
18
integration-tests/jaxb/src/test/java/io/quarkus/it/jaxb/JaxbIT.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 |
---|---|---|
@@ -1,8 +1,24 @@ | ||
package io.quarkus.it.jaxb; | ||
|
||
import static io.restassured.RestAssured.given; | ||
import static org.hamcrest.Matchers.is; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import io.quarkus.test.junit.QuarkusIntegrationTest; | ||
|
||
@QuarkusIntegrationTest | ||
public class JaxbIT extends JaxbTest { | ||
|
||
//We have to test native executable of Jaxb | ||
@Test | ||
public void bookWithParent() { | ||
given().when() | ||
.param("name", "Foundation") | ||
.param("iban", "4242") | ||
.get("/jaxb/bookwithparent") | ||
.then() | ||
.statusCode(200) | ||
.body(is( | ||
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><bookWithParent><IBAN>4242</IBAN><title>Foundation</title></bookWithParent>")); | ||
} | ||
} |