Resource group to share resources between intents
Change-Id: I5bf7d4261197449924d07dabac841cf8ccbe9389
diff --git a/core/api/src/test/java/org/onosproject/net/intent/PathIntentTest.java b/core/api/src/test/java/org/onosproject/net/intent/PathIntentTest.java
index e388468..da13af0 100644
--- a/core/api/src/test/java/org/onosproject/net/intent/PathIntentTest.java
+++ b/core/api/src/test/java/org/onosproject/net/intent/PathIntentTest.java
@@ -73,6 +73,21 @@
assertEquals("incorrect action", NOP, intent.treatment());
assertEquals("incorrect path", PATH1, intent.path());
assertEquals("incorrect key", KEY, intent.key());
+
+ intent = createAnother();
+ assertEquals("incorrect id", APPID, intent.appId());
+ assertEquals("incorrect match", MATCH, intent.selector());
+ assertEquals("incorrect action", NOP, intent.treatment());
+ assertEquals("incorrect path", PATH2, intent.path());
+ assertEquals("incorrect key", KEY, intent.key());
+
+ intent = createWithResourceGroup();
+ assertEquals("incorrect id", APPID, intent.appId());
+ assertEquals("incorrect match", MATCH, intent.selector());
+ assertEquals("incorrect action", NOP, intent.treatment());
+ assertEquals("incorrect path", PATH2, intent.path());
+ assertEquals("incorrect key", KEY, intent.key());
+ assertEquals("incorrect resource group", RESOURCE_GROUP, intent.resourceGroup());
}
@Override
@@ -90,12 +105,24 @@
protected PathIntent createAnother() {
return PathIntent.builder()
.appId(APPID)
+ .key(KEY)
.selector(MATCH)
.treatment(NOP)
.path(PATH2)
.build();
}
+ protected PathIntent createWithResourceGroup() {
+ return PathIntent.builder()
+ .appId(APPID)
+ .key(KEY)
+ .selector(MATCH)
+ .treatment(NOP)
+ .path(PATH2)
+ .resourceGroup(RESOURCE_GROUP)
+ .build();
+ }
+
/**
* Tests the constructor raises IllegalArgumentException when the same device is specified in
* source and destination of a link.