Search in sources :

Example 1 with UnnumberedAdjacencyBuilder

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));
}
Also used : SrEroTypeBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.add.lsp.input.arguments.ero.subobject.subobject.type.SrEroTypeBuilder) UnnumberedAdjacencyBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.subobject.nai.UnnumberedAdjacencyBuilder) ByteBuf(io.netty.buffer.ByteBuf) SubobjectBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit.route.object.ero.SubobjectBuilder) Test(org.junit.Test)

Example 2 with UnnumberedAdjacencyBuilder

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));
}
Also used : UnnumberedAdjacencyBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.subobject.nai.UnnumberedAdjacencyBuilder) ByteBuf(io.netty.buffer.ByteBuf) SrRroTypeBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.add.lsp.input.arguments.rro.subobject.subobject.type.SrRroTypeBuilder) SubobjectBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.reported.route.object.rro.SubobjectBuilder) Test(org.junit.Test)

Aggregations

ByteBuf (io.netty.buffer.ByteBuf)2 Test (org.junit.Test)2 UnnumberedAdjacencyBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.subobject.nai.UnnumberedAdjacencyBuilder)2 SrEroTypeBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.add.lsp.input.arguments.ero.subobject.subobject.type.SrEroTypeBuilder)1 SrRroTypeBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.add.lsp.input.arguments.rro.subobject.subobject.type.SrRroTypeBuilder)1 SubobjectBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit.route.object.ero.SubobjectBuilder)1 SubobjectBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.reported.route.object.rro.SubobjectBuilder)1