use of org.apache.cxf.aegis.type.basic.StringType in project cxf by apache.
the class StandaloneWriteTest method testBasicTypeWrite.
@Test
public void testBasicTypeWrite() throws Exception {
context = new AegisContext();
context.initialize();
AegisWriter<XMLStreamWriter> writer = context.createXMLStreamWriter();
StringWriter stringWriter = new StringWriter();
XMLStreamWriter xmlWriter = xmlOutputFactory.createXMLStreamWriter(stringWriter);
writer.write("ball-of-yarn", new QName("urn:meow", "cat-toy"), false, xmlWriter, new StringType());
xmlWriter.close();
String xml = stringWriter.toString();
XMLStreamReader reader = xmlInputFactory.createXMLStreamReader(new StringReader(xml));
reader.nextTag();
assertEquals("urn:meow", reader.getNamespaceURI());
assertEquals("cat-toy", reader.getLocalName());
reader.next();
String text = reader.getText();
assertEquals("ball-of-yarn", text);
}
Aggregations