use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.rib.tables.Attributes in project bgpcep by opendaylight.
the class EvpnNlriAttributesParserTest method testAttributes1.
@Test
public void testAttributes1() throws BGPParsingException {
final ByteBuf buffer = Unpooled.buffer();
final Attributes att = new AttributesBuilder().addAugmentation(Attributes1.class, new Attributes1Builder().setMpReachNlri(createReach()).build()).build();
this.parser.serializeAttribute(att, buffer);
Assert.assertArrayEquals(IncMultEthTagRParserTest.RESULT, ByteArray.getAllBytes(buffer));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.rib.tables.Attributes in project bgpcep by opendaylight.
the class EvpnRibSupportTest method testBuildMpUnreachNlriUpdate.
@Test
public void testBuildMpUnreachNlriUpdate() {
final Update update = RIB_SUPPORT.buildUpdate(Collections.emptyList(), createRoutes(EVPN_ROUTES), ATTRIBUTES);
assertEquals(UNREACH_NLRI, update.getAttributes().getAugmentation(Attributes2.class).getMpUnreachNlri().getWithdrawnRoutes().getDestinationType());
assertNull(update.getAttributes().getAugmentation(Attributes1.class));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.rib.tables.Attributes in project bgpcep by opendaylight.
the class PMSITunnelAttributeHandlerTest method testMldpmP2MpLsp.
@Test
public void testMldpmP2MpLsp() throws Exception {
final Attributes expected = buildMLDpMp2mPLspAttribute();
final ByteBuf actual = Unpooled.buffer();
this.handler.serializeAttribute(expected, actual);
assertArrayEquals(M_LDP_MP_2_MP_LSP_EXPECTED, ByteArray.readAllBytes(actual));
final Attributes actualAttr = this.handler.parseAttributes(Unpooled.wrappedBuffer(M_LDP_MP_2_MP_LSP_EXPECTED), null);
assertEquals(expected, actualAttr);
final Attributes actualWrong = this.handler.parseAttributes(Unpooled.wrappedBuffer(M_LDP_MP_2_MP_LSP_WRONG), null);
assertEquals(buildWOTunnelInfAttribute(), actualWrong);
final Attributes wrongAttribute = buildMldpMP2mpLspWrongAttribute();
final ByteBuf actualWrongBuf = Unpooled.buffer();
this.handler.serializeAttribute(wrongAttribute, actualWrongBuf);
assertArrayEquals(NO_TUNNEL_INFORMATION_PRESENT_EXPECTED, ByteArray.readAllBytes(actualWrongBuf));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.rib.tables.Attributes in project bgpcep by opendaylight.
the class PMSITunnelAttributeHandlerTest method testRsvpteP2MplspLsp.
@Test
public void testRsvpteP2MplspLsp() throws Exception {
final Attributes expected = buildRsvpTep2MPLspAttribute();
final ByteBuf actual = Unpooled.buffer();
this.handler.serializeAttribute(expected, actual);
assertArrayEquals(RSVP_TE_P2MP_LSP_LSP_EXPECTED, ByteArray.readAllBytes(actual));
final Attributes actualAttr = this.handler.parseAttributes(Unpooled.wrappedBuffer(RSVP_TE_P2MP_LSP_LSP_EXPECTED), null);
assertEquals(expected, actualAttr);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.rib.tables.Attributes in project bgpcep by opendaylight.
the class PMSITunnelAttributeHandlerTest method testPMSITunnelAttributeParser.
@Test
public void testPMSITunnelAttributeParser() {
final PMSITunnelAttributeHandler pmsiHandler = new PMSITunnelAttributeHandler(ServiceLoaderBGPExtensionProviderContext.getSingletonInstance().getAddressFamilyRegistry());
assertEquals(22, pmsiHandler.getType());
final AttributesBuilder builder = new AttributesBuilder();
final ByteBuf emptyBuffer = Unpooled.buffer();
pmsiHandler.parseAttribute(emptyBuffer, builder);
final Attributes emptyAttributes = new AttributesBuilder().build();
assertEquals(emptyAttributes, builder.build());
pmsiHandler.serializeAttribute(emptyAttributes, emptyBuffer);
assertEquals(Unpooled.buffer(), emptyBuffer);
}
Aggregations