use of org.onosproject.net.domain.DomainPointToPointIntent in project onos by opennetworkinglab.
the class LinkCollectionIntentCompilerDomainP2PTest method testCompilationSingleDeviceDomainP2P.
/**
* We test the proper compilation of one domain device.
*/
@Test
public void testCompilationSingleDeviceDomainP2P() {
intent = LinkCollectionIntent.builder().appId(APP_ID).selector(selector).treatment(treatment).applyTreatmentOnEgress(true).links(p2pLinks).filteredIngressPoints(ImmutableSet.of(new FilteredConnectPoint(d1p10))).filteredEgressPoints(ImmutableSet.of(new FilteredConnectPoint(d3p10))).constraints(domainConstraint).build();
sut.activate();
List<Intent> compiled = sut.compile(intent, Collections.emptyList());
assertThat(compiled, hasSize(2));
DomainPointToPointIntent domainIntent = ((DomainPointToPointIntent) compiled.get(0));
ConnectPoint ingress = domainIntent.filteredIngressPoints().iterator().next().connectPoint();
assertThat(ingress, equalTo(d2p0));
ConnectPoint egress = domainIntent.filteredEgressPoints().iterator().next().connectPoint();
assertThat(egress, equalTo(d2p1));
assertThat(domainIntent.links(), hasSize(0));
Collection<FlowRule> rules = ((FlowRuleIntent) compiled.get(1)).flowRules();
assertThat(rules, hasSize(2));
sut.deactivate();
}
use of org.onosproject.net.domain.DomainPointToPointIntent in project onos by opennetworkinglab.
the class DomainIntentInstallerTest method createAnotherDomainIntents.
/**
* Create another domain Intents.
*
* @return the domain Intents
*/
private List<Intent> createAnotherDomainIntents() {
FilteredConnectPoint ingress = new FilteredConnectPoint(CP1);
FilteredConnectPoint egress = new FilteredConnectPoint(CP3);
DomainPointToPointIntent intent = DomainPointToPointIntent.builder().appId(APP_ID).key(KEY1).priority(DEFAULT_PRIORITY).filteredIngressPoint(ingress).filteredEgressPoint(egress).links(ImmutableList.of()).build();
return ImmutableList.of(intent);
}
Aggregations