use of org.apache.cxf.aegis.services.XmlMappedAttributeBean in project cxf by apache.
the class QualificationTest method testXmlDefaultQualifiedAttribute.
@Test
public void testXmlDefaultQualifiedAttribute() throws Exception {
AegisContext context = new AegisContext();
TypeCreationOptions typeCreationOptions = new TypeCreationOptions();
typeCreationOptions.setQualifyAttributes(true);
context.setTypeCreationOptions(typeCreationOptions);
context.initialize();
TypeMapping mapping = context.getTypeMapping();
AegisType type = mapping.getTypeCreator().createType(XmlMappedAttributeBean.class);
type.setSchemaType(new QName("urn:Bean", "bean"));
Context messageContext = new Context(context);
XmlMappedAttributeBean bean = new XmlMappedAttributeBean();
Element element = writeObjectToElement(type, bean, messageContext);
assertValid("/b:root[@pkg:attrXmlString]", element);
assertXPathEquals("/b:root/@pkg:attrXmlString", "attrXml", element);
}
use of org.apache.cxf.aegis.services.XmlMappedAttributeBean in project cxf by apache.
the class QualificationTest method testXmlDefaultUnqualifiedAttribute.
@Test
public void testXmlDefaultUnqualifiedAttribute() throws Exception {
AegisContext context = new AegisContext();
context.initialize();
TypeMapping mapping = context.getTypeMapping();
AegisType type = mapping.getTypeCreator().createType(XmlMappedAttributeBean.class);
type.setSchemaType(new QName("urn:Bean", "bean"));
Context messageContext = new Context(context);
XmlMappedAttributeBean bean = new XmlMappedAttributeBean();
Element element = writeObjectToElement(type, bean, messageContext);
assertValid("/b:root[@attrXmlString]", element);
assertXPathEquals("/b:root/@attrXmlString", "attrXml", element);
}
Aggregations