Fix Jdk8 compatibility
[openflowplugin.git] / test-provider / src / main / java / org / opendaylight / openflowplugin / test / OpenflowpluginTestCommandProvider.java
index fd38c206f4e5b5092b6738ff4e0f0be0df928b81..908a2fe5937a97645f732b231644379e53f38af9 100644 (file)
@@ -8,27 +8,24 @@
 
 package org.opendaylight.openflowplugin.test;
 
+import com.google.common.util.concurrent.CheckedFuture;
+import com.google.common.util.concurrent.FutureCallback;
+import com.google.common.util.concurrent.Futures;
 import java.math.BigInteger;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.List;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
-import java.util.List;
-import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
-import java.util.Collection;
-import java.util.Iterator;
-
 import org.eclipse.osgi.framework.console.CommandInterpreter;
 import org.eclipse.osgi.framework.console.CommandProvider;
-import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
-import org.opendaylight.controller.md.sal.common.api.data.DataModification;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
 import org.opendaylight.controller.sal.binding.api.NotificationService;
-import org.opendaylight.controller.sal.binding.api.data.DataBrokerService;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Dscp;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Address;
@@ -171,6 +168,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4Match;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6MatchBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.TunnelIpv4MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.SctpMatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatchBuilder;
@@ -178,9 +176,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.vlan.match.fields.VlanIdBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.NodeErrorListener;
 import org.opendaylight.yangtools.concepts.Registration;
-import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -189,494 +185,514 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static final Logger LOG = LoggerFactory.getLogger(OpenflowpluginTestCommandProvider.class);
 
-    private DataBrokerService dataBrokerService;
-    private ProviderContext pc;
+    private DataBroker dataBroker;
     private final BundleContext ctx;
     private FlowBuilder testFlow;
-    private NodeBuilder testNode;
-    private final String originalFlowName = "Foo";
-    private final String updatedFlowName = "Bar";
+    private static final String ORIGINAL_FLOW_NAME = "Foo";
+    private static final String UPDATED_FLOW_NAME = "Bar";
+    private static final String IPV4_PREFIX = "10.0.0.1/24";
+    private static final String DEST_MAC_ADDRESS = "ff:ff:ff:ff:ff:ff";
+    private static final String SRC_MAC_ADDRESS = "00:00:00:00:23:ae";
     private final SalFlowListener flowEventListener = new FlowEventListenerLoggingImpl();
     private final NodeErrorListener nodeErrorListener = new NodeErrorListenerLoggingImpl();
     private static NotificationService notificationService;
-    private Registration<org.opendaylight.yangtools.yang.binding.NotificationListener> listener1Reg;
-    private Registration<org.opendaylight.yangtools.yang.binding.NotificationListener> listener2Reg;
 
     public OpenflowpluginTestCommandProvider(BundleContext ctx) {
         this.ctx = ctx;
     }
 
     public void onSessionInitiated(ProviderContext session) {
-        pc = session;
         notificationService = session.getSALService(NotificationService.class);
         // For switch events
-        listener1Reg = notificationService.registerNotificationListener(flowEventListener);
-        listener2Reg = notificationService.registerNotificationListener(nodeErrorListener);
-        dataBrokerService = session.getSALService(DataBrokerService.class);
+        notificationService.registerNotificationListener(flowEventListener);
+        notificationService.registerNotificationListener(nodeErrorListener);
+        dataBroker = session.getSALService(DataBroker.class);
         ctx.registerService(CommandProvider.class.getName(), this, null);
         createTestFlow(createTestNode(null), null, null);
     }
 
     private NodeBuilder createTestNode(String nodeId) {
+        String localNodeId;
+        
         if (nodeId == null) {
-            nodeId = OpenflowpluginTestActivator.NODE_ID;
+            localNodeId = OpenflowpluginTestActivator.NODE_ID;
+        } else {
+            localNodeId = nodeId;
         }
-        NodeRef nodeOne = createNodeRef(nodeId);
+        
         NodeBuilder builder = new NodeBuilder();
-        builder.setId(new NodeId(nodeId));
+        builder.setId(new NodeId(localNodeId));
         builder.setKey(new NodeKey(builder.getId()));
-        testNode = builder;
         return builder;
     }
 
     private InstanceIdentifier<Node> nodeBuilderToInstanceId(NodeBuilder node) {
-        return InstanceIdentifier.builder(Nodes.class).child(Node.class, node.getKey()).toInstance();
+        return InstanceIdentifier.create(Nodes.class).child(Node.class, node.getKey());
     }
 
     private FlowBuilder createTestFlow(NodeBuilder nodeBuilder, String flowTypeArg, String tableId) {
-
+        final long TEST_ID = 123;
+        
         FlowBuilder flow = new FlowBuilder();
-        long id = 123;
+        long id = TEST_ID;
 
         String flowType = flowTypeArg;
         if (flowType == null) {
             flowType = "f1";
         }
-        
+
         flow.setPriority(2);
 
         switch (flowType) {
-        case "f1":
-            id += 1;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createDecNwTtlInstructions().build());
-            break;
-        case "f2":
-            id += 2;
-            flow.setMatch(createMatch2().build());
-            flow.setInstructions(createDropInstructions().build());
-            break;
-        case "f3":
-            id += 3;
-            flow.setMatch(createMatch3().build());
-            flow.setInstructions(createDropInstructions().build());
-            break;
-        case "f4":
-            id += 4;
-            flow.setMatch(createEthernetMatch().build());
-            flow.setInstructions(createDropInstructions().build());
-            break;
-        case "f5":
-            id += 5;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction().build());
-            break;
-        case "f6":
-            id += 6;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createGotoTableInstructions().build());
-            break;
-        case "f7":
-            id += 7;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createMeterInstructions().build());
-            break;
-        case "f8":
-            id += 8;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction1().build());
-            break;
-        case "f9":
-            id += 9;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction2().build());
-            break;
-        case "f10":
-            id += 10;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction3().build());
-            break;
-        case "f11":
-            id += 11;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction4().build());
-            break;
-        case "f12":
-            id += 12;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction5().build());
-            break;
-        case "f13":
-            id += 13;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction6().build());
-            break;
-        case "f14":
-            id += 14;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction7().build());
-            break;
-        case "f15":
-            id += 15;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction8().build());
-            break;
-        case "f16":
-            id += 16;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction9().build());
-            break;
-        case "f17":
-            id += 17;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction10().build());
-            break;
-        case "f18":
-            id += 18;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction11().build());
-            break;
-        case "f19":
-            id += 19;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction12().build());
-            break;
-        case "f20":
-            id += 20;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction13().build());
-            break;
-        case "f21":
-            id += 21;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction14().build());
-            break;
-        case "f22":
-            id += 22;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction15().build());
-            break;
-        case "f23":
-            id += 23;
-            // f23 can be used as test-case for generating error notification
-            // if the particular group is not configured - tested
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction16().build());
-            break;
-        case "f24":
-            id += 24;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction17().build());
-            break;
-        case "f25":
-            id += 25;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction18().build());
-            break;
-        case "f26":
-            id += 26;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction19().build());
-            break;
-        case "f27":
-            id += 27;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createMetadataInstructions().build());
-            break;
-        case "f28":
-            id += 28;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction20().build());
-            break;
-        case "f29":
-            id += 29;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction21().build());
-            break;
-        case "f30":
-            id += 30;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction22().build());
-            break;
-        case "f31":
-            id += 31;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction23(nodeBuilder.getId()).build());
-            break;
-        case "f32":
-            id += 32;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction24().build());
-            break;
-        case "f33":
-            id += 33;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction25().build());
-            break;
-        case "f34":
-            id += 34;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction26().build());
-            break;
-        case "f35":
-            id += 35;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction27().build());
-            break;
-        case "f36":
-            id += 36;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction28().build());
-            break;
-        case "f37":
-            id += 37;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction29().build());
-            break;
-        case "f38":
-            id += 38;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction30().build());
-            break;
-        case "f39":
-            id += 39;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction31().build());
-            break;
-        case "f40":
-            id += 40;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction32().build());
-            break;
-        case "f41":
-            id += 41;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction33().build());
-            break;
-        case "f42":
-            id += 42;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction34().build());
-            break;
-        case "f43":
-            id += 43;
-            flow.setMatch(createICMPv6Match().build());
-            flow.setInstructions(createDecNwTtlInstructions().build());
-            break;
-        case "f44":
-            id += 44;
-            flow.setMatch(createInphyportMatch(nodeBuilder.getId()).build());
-            flow.setInstructions(createDropInstructions().build());
-            break;
-        case "f45":
-            id += 45;
-            flow.setMatch(createMetadataMatch().build());
-            flow.setInstructions(createDropInstructions().build());
-            break;
-        case "f46":
-            id += 46;
-            flow.setMatch(createL3IPv6Match().build());
-            flow.setInstructions(createDecNwTtlInstructions().build());
-            break;
-        case "f47":
-            id += 47;
-            flow.setMatch(createL4SCTPMatch().build());
-            flow.setInstructions(createAppyActionInstruction().build());
-            break;
-        case "f48":
-            id += 48;
-            flow.setMatch(createTunnelIDMatch().build());
-            flow.setInstructions(createGotoTableInstructions().build());
-            break;
-        case "f49":
-            id += 49;
-            flow.setMatch(createVlanMatch().build());
-            flow.setInstructions(createMeterInstructions().build());
-            break;
-        case "f50":
-            id += 50;
-            flow.setMatch(createPbbMatch().build());
-            flow.setInstructions(createMeterInstructions().build());
-            break;
-        case "f51":
-            id += 51;
-            flow.setMatch(createVlanMatch().build());
-            flow.setInstructions(createDropInstructions().build());
-            break;
-        case "f52":
-            id += 52;
-            flow.setMatch(createL4TCPMatch().build());
-            flow.setInstructions(createDropInstructions().build());
-            break;
-
-        case "f53":
-            id += 53;
-            flow.setMatch(createL4UDPMatch().build());
-            flow.setInstructions(createDropInstructions().build());
-            break;
-        case "f54":
-            id += 54;
-            flow.setMatch(new MatchBuilder().build());
-            flow.setInstructions(createSentToControllerInstructions().build());
-            flow.setPriority(0);
-            break;
-        case "f55":
-            id += 55;
-            flow.setMatch(createToSMatch().build());
-            flow.setInstructions(createDropInstructions().build());
-            break;
-        case "f56":
-            id += 56;
-            flow.setMatch(createToSMatch().build());
-            flow.setInstructions(createOutputInstructions("INPORT", 10).build());
-            break;
-        case "f57":
-            id += 57;
-            flow.setMatch(createToSMatch().build());
-            flow.setInstructions(createOutputInstructions("FLOOD", 20).build());
-            break;
-        case "f58":
-            id += 58;
-            flow.setMatch(createToSMatch().build());
-            flow.setInstructions(createOutputInstructions("ALL", 30).build());
-            break;
-        case "f59":
-            id += 59;
-            flow.setMatch(createToSMatch().build());
-            flow.setInstructions(createOutputInstructions("NORMAL", 40).build());
-            break;
-        case "f60":
-            id += 60;
-            flow.setMatch(createToSMatch().build());
-            flow.setInstructions(createOutputInstructions("LOCAL", 50).build());
-            break;
-        case "f61":
-            id += 61;
-            flow.setMatch(createToSMatch().build());
-            flow.setInstructions(createOutputInstructions("TABLE", 60).build());
-            break;
-        case "f62":
-            id += 62;
-            flow.setMatch(createToSMatch().build());
-            flow.setInstructions(createOutputInstructions("NONE", 70).build());
-            break;
-        case "f63":
-            id += 63;
-            flow.setMatch(createToSMatch().build());
-            flow.setInstructions(createStripVlanInstructions().build());
-            flow.setBarrier(Boolean.TRUE);
-            break;
-        case "f64":
-            id += 64;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction35().build());
-            break;
-        case "f65":
-            id += 65;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction36().build());
-            break;
-        case "f66":
-            id += 66;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction37().build());
-            break;
-        case "f67":
-            id += 67;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction38().build());
-            break;
-        case "f68":
-            id += 68;
-            flow.setMatch(createL4TCPMatch().build());
-            flow.setInstructions(createAppyActionInstruction39().build());
-            break;
-        case "f69":
-            id += 69;
-            flow.setMatch(createL4UDPMatch().build());
-            flow.setInstructions(createAppyActionInstruction40().build());
-            break;
-        case "f70":
-            id += 70;
-            flow.setMatch(createL4SCTPMatch().build());
-            flow.setInstructions(createAppyActionInstruction41().build());
-            break;
-        case "f71":
-            id += 71;
-            flow.setMatch(createICMPv4Match().build());
-            flow.setInstructions(createAppyActionInstruction42().build());
-            break;
-        case "f72":
-            id += 72;
-            flow.setMatch(createArpMatch().build());
-            flow.setInstructions(createAppyActionInstruction43().build());
-            break;
-        case "f73":
-            id += 73;
-            flow.setMatch(createL3IPv6Match().build());
-            flow.setInstructions(createAppyActionInstruction44().build());
-            break;
-        case "f74":
-            id += 74;
-            flow.setMatch(createICMPv6Match().build());
-            flow.setInstructions(createAppyActionInstruction45().build());
-            break;
-        case "f75":
-            id += 75;
-            flow.setMatch(createMplsMatch().build());
-            flow.setInstructions(createAppyActionInstruction46().build());
-            break;
-        case "f76":
-            id += 76;
-            flow.setMatch(createPbbMatch().build());
-            flow.setInstructions(createAppyActionInstruction47().build());
-            break;
-        case "f77":
-            id += 77;
-            flow.setMatch(createTunnelIDMatch().build());
-            flow.setInstructions(createAppyActionInstruction48().build());
-            break;
-        case "f78":
-            id += 78;
-            flow.setMatch(createMatch33().build());
-            flow.setInstructions(createDropInstructions().build());
-            break;
-        case "f79":
-            id += 79;
-            flow.setMatch(createICMPv6Match1().build());
-            flow.setInstructions(createDecNwTtlInstructions().build());
-            break;
-        case "f80":
-            id += 80;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createAppyActionInstruction88().build());
-            break;
-        case "f81":
-            id += 81;
-            flow.setMatch(createLLDPMatch().build());
-            flow.setInstructions(createSentToControllerInstructions().build());
-            break;
-        case "f82":
-            id += 82;
-            flow.setMatch(createToSMatch().build());
-            flow.setInstructions(createOutputInstructions().build());
-            break;
-        case "f83":
-            id += 83; // Test TCP_Flag Match
-            flow.setMatch(createTcpFlagMatch().build());
-            flow.setInstructions(createDropInstructions().build());
-            break;
-        default:
-            LOG.warn("flow type not understood: {}", flowType);
+            case "f1":
+                id += 1;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createDecNwTtlInstructions().build());
+                break;
+            case "f2":
+                id += 2;
+                flow.setMatch(createMatch2().build());
+                flow.setInstructions(createDropInstructions().build());
+                break;
+            case "f3":
+                id += 3;
+                flow.setMatch(createMatch3().build());
+                flow.setInstructions(createDropInstructions().build());
+                break;
+            case "f4":
+                id += 4;
+                flow.setMatch(createEthernetMatch().build());
+                flow.setInstructions(createDropInstructions().build());
+                break;
+            case "f5":
+                id += 5;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction().build());
+                break;
+            case "f6":
+                id += 6;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createGotoTableInstructions().build());
+                break;
+            case "f7":
+                id += 7;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createMeterInstructions().build());
+                break;
+            case "f8":
+                id += 8;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction1().build());
+                break;
+            case "f9":
+                id += 9;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction2().build());
+                break;
+            case "f10":
+                id += 10;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction3().build());
+                break;
+            case "f11":
+                id += 11;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction4().build());
+                break;
+            case "f12":
+                id += 12;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction5().build());
+                break;
+            case "f13":
+                id += 13;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction6().build());
+                break;
+            case "f14":
+                id += 14;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction7().build());
+                break;
+            case "f15":
+                id += 15;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction8().build());
+                break;
+            case "f16":
+                id += 16;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction9().build());
+                break;
+            case "f17":
+                id += 17;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction10().build());
+                break;
+            case "f18":
+                id += 18;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction11().build());
+                break;
+            case "f19":
+                id += 19;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction12().build());
+                break;
+            case "f20":
+                id += 20;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction13().build());
+                break;
+            case "f21":
+                id += 21;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction14().build());
+                break;
+            case "f22":
+                id += 22;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction15().build());
+                break;
+            case "f23":
+                id += 23;
+                // f23 can be used as test-case for generating error notification
+                // if the particular group is not configured - tested
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction16().build());
+                break;
+            case "f24":
+                id += 24;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction17().build());
+                break;
+            case "f25":
+                id += 25;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction18().build());
+                break;
+            case "f26":
+                id += 26;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction19().build());
+                break;
+            case "f27":
+                id += 27;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createMetadataInstructions().build());
+                break;
+            case "f28":
+                id += 28;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction20().build());
+                break;
+            case "f29":
+                id += 29;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction21().build());
+                break;
+            case "f30":
+                id += 30;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction22().build());
+                break;
+            case "f31":
+                id += 31;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction23(nodeBuilder.getId()).build());
+                break;
+            case "f32":
+                id += 32;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction24().build());
+                break;
+            case "f33":
+                id += 33;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction25().build());
+                break;
+            case "f34":
+                id += 34;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction26().build());
+                break;
+            case "f35":
+                id += 35;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction27().build());
+                break;
+            case "f36":
+                id += 36;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction28().build());
+                break;
+            case "f37":
+                id += 37;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction29().build());
+                break;
+            case "f38":
+                id += 38;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction30().build());
+                break;
+            case "f39":
+                id += 39;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction31().build());
+                break;
+            case "f40":
+                id += 40;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction32().build());
+                break;
+            case "f41":
+                id += 41;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction33().build());
+                break;
+            case "f42":
+                id += 42;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction34().build());
+                break;
+            case "f43":
+                id += 43;
+                flow.setMatch(createICMPv6Match().build());
+                flow.setInstructions(createDecNwTtlInstructions().build());
+                break;
+            case "f44":
+                id += 44;
+                flow.setMatch(createInphyportMatch(nodeBuilder.getId()).build());
+                flow.setInstructions(createDropInstructions().build());
+                break;
+            case "f45":
+                id += 45;
+                flow.setMatch(createMetadataMatch().build());
+                flow.setInstructions(createDropInstructions().build());
+                break;
+            case "f46":
+                id += 46;
+                flow.setMatch(createL3IPv6Match().build());
+                flow.setInstructions(createDecNwTtlInstructions().build());
+                break;
+            case "f47":
+                id += 47;
+                flow.setMatch(createL4SCTPMatch().build());
+                flow.setInstructions(createAppyActionInstruction().build());
+                break;
+            case "f48":
+                id += 48;
+                flow.setMatch(createTunnelIDMatch().build());
+                flow.setInstructions(createGotoTableInstructions().build());
+                break;
+            case "f49":
+                id += 49;
+                flow.setMatch(createVlanMatch().build());
+                flow.setInstructions(createMeterInstructions().build());
+                break;
+            case "f50":
+                id += 50;
+                flow.setMatch(createPbbMatch().build());
+                flow.setInstructions(createMeterInstructions().build());
+                break;
+            case "f51":
+                id += 51;
+                flow.setMatch(createVlanMatch().build());
+                flow.setInstructions(createDropInstructions().build());
+                break;
+            case "f52":
+                id += 52;
+                flow.setMatch(createL4TCPMatch().build());
+                flow.setInstructions(createDropInstructions().build());
+                break;
+
+            case "f53":
+                id += 53;
+                flow.setMatch(createL4UDPMatch().build());
+                flow.setInstructions(createDropInstructions().build());
+                break;
+            case "f54":
+                id += 54;
+                flow.setMatch(new MatchBuilder().build());
+                flow.setInstructions(createSentToControllerInstructions().build());
+                flow.setPriority(0);
+                break;
+            case "f55":
+                id += 55;
+                flow.setMatch(createToSMatch().build());
+                flow.setInstructions(createDropInstructions().build());
+                break;
+            case "f56":
+                id += 56;
+                flow.setMatch(createToSMatch().build());
+                flow.setInstructions(createOutputInstructions("INPORT", 10).build());
+                break;
+            case "f57":
+                id += 57;
+                flow.setMatch(createToSMatch().build());
+                flow.setInstructions(createOutputInstructions("FLOOD", 20).build());
+                break;
+            case "f58":
+                id += 58;
+                flow.setMatch(createToSMatch().build());
+                flow.setInstructions(createOutputInstructions("ALL", 30).build());
+                break;
+            case "f59":
+                id += 59;
+                flow.setMatch(createToSMatch().build());
+                flow.setInstructions(createOutputInstructions("NORMAL", 40).build());
+                break;
+            case "f60":
+                id += 60;
+                flow.setMatch(createToSMatch().build());
+                flow.setInstructions(createOutputInstructions("LOCAL", 50).build());
+                break;
+            case "f61":
+                id += 61;
+                flow.setMatch(createToSMatch().build());
+                flow.setInstructions(createOutputInstructions("TABLE", 60).build());
+                break;
+            case "f62":
+                id += 62;
+                flow.setMatch(createToSMatch().build());
+                flow.setInstructions(createOutputInstructions("NONE", 70).build());
+                break;
+            case "f63":
+                id += 63;
+                flow.setMatch(createToSMatch().build());
+                flow.setInstructions(createStripVlanInstructions().build());
+                flow.setBarrier(Boolean.TRUE);
+                break;
+            case "f64":
+                id += 64;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction35().build());
+                break;
+            case "f65":
+                id += 65;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction36().build());
+                break;
+            case "f66":
+                id += 66;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction37().build());
+                break;
+            case "f67":
+                id += 67;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createAppyActionInstruction38().build());
+                break;
+            case "f68":
+                id += 68;
+                flow.setMatch(createL4TCPMatch().build());
+                flow.setInstructions(createAppyActionInstruction39().build());
+                break;
+            case "f69":
+                id += 69;
+                flow.setMatch(createL4UDPMatch().build());
+                flow.setInstructions(createAppyActionInstruction40().build());
+                break;
+            case "f70":
+                id += 70;
+                flow.setMatch(createL4SCTPMatch().build());
+                flow.setInstructions(createAppyActionInstruction41().build());
+                break;
+            case "f71":
+                id += 71;
+                flow.setMatch(createICMPv4Match().build());
+                flow.setInstructions(createAppyActionInstruction42().build());
+                break;
+            case "f72":
+                id += 72;
+                flow.setMatch(createArpMatch().build());
+                flow.setInstructions(createAppyActionInstruction43().build());
+                break;
+            case "f73":
+                id += 73;
+                flow.setMatch(createL3IPv6Match().build());
+                flow.setInstructions(createAppyActionInstruction44().build());
+                break;
+            case "f74":
+                id += 74;
+                flow.setMatch(createICMPv6Match().build());
+                flow.setInstructions(createAppyActionInstruction45().build());
+                break;
+            case "f75":
+                id += 75;
+                flow.setMatch(createMplsMatch().build());
+                flow.setInstructions(createAppyActionInstruction46().build());
+                break;
+            case "f76":
+                id += 76;
+                flow.setMatch(createPbbMatch().build());
+                flow.setInstructions(createAppyActionInstruction47().build());
+                break;
+            case "f77":
+                id += 77;
+                flow.setMatch(createTunnelIDMatch().build());
+                flow.setInstructions(createAppyActionInstruction48().build());
+                break;
+            case "f78":
+                id += 78;
+                flow.setMatch(createMatch33().build());
+                flow.setInstructions(createDropInstructions().build());
+                break;
+            case "f79":
+                id += 79;
+                flow.setMatch(createICMPv6Match1().build());
+                flow.setInstructions(createDecNwTtlInstructions().build());
+                break;
+            case "f80":
+                id += 80;
+                flow.setMatch(createVlanMatch().build());
+                flow.setInstructions(createAppyActionInstruction88().build());
+                break;
+            case "f81":
+                id += 81;
+                flow.setMatch(createLLDPMatch().build());
+                flow.setInstructions(createSentToControllerInstructions().build());
+                break;
+            case "f82":
+                id += 82;
+                flow.setMatch(createToSMatch().build());
+                flow.setInstructions(createOutputInstructions().build());
+                break;
+            case "f83":
+                // Test TCP_Flag Match
+                id += 83; 
+                flow.setMatch(createTcpFlagMatch().build());
+                flow.setInstructions(createDropInstructions().build());
+                break;
+            case "f84":
+                id += 84;
+                // match vlan=10,dl_vlan_pcp=3
+                flow.setMatch(createVlanMatch().build()); 
+                // vlan_pcp=4
+                flow.setInstructions(createAppyActionInstruction88().build()); 
+                break;
+            case "f85":
+                // Test Tunnel IPv4 Src (e.g. set_field:172.16.100.200->tun_src)
+                id += 85; 
+                flow.setMatch(createMatch3().build());
+                flow.setInstructions(createTunnelIpv4SrcInstructions().build());
+                break;
+            case "f86":
+                // Test Tunnel IPv4 Dst (e.g. set_field:172.16.100.100->tun_dst)
+                id += 86; 
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createTunnelIpv4DstInstructions().build());
+                break;
+            default:
+                LOG.warn("flow type not understood: {}", flowType);
         }
 
         FlowKey key = new FlowKey(new FlowId(Long.toString(id)));
         if (null == flow.isBarrier()) {
             flow.setBarrier(Boolean.FALSE);
         }
-        // flow.setBufferId(new Long(12));
-        BigInteger value = new BigInteger("10", 10);
-        // BigInteger outputPort = new BigInteger("65535", 10);
+        BigInteger value = BigInteger.valueOf(10);
         flow.setCookie(new FlowCookie(value));
         flow.setCookieMask(new FlowCookie(value));
         flow.setHardTimeout(0);
@@ -687,50 +703,40 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         flow.setFlags(new FlowModFlags(false, false, false, false, true));
         flow.setId(new FlowId("12"));
         flow.setTableId(getTableId(tableId));
-        // commenting setOutGroup and setOutPort, as by default
-        // OFPG_ANY is send
-        // enable setOutGroup and setOutPort to enable output filtering
-        // flow.setOutGroup(new Long(2));
-        // set outport to OFPP_NONE (65535) to disable remove restriction for
-        // flow
-        // flow.setOutPort(outputPort);
 
         flow.setKey(key);
-        flow.setFlowName(originalFlowName + "X" + flowType);
+        flow.setFlowName(ORIGINAL_FLOW_NAME + "X" + flowType);
         testFlow = flow;
         return flow;
     }
 
-    
-    private FlowBuilder createTestFlow_perfTest(NodeBuilder nodeBuilder, String flowTypeArg, String tableId, int id) {
 
+    private FlowBuilder createTestFlowPerfTest(String flowTypeArg, String tableId, int id) {
         FlowBuilder flow = new FlowBuilder();
-        //long id = 123;
-
         String flowType = flowTypeArg;
+        int flowId = id;
+        
         if (flowType == null) {
             flowType = "f1";
         }
-        
-        flow.setPriority(id);
+
+        flow.setPriority(flowId);
 
         switch (flowType) {
-        case "f1":
-            id += 1;
-            flow.setMatch(createMatch1().build());
-            flow.setInstructions(createDecNwTtlInstructions().build());
-            break;
-        default:
-            LOG.warn("flow type not understood: {}", flowType);
+            case "f1":
+                flowId += 1;
+                flow.setMatch(createMatch1().build());
+                flow.setInstructions(createDecNwTtlInstructions().build());
+                break;
+            default:
+                LOG.warn("flow type not understood: {}", flowType);
         }
 
-        FlowKey key = new FlowKey(new FlowId(Long.toString(id)));
+        FlowKey key = new FlowKey(new FlowId(Long.toString(flowId)));
         if (null == flow.isBarrier()) {
             flow.setBarrier(Boolean.FALSE);
         }
-        // flow.setBufferId(new Long(12));
-        BigInteger value = new BigInteger("10", 10);
-        // BigInteger outputPort = new BigInteger("65535", 10);
+        BigInteger value = BigInteger.valueOf(10);
         flow.setCookie(new FlowCookie(value));
         flow.setCookieMask(new FlowCookie(value));
         flow.setHardTimeout(0);
@@ -741,20 +747,14 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         flow.setFlags(new FlowModFlags(false, false, false, false, true));
         flow.setId(new FlowId("12"));
         flow.setTableId(getTableId(tableId));
-        // commenting setOutGroup and setOutPort, as by default
-        // OFPG_ANY is send
-        // enable setOutGroup and setOutPort to enable output filtering
-        // flow.setOutGroup(new Long(2));
-        // set outport to OFPP_NONE (65535) to disable remove restriction for
-        // flow
-        // flow.setOutPort(outputPort);
 
         flow.setKey(key);
-        flow.setFlowName(originalFlowName + "X" + flowType);
+        flow.setFlowName(ORIGINAL_FLOW_NAME + "X" + flowType);
         testFlow = flow;
         return flow;
     }
-    private FlowBuilder createtablemiss(NodeBuilder nodeBuilder, String flowTypeArg, String tableId) {
+
+    private FlowBuilder createtablemiss() {
         FlowBuilder flow = new FlowBuilder();
         long id = 456;
         MatchBuilder matchBuilder = new MatchBuilder();
@@ -769,15 +769,15 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
     }
 
     private short getTableId(String tableId) {
-        short table = 2;
+        final short TABLE_ID = 2;
+        short table = TABLE_ID;
         try {
             table = Short.parseShort(tableId);
         } catch (Exception ex) {
-            // ignore exception and continue with default value
+            LOG.info("Parsing String tableId {} failed. Continuing with default tableId {}.", 
+                    tableId, table);
         }
-
         return table;
-
     }
 
     /**
@@ -796,7 +796,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         // Create an Apply Action
         ApplyActionsBuilder aab = new ApplyActionsBuilder();
         aab.setAction(actionList);
-       
+
         // Wrap our Apply Action in an Instruction
         InstructionBuilder ib = new InstructionBuilder();
         ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
@@ -835,8 +835,8 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
     private static InstructionsBuilder createMetadataInstructions() {
 
         WriteMetadataBuilder aab = new WriteMetadataBuilder();
-        aab.setMetadata(new BigInteger("10", 10));
-        aab.setMetadataMask(new BigInteger("12", 10));
+        aab.setMetadata(BigInteger.valueOf(10));
+        aab.setMetadataMask(BigInteger.valueOf(10));
 
         InstructionBuilder ib = new InstructionBuilder();
         ib.setInstruction(new WriteMetadataCaseBuilder().setWriteMetadata(aab.build()).build());
@@ -853,7 +853,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
     private static InstructionsBuilder createGotoTableInstructions() {
 
         GoToTableBuilder aab = new GoToTableBuilder();
-        aab.setTableId((short) 2);
+        aab.setTableId((short) 5);
 
         InstructionBuilder ib = new InstructionBuilder();
         ib.setInstruction(new GoToTableCaseBuilder().setGoToTable(aab.build()).build());
@@ -987,7 +987,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         ActionBuilder ab = new ActionBuilder();
 
         OutputActionBuilder output = new OutputActionBuilder();
-        output.setMaxLength(new Integer(0xffff));
+        output.setMaxLength(Integer.valueOf(0xffff));
         Uri value = new Uri(OutputPortValues.CONTROLLER.toString());
         output.setOutputNodeConnector(value);
         ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
@@ -1075,7 +1075,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         ActionBuilder ab = new ActionBuilder();
 
         PushMplsActionBuilder push = new PushMplsActionBuilder();
-        push.setEthernetType(new Integer(0x8847));
+        push.setEthernetType(Integer.valueOf(0x8847));
         ab.setAction(new PushMplsActionCaseBuilder().setPushMplsAction(push.build()).build());
         ab.setKey(new ActionKey(0));
         actionList.add(ab.build());
@@ -1102,7 +1102,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         ActionBuilder ab = new ActionBuilder();
 
         PushPbbActionBuilder pbb = new PushPbbActionBuilder();
-        pbb.setEthernetType(new Integer(0x88E7));
+        pbb.setEthernetType(Integer.valueOf(0x88E7));
         ab.setAction(new PushPbbActionCaseBuilder().setPushPbbAction(pbb.build()).build());
         ab.setKey(new ActionKey(0));
         actionList.add(ab.build());
@@ -1129,7 +1129,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         ActionBuilder ab = new ActionBuilder();
 
         PushVlanActionBuilder vlan = new PushVlanActionBuilder();
-        vlan.setEthernetType(new Integer(0x8100));
+        vlan.setEthernetType(Integer.valueOf(0x8100));
         ab.setAction(new PushVlanActionCaseBuilder().setPushVlanAction(vlan.build()).build());
         ab.setKey(new ActionKey(0));
         actionList.add(ab.build());
@@ -1728,7 +1728,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         SetNextHopActionBuilder setNextHopActionBuilder = new SetNextHopActionBuilder();
         Ipv4Builder ipnext = new Ipv4Builder();
-        Ipv4Prefix prefix = new Ipv4Prefix("10.0.0.1/24");
+        Ipv4Prefix prefix = new Ipv4Prefix(IPV4_PREFIX);
         ipnext.setIpv4Address(prefix);
         setNextHopActionBuilder.setAddress(ipnext.build());
         ab.setAction(new SetNextHopActionCaseBuilder().setSetNextHopAction(setNextHopActionBuilder.build()).build());
@@ -2369,8 +2369,8 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         SetFieldBuilder setFieldBuilder4 = new SetFieldBuilder();
 
         // setting the values of ARP
-        MacAddress macdest = new MacAddress("ff:ff:ff:ff:ff:ff");
-        MacAddress macsrc = new MacAddress("00:00:00:00:23:ae");
+        MacAddress macdest = new MacAddress(DEST_MAC_ADDRESS);
+        MacAddress macsrc = new MacAddress(SRC_MAC_ADDRESS);
         Ipv4Prefix dstiparp = new Ipv4Prefix("200.71.9.52");
         Ipv4Prefix srciparp = new Ipv4Prefix("100.1.1.1");
         // create ARP match action
@@ -2435,13 +2435,6 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
         ActionBuilder ab1 = new ActionBuilder();
         SetFieldBuilder setFieldBuilder1 = new SetFieldBuilder();
-        /*
-         * ActionBuilder ab2 = new ActionBuilder(); SetFieldBuilder
-         * setFieldBuilder2 = new SetFieldBuilder(); ActionBuilder ab3 = new
-         * ActionBuilder(); SetFieldBuilder setFieldBuilder3 = new
-         * SetFieldBuilder(); ActionBuilder ab4 = new ActionBuilder();
-         * SetFieldBuilder setFieldBuilder4 = new SetFieldBuilder();
-         */
         ActionBuilder ab5 = new ActionBuilder();
         SetFieldBuilder setFieldBuilder5 = new SetFieldBuilder();
         ActionBuilder ab6 = new ActionBuilder();
@@ -2450,18 +2443,11 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         // IPv6
         Ipv6MatchBuilder ipv6Builder = new Ipv6MatchBuilder();
         Ipv6MatchBuilder ipv6Builder1 = new Ipv6MatchBuilder();
-        // Ipv6MatchBuilder ipv6Builder2 = new Ipv6MatchBuilder();
-        // Ipv6MatchBuilder ipv6Builder3 = new Ipv6MatchBuilder();
-        // Ipv6MatchBuilder ipv6Builder4 = new Ipv6MatchBuilder();
         Ipv6MatchBuilder ipv6Builder5 = new Ipv6MatchBuilder();
         Ipv6MatchBuilder ipv6Builder6 = new Ipv6MatchBuilder();
 
         Ipv6Prefix dstip6 = new Ipv6Prefix("2002::2");
         Ipv6Prefix srcip6 = new Ipv6Prefix("2001:0:0:0:0:0:0:1");
-        // Ipv6Address ndtarget = new
-        // Ipv6Address("2001:db8:0:1:fd97:f9f0:a810:782e");
-        // MacAddress ndsll = new MacAddress("c2:00:54:f5:00:00");
-        // MacAddress ndtll = new MacAddress("00:0c:29:0e:4c:67");
         Ipv6ExtHeaderBuilder nextheader = new Ipv6ExtHeaderBuilder();
         nextheader.setIpv6Exthdr(58);
         Ipv6LabelBuilder ipv6label = new Ipv6LabelBuilder();
@@ -2470,9 +2456,6 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         ipv6Builder.setIpv6Source(srcip6);
         ipv6Builder1.setIpv6Destination(dstip6);
-        // ipv6Builder2.setIpv6NdTarget(ndtarget);
-        // ipv6Builder3.setIpv6NdSll(ndsll);
-        // ipv6Builder4.setIpv6NdTll(ndtll);
         ipv6Builder5.setIpv6ExtHeader(nextheader.build());
         ipv6Builder6.setIpv6Label(ipv6label.build());
 
@@ -2486,22 +2469,6 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         ab1.setKey(new ActionKey(1));
         actionLists.add(ab1.build());
 
-        /*
-         * setFieldBuilder2.setLayer3Match(ipv6Builder2.build());
-         * ab2.setAction(new
-         * SetFieldCaseBuilder().setSetField(setFieldBuilder2.build()).build());
-         * ab2.setKey(new ActionKey(2)); actionLists.add(ab2.build());
-         *
-         * setFieldBuilder3.setLayer3Match(ipv6Builder3.build());
-         * ab3.setAction(new
-         * SetFieldCaseBuilder().setSetField(setFieldBuilder3.build()).build());
-         * ab3.setKey(new ActionKey(3)); actionLists.add(ab3.build());
-         *
-         * setFieldBuilder4.setLayer3Match(ipv6Builder4.build());
-         * ab4.setAction(new
-         * SetFieldCaseBuilder().setSetField(setFieldBuilder4.build()).build());
-         * ab4.setKey(new ActionKey(4)); actionLists.add(ab4.build());
-         */
         setFieldBuilder5.setLayer3Match(ipv6Builder5.build());
         ab5.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder5.build()).build());
         ab5.setKey(new ActionKey(5));
@@ -2619,7 +2586,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
         // PBB
         ProtocolMatchFieldsBuilder protomatch = new ProtocolMatchFieldsBuilder();
-        protomatch.setPbb(new PbbBuilder().setPbbIsid(4L).setPbbMask((new BigInteger(new byte[] { 0, 1, 0, 0 }).longValue())).build());
+        protomatch.setPbb(new PbbBuilder().setPbbIsid(4L).setPbbMask((new BigInteger(new byte[]{0, 1, 0, 0}).longValue())).build());
         setFieldBuilder.setProtocolMatchFields(protomatch.build());
         ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
         actionList.add(ab.build());
@@ -2667,6 +2634,70 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         return isb;
     }
 
+    private static InstructionsBuilder createTunnelIpv4DstInstructions() {
+
+        List<Action> actionList = new ArrayList<Action>();
+        ActionBuilder ab = new ActionBuilder();
+        // Build the tunnel endpoint destination IPv4 address
+        SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
+        Ipv4Prefix dstIp = new Ipv4Prefix("172.16.100.100");
+        // Add the mew IPv4 object as the tunnel destination
+        TunnelIpv4MatchBuilder tunnelIpv4DstMatchBuilder = new TunnelIpv4MatchBuilder();
+        tunnelIpv4DstMatchBuilder.setTunnelIpv4Destination(dstIp);
+        setFieldBuilder.setLayer3Match(tunnelIpv4DstMatchBuilder.build());
+        // Add the IPv4 tunnel dst to the set_field value
+        ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
+        ab.setOrder(0);
+        ab.setKey(new ActionKey(0));
+        actionList.add(ab.build());
+        // Resulting action is a per/flow src TEP (set_field:172.16.100.100->tun_dst)
+        ApplyActionsBuilder aab = new ApplyActionsBuilder();
+        aab.setAction(actionList);
+        // Add the action to the ordered list of Instructions
+        InstructionBuilder ib = new InstructionBuilder();
+        ib.setOrder(0);
+        ib.setKey(new InstructionKey(0));
+        ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
+        // Add the Instruction in a list of Instructions
+        InstructionsBuilder isb = new InstructionsBuilder();
+        List<Instruction> instructions = new ArrayList<Instruction>();
+        instructions.add(ib.build());
+        isb.setInstruction(instructions);
+        return isb;
+    }
+
+    private static InstructionsBuilder createTunnelIpv4SrcInstructions() {
+
+        List<Action> actionList = new ArrayList<Action>();
+        ActionBuilder ab = new ActionBuilder();
+        // Build the tunnel endpoint source IPv4 address
+        SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
+        Ipv4Prefix dstIp = new Ipv4Prefix("172.16.100.200");
+        // Add the new IPv4 object as the tunnel destination
+        TunnelIpv4MatchBuilder tunnelIpv4MatchBuilder = new TunnelIpv4MatchBuilder();
+        tunnelIpv4MatchBuilder.setTunnelIpv4Source(dstIp);
+        setFieldBuilder.setLayer3Match(tunnelIpv4MatchBuilder.build());
+        // Add the IPv4 tunnel src to the set_field value
+        ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
+        ab.setOrder(0);
+        ab.setKey(new ActionKey(0));
+        actionList.add(ab.build());
+        // Resulting action is a per/flow src TEP (set_field:172.16.100.100->tun_src)
+        ApplyActionsBuilder aab = new ApplyActionsBuilder();
+        aab.setAction(actionList);
+        // Add the action to the ordered list of Instructions
+        InstructionBuilder ib = new InstructionBuilder();
+        ib.setOrder(0);
+        ib.setKey(new InstructionKey(0));
+        ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
+        // Put our Instruction in a list of Instructions
+        InstructionsBuilder isb = new InstructionsBuilder();
+        List<Instruction> instructions = new ArrayList<Instruction>();
+        instructions.add(ib.build());
+        isb.setInstruction(instructions);
+        return isb;
+    }
+
     private static MatchBuilder createLLDPMatch() {
         MatchBuilder match = new MatchBuilder();
         EthernetMatchBuilder eth = new EthernetMatchBuilder();
@@ -2683,7 +2714,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
     private static MatchBuilder createMatch1() {
         MatchBuilder match = new MatchBuilder();
         Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
-        Ipv4Prefix prefix = new Ipv4Prefix("10.0.0.1/24");
+        Ipv4Prefix prefix = new Ipv4Prefix(IPV4_PREFIX);;
         ipv4Match.setIpv4Destination(prefix);
         Ipv4Match i4m = ipv4Match.build();
         match.setLayer3Match(i4m);
@@ -2696,38 +2727,6 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         return match;
     }
 
-    /**
-     * @return
-     */
-    private static MatchBuilder createIPv4DstMatch() {
-        MatchBuilder match = new MatchBuilder();
-        Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
-        Ipv4Prefix prefix = new Ipv4Prefix("10.0.0.1/24");
-        ipv4Match.setIpv4Destination(prefix);
-        Ipv4Match i4m = ipv4Match.build();
-        match.setLayer3Match(i4m);
-
-        return match;
-    }
-
-    /**
-     * @return
-     */
-    private static MatchBuilder createIPv4SrcMatch() {
-        MatchBuilder match = new MatchBuilder();
-        Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
-        Ipv4Prefix prefix = new Ipv4Prefix("10.20.30.40/24");
-        ipv4Match.setIpv4Source(prefix);
-        Ipv4Match i4m = ipv4Match.build();
-        match.setLayer3Match(i4m);
-
-        EthernetMatchBuilder eth = new EthernetMatchBuilder();
-        EthernetTypeBuilder ethTypeBuilder = new EthernetTypeBuilder();
-        ethTypeBuilder.setType(new EtherType(0x0800L));
-        eth.setEthernetType(ethTypeBuilder.build());
-        match.setEthernetMatch(eth.build());
-        return match;
-    }
 
     /**
      * @return
@@ -2774,12 +2773,15 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         eth.setEthernetType(ethTypeBuilder.build());
         match.setEthernetMatch(eth.build());
 
-        IpMatchBuilder ipmatch = new IpMatchBuilder(); // ipv4 version
+        // ipv4 version
+        IpMatchBuilder ipmatch = new IpMatchBuilder(); 
         ipmatch.setIpProtocol((short) 256);
         match.setIpMatch(ipmatch.build());
-
-        Icmpv6MatchBuilder icmpv6match = new Icmpv6MatchBuilder(); // icmpv6
-                                                                   // match
+        
+        // icmpv6
+        Icmpv6MatchBuilder icmpv6match = new Icmpv6MatchBuilder();
+        
+        // match
         icmpv6match.setIcmpv6Type((short) 135);
         icmpv6match.setIcmpv6Code((short) 1);
         match.setIcmpv6Match(icmpv6match.build());
@@ -2813,27 +2815,23 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static MatchBuilder createEthernetMatch() {
         MatchBuilder match = new MatchBuilder();
-
-        byte[] mask1 = new byte[] { (byte) -1, (byte) -1, 0, 0, 0, 0 };
-        byte[] mask2 = new byte[] { (byte) -1, (byte) -1, (byte) -1, 0, 0, 0 };
-
         EthernetMatchBuilder ethmatch = new EthernetMatchBuilder(); // ethernettype
-                                                                    // match
+        // match
         EthernetTypeBuilder ethtype = new EthernetTypeBuilder();
         EtherType type = new EtherType(0x0800L);
         ethmatch.setEthernetType(ethtype.setType(type).build());
 
         EthernetDestinationBuilder ethdest = new EthernetDestinationBuilder(); // ethernet
-                                                                               // macaddress
-                                                                               // match
-        MacAddress macdest = new MacAddress("ff:ff:ff:ff:ff:ff");
+        // macaddress
+        // match
+        MacAddress macdest = new MacAddress(DEST_MAC_ADDRESS);
         ethdest.setAddress(macdest);
         ethdest.setMask(new MacAddress("ff:ff:ff:00:00:00"));
 
         ethmatch.setEthernetDestination(ethdest.build());
 
         EthernetSourceBuilder ethsrc = new EthernetSourceBuilder();
-        MacAddress macsrc = new MacAddress("00:00:00:00:23:ae");
+        MacAddress macsrc = new MacAddress(SRC_MAC_ADDRESS);
         ethsrc.setAddress(macsrc);
         ethsrc.setMask(new MacAddress("ff:ff:00:00:00:00"));
 
@@ -2849,7 +2847,8 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     private static MatchBuilder createVlanMatch() {
         MatchBuilder match = new MatchBuilder();
-        VlanMatchBuilder vlanBuilder = new VlanMatchBuilder(); // vlan match
+        // vlan match
+        VlanMatchBuilder vlanBuilder = new VlanMatchBuilder(); 
         VlanIdBuilder vlanIdBuilder = new VlanIdBuilder();
         VlanId vlanId = new VlanId(10);
         VlanPcp vpcp = new VlanPcp((short) 3);
@@ -2868,20 +2867,19 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         MatchBuilder match = new MatchBuilder();
 
         EthernetMatchBuilder ethmatch = new EthernetMatchBuilder();
-        MacAddress macdest = new MacAddress("ff:ff:ff:ff:ff:ff");
-        MacAddress macsrc = new MacAddress("00:00:00:00:23:ae");
-
-        byte[] mask = new byte[] { (byte) -1, (byte) -1, 0, 0, 0, 0 };
-        byte[] mask2 = new byte[] { (byte) -1, (byte) -1, (byte) -1, 0, 0, 0 };
+        MacAddress macdest = new MacAddress(DEST_MAC_ADDRESS);
+        MacAddress macsrc = new MacAddress(SRC_MAC_ADDRESS);
 
         EthernetTypeBuilder ethtype = new EthernetTypeBuilder();
         EtherType type = new EtherType(0x0806L);
         ethmatch.setEthernetType(ethtype.setType(type).build());
 
-        Ipv4Prefix dstip = new Ipv4Prefix("200.71.9.52/10"); // ipv4 match
+        // ipv4 match
+        Ipv4Prefix dstip = new Ipv4Prefix("200.71.9.52/10"); 
         Ipv4Prefix srcip = new Ipv4Prefix("100.1.1.1/8");
 
-        ArpMatchBuilder arpmatch = new ArpMatchBuilder(); // arp match
+        // arp match
+        ArpMatchBuilder arpmatch = new ArpMatchBuilder(); 
         ArpSourceHardwareAddressBuilder arpsrc = new ArpSourceHardwareAddressBuilder();
         arpsrc.setAddress(macsrc);
         arpsrc.setMask(new MacAddress("ff:ff:ff:00:00:00"));
@@ -2900,25 +2898,6 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         return match;
     }
 
-    /**
-     * @return
-     */
-    private static MatchBuilder createIPMatch() {
-        MatchBuilder match = new MatchBuilder();
-        EthernetMatchBuilder ethmatch = new EthernetMatchBuilder();
-        EthernetTypeBuilder ethtype = new EthernetTypeBuilder();
-        EtherType type = new EtherType(0x0800L);
-        ethmatch.setEthernetType(ethtype.setType(type).build());
-        match.setEthernetMatch(ethmatch.build());
-
-        IpMatchBuilder ipmatch = new IpMatchBuilder(); // ipv4 version
-        ipmatch.setIpProtocol((short) 1);
-        Dscp dscp = new Dscp((short) 3);
-        ipmatch.setIpDscp(dscp);
-        ipmatch.setIpEcn((short) 2);
-        match.setIpMatch(ipmatch.build());
-        return match;
-    }
 
     /**
      * @return
@@ -2933,7 +2912,8 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         match.setEthernetMatch(eth.build());
 
         Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
-        Ipv4Prefix dstip = new Ipv4Prefix("200.71.9.52/10"); // ipv4 match
+        // ipv4 match
+        Ipv4Prefix dstip = new Ipv4Prefix("200.71.9.52/10"); 
         Ipv4Prefix srcip = new Ipv4Prefix("100.1.1.1/8");
         Ipv4MatchBuilder ipv4match = new Ipv4MatchBuilder();
         ipv4match.setIpv4Destination(dstip);
@@ -2969,7 +2949,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         ipv6label.setFlabelMask(new Ipv6FlowLabel(1L));
 
         Icmpv6MatchBuilder icmpv6match = new Icmpv6MatchBuilder(); // icmpv6
-                                                                   // match
+        // match
         icmpv6match.setIcmpv6Type((short) 135);
         icmpv6match.setIcmpv6Code((short) 0);
         match.setIcmpv6Match(icmpv6match.build());
@@ -3005,7 +2985,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         match.setIpMatch(ipmatch.build());
 
         Icmpv4MatchBuilder icmpv4match = new Icmpv4MatchBuilder(); // icmpv4
-                                                                   // match
+        // match
         icmpv4match.setIcmpv4Type((short) 8);
         icmpv4match.setIcmpv4Code((short) 0);
         match.setIcmpv4Match(icmpv4match.build());
@@ -3029,7 +3009,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         match.setIpMatch(ipmatch.build());
 
         Icmpv6MatchBuilder icmpv6match = new Icmpv6MatchBuilder(); // icmpv6
-                                                                   // match
+        // match
         icmpv6match.setIcmpv6Type((short) 135);
         icmpv6match.setIcmpv6Code((short) 1);
         match.setIcmpv6Match(icmpv6match.build());
@@ -3140,10 +3120,10 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
      */
     private static MatchBuilder createMetadataMatch() {
         MatchBuilder match = new MatchBuilder();
-        byte[] metamask = new byte[] { (byte) -1, (byte) -1, (byte) -1, 0, 0, 0, (byte) 1, (byte) 1 };
+        byte[] metamask = new byte[]{(byte) -1, (byte) -1, (byte) -1, 0, 0, 0, (byte) 1, (byte) 1};
         MetadataBuilder metadata = new MetadataBuilder(); // metadata match
         metadata.setMetadata(BigInteger.valueOf(500L));
-        metadata.setMetadataMask(new BigInteger(metamask));
+        metadata.setMetadataMask(new BigInteger(1, metamask));
         match.setMetadata(metadata.build());
 
         return match;
@@ -3186,7 +3166,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
         ProtocolMatchFieldsBuilder protomatch = new ProtocolMatchFieldsBuilder(); // mpls
         // match
-        protomatch.setPbb(new PbbBuilder().setPbbIsid(4L).setPbbMask(new BigInteger(new byte[] { 0, 1, 0, 0 }).longValue()).build());
+        protomatch.setPbb(new PbbBuilder().setPbbIsid(4L).setPbbMask(new BigInteger(new byte[]{0, 1, 0, 0}).longValue()).build());
         match.setProtocolMatchFields(protomatch.build());
 
         return match;
@@ -3200,8 +3180,8 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         MatchBuilder match = new MatchBuilder();
         TunnelBuilder tunnel = new TunnelBuilder(); // tunnel id match
         tunnel.setTunnelId(BigInteger.valueOf(10668));
-        byte[] mask = new byte[] { (byte) -1, (byte) -1, (byte) -1, 0, 0, 0, (byte) 1, (byte) 1 };
-        tunnel.setTunnelMask(new BigInteger(mask));
+        byte[] mask = new byte[]{(byte) -1, (byte) -1, (byte) -1, 0, 0, 0, (byte) 1, (byte) 1};
+        tunnel.setTunnelMask(new BigInteger(1, mask));
         match.setTunnel(tunnel.build());
 
         return match;
@@ -3209,6 +3189,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
 
     /**
      * Test match for TCP_Flags
+     *
      * @return match containing Ethertype (0x0800), IP Protocol (TCP), TCP_Flag (SYN)
      */
     //FIXME: move to extensible support
@@ -3233,11 +3214,11 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         tcpMatch.setTcpDestinationPort(dstPort);
         match.setLayer4Match(tcpMatch.build());
         /**
-        * Defined TCP Flag values in OVS v2.1+
-        * TCP_FIN 0x001 / TCP_SYN 0x002 / TCP_RST 0x004
-        * TCP_PSH 0x008 / TCP_ACK 0x010 / TCP_URG 0x020
-        * TCP_ECE 0x040 / TCP_CWR 0x080 / TCP_NS  0x100
-        */
+         * Defined TCP Flag values in OVS v2.1+
+         * TCP_FIN 0x001 / TCP_SYN 0x002 / TCP_RST 0x004
+         * TCP_PSH 0x008 / TCP_ACK 0x010 / TCP_URG 0x020
+         * TCP_ECE 0x040 / TCP_CWR 0x080 / TCP_NS  0x100
+         */
         TcpFlagMatchBuilder tcpFlagMatch = new TcpFlagMatchBuilder();
         tcpFlagMatch.setTcpFlag(0x002);
         match.setTcpFlagMatch(tcpFlagMatch.build());
@@ -3245,85 +3226,88 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         return match;
     }
 
-    public void _removeMDFlow(CommandInterpreter ci) {
-        DataModification<InstanceIdentifier<?>, DataObject> modification = dataBrokerService.beginTransaction();
+    public void _removeMDFlow(final CommandInterpreter ci) {
+        ReadWriteTransaction modification = dataBroker.newReadWriteTransaction();
         NodeBuilder tn = createTestNode(ci.nextArgument());
         String flowtype = ci.nextArgument();
         FlowBuilder tf;
         if (flowtype.equals("fTM")) {
-            tf = createtablemiss(tn, flowtype, ci.nextArgument());
+            tf = createtablemiss();
         } else {
             tf = createTestFlow(tn, flowtype, ci.nextArgument());
         }
-        InstanceIdentifier<Flow> path1 = InstanceIdentifier.builder(Nodes.class).child(Node.class, tn.getKey())
+        InstanceIdentifier<Flow> path1 = InstanceIdentifier.create(Nodes.class).child(Node.class, tn.getKey())
                 .augmentation(FlowCapableNode.class).child(Table.class, new TableKey(tf.getTableId()))
-                .child(Flow.class, tf.getKey()).build();
-        modification.removeConfigurationData(path1);
-        Future<RpcResult<TransactionStatus>> commitFuture = modification.commit();
-        try {
-            RpcResult<TransactionStatus> result = commitFuture.get();
-            TransactionStatus status = result.getResult();
-            ci.println("Status of Flow Data Loaded Transaction: " + status);
-
-        } catch (InterruptedException e) {
-            LOG.error(e.getMessage(), e);
-        } catch (ExecutionException e) {
-            LOG.error(e.getMessage(), e);
-        }
+                .child(Flow.class, tf.getKey());
+        modification.delete(LogicalDatastoreType.CONFIGURATION, path1);
+        CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
+        Futures.addCallback(commitFuture, new FutureCallback<Void>() {
+            @Override
+            public void onSuccess(Void aVoid) {
+                ci.println("Status of Group Data Loaded Transaction: success.");
+            }
+
+            @Override
+            public void onFailure(Throwable throwable) {
+                LOG.error(throwable.getMessage(), throwable);
+                ci.println(String.format("Status of Group Data Loaded Transaction : failure. Reason : %s", throwable));
+            }
+        });
     }
 
     /**
      * @param ci arguments: switchId flowType tableNum
-     * 
-     * <pre>
-     * e.g.: addMDFlow openflow:1 f1 42
-     * </pre>
+     *           <p>
+     *           <pre>
+     *                     e.g.: addMDFlow openflow:1 f1 42
+     *                     </pre>
      */
     public void _addMDFlow(CommandInterpreter ci) {
         NodeBuilder tn = createTestNode(ci.nextArgument());
         String flowtype = ci.nextArgument();
         FlowBuilder tf;
         if (flowtype.equals("fTM")) {
-            tf = createtablemiss(tn, flowtype, ci.nextArgument());
+            tf = createtablemiss();
         } else {
             tf = createTestFlow(tn, flowtype, ci.nextArgument());
         }
         writeFlow(ci, tf, tn);
     }
 
-    private void writeFlow(CommandInterpreter ci, FlowBuilder flow, NodeBuilder nodeBuilder) {
-        DataModification<InstanceIdentifier<?>, DataObject> modification = dataBrokerService.beginTransaction();
-        InstanceIdentifier<Flow> path1 = InstanceIdentifier.builder(Nodes.class)
+    private void writeFlow(final CommandInterpreter ci, FlowBuilder flow, NodeBuilder nodeBuilder) {
+        ReadWriteTransaction modification = dataBroker.newReadWriteTransaction();
+        InstanceIdentifier<Flow> path1 = InstanceIdentifier.create(Nodes.class)
                 .child(Node.class, nodeBuilder.getKey()).augmentation(FlowCapableNode.class)
-                .child(Table.class, new TableKey(flow.getTableId())).child(Flow.class, flow.getKey()).build();
-        modification.putConfigurationData(nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build());
-        modification.putConfigurationData(path1, flow.build());
-        Future<RpcResult<TransactionStatus>> commitFuture = modification.commit();
-        try {
-            RpcResult<TransactionStatus> result = commitFuture.get();
-            TransactionStatus status = result.getResult();
-            ci.println("Status of Flow Data Loaded Transaction: " + status);
-
-        } catch (InterruptedException e) {
-            LOG.error(e.getMessage(), e);
-        } catch (ExecutionException e) {
-            LOG.error(e.getMessage(), e);
-        }
+                .child(Table.class, new TableKey(flow.getTableId())).child(Flow.class, flow.getKey());
+        modification.merge(LogicalDatastoreType.CONFIGURATION, nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(), true);
+        modification.merge(LogicalDatastoreType.CONFIGURATION, path1, flow.build(), true);
+        CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
+        Futures.addCallback(commitFuture, new FutureCallback<Void>() {
+            @Override
+            public void onSuccess(Void aVoid) {
+                ci.println("Status of Group Data Loaded Transaction: success.");
+            }
+
+            @Override
+            public void onFailure(Throwable throwable) {
+                LOG.error(throwable.getMessage(), throwable);
+                ci.println(String.format("Status of Group Data Loaded Transaction : failure. Reason : %s", throwable));
+            }
+        });
     }
 
     public void _modifyMDFlow(CommandInterpreter ci) {
         NodeBuilder tn = createTestNode(ci.nextArgument());
         FlowBuilder tf = createTestFlow(tn, ci.nextArgument(), ci.nextArgument());
-        tf.setFlowName(updatedFlowName);
+        tf.setFlowName(UPDATED_FLOW_NAME);
         writeFlow(ci, tf, tn);
-        tf.setFlowName(originalFlowName);
+        tf.setFlowName(ORIGINAL_FLOW_NAME);
         writeFlow(ci, tf, tn);
     }
 
     private static NodeRef createNodeRef(String string) {
         NodeKey key = new NodeKey(new NodeId(string));
-        InstanceIdentifier<Node> path = InstanceIdentifier.builder(Nodes.class).child(Node.class, key)
-                .toInstance();
+        InstanceIdentifier<Node> path = InstanceIdentifier.create(Nodes.class).child(Node.class, key);
 
         return new NodeRef(path);
     }
@@ -3332,101 +3316,99 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
     public String getHelp() {
         return "No help";
     }
-    
+
     /*
      * usage testSwitchFlows <numberOfSwitches> <numberOfFlows> <warmup iterations> <Number Of Threads>
      * ex: _perfFlowTest 10 5 1 2
      */
     public void _perfFlowTest(CommandInterpreter ci) {
-       
+
         String numberOfSwtichesStr = ci.nextArgument();
         String numberOfFlowsStr = ci.nextArgument();
         String warmupIterationsStr = ci.nextArgument();
         String threadCountStr = ci.nextArgument();
         String warmUpStr = ci.nextArgument();
-        
+
         Collection<String> testResults = null;
-        if(testResults == null){
-               testResults = new ArrayList<String>();
+        if (testResults == null) {
+            testResults = new ArrayList<String>();
         }
-         
+
         int numberOfSwtiches = 0;
         int numberOfFlows = 0;
         int warmupIterations = 0;
         boolean warmUpIterations = false;
 
         int threadCount = 0;
-        if(numberOfSwtichesStr !=null && !numberOfSwtichesStr.trim().equals("")){
-               numberOfSwtiches = new Integer(numberOfSwtichesStr).intValue();
-        }else {
-               numberOfSwtiches = 2;
+        if (numberOfSwtichesStr != null && !numberOfSwtichesStr.trim().equals("")) {
+            numberOfSwtiches = Integer.parseInt(numberOfSwtichesStr);
+        } else {
+            numberOfSwtiches = 2;
         }
-        
-        if(numberOfFlowsStr !=null && !numberOfFlowsStr.trim().equals("")){
-               numberOfFlows = new Integer(numberOfFlowsStr).intValue();
-        }else {
-               numberOfFlows = 2;
+
+        if (numberOfFlowsStr != null && !numberOfFlowsStr.trim().equals("")) {
+            numberOfFlows = Integer.parseInt(numberOfFlowsStr);
+        } else {
+            numberOfFlows = 2;
         }
-        
-        if(warmupIterationsStr !=null && !warmupIterationsStr.trim().equals("")){
-               warmupIterations = new Integer(warmupIterationsStr).intValue();
-        }else {
-               warmupIterations = 2;
+
+        if (warmupIterationsStr != null && !warmupIterationsStr.trim().equals("")) {
+            warmupIterations = Integer.parseInt(warmupIterationsStr);
+        } else {
+            warmupIterations = 2;
         }
-        
-        if(threadCountStr !=null && !threadCountStr.trim().equals("")){
-               threadCount = new Integer(threadCountStr).intValue();
-        }else {
-               threadCount = 2; 
+
+        if (threadCountStr != null && !threadCountStr.trim().equals("")) {
+            threadCount = Integer.parseInt(threadCountStr);
+        } else {
+            threadCount = 2;
+        }
+        if (warmUpStr != null && !warmUpStr.trim().equals("") && warmUpStr.trim().equals("true")) {
+            warmUpIterations = true;
+        } else {
+            warmUpIterations = false;
         }
-         if(warmUpStr !=null && !warmUpStr.trim().equals("") && warmUpStr.trim().equals("true")){
-             warmUpIterations = true;
-         }else {
-             warmUpIterations = false;
-         }    
         ci.println("*     Test Configurations*");
-        ci.println("*     numberOfSwtiches:::"+numberOfSwtiches+"");
-        ci.println("*     numberOfFlows:::"+numberOfFlows+"");
-        ci.println("*     warmupIterations:::"+warmupIterations+"");
-        ci.println("*     Number of Threads :::"+threadCount+"");
-        ci.println("*     Warmup Required? :::"+warmUpIterations+"");
-        
-        String dataPath="openflow:1";
-        String flowType = "fTM";
+        ci.println("*     numberOfSwtiches:::" + numberOfSwtiches + "");
+        ci.println("*     numberOfFlows:::" + numberOfFlows + "");
+        ci.println("*     warmupIterations:::" + warmupIterations + "");
+        ci.println("*     Number of Threads :::" + threadCount + "");
+        ci.println("*     Warmup Required? :::" + warmUpIterations + "");
+
+        String dataPath = "openflow:1";
         NodeBuilder tn;
         FlowBuilder tf;
         String tableId = "0";
-        if(warmUpIterations){
-        ci.println("----Warmup Started-----");
-        for(int j =1; j<= warmupIterations; j++){
-               for(int i =1;i<=numberOfSwtiches;i++){
-                        dataPath = "openflow:"+i;
-                        tn = createTestNode(dataPath);
-                       for (int flow=1;flow<numberOfFlows;flow++){
-                                tf = createTestFlow_perfTest(tn, "f1", tableId, flow);
-                                writeFlow(ci, tf, tn);
-                       }
-               }
-         }
-
-       ci.println("----Warmup Done-----");
+        if (warmUpIterations) {
+            ci.println("----Warmup Started-----");
+            for (int j = 1; j <= warmupIterations; j++) {
+                for (int i = 1; i <= numberOfSwtiches; i++) {
+                    dataPath = "openflow:" + i;
+                    tn = createTestNode(dataPath);
+                    for (int flow = 1; flow < numberOfFlows; flow++) {
+                        tf = createTestFlowPerfTest("f1", tableId, flow);
+                        writeFlow(ci, tf, tn);
+                    }
+                }
+            }
+
+            ci.println("----Warmup Done-----");
         }
-       try{
-              ExecutorService executor = Executors.newFixedThreadPool(threadCount);
-              int flowID = 0;
-               int tableID = 0;
-              for ( int t=0;t< threadCount;t++){
-                  tableID = t+1;
-                  Runnable tRunnable = new TestFlowThread(numberOfSwtiches, numberOfFlows, ci, t, tableID);
-                  executor.execute(tRunnable);
-              }
-              executor.shutdown();
-              executor.awaitTermination(1, TimeUnit.SECONDS);
-       } catch(Exception e){
-         ci.println("Exception:"+e.getMessage());
-       }
-    }
-    
+        try {
+            ExecutorService executor = Executors.newFixedThreadPool(threadCount);
+            int tableID = 0;
+            for (int t = 0; t < threadCount; t++) {
+                tableID = t + 1;
+                Runnable tRunnable = new TestFlowThread(numberOfSwtiches, numberOfFlows, ci, t, tableID);
+                executor.execute(tRunnable);
+            }
+            executor.shutdown();
+            executor.awaitTermination(1, TimeUnit.SECONDS);
+        } catch (Exception e) {
+            ci.println("Exception:" + e.getMessage());
+        }
+    }
+
     public class TestFlowThread implements Runnable {
 
         int numberOfSwitches;
@@ -3467,7 +3449,7 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
                 dataPath = "openflow:" + i;
                 tn = createTestNode(dataPath);
                 for (int flow2 = 1; flow2 <= this.numberOfFlows; flow2++) {
-                    tf = createTestFlow_perfTest(tn, "f1", ""+this.tableID, flow2);
+                    tf = createTestFlowPerfTest("f1", "" + this.tableID, flow2);
                     writeFlow(this.ci, tf, tn);
                     totalNumberOfFlows++;
                 }
@@ -3482,32 +3464,32 @@ public class OpenflowpluginTestCommandProvider implements CommandProvider {
         }
 
     }
+
     /*
      * usage testAllFlows <dp>
      * ex: _perfFlowTest 1
      */
     public void _testAllFlows(CommandInterpreter ci) {
-       String dataPathID = ci.nextArgument();
-       int numberOfFlows = 82;
-        int threadCount = 0;
-        if(dataPathID ==null || dataPathID.trim().equals("")){
-               dataPathID = "1";
+        String dataPathID = ci.nextArgument();
+        int numberOfFlows = 82;
+        if (dataPathID == null || dataPathID.trim().equals("")) {
+            dataPathID = "1";
         }
         ci.println("*     Test All Flows       *");
-        ci.println("*     dataPathID:::"+dataPathID+"");
-        String dataPath="openflow:"+dataPathID;
+        ci.println("*     dataPathID:::" + dataPathID + "");
+        String dataPath = "openflow:" + dataPathID;
         String tableId = "0";
         NodeBuilder tn = createTestNode(dataPath);
         FlowBuilder tf;
-               for (int flow=1;flow<numberOfFlows;flow++){
-                       String flowID = "f"+flow;
-                       try{
-                               tf = createTestFlow(tn, flowID, tableId);
-                               writeFlow(ci, tf, tn);
-                       } catch(Exception e){
-                               ci.println("--Test Failed--Issue found while adding flow"+ flow);
-                               break;
-                       }
-               }
+        for (int flow = 1; flow < numberOfFlows; flow++) {
+            String flowID = "f" + flow;
+            try {
+                tf = createTestFlow(tn, flowID, tableId);
+                writeFlow(ci, tf, tn);
+            } catch (Exception e) {
+                ci.println("--Test Failed--Issue found while adding flow" + flow);
+                break;
+            }
+        }
     }
 }