Merged master fixed conflict.

Change-Id: I1260048f4cc90c422ce6033d506c25ec38d6cc3a
diff --git a/core/net/src/test/java/org/onosproject/net/flow/impl/FlowRuleManagerTest.java b/core/net/src/test/java/org/onosproject/net/flow/impl/FlowRuleManagerTest.java
index 235699d..014cb95 100644
--- a/core/net/src/test/java/org/onosproject/net/flow/impl/FlowRuleManagerTest.java
+++ b/core/net/src/test/java/org/onosproject/net/flow/impl/FlowRuleManagerTest.java
@@ -260,6 +260,22 @@
     }
 
     @Test
+    public void purgeFlowRules() {
+        FlowRule f1 = addFlowRule(1);
+        FlowRule f2 = addFlowRule(2);
+        FlowRule f3 = addFlowRule(3);
+        assertEquals("3 rules should exist", 3, flowCount());
+        FlowEntry fe1 = new DefaultFlowEntry(f1);
+        FlowEntry fe2 = new DefaultFlowEntry(f2);
+        FlowEntry fe3 = new DefaultFlowEntry(f3);
+        providerService.pushFlowMetrics(DID, ImmutableList.of(fe1, fe2, fe3));
+        validateEvents(RULE_ADD_REQUESTED, RULE_ADD_REQUESTED, RULE_ADD_REQUESTED,
+                RULE_ADDED, RULE_ADDED, RULE_ADDED);
+        mgr.purgeFlowRules(DID);
+        assertEquals("0 rule should exist", 0, flowCount());
+    }
+
+    @Test
     public void removeFlowRules() {
         FlowRule f1 = addFlowRule(1);
         FlowRule f2 = addFlowRule(2);
diff --git a/core/net/src/test/java/org/onosproject/net/group/impl/GroupManagerTest.java b/core/net/src/test/java/org/onosproject/net/group/impl/GroupManagerTest.java
index 40ed988..065da4d 100644
--- a/core/net/src/test/java/org/onosproject/net/group/impl/GroupManagerTest.java
+++ b/core/net/src/test/java/org/onosproject/net/group/impl/GroupManagerTest.java
@@ -188,6 +188,21 @@
     }
 
     /**
+     * Tests group Purge Operation.
+     */
+    @Test
+    public void testPurgeGroups() {
+        //Test Group creation before AUDIT process
+        testGroupCreationBeforeAudit(DID);
+        programmableTestCleanUp();
+        testAuditWithExtraneousMissingGroups(DID);
+        // Test group add bucket operations
+        testAddBuckets(DID);
+        // Test group Purge operations
+        testPurgeGroupEntry(DID);
+    }
+
+    /**
      * Tests group bucket modifications (additions and deletions) and
      * Tests group deletion.
      */
@@ -507,6 +522,13 @@
         internalListener.validateEvent(Collections.singletonList(GroupEvent.Type.GROUP_UPDATED));
     }
 
+    // Test purge group entry operations
+    private void testPurgeGroupEntry(DeviceId deviceId) {
+        assertEquals(1, Iterables.size(groupService.getGroups(deviceId, appId)));
+        groupService.purgeGroupEntries(deviceId);
+        assertEquals(0, Iterables.size(groupService.getGroups(deviceId, appId)));
+    }
+
     // Test group remove operations
     private void testRemoveGroup(DeviceId deviceId) {
         GroupKey currKey = new DefaultGroupKey("group1RemoveBuckets".getBytes());