use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.subobject.nai.UnnumberedAdjacencyBuilder in project bgpcep by opendaylight.
the class SrEroSubobjectParserTest method testSrEroSubobjectUnnumberedNAI.
@Test
public void testSrEroSubobjectUnnumberedNAI() throws PCEPDeserializerException {
final SrEroTypeBuilder builder = new SrEroTypeBuilder().setNaiType(NaiType.Unnumbered).setSid(Uint32.valueOf(123456)).setCFlag(false).setMFlag(false).setNai(new UnnumberedAdjacencyBuilder().setLocalNodeId(Uint32.ONE).setLocalInterfaceId(Uint32.valueOf(2)).setRemoteNodeId(Uint32.valueOf(3)).setRemoteInterfaceId(Uint32.valueOf(4)).build());
final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build()).setLoose(false);
assertEquals(subobjBuilder.build(), this.parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(SR_ERO_SUBOBJECT_WITH_UNNUMBERED, 2)), false));
final ByteBuf buffer = Unpooled.buffer();
this.parser.serializeSubobject(subobjBuilder.build(), buffer);
assertArrayEquals(SR_ERO_SUBOBJECT_WITH_UNNUMBERED, ByteArray.getAllBytes(buffer));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.subobject.nai.UnnumberedAdjacencyBuilder in project bgpcep by opendaylight.
the class SrRroSubobjectParserTest method testSrRroSubobjectUnnumberedNAI.
@Test
public void testSrRroSubobjectUnnumberedNAI() throws PCEPDeserializerException {
final SrRroTypeBuilder builder = new SrRroTypeBuilder().setNaiType(NaiType.Unnumbered).setSid(Uint32.valueOf(123456)).setCFlag(false).setMFlag(false).setNai(new UnnumberedAdjacencyBuilder().setLocalNodeId(Uint32.ONE).setLocalInterfaceId(Uint32.TWO).setRemoteNodeId(Uint32.valueOf(3)).setRemoteInterfaceId(Uint32.valueOf(4)).build());
final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build());
assertEquals(subobjBuilder.build(), this.parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(SR_RRO_SUBOBJECT_WIT_UNNUMBERED, 2))));
final ByteBuf buffer = Unpooled.buffer();
this.parser.serializeSubobject(subobjBuilder.build(), buffer);
assertArrayEquals(SR_RRO_SUBOBJECT_WIT_UNNUMBERED, ByteArray.getAllBytes(buffer));
}
Aggregations