use of org.eclipse.persistence.jaxb.TypeMappingInfo in project eclipselink by eclipse-ee4j.
the class EmptyClassTestCases method getTypeMappingInfos.
protected TypeMappingInfo[] getTypeMappingInfos() throws Exception {
if (typeMappingInfos == null) {
typeMappingInfos = new TypeMappingInfo[1];
TypeMappingInfo tpi = new TypeMappingInfo();
tpi.setXmlTagName(new QName("", "testTagname"));
tpi.setElementScope(ElementScope.Global);
tpi.setType(Person.class);
typeMappingInfos[0] = tpi;
}
return typeMappingInfos;
}
use of org.eclipse.persistence.jaxb.TypeMappingInfo in project eclipselink by eclipse-ee4j.
the class TypeMappingInfoNullTypeTestCases method testNullTypeNullTagName.
public void testNullTypeNullTagName() throws Exception {
TypeMappingInfo[] tmis = new TypeMappingInfo[1];
TypeMappingInfo tmi = new TypeMappingInfo();
tmi.setType(null);
tmis[0] = tmi;
try {
JAXBContext ctx = org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(tmis, null, Thread.currentThread().getContextClassLoader());
} catch (JAXBException ex) {
assertEquals(JAXBException.NULL_TYPE_ON_TYPEMAPPINGINFO, ex.getErrorCode());
return;
}
fail("A JAXBException should have happened but didn't");
}
use of org.eclipse.persistence.jaxb.TypeMappingInfo in project eclipselink by eclipse-ee4j.
the class TypeMappingInfoNullTypeTestCases method testNullTypeNonNullTagName.
public void testNullTypeNonNullTagName() throws Exception {
TypeMappingInfo[] tmis = new TypeMappingInfo[1];
TypeMappingInfo tmi = new TypeMappingInfo();
tmi.setType(null);
QName tagname = new QName("someUri", "someLocalName");
tmi.setXmlTagName(tagname);
tmis[0] = tmi;
try {
JAXBContext ctx = org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(tmis, null, Thread.currentThread().getContextClassLoader());
} catch (JAXBException ex) {
assertEquals(JAXBException.NULL_TYPE_ON_TYPEMAPPINGINFO, ex.getErrorCode());
return;
}
fail("A JAXBException should have happened but didn't");
}
use of org.eclipse.persistence.jaxb.TypeMappingInfo in project eclipselink by eclipse-ee4j.
the class PrimitiveIntArrayTestsCases method getTypeMappingInfos.
protected TypeMappingInfo[] getTypeMappingInfos() throws Exception {
if (typeMappingInfos == null) {
typeMappingInfos = new TypeMappingInfo[1];
TypeMappingInfo tmi = new TypeMappingInfo();
tmi.setXmlTagName(new QName("http://jaxb.dev.java.net/array", "testTagName"));
tmi.setElementScope(ElementScope.Global);
tmi.setType(getClass().getField("intArrayField").getGenericType());
typeMappingInfos[0] = tmi;
}
return typeMappingInfos;
}
use of org.eclipse.persistence.jaxb.TypeMappingInfo in project eclipselink by eclipse-ee4j.
the class StringArrayTestsCases method getTypeMappingInfos.
protected TypeMappingInfo[] getTypeMappingInfos() throws Exception {
if (typeMappingInfos == null) {
typeMappingInfos = new TypeMappingInfo[1];
TypeMappingInfo tmi = new TypeMappingInfo();
tmi.setXmlTagName(new QName("http://jaxb.dev.java.net/array", "testTagName"));
tmi.setElementScope(ElementScope.Global);
tmi.setType(getClass().getField("stringArrayField").getGenericType());
typeMappingInfos[0] = tmi;
}
return typeMappingInfos;
}
Aggregations