use of org.onosproject.net.intent.ResourceContext in project onos by opennetworkinglab.
the class LatencyConstraintTest method setUp.
@Before
public void setUp() {
resourceContext = createMock(ResourceContext.class);
Annotations annotations1 = DefaultAnnotations.builder().set(LATENCY, LATENCY1).build();
Annotations annotations2 = DefaultAnnotations.builder().set(LATENCY, LATENCY2).build();
link1 = DefaultLink.builder().providerId(PROVIDER_ID).src(cp(DID1, PN1)).dst(cp(DID2, PN2)).type(DIRECT).annotations(annotations1).build();
link2 = DefaultLink.builder().providerId(PROVIDER_ID).src(cp(DID2, PN3)).dst(cp(DID3, PN4)).type(DIRECT).annotations(annotations2).build();
path = new DefaultPath(PROVIDER_ID, Arrays.asList(link1, link2), ScalarWeight.toWeight(10));
}
use of org.onosproject.net.intent.ResourceContext in project onos by opennetworkinglab.
the class WaypointConstraintTest method setUp.
@Before
public void setUp() {
resourceContext = createMock(ResourceContext.class);
link1 = DefaultLink.builder().providerId(PROVIDER_ID).src(cp(DID1, PN1)).dst(cp(DID2, PN2)).type(DIRECT).build();
link2 = DefaultLink.builder().providerId(PROVIDER_ID).src(cp(DID2, PN3)).dst(cp(DID3, PN4)).type(DIRECT).build();
path = new DefaultPath(PROVIDER_ID, Arrays.asList(link1, link2), ScalarWeight.toWeight(10));
}
use of org.onosproject.net.intent.ResourceContext in project onos by opennetworkinglab.
the class AnnotationConstraintTest method setUp.
@Before
public void setUp() {
resourceContext = createMock(ResourceContext.class);
DefaultAnnotations annotations = DefaultAnnotations.builder().set(KEY, String.valueOf(VALUE)).build();
link = DefaultLink.builder().providerId(PID).src(cp(DID1, PID1)).dst(cp(DID2, PID2)).type(DIRECT).annotations(annotations).build();
}
use of org.onosproject.net.intent.ResourceContext in project onos by opennetworkinglab.
the class ObstacleConstraintTest method setUp.
@Before
public void setUp() {
resourceContext = createMock(ResourceContext.class);
link1 = DefaultLink.builder().providerId(PROVIDER_ID).src(cp(DID1, PN1)).dst(cp(DID2, PN2)).type(DIRECT).build();
link2 = DefaultLink.builder().providerId(PROVIDER_ID).src(cp(DID2, PN3)).dst(cp(DID3, PN4)).type(DIRECT).build();
host1 = new DefaultHost(PROVIDER_ID, HostId.hostId("00:00:00:00:00:01/None"), MacAddress.valueOf(0), VlanId.vlanId(), new HostLocation(DID5, PN1, 1), ImmutableSet.of(), DefaultAnnotations.EMPTY);
host2 = new DefaultHost(PROVIDER_ID, HostId.hostId("00:00:00:00:00:02/None"), MacAddress.valueOf(0), VlanId.vlanId(), new HostLocation(DID6, PN1, 1), ImmutableSet.of(), DefaultAnnotations.EMPTY);
edgelink1 = createEdgeLink(host1, true);
edgelink2 = createEdgeLink(host2, false);
path = new DefaultPath(PROVIDER_ID, Arrays.asList(link1, link2), ScalarWeight.toWeight(10));
pathWithEdgeLink = new DefaultPath(PROVIDER_ID, Arrays.asList(edgelink1, link1, link2, edgelink2), ScalarWeight.toWeight(10));
}
use of org.onosproject.net.intent.ResourceContext in project onos by opennetworkinglab.
the class MeteredConstraintTest method setUp.
@Before
public void setUp() {
resourceContext = createMock(ResourceContext.class);
Annotations annotations1 = DefaultAnnotations.builder().set(METERED, METERED1).build();
Annotations annotations2 = DefaultAnnotations.builder().set(METERED, METERED2).build();
meteredLink = DefaultLink.builder().providerId(PROVIDER_ID).src(cp(DID1, PN1)).dst(cp(DID2, PN2)).type(DIRECT).annotations(annotations1).build();
nonMeteredLink = DefaultLink.builder().providerId(PROVIDER_ID).src(cp(DID2, PN3)).dst(cp(DID3, PN4)).type(DIRECT).annotations(annotations2).build();
unAnnotatedLink = DefaultLink.builder().providerId(PROVIDER_ID).src(cp(DID1, PN5)).dst(cp(DID3, PN6)).type(DIRECT).build();
meteredPath = new DefaultPath(PROVIDER_ID, Arrays.asList(meteredLink, nonMeteredLink), ScalarWeight.toWeight(10));
nonMeteredPath = new DefaultPath(PROVIDER_ID, Arrays.asList(nonMeteredLink, unAnnotatedLink), ScalarWeight.toWeight(10));
}
Aggregations