CorbaConstants.NT_CORBA_BOOLEAN,
orb.get_primitive_tc(TCKind.tk_boolean),
null);
obj.setValueFromData("false");
XMLInputFactory inputFactory = XMLInputFactory.newInstance();
XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE);
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
XMLEventWriter evtWriter = null;
try {
evtWriter = outputFactory.createXMLEventWriter(outStream);
} catch (XMLStreamException ex) {
}
assertNotNull(evtWriter);
try {
XMLEventFactory factory = XMLEventFactory.newInstance();
StartElement startEl = factory.createStartElement(obj.getName(), null, null);
evtWriter.add(startEl);
staxObject.writeObjectToStax(obj, evtWriter, factory);
EndElement endEl = factory.createEndElement(obj.getName(), null);
evtWriter.add(endEl);
evtWriter.flush();
} catch (XMLStreamException ex) {
}
ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());
XMLEventReader evtReader = null;
try {
evtReader = inputFactory.createXMLEventReader(inStream);
// read the first tag which should be a start document
XMLEvent evt = evtReader.nextEvent();
assertTrue(evt.isStartDocument());
} catch (XMLStreamException ex) {
}