- @Test
- public void testInMemoryTestModelProtoBuffEncoding() throws Exception {
-
- SimpleNormalizedNodeMessage.NormalizedNodeXml nnXml =
- EncoderDecoderUtil.encode(parseTestSchema("/odl-datastore-test.yang"),
- TestModel.createFamily());
-
- Document convertedDoc =
- EncoderDecoderUtil.factory.newDocumentBuilder().parse(
- new ByteArrayInputStream(nnXml.getXmlString().getBytes("utf-8")));
- System.out.println(toString(convertedDoc.getDocumentElement()));
-
- // now we will try to convert xml back to normalize node.
- ContainerNode cn =
- (ContainerNode) EncoderDecoderUtil.decode(
- parseTestSchema("/odl-datastore-test.yang"), nnXml);
- junit.framework.Assert.assertEquals(TestModel.createFamily(), cn);
-
-
- }