Support encapsulation in PathIntent
- related to ONOS-3467
- unit test work
- depends on ONOS-3507 and also on the advertisement of VLAN resource
for different devices.
Change-Id: Ia852c751135b5ca4a16901c6f3a85ceea11514a3
diff --git a/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/MockResourceService.java b/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/MockResourceService.java
index 2926346..866c513 100644
--- a/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/MockResourceService.java
+++ b/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/MockResourceService.java
@@ -17,6 +17,7 @@
import com.google.common.collect.ImmutableList;
import org.onlab.packet.MplsLabel;
+import org.onlab.packet.VlanId;
import org.onosproject.net.newresource.ResourceAllocation;
import org.onosproject.net.newresource.ResourceConsumer;
import org.onosproject.net.newresource.ResourceListener;
@@ -25,6 +26,7 @@
import java.util.Collection;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@@ -91,8 +93,11 @@
@Override
public Collection<ResourcePath> getAvailableResources(ResourcePath parent) {
- ResourcePath resource = parent.child(MplsLabel.mplsLabel(10));
- return ImmutableList.of(resource);
+
+ Collection<ResourcePath> resources = new HashSet<ResourcePath>();
+ resources.add(parent.child(VlanId.vlanId((short) 10)));
+ resources.add(parent.child(MplsLabel.mplsLabel(10)));
+ return ImmutableList.copyOf(resources);
}
@Override