Changes related to the "LinkCollectionIntent" type of intents
(e.g., Multipoint-to-singlepoint and Singlepoint-to-multipoint)

* Apply the Intent-defined traffic treatment only on the flowmods
  on the ingress switch with ingress inport for a flowmod.
  Previously, the traffic treatments were applied on each switch,
  and semantically it is not the correct (default) behavior.

* Express the flowmods by explicitly specifying the expected inport
  in the matching conditions for each flowmod.
  Previously, the inport was not included in the matching conditions.

[Merge from branch onos-1.0 - manually]

Change-Id: Ic378b6e8be033a70b016f4ba5550d91fe08ddd9a
diff --git a/core/api/src/test/java/org/onosproject/net/intent/LinkCollectionIntentTest.java b/core/api/src/test/java/org/onosproject/net/intent/LinkCollectionIntentTest.java
index 9282f0f..0327390 100644
--- a/core/api/src/test/java/org/onosproject/net/intent/LinkCollectionIntentTest.java
+++ b/core/api/src/test/java/org/onosproject/net/intent/LinkCollectionIntentTest.java
@@ -45,6 +45,7 @@
  */
 public class LinkCollectionIntentTest extends IntentTest {
 
+    final ConnectPoint ingress = NetTestTools.connectPoint("ingress", 2);
     final ConnectPoint egress = NetTestTools.connectPoint("egress", 3);
     final TrafficSelector selector = new IntentTestsMocks.MockSelector();
     final IntentTestsMocks.MockTreatment treatment = new IntentTestsMocks.MockTreatment();
@@ -70,6 +71,7 @@
                         selector,
                         treatment,
                         links1,
+                        ingress,
                         egress);
 
         final HashSet<Link> links2 = new HashSet<>();
@@ -79,6 +81,7 @@
                         selector,
                         treatment,
                         links2,
+                        ingress,
                         egress);
 
         new EqualsTester()
@@ -99,6 +102,7 @@
                         selector,
                         treatment,
                         links1,
+                        ingress,
                         egress);
 
         final Set<Link> createdLinks = collectionIntent.links();
@@ -106,6 +110,7 @@
         assertThat(collectionIntent.isInstallable(), is(true));
         assertThat(collectionIntent.treatment(), is(treatment));
         assertThat(collectionIntent.selector(), is(selector));
+        assertThat(collectionIntent.ingressPoints(), is(ImmutableSet.of(ingress)));
         assertThat(collectionIntent.egressPoints(), is(ImmutableSet.of(egress)));
         assertThat(collectionIntent.resources(), hasSize(1));
         final List<Constraint> createdConstraints = collectionIntent.constraints();
@@ -127,6 +132,7 @@
                         selector,
                         treatment,
                         links1,
+                        ingress,
                         egress,
                         constraints);
 
@@ -135,6 +141,7 @@
         assertThat(collectionIntent.isInstallable(), is(true));
         assertThat(collectionIntent.treatment(), is(treatment));
         assertThat(collectionIntent.selector(), is(selector));
+        assertThat(collectionIntent.ingressPoints(), is(ImmutableSet.of(ingress)));
         assertThat(collectionIntent.egressPoints(), is(ImmutableSet.of(egress)));
 
         final List<Constraint> createdConstraints = collectionIntent.constraints();
@@ -156,6 +163,7 @@
         assertThat(collectionIntent.isInstallable(), is(true));
         assertThat(collectionIntent.treatment(), nullValue());
         assertThat(collectionIntent.selector(), nullValue());
+        assertThat(collectionIntent.ingressPoints(), nullValue());
         assertThat(collectionIntent.egressPoints(), nullValue());
 
         final List<Constraint> createdConstraints = collectionIntent.constraints();
@@ -170,6 +178,7 @@
                                         selector,
                                         treatment,
                                         links1,
+                                        ingress,
                                         egress);
     }
 
@@ -181,6 +190,7 @@
                                         selector,
                                         treatment,
                                         links2,
+                                        ingress,
                                         egress);
     }
 }