Search in sources :

Example 1 with ResourceContext

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));
}
Also used : ResourceContext(org.onosproject.net.intent.ResourceContext) DefaultAnnotations(org.onosproject.net.DefaultAnnotations) Annotations(org.onosproject.net.Annotations) DefaultPath(org.onosproject.net.DefaultPath) Before(org.junit.Before)

Example 2 with ResourceContext

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));
}
Also used : ResourceContext(org.onosproject.net.intent.ResourceContext) DefaultPath(org.onosproject.net.DefaultPath) Before(org.junit.Before)

Example 3 with ResourceContext

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();
}
Also used : ResourceContext(org.onosproject.net.intent.ResourceContext) DefaultAnnotations(org.onosproject.net.DefaultAnnotations) Before(org.junit.Before)

Example 4 with ResourceContext

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));
}
Also used : DefaultHost(org.onosproject.net.DefaultHost) ResourceContext(org.onosproject.net.intent.ResourceContext) HostLocation(org.onosproject.net.HostLocation) DefaultPath(org.onosproject.net.DefaultPath) Before(org.junit.Before)

Example 5 with ResourceContext

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));
}
Also used : ResourceContext(org.onosproject.net.intent.ResourceContext) DefaultAnnotations(org.onosproject.net.DefaultAnnotations) Annotations(org.onosproject.net.Annotations) DefaultPath(org.onosproject.net.DefaultPath) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)6 ResourceContext (org.onosproject.net.intent.ResourceContext)6 DefaultPath (org.onosproject.net.DefaultPath)5 DefaultAnnotations (org.onosproject.net.DefaultAnnotations)4 Annotations (org.onosproject.net.Annotations)3 DefaultHost (org.onosproject.net.DefaultHost)1 HostLocation (org.onosproject.net.HostLocation)1