Search in sources :

Example 6 with ResourceContext

use of org.onosproject.net.intent.ResourceContext in project onos by opennetworkinglab.

the class TierConstraintTest method setUp.

@Before
public void setUp() {
    resourceContext = createMock(ResourceContext.class);
    Annotations annotations1 = DefaultAnnotations.builder().set(TIER, TIER1).build();
    Annotations annotations2 = DefaultAnnotations.builder().set(TIER, TIER2).build();
    Annotations annotations3 = DefaultAnnotations.builder().set(TIER, TIER3).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();
    link3 = DefaultLink.builder().providerId(PROVIDER_ID).src(cp(DID2, PN5)).dst(cp(DID4, PN6)).type(DIRECT).annotations(annotations3).build();
    path12 = new DefaultPath(PROVIDER_ID, Arrays.asList(link1, link2), ScalarWeight.toWeight(10));
    path13 = new DefaultPath(PROVIDER_ID, Arrays.asList(link1, link3), ScalarWeight.toWeight(10));
    path23 = new DefaultPath(PROVIDER_ID, Arrays.asList(link2, link3), 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