use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev200120.redirect.ipv6.extended.community.RedirectIpv6Builder in project bgpcep by opendaylight.
the class FSExtendedCommunitiesTest method testRedirectIpv6Serializer.
@Test
public void testRedirectIpv6Serializer() {
final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev200120.bgp.rib.route.attributes.extended.communities.extended.community.RedirectIpv6ExtendedCommunityCase redirect = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev200120.bgp.rib.route.attributes.extended.communities.extended.community.RedirectIpv6ExtendedCommunityCaseBuilder().setRedirectIpv6(new RedirectIpv6Builder().setGlobalAdministrator(new Ipv6AddressNoZone("102:304:506:708:90a:b0c:d0e:f10")).setLocalAdministrator(Uint16.valueOf(258)).build()).build();
final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect).setTransitive(true).build();
final ByteBuf output = Unpooled.buffer(REDIRECT_IPV6.length);
this.registry.serializeExtendedCommunity(expected, output);
Assert.assertArrayEquals(REDIRECT_IPV6, output.array());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev200120.redirect.ipv6.extended.community.RedirectIpv6Builder in project bgpcep by opendaylight.
the class FSExtendedCommunitiesTest method testRedirectIpv6Parser.
@Test
public void testRedirectIpv6Parser() throws BGPDocumentedException, BGPParsingException {
final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(new RedirectIpv6ExtendedCommunityCaseBuilder().setRedirectIpv6(new RedirectIpv6Builder().setGlobalAdministrator(new Ipv6AddressNoZone("102:304:506:708:90a:b0c:d0e:f10")).setLocalAdministrator(Uint16.valueOf(258)).build()).build()).setTransitive(true).build();
final ExtendedCommunities parsed = this.registry.parseExtendedCommunity(Unpooled.copiedBuffer(REDIRECT_IPV6));
Assert.assertEquals(expected, parsed);
}
Aggregations