XmlNodeConverter implements NodeConverter { @Override public Writer serializeData(final SchemaNode schemaNode, final NormalizedNode<?, ?> normalizedNode) throws SerializationException { Writer writer = new StringWriter(); try (NormalizedNodeWriter normalizedNodeWriter = createNormalizedNodeWriter(schemaContext, writer, schemaNode.getPath())) { normalizedNodeWriter.write(normalizedNode); normalizedNodeWriter.flush(); } catch (IOException ioe) { throw new SerializationException(ioe); } return writer; } XmlNodeConverter(final SchemaContext schemaContext); @Override Writer serializeData(final SchemaNode schemaNode, final NormalizedNode<?, ?> normalizedNode); @Override Writer serializeRpc(final SchemaNode schemaNode, final NormalizedNode<?, ?> normalizedNode); @Override NormalizedNode<?, ?> deserialize(final SchemaNode schemaNode, final Reader inputData); static void closeQuietly(final XMLStreamReader xmlStreamReader);  }
@Test public void testSerializeData() throws Exception { Writer serializeData = bindingSerializer.serializeData(schemaContext, testedToasterNormalizedNodes); Assert.assertFalse(Strings.isNullOrEmpty(serializeData.toString())); LOG.info(serializeData.toString()); }
@Test public void testSerializeData_list() throws SerializationException { SchemaNode schemaNode = ConverterUtils.getSchemaNode(schemaContext, SAMPLES_NAMESPACE, SAMPLES_REVISION, "sample-list"); Writer serializedData = bindingSerializer.serializeData(schemaNode, testedSampleListNormalizedNodes); Assert.assertNotNull(serializedData.toString()); }