From c17e6371d059d59bb235c816e11dfdbe35264c74 Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Fri, 15 May 2020 10:28:33 +0100 Subject: [PATCH] Disable JAXB related tests --- .../io/quarkus/it/panache/JAXBEntity.java | 35 ------------ .../io/quarkus/it/panache/TestEndpoint.java | 54 ------------------- 2 files changed, 89 deletions(-) delete mode 100644 integration-tests/hibernate-orm-panache/src/main/java/io/quarkus/it/panache/JAXBEntity.java diff --git a/integration-tests/hibernate-orm-panache/src/main/java/io/quarkus/it/panache/JAXBEntity.java b/integration-tests/hibernate-orm-panache/src/main/java/io/quarkus/it/panache/JAXBEntity.java deleted file mode 100644 index 80783566da025..0000000000000 --- a/integration-tests/hibernate-orm-panache/src/main/java/io/quarkus/it/panache/JAXBEntity.java +++ /dev/null @@ -1,35 +0,0 @@ -package io.quarkus.it.panache; - -import javax.persistence.Entity; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElements; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlTransient; - -import io.quarkus.hibernate.orm.panache.PanacheEntity; - -@Entity -@XmlRootElement(name = "JAXBEntity") -@XmlAccessorType(XmlAccessType.NONE) -public class JAXBEntity extends PanacheEntity { - - @XmlAttribute(name = "Named") - public String namedAnnotatedProp; - - @XmlTransient - public String transientProp; - - @XmlAttribute - public String defaultAnnotatedProp; - - @XmlElements({ - @XmlElement(name = "array1"), - @XmlElement(name = "array2") - }) - public String arrayAnnotatedProp; - - public String unAnnotatedProp; -} diff --git a/integration-tests/hibernate-orm-panache/src/main/java/io/quarkus/it/panache/TestEndpoint.java b/integration-tests/hibernate-orm-panache/src/main/java/io/quarkus/it/panache/TestEndpoint.java index ad2c8da8c6615..133733c30dc58 100644 --- a/integration-tests/hibernate-orm-panache/src/main/java/io/quarkus/it/panache/TestEndpoint.java +++ b/integration-tests/hibernate-orm-panache/src/main/java/io/quarkus/it/panache/TestEndpoint.java @@ -23,9 +23,6 @@ import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElements; -import javax.xml.bind.annotation.XmlTransient; import org.hibernate.engine.spi.SelfDirtinessTracker; import org.hibernate.jpa.QueryHints; @@ -1168,57 +1165,6 @@ public String testBug5885() { return "OK"; } - @GET - @Path("testJaxbAnnotationTransfer") - public String testJaxbAnnotationTransfer() throws Exception { - // Test for fix to this bug: https://github.com/quarkusio/quarkus/issues/6021 - - // Ensure that any JAX-B annotations are properly moved to generated getters - Method m = JAXBEntity.class.getMethod("getNamedAnnotatedProp"); - XmlAttribute anno = m.getAnnotation(XmlAttribute.class); - assertNotNull(anno); - assertEquals("Named", anno.name()); - assertNull(m.getAnnotation(XmlTransient.class)); - - m = JAXBEntity.class.getMethod("getDefaultAnnotatedProp"); - anno = m.getAnnotation(XmlAttribute.class); - assertNotNull(anno); - assertEquals("##default", anno.name()); - assertNull(m.getAnnotation(XmlTransient.class)); - - m = JAXBEntity.class.getMethod("getUnAnnotatedProp"); - assertNull(m.getAnnotation(XmlAttribute.class)); - assertNull(m.getAnnotation(XmlTransient.class)); - - m = JAXBEntity.class.getMethod("getTransientProp"); - assertNull(m.getAnnotation(XmlAttribute.class)); - assertNotNull(m.getAnnotation(XmlTransient.class)); - - m = JAXBEntity.class.getMethod("getArrayAnnotatedProp"); - assertNull(m.getAnnotation(XmlTransient.class)); - XmlElements elementsAnno = m.getAnnotation(XmlElements.class); - assertNotNull(elementsAnno); - assertNotNull(elementsAnno.value()); - assertEquals(2, elementsAnno.value().length); - assertEquals("array1", elementsAnno.value()[0].name()); - assertEquals("array2", elementsAnno.value()[1].name()); - - // Ensure that all original fields were labeled @XmlTransient and had their original JAX-B annotations removed - ensureFieldSanitized("namedAnnotatedProp"); - ensureFieldSanitized("transientProp"); - ensureFieldSanitized("defaultAnnotatedProp"); - ensureFieldSanitized("unAnnotatedProp"); - ensureFieldSanitized("arrayAnnotatedProp"); - - return "OK"; - } - - private void ensureFieldSanitized(String fieldName) throws Exception { - Field f = JAXBEntity.class.getField(fieldName); - assertNull(f.getAnnotation(XmlAttribute.class)); - assertNotNull(f.getAnnotation(XmlTransient.class)); - } - @GET @Path("composite") @Transactional