Extension of the LinkCollectionCompiler to support Domains

Introduced the DomainConstraint which marks intents that allow domains.
Added the handling of domains to the base compiler and its implementations.
Fixed existing test by adding the domain service and added new ones for domains.

Change-Id: I6594e92e41c2434a9b667415e6fb90a6c571df79
diff --git a/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/LinkCollectionIntentObjectiveCompilerTest.java b/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/LinkCollectionIntentObjectiveCompilerTest.java
index 613c3cb..2c77956 100644
--- a/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/LinkCollectionIntentObjectiveCompilerTest.java
+++ b/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/LinkCollectionIntentObjectiveCompilerTest.java
@@ -25,9 +25,11 @@
 import org.onosproject.cfg.ComponentConfigAdapter;
 import org.onosproject.core.CoreService;
 import org.onosproject.net.DefaultLink;
+import org.onosproject.net.DeviceId;
 import org.onosproject.net.FilteredConnectPoint;
 import org.onosproject.net.Link;
 import org.onosproject.net.PortNumber;
+import org.onosproject.net.domain.DomainService;
 import org.onosproject.net.flow.DefaultTrafficSelector;
 import org.onosproject.net.flow.DefaultTrafficTreatment;
 import org.onosproject.net.flow.TrafficSelector;
@@ -50,7 +52,10 @@
 import java.util.List;
 import java.util.Set;
 
-import static org.easymock.EasyMock.*;
+import static org.easymock.EasyMock.anyObject;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
 import static org.hamcrest.CoreMatchers.hasItem;
 import static org.hamcrest.CoreMatchers.instanceOf;
 import static org.hamcrest.MatcherAssert.assertThat;
@@ -59,6 +64,7 @@
 import static org.hamcrest.Matchers.nullValue;
 import static org.onosproject.net.Link.Type.DIRECT;
 import static org.onosproject.net.NetTestTools.PID;
+import static org.onosproject.net.domain.DomainId.LOCAL;
 
 public class LinkCollectionIntentObjectiveCompilerTest extends AbstractLinkCollectionTest {
 
@@ -82,6 +88,11 @@
         compiler.coreService = coreService;
         compiler.flowObjectiveService = flowObjectiveService;
 
+
+        domainService = createMock(DomainService.class);
+        expect(domainService.getDomain(anyObject(DeviceId.class))).andReturn(LOCAL).anyTimes();
+        compiler.domainService = domainService;
+
         Intent.bindIdGenerator(idGenerator);
 
         intentExtensionService = createMock(IntentExtensionService.class);
@@ -99,7 +110,7 @@
         LinkCollectionCompiler.optimizeInstructions = false;
         LinkCollectionCompiler.copyTtl = false;
 
-        replay(coreService, intentExtensionService);
+        replay(coreService, domainService, intentExtensionService);
 
     }