[ONOS-3835] Install load balanced classifier rules

Change-Id: I585a83021dbf2aff6a65dd43944a1f6979b33ead
diff --git a/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/FlowClassifierManagerTestImpl.java b/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/FlowClassifierAdapter.java
similarity index 96%
rename from apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/FlowClassifierManagerTestImpl.java
rename to apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/FlowClassifierAdapter.java
index fe5babb..305bd03 100644
--- a/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/FlowClassifierManagerTestImpl.java
+++ b/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/FlowClassifierAdapter.java
@@ -28,7 +28,7 @@
 /**
  * Provides implementation of the Flow Classifier Service.
  */
-public class FlowClassifierManagerTestImpl implements FlowClassifierService {
+public class FlowClassifierAdapter implements FlowClassifierService {
 
     private final ConcurrentMap<FlowClassifierId, FlowClassifier> flowClassifierStore = new ConcurrentHashMap<>();
 
diff --git a/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/FlowObjectiveServiceTestImpl.java b/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/FlowObjectiveAdapter.java
similarity index 83%
rename from apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/FlowObjectiveServiceTestImpl.java
rename to apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/FlowObjectiveAdapter.java
index 9da9ee9..11f3667 100644
--- a/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/FlowObjectiveServiceTestImpl.java
+++ b/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/FlowObjectiveAdapter.java
@@ -16,16 +16,17 @@
 package org.onosproject.sfc.util;
 
 import org.onosproject.net.DeviceId;
-import org.onosproject.net.flowobjective.FlowObjectiveService;
 import org.onosproject.net.flowobjective.FilteringObjective;
+import org.onosproject.net.flowobjective.FlowObjectiveService;
 import org.onosproject.net.flowobjective.ForwardingObjective;
 import org.onosproject.net.flowobjective.NextObjective;
 
 /**
  * Testing version of implementation on FlowObjectiveService.
  */
-public class FlowObjectiveServiceTestImpl implements FlowObjectiveService {
+public class FlowObjectiveAdapter implements FlowObjectiveService {
 
+    private ForwardingObjective forwardingObjective;
     @Override
     public void filter(DeviceId deviceId, FilteringObjective filteringObjective) {
 
@@ -33,7 +34,7 @@
 
     @Override
     public void forward(DeviceId deviceId, ForwardingObjective forwardingObjective) {
-
+        this.forwardingObjective = forwardingObjective;
     }
 
     @Override
@@ -50,4 +51,8 @@
     public void initPolicy(String policy) {
 
     }
+
+    public ForwardingObjective forwardingObjective() {
+        return forwardingObjective;
+    }
 }
diff --git a/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/MockDriverHandler.java b/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/MockDriverHandler.java
new file mode 100644
index 0000000..08aea73
--- /dev/null
+++ b/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/MockDriverHandler.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.sfc.util;
+
+import org.onosproject.net.behaviour.ExtensionSelectorResolver;
+import org.onosproject.net.behaviour.ExtensionTreatmentResolver;
+import org.onosproject.net.driver.Behaviour;
+import org.onosproject.net.driver.Driver;
+import org.onosproject.net.driver.DriverData;
+import org.onosproject.net.driver.DriverHandler;
+
+public class MockDriverHandler implements DriverHandler {
+
+    @Override
+    public Driver driver() {
+        return null;
+    }
+
+    @Override
+    public DriverData data() {
+        return null;
+    }
+
+    @Override
+    public <T extends Behaviour> T behaviour(Class<T> behaviourClass) {
+        if (behaviourClass == ExtensionSelectorResolver.class) {
+            return (T) new MockExtensionSelectorResolver();
+        } else if (behaviourClass == ExtensionTreatmentResolver.class) {
+            return (T) new MockExtensionTreatmentResolver();
+        }
+        return null;
+    }
+
+    @Override
+    public <T> T get(Class<T> serviceClass) {
+        return null;
+    }
+}
\ No newline at end of file
diff --git a/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/MockExtensionSelector.java b/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/MockExtensionSelector.java
new file mode 100644
index 0000000..2dde927
--- /dev/null
+++ b/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/MockExtensionSelector.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.sfc.util;
+
+import java.util.List;
+
+import org.onosproject.net.flow.criteria.ExtensionSelector;
+import org.onosproject.net.flow.criteria.ExtensionSelectorType;
+import org.onosproject.net.flow.instructions.ExtensionPropertyException;
+
+public class MockExtensionSelector implements ExtensionSelector {
+
+    @Override
+    public <T> void setPropertyValue(String key, T value) throws ExtensionPropertyException {
+    }
+
+    @Override
+    public <T> T getPropertyValue(String key) throws ExtensionPropertyException {
+        return null;
+    }
+
+    @Override
+    public List<String> getProperties() {
+        return null;
+    }
+
+    @Override
+    public byte[] serialize() {
+        return null;
+    }
+
+    @Override
+    public void deserialize(byte[] data) {
+    }
+
+    @Override
+    public ExtensionSelectorType type() {
+        return null;
+    }
+}
\ No newline at end of file
diff --git a/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/MockExtensionSelectorResolver.java b/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/MockExtensionSelectorResolver.java
new file mode 100644
index 0000000..7583708
--- /dev/null
+++ b/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/MockExtensionSelectorResolver.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.sfc.util;
+
+import org.onosproject.net.behaviour.ExtensionSelectorResolver;
+import org.onosproject.net.driver.DriverData;
+import org.onosproject.net.driver.DriverHandler;
+import org.onosproject.net.flow.criteria.ExtensionSelector;
+import org.onosproject.net.flow.criteria.ExtensionSelectorType;
+
+public class MockExtensionSelectorResolver implements ExtensionSelectorResolver {
+
+    @Override
+    public DriverHandler handler() {
+        return null;
+    }
+
+    @Override
+    public void setHandler(DriverHandler handler) {
+    }
+
+    @Override
+    public DriverData data() {
+        return null;
+    }
+
+    @Override
+    public void setData(DriverData data) {
+    }
+
+    @Override
+    public ExtensionSelector getExtensionSelector(ExtensionSelectorType type) {
+        return new MockExtensionSelector();
+    }
+}
\ No newline at end of file
diff --git a/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/MockExtensionTreatment.java b/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/MockExtensionTreatment.java
new file mode 100644
index 0000000..f28d5dd
--- /dev/null
+++ b/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/MockExtensionTreatment.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.sfc.util;
+
+import java.util.List;
+
+import org.onosproject.net.flow.instructions.ExtensionPropertyException;
+import org.onosproject.net.flow.instructions.ExtensionTreatment;
+import org.onosproject.net.flow.instructions.ExtensionTreatmentType;
+
+public class MockExtensionTreatment implements ExtensionTreatment {
+
+    @Override
+    public <T> void setPropertyValue(String key, T value) throws ExtensionPropertyException {
+    }
+
+    @Override
+    public <T> T getPropertyValue(String key) throws ExtensionPropertyException {
+        return null;
+    }
+
+    @Override
+    public List<String> getProperties() {
+        return null;
+    }
+
+    @Override
+    public byte[] serialize() {
+        return null;
+    }
+
+    @Override
+    public void deserialize(byte[] data) {
+    }
+
+    @Override
+    public ExtensionTreatmentType type() {
+        return null;
+    }
+
+}
\ No newline at end of file
diff --git a/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/MockExtensionTreatmentResolver.java b/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/MockExtensionTreatmentResolver.java
new file mode 100644
index 0000000..b9a0d0d
--- /dev/null
+++ b/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/MockExtensionTreatmentResolver.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.sfc.util;
+
+import org.onosproject.net.behaviour.ExtensionTreatmentResolver;
+import org.onosproject.net.driver.DriverData;
+import org.onosproject.net.driver.DriverHandler;
+import org.onosproject.net.flow.instructions.ExtensionTreatment;
+import org.onosproject.net.flow.instructions.ExtensionTreatmentType;
+
+public class MockExtensionTreatmentResolver implements ExtensionTreatmentResolver {
+
+    @Override
+    public DriverHandler handler() {
+        return null;
+    }
+
+    @Override
+    public void setHandler(DriverHandler handler) {
+    }
+
+    @Override
+    public DriverData data() {
+        return null;
+    }
+
+    @Override
+    public void setData(DriverData data) {
+    }
+
+    @Override
+    public ExtensionTreatment getExtensionInstruction(ExtensionTreatmentType type) {
+        return new MockExtensionTreatment();
+    }
+
+}
\ No newline at end of file
diff --git a/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/PortChainManagerTestImpl.java b/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/PortChainAdapter.java
similarity index 98%
rename from apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/PortChainManagerTestImpl.java
rename to apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/PortChainAdapter.java
index 4a3ba03..c76b2e6 100644
--- a/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/PortChainManagerTestImpl.java
+++ b/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/PortChainAdapter.java
@@ -29,7 +29,7 @@
 /**
  * Provides implementation of the portChainService.
  */
-public class PortChainManagerTestImpl
+public class PortChainAdapter
             extends AbstractListenerManager<PortChainEvent, PortChainListener>
             implements PortChainService {
 
diff --git a/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/PortPairManagerTestImpl.java b/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/PortPairAdapter.java
similarity index 97%
rename from apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/PortPairManagerTestImpl.java
rename to apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/PortPairAdapter.java
index aff5882..1a526b4 100644
--- a/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/PortPairManagerTestImpl.java
+++ b/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/PortPairAdapter.java
@@ -27,7 +27,7 @@
 /**
  * Provides implementation of the portPairService.
  */
-public class PortPairManagerTestImpl implements PortPairService {
+public class PortPairAdapter implements PortPairService {
 
     private ConcurrentMap<PortPairId, PortPair> portPairStore = new ConcurrentHashMap<>();
 
diff --git a/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/PortPairGroupManagerTestImpl.java b/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/PortPairGroupAdapter.java
similarity index 96%
rename from apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/PortPairGroupManagerTestImpl.java
rename to apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/PortPairGroupAdapter.java
index ba31cd6..6e3de44 100644
--- a/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/PortPairGroupManagerTestImpl.java
+++ b/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/PortPairGroupAdapter.java
@@ -27,7 +27,7 @@
 /**
  * Provides implementation of the portPairGroupService.
  */
-public class PortPairGroupManagerTestImpl implements PortPairGroupService {
+public class PortPairGroupAdapter implements PortPairGroupService {
 
     private ConcurrentMap<PortPairGroupId, PortPairGroup> portPairGroupStore = new ConcurrentHashMap<>();
 
diff --git a/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/VirtualPortManagerTestImpl.java b/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/VirtualPortAdapter.java
similarity index 96%
rename from apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/VirtualPortManagerTestImpl.java
rename to apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/VirtualPortAdapter.java
index de056a7..6570c97 100644
--- a/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/VirtualPortManagerTestImpl.java
+++ b/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/VirtualPortAdapter.java
@@ -31,7 +31,7 @@
 /**
  * Provides implementation of the VirtualPort APIs.
  */
-public class VirtualPortManagerTestImpl implements VirtualPortService {
+public class VirtualPortAdapter implements VirtualPortService {
 
     protected ConcurrentMap<VirtualPortId, VirtualPort> vPortStore = new ConcurrentHashMap<>();
 
diff --git a/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/VtnRscManagerTestImpl.java b/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/VtnRscAdapter.java
similarity index 93%
rename from apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/VtnRscManagerTestImpl.java
rename to apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/VtnRscAdapter.java
index 4c761e9..1179dc0 100644
--- a/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/VtnRscManagerTestImpl.java
+++ b/apps/vtn/sfcmgr/src/test/java/org/onosproject/sfc/util/VtnRscAdapter.java
@@ -31,7 +31,7 @@
 /**
  * Provides implementation of the VtnRsc service.
  */
-public class VtnRscManagerTestImpl implements VtnRscService {
+public class VtnRscAdapter implements VtnRscService {
     @Override
     public void addListener(VtnRscListener listener) {
     }
@@ -62,13 +62,12 @@
 
     @Override
     public boolean isServiceFunction(VirtualPortId portId) {
-        // TODO Auto-generated method stub
         return false;
     }
 
     @Override
     public DeviceId getSfToSffMaping(VirtualPortId portId) {
-        return DeviceId.deviceId("www.google.com");
+        return DeviceId.deviceId("of:000000000000001");
     }
 
     @Override