use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.routes.linkstate.routes.LinkstateRouteBuilder in project bgpcep by opendaylight.
the class UriBuilderTest method test.
@Test
public void test() {
final LinkstateRouteBuilder routeB = new LinkstateRouteBuilder().setProtocolId(ProtocolId.Direct).setIdentifier(new Identifier(BigInteger.TEN));
final UriBuilder a = new UriBuilder(routeB.build());
assertEquals("bgpls://Direct:10/", a.toString());
routeB.setDistinguisher(new RouteDistinguisher(BigInteger.ONE));
final UriBuilder b = new UriBuilder(routeB.build());
assertEquals("bgpls://1:Direct:10/", b.toString());
final UriBuilder c = new UriBuilder(b, "foo");
assertEquals("bgpls://1:Direct:10/type=foo", c.toString());
a.add("foo", 25L);
assertEquals("bgpls://Direct:10/&foo=25", a.toString());
final LinkCaseBuilder linkB = new LinkCaseBuilder();
linkB.setLinkDescriptors(new LinkDescriptorsBuilder().setIpv4InterfaceAddress(new Ipv4InterfaceIdentifier("127.0.0.1")).setIpv4NeighborAddress(new Ipv4InterfaceIdentifier("20.20.20.20")).setMultiTopologyId(new TopologyIdentifier(55)).setLinkLocalIdentifier(1L).setLinkRemoteIdentifier(2L).build());
final LocalNodeDescriptorsBuilder nodeB = new LocalNodeDescriptorsBuilder();
nodeB.setAsNumber(new AsNumber(12L)).setDomainId(new DomainIdentifier(15L)).setAreaId(new AreaIdentifier(17L));
nodeB.setCRouterIdentifier(new OspfNodeCaseBuilder().setOspfNode(new OspfNodeBuilder().setOspfRouterId(22L).build()).build());
linkB.setLocalNodeDescriptors(nodeB.build());
final RemoteNodeDescriptorsBuilder nodeR = new RemoteNodeDescriptorsBuilder();
nodeR.setCRouterIdentifier(new IsisPseudonodeCaseBuilder().setIsisPseudonode(new IsisPseudonodeBuilder().setIsIsRouterIdentifier(new IsIsRouterIdentifierBuilder().setIsoSystemId(new IsoSystemIdentifier(new byte[] { 1, 2, 3, 4, 5, 6 })).build()).setPsn((short) 2).build()).build());
linkB.setRemoteNodeDescriptors(nodeR.build());
c.add(linkB.build());
assertEquals("bgpls://1:Direct:10/type=foo&local-as=12&local-domain=15&local-area=17&local-router=22" + "&remote-router=0102.0304.0506.02&ipv4-iface=127.0.0.1&ipv4-neigh=20.20.20.20&mt=55&local-id=1&" + "remote-id=2", c.toString());
}
Aggregations