- @Test
- public void testSerializeDeserializeAugmentNoref() throws IOException {
- final YangInstanceIdentifier expected = YangInstanceIdentifier.create(
- AugmentationIdentifier.create(ImmutableSet.of(
- QName.create("foo", "leaf1"),
- QName.create("bar", "leaf2"))));
-
- final ByteArrayOutputStream bos = new ByteArrayOutputStream();
- final DataOutput out = new DataOutputStream(bos);
- SerializationUtils.writePath(out, expected);
-
- final byte[] bytes = bos.toByteArray();
- assertEquals(37, bytes.length);
-
- final DataInputStream in = new DataInputStream(new ByteArrayInputStream(bytes));
- final YangInstanceIdentifier read = SerializationUtils.readPath(in);
- assertEquals(expected, read);
- }
-