use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.Attributes in project bgpcep by opendaylight.
the class PMSITunnelAttributeHandlerTest method testMldpP2MpLsp.
@Test
public void testMldpP2MpLsp() throws Exception {
final Attributes expectedIpv4Att = buildMldpP2mpLspIpv4Attribute();
final ByteBuf actualIpv4 = Unpooled.buffer();
this.handler.serializeAttribute(expectedIpv4Att, actualIpv4);
assertArrayEquals(M_LDP_P2MP_LSP_EXPECTED_IPV4, ByteArray.readAllBytes(actualIpv4));
final Attributes actualIpv4Attribute = this.handler.parseAttributes(Unpooled.wrappedBuffer(M_LDP_P2MP_LSP_EXPECTED_IPV4_2), null).getAttributes();
assertEquals(expectedIpv4Att, actualIpv4Attribute);
final Attributes expectedIpv6Att = buildMldpP2mpLspIpv6Attribute();
final ByteBuf actualIpv6 = Unpooled.buffer();
this.handler.serializeAttribute(expectedIpv6Att, actualIpv6);
assertArrayEquals(M_LDP_P2MP_LSP_EXPECTED_IPV6, ByteArray.readAllBytes(actualIpv6));
final Attributes actualIpv6Attribute = this.handler.parseAttributes(Unpooled.wrappedBuffer(M_LDP_P2MP_LSP_EXPECTED_IPV6), null).getAttributes();
assertEquals(expectedIpv6Att, actualIpv6Attribute);
final ByteBuf actualL2vpn = Unpooled.buffer();
this.handler.serializeAttribute(buildNoSupportedFamilyAttribute(), actualL2vpn);
assertArrayEquals(new byte[0], ByteArray.readAllBytes(actualIpv4));
final Attributes actualWrongFamily = this.handler.parseAttributes(Unpooled.wrappedBuffer(M_LDP_P2MP_LSP_EXPECTED_WRONG_FAMILY), null).getAttributes();
assertEquals(buildWOTunnelInfAttribute(), actualWrongFamily);
final Attributes expectedL2vpnAtt = buildMldpp2MPLspL2vpnAttribute();
final Attributes actualL2vpnAttribute = this.handler.parseAttributes(Unpooled.wrappedBuffer(M_LDP_P2MP_LSP_EXPECTED_L2VPN), null).getAttributes();
assertEquals(expectedL2vpnAtt, actualL2vpnAttribute);
final ByteBuf actualL2vp = Unpooled.buffer();
this.handler.serializeAttribute(expectedL2vpnAtt, actualL2vp);
assertArrayEquals(M_LDP_P2MP_LSP_EXPECTED_L2VPN, ByteArray.readAllBytes(actualL2vp));
final ByteBuf actualNonSupportedOpaques = Unpooled.buffer();
this.handler.serializeAttribute(buildNoSupportedOpaqueAttribute(), actualNonSupportedOpaques);
assertArrayEquals(NO_TUNNEL_INFORMATION_PRESENT_EXPECTED, ByteArray.readAllBytes(actualNonSupportedOpaques));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.Attributes in project bgpcep by opendaylight.
the class PMSITunnelAttributeHandlerTest method testPimSMTree.
@Test
public void testPimSMTree() throws Exception {
final Attributes attributes = buildPimSMTreeAttribute();
final ByteBuf actual = Unpooled.buffer();
this.handler.serializeAttribute(attributes, actual);
assertArrayEquals(PIM_SM_TREE_EXPECTED, ByteArray.readAllBytes(actual));
final Attributes expected = buildPimSMTreeAttribute();
final Attributes actualAttr = this.handler.parseAttributes(Unpooled.wrappedBuffer(PIM_SM_TREE_EXPECTED), null).getAttributes();
assertEquals(expected, actualAttr);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.Attributes in project bgpcep by opendaylight.
the class PMSITunnelAttributeHandlerTest method serializePimSSMTree.
@Test
public void serializePimSSMTree() {
final Attributes attributes = buildPimSSMTreeAttribute();
final ByteBuf actual = Unpooled.buffer();
this.handler.serializeAttribute(attributes, actual);
assertArrayEquals(PIM_SSM_TREE_EXPECTED, ByteArray.readAllBytes(actual));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.Attributes in project bgpcep by opendaylight.
the class PMSITunnelAttributeHandlerTest method parsePimSSMTree.
@Test
public void parsePimSSMTree() throws Exception {
final Attributes expected = buildPimSSMTreeAttribute();
final Attributes actual = this.handler.parseAttributes(Unpooled.wrappedBuffer(PIM_SSM_TREE_EXPECTED), null).getAttributes();
assertEquals(expected, actual);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.Attributes in project bgpcep by opendaylight.
the class PMSITunnelAttributeHandlerTest method testIngressReplication.
@Test
public void testIngressReplication() throws Exception {
final Attributes expected = buildIngressReplicationAttribute();
final ByteBuf actual = Unpooled.buffer();
this.handler.serializeAttribute(expected, actual);
assertArrayEquals(INGRESS_REPLICATION_EXPECTED, ByteArray.readAllBytes(actual));
final Attributes actualAttr = this.handler.parseAttributes(Unpooled.wrappedBuffer(INGRESS_REPLICATION_EXPECTED), null).getAttributes();
assertEquals(expected, actualAttr);
}
Aggregations