some drop tests statistics were not cleaned on clearstats command
[openflowplugin.git] / test-common / src / main / java / org / opendaylight / openflowplugin / testcommon / DropTestCommiter.java
index 4aa347be4b4ed5458a52b78e022b9899795e918c..f38cbcdd35c3e141950d995ffb9eff7c2ee13394 100644 (file)
@@ -72,7 +72,7 @@ public class DropTestCommiter extends AbstractDropTest {
      * start listening on packetIn
      */
     public void start() {
-        SimpleTaskRetryLooper looper = new SimpleTaskRetryLooper(STARTUP_LOOP_TICK,
+        final SimpleTaskRetryLooper looper = new SimpleTaskRetryLooper(STARTUP_LOOP_TICK,
                 STARTUP_LOOP_MAX_RETRIES);
         try {
             notificationRegistration = looper.loopUntilNoException(new Callable<ListenerRegistration<DropTestCommiter>>() {
@@ -81,7 +81,7 @@ public class DropTestCommiter extends AbstractDropTest {
                     return notificationService.registerNotificationListener(DropTestCommiter.this);
                 }
             });
-        } catch (Exception e) {
+        } catch (final Exception e) {
             LOG.warn("DropTest committer notification listener registration fail!");
             LOG.debug("DropTest committer notification listener registration fail! ..", e);
             throw new IllegalStateException("DropTest startup fail! Try again later.", e);
@@ -91,7 +91,7 @@ public class DropTestCommiter extends AbstractDropTest {
     /**
      * @param dataService the dataService to set
      */
-    public void setDataService(DataBroker dataService) {
+    public void setDataService(final DataBroker dataService) {
         this.dataService = dataService;
     }
 
@@ -102,7 +102,7 @@ public class DropTestCommiter extends AbstractDropTest {
         final FlowBuilder fb = BUILDER.get();
         fb.setMatch(match);
         fb.setInstructions(instructions);
-        fb.setId(new FlowId(String.valueOf(fb.hashCode()) +"."+ ID_COUNTER.getAndIncrement()));
+        fb.setId(new FlowId(String.valueOf(fb.hashCode()) + "." + ID_COUNTER.getAndIncrement()));
 
         // Construct the flow instance id
         final InstanceIdentifier<Flow> flowInstanceId =
@@ -110,11 +110,11 @@ public class DropTestCommiter extends AbstractDropTest {
                 InstanceIdentifier.builder(Nodes.class)
                         // A particular node identified by nodeKey
                         .child(Node.class, node)
-                        // That is flow capable, only FlowCapableNodes have tables
+                                // That is flow capable, only FlowCapableNodes have tables
                         .augmentation(FlowCapableNode.class)
-                        // In the table identified by TableKey
+                                // In the table identified by TableKey
                         .child(Table.class, new TableKey((short) 0))
-                        // A flow identified by flowKey
+                                // A flow identified by flowKey
                         .child(Flow.class, new FlowKey(fb.getId()))
                         .build();
 
@@ -131,12 +131,13 @@ public class DropTestCommiter extends AbstractDropTest {
 
     @Override
     public void close() {
+        super.close();
         try {
             LOG.debug("DropTestProvider stopped.");
             if (notificationRegistration != null) {
                 notificationRegistration.close();
             }
-        } catch (Exception e) {
+        } catch (final Exception e) {
             LOG.warn("unregistration of notification listener failed: {}", e.getMessage());
             LOG.debug("unregistration of notification listener failed.. ", e);
         }
@@ -145,7 +146,7 @@ public class DropTestCommiter extends AbstractDropTest {
     /**
      * @param notificationService
      */
-    public void setNotificationService(NotificationService notificationService) {
+    public void setNotificationService(final NotificationService notificationService) {
         this.notificationService = notificationService;
     }
 }