Skip to content

Commit

Permalink
Disable JAXB related tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanne committed May 15, 2020
1 parent 091a47f commit c17e637
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 89 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c17e637

Please sign in to comment.