use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.rib.tables.AttributesBuilder in project bgpcep by opendaylight.
the class MatchBgpNeighborSetTest method testMatchFromBgpNeighborAny.
@Test
public void testMatchFromBgpNeighborAny() {
Statement statement = this.basicStatements.stream().filter(st -> st.getName().equals("reject-from-neighbor-test")).findFirst().get();
RouteAttributeContainer attributeContainer = routeAttributeContainerFalse(new AttributesBuilder().build());
doReturn(new PeerId("bgp://42.42.42.42")).when(this.exportParameters).getFromPeerId();
RouteAttributeContainer result = this.statementRegistry.applyExportStatement(this.baseAttributes, this.exportParameters, attributeContainer, statement);
assertNotNull(result.getAttributes());
doReturn(new PeerId("bgp://127.0.0.1")).when(this.exportParameters).getFromPeerId();
result = this.statementRegistry.applyExportStatement(this.baseAttributes, this.exportParameters, attributeContainer, statement);
assertNull(result.getAttributes());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.rib.tables.AttributesBuilder in project bgpcep by opendaylight.
the class MatchCommunityTest method testComAny.
@Test
public void testComAny() {
Statement statement = this.basicStatements.stream().filter(st -> st.getName().equals("community-any-test")).findFirst().get();
RouteAttributeContainer attributeContainer = routeAttributeContainerFalse(new AttributesBuilder().build());
RouteAttributeContainer result = this.statementRegistry.applyExportStatement(this.baseAttributes, this.exportParameters, attributeContainer, statement);
assertNotNull(result.getAttributes());
attributeContainer = routeAttributeContainerFalse(new AttributesBuilder().setCommunities(Collections.singletonList(new CommunitiesBuilder().setAsNumber(AsNumber.getDefaultInstance("65")).setSemantics(10).build())).build());
result = this.statementRegistry.applyExportStatement(this.baseAttributes, this.exportParameters, attributeContainer, statement);
assertNull(result.getAttributes());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.rib.tables.AttributesBuilder in project bgpcep by opendaylight.
the class MatchCommunityTest method testComInvert.
@Test
public void testComInvert() {
Statement statement = this.basicStatements.stream().filter(st -> st.getName().equals("community-invert-test")).findFirst().get();
RouteAttributeContainer attributeContainer = routeAttributeContainerFalse(new AttributesBuilder().build());
RouteAttributeContainer result = this.statementRegistry.applyExportStatement(this.baseAttributes, this.exportParameters, attributeContainer, statement);
assertNull(result.getAttributes());
attributeContainer = routeAttributeContainerFalse(new AttributesBuilder().setCommunities(Collections.singletonList(new CommunitiesBuilder().setAsNumber(AsNumber.getDefaultInstance("65")).setSemantics(10).build())).build());
result = this.statementRegistry.applyExportStatement(this.baseAttributes, this.exportParameters, attributeContainer, statement);
assertNotNull(result.getAttributes());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.rib.tables.AttributesBuilder in project bgpcep by opendaylight.
the class SetCommunityTest method testReferenceReplace.
@Test
public void testReferenceReplace() {
Statement statement = this.basicStatements.stream().filter(st -> st.getName().equals("set-community-reference-replace-test")).findFirst().get();
RouteAttributeContainer attributeContainer = routeAttributeContainerFalse(new AttributesBuilder().build());
RouteAttributeContainer result = this.statementRegistry.applyExportStatement(this.baseAttributes, this.exportParameters, attributeContainer, statement);
assertEquals(this.multipleCom, result.getAttributes());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.rib.tables.AttributesBuilder in project bgpcep by opendaylight.
the class SetExtCommunityTest method testInlineReplace.
@Test
public void testInlineReplace() {
Statement statement = this.basicStatements.stream().filter(st -> st.getName().equals("set-ext-community-inline-replace-test")).findFirst().get();
RouteAttributeContainer attributeContainer = routeAttributeContainerFalse(new AttributesBuilder().build());
RouteAttributeContainer result = this.statementRegistry.applyExportStatement(this.baseAttributes, this.exportParameters, attributeContainer, statement);
assertEquals(this.multipleExtCom, result.getAttributes());
}
Aggregations