Fix checkstyle and spotbug violations of Legato module 88/90688/2
authorsantanude <santanu.de@xoriant.com>
Thu, 25 Jun 2020 08:40:52 +0000 (10:40 +0200)
committerDonald Hunter <donaldh@cisco.com>
Mon, 29 Jun 2020 13:24:30 +0000 (14:24 +0100)
Signed-off-by: santanude <santanu.de@xoriant.com>
Change-Id: I452bb449510a39e3c8dc9e99f089399a8308d199
Signed-off-by: Donald Hunter <donaldh@cisco.com>
13 files changed:
legato-api/pom.xml
legato-api/src/main/java/org/opendaylight/unimgr/mef/legato/LegatoServiceController.java [changed mode: 0644->0755]
legato-api/src/main/java/org/opendaylight/unimgr/mef/legato/dao/EVCDao.java
legato-api/src/main/java/org/opendaylight/unimgr/mef/legato/util/LegatoUtils.java [changed mode: 0644->0755]
legato-api/src/test/java/org/opendaylight/unimgr/mef/legato/evc/EpLanIntegrationTest.java [changed mode: 0644->0755]
legato-api/src/test/java/org/opendaylight/unimgr/mef/legato/evc/EpLineIntegrationTest.java [changed mode: 0644->0755]
legato-api/src/test/java/org/opendaylight/unimgr/mef/legato/evc/EpTreeIntegrationTest.java [changed mode: 0644->0755]
legato-api/src/test/java/org/opendaylight/unimgr/mef/legato/evc/EvcDataTreeChangeListenerTest.java [changed mode: 0644->0755]
legato-api/src/test/java/org/opendaylight/unimgr/mef/legato/evc/EvcUnitTest.java [changed mode: 0644->0755]
legato-api/src/test/java/org/opendaylight/unimgr/mef/legato/evc/EvpLanIntegrationTest.java [changed mode: 0644->0755]
legato-api/src/test/java/org/opendaylight/unimgr/mef/legato/evc/EvpLineIntegrationTest.java [changed mode: 0644->0755]
legato-api/src/test/java/org/opendaylight/unimgr/mef/legato/evc/EvpTreeIntegrationTest.java [changed mode: 0644->0755]
legato-api/src/test/java/org/opendaylight/unimgr/mef/legato/utils/LegatoUtilsTest.java [changed mode: 0644->0755]

index 8b14cd58325fe553ba652528bc558426c629b57a..b365af69d2e8cf79758b3ef667ddca8a3e1a99f0 100644 (file)
@@ -27,8 +27,6 @@
 
     <properties>
       <controller.model.version>1.11.1</controller.model.version>
-      <odlparent.checkstyle.enforce>false</odlparent.checkstyle.enforce>
-      <odlparent.spotbugs.enforce>false</odlparent.spotbugs.enforce>
     </properties>
 
     <dependencies>
old mode 100644 (file)
new mode 100755 (executable)
index 215e3a1..b31564f
@@ -14,7 +14,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Optional;
 import java.util.concurrent.Future;
-
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
 import org.opendaylight.mdsal.binding.api.DataTreeModification;
@@ -33,9 +32,8 @@ import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev18030
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev180307.CreateConnectivityServiceOutput;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev180307.DeleteConnectivityServiceInput;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev180307.DeleteConnectivityServiceInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev180307.DeleteConnectivityServiceOutput;
 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev180307.TapiConnectivityService;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev180307.UpdateConnectivityServiceInput;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev180307.UpdateConnectivityServiceOutput;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcResult;
@@ -157,7 +155,7 @@ public class LegatoServiceController extends UnimgrDataTreeChangeListener<Evc> {
 
         try {
             EVCDao evcDao =  LegatoUtils.parseNodes(evc);
-            LOG.trace("========" + evcDao.getUniVlanIdList().toString());
+            LOG.trace(" UniVlanIdList = {} ", evcDao.getUniVlanIdList().toString());
             assert evcDao != null
                     && evcDao.getUniIdList() != null && evcDao.getConnectionType() != null;
             LOG.trace(" connection-type :{}, svc-type :{}", evcDao.getConnectionType(), evcDao.getSvcType());
@@ -217,7 +215,7 @@ public class LegatoServiceController extends UnimgrDataTreeChangeListener<Evc> {
                                         dataBroker);
                             }
                         }
-                        LOG.trace("EVC_UUID_MAP_LIST  " + EVC_UUID_MAP_LIST.toString());
+                        LOG.trace("EVC_UUID_MAP_LIST {} ", EVC_UUID_MAP_LIST.toString());
                     } else {
                         if (evcDao.getSvcType().equalsIgnoreCase(LegatoConstants.EVPL)
                               || evcDao.getSvcType().equalsIgnoreCase(LegatoConstants.EVPLAN)
@@ -240,7 +238,7 @@ public class LegatoServiceController extends UnimgrDataTreeChangeListener<Evc> {
                 LOG.trace("svc-type in payload should be epl, evpl, eplan, evplan, evptree");
             }
 
-        } catch (Exception ex) {
+        } catch (RuntimeException ex) {
             LOG.error("Error in createConnection(). Err: ", ex);
         }
 
@@ -279,7 +277,7 @@ public class LegatoServiceController extends UnimgrDataTreeChangeListener<Evc> {
                         assert evcDao.getUniVlanIdList() != null;
                         List<String> vlanIdList = LegatoUtils.validateVlanTag(evcDao);
 
-                        LOG.trace(" number of noOfVlan = " + vlanIdList.toString());
+                        LOG.trace(" number of noOfVlan {} ", vlanIdList.toString());
                         if (vlanIdList.size() > 0) {
                             // delete existing EVC and create service
                             deleteConnection(evc);
@@ -292,7 +290,7 @@ public class LegatoServiceController extends UnimgrDataTreeChangeListener<Evc> {
             } else {
                 LOG.trace("svc-type in payload should be epl, evpl, eplan, evplan, eptree, evptree");
             }
-        } catch (Exception ex) {
+        } catch (RuntimeException ex) {
 
             LOG.error("Error in updateConnection(). Err: ", ex);
         }
@@ -364,59 +362,20 @@ public class LegatoServiceController extends UnimgrDataTreeChangeListener<Evc> {
         }
     }
 
-    @SuppressWarnings("checkstyle:illegalcatch")
-    private void callUpdateConnectionService(
-            UpdateConnectivityServiceInput updateConnectivityServiceInput,
-            String evcId) {
-        try {
-            Future<RpcResult<UpdateConnectivityServiceOutput>> response = this.prestoConnectivityService
-                    .updateConnectivityService(updateConnectivityServiceInput);
-
-            if (response.get().isSuccessful()) {
-                LOG.trace("call Success = {}, response = {} ", response.get()
-                        .isSuccessful(), response.get().getResult());
-
-                Optional<Evc> optionalEvc = LegatoUtils.readEvc(
-                        dataBroker,
-                        LogicalDatastoreType.CONFIGURATION,
-                        InstanceIdentifier
-                                .create(MefServices.class)
-                                .child(CarrierEthernet.class)
-                                .child(SubscriberServices.class)
-                                .child(Evc.class,
-                                        new EvcKey(new EvcIdType(evcId))));
-
-                // update EVC Node in OPERATIONAL DB
-                if (optionalEvc.isPresent()) {
-                    LegatoUtils.deleteFromOperationalDB(InstanceIdentifier
-                            .create(MefServices.class)
-                            .child(CarrierEthernet.class)
-                            .child(SubscriberServices.class)
-                            .child(Evc.class, new EvcKey(new EvcIdType(evcId))), dataBroker);
-
-                    LegatoUtils.updateEvcInOperationalDB(optionalEvc.get(), EVC_IID_OPERATIONAL,  dataBroker);
-                }
-
-            } else {
-                LOG.trace("call Failure = {} >> {} ", response.get()
-                        .isSuccessful(), response.get().getErrors());
-            }
-        } catch (Exception ex) {
-            LOG.error("Error in UpdateConnectivityServiceInput(). Err: ", ex);
-        }
-    }
-
     @SuppressWarnings("checkstyle:illegalcatch")
     private boolean callDeleteConnectionService(
             DeleteConnectivityServiceInput deleteConnectivityServiceInput) {
         try {
-            this.prestoConnectivityService
+            Future<RpcResult<DeleteConnectivityServiceOutput>> response = this.prestoConnectivityService
                     .deleteConnectivityService(deleteConnectivityServiceInput);
-            return true;
-
+            if (response.get().isSuccessful()) {
+                LOG.trace("delete call Success = {}, response = {} ", response.get()
+                        .isSuccessful(), response.get().getResult());
+                return true;
+            }
         } catch (Exception ex) {
             LOG.error("Fail to call callDeleteConnectionService(). Err: ", ex);
-            return false;
         }
+        return false;
     }
 }
index 2787d6c266053f4babd101745614a6847a24159d..2f7be983ff5ad030964e8b9a7f036177f1bd4bcd 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.unimgr.mef.legato.dao;
 
 import java.util.List;
 import java.util.Map;
-
 import org.opendaylight.yangtools.yang.common.Uint16;
 
 /*
old mode 100644 (file)
new mode 100755 (executable)
index 85f5aae..7301ecb
@@ -7,14 +7,15 @@
  */
 package org.opendaylight.unimgr.mef.legato.util;
 
+import com.google.common.util.concurrent.FluentFuture;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 import java.util.Optional;
 import java.util.concurrent.ExecutionException;
-
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.ReadTransaction;
 import org.opendaylight.mdsal.binding.api.WriteTransaction;
@@ -64,7 +65,6 @@ import org.opendaylight.yangtools.yang.common.Uint16;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.util.concurrent.FluentFuture;
 
 /*
  * @author santanu.de@xoriant.com
@@ -100,8 +100,8 @@ public final class LegatoUtils {
             } else {
                 vlanIdList.add(vlanId);
             }
-            uniVlanList.put(endPoint.getUniId().getValue().toString(), vlanIdList);
-            uniIdList.add(endPoint.getUniId().getValue().toString());
+            uniVlanList.put(endPoint.getUniId().getValue(), vlanIdList);
+            uniIdList.add(endPoint.getUniId().getValue());
         }
 
         final EVCDao evcDao = new EVCDao();
@@ -183,7 +183,7 @@ public final class LegatoUtils {
         CreateConnectivityServiceInputBuilder createConnServiceInputBuilder =
                 new CreateConnectivityServiceInputBuilder();
 
-        switch (evcDao.getConnectionType().replace("-", "").toUpperCase()) {
+        switch (evcDao.getConnectionType().replace("-", "").toUpperCase(Locale.ROOT)) {
             case LegatoConstants.POINTTOPOINT:
                 createConnServiceInputBuilder.setConnConstraint(new ConnConstraintBuilder()
                         .setServiceLevel(LegatoConstants.BEST_EFFORT).setIsExclusive(isExclusive)
@@ -232,7 +232,7 @@ public final class LegatoUtils {
         UpdateConnectivityServiceInputBuilder updateConnServiceInputBuilder =
                 new UpdateConnectivityServiceInputBuilder();
 
-        switch (evcDao.getConnectionType().replace("-", "").toUpperCase()) {
+        switch (evcDao.getConnectionType().replace("-", "").toUpperCase(Locale.ROOT)) {
             case LegatoConstants.POINTTOPOINT:
                 updateConnServiceInputBuilder.setConnConstraint(
                         new org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev180307
@@ -295,7 +295,6 @@ public final class LegatoUtils {
 
             endpointList.add(endPointBuilder.build());
         }
-        endPointBuilder = null;
 
         return endpointList;
     }
@@ -318,9 +317,6 @@ public final class LegatoUtils {
                     .setLayerProtocolName(layerProtocolName).addAugmentation(EndPoint7.class,
                             LegatoUtils.buildUpdateEthConnectivityEndPointAugmentation(uniArr[1]));
         }
-
-        uniArr = null;
-
         return endPointBuilder.build();
     }
 
@@ -332,16 +328,16 @@ public final class LegatoUtils {
             final FluentFuture<Optional<Evc>> linkFuture = read.read(store, evcId);
             return linkFuture.get();
         } catch (final InterruptedException | ExecutionException e) {
-            LOG.error("Unable to read node with EVC Id {}, err: {} ", evcId, e);
+            LOG.error("Unable to read node with EVC Id {}, err: ", evcId, e);
         }
         return Optional.empty();
     }
 
     public static <T extends DataObject> Optional<T> readProfile(
-            DataBroker dataBroker, LogicalDatastoreType store, InstanceIdentifier<T> child, Class<T> c) {
+            DataBroker dataBroker, LogicalDatastoreType store, InstanceIdentifier<T> child, Class<T> className) {
         final ReadTransaction read = dataBroker.newReadOnlyTransaction();
 
-        final InstanceIdentifier<T> profileId = child.firstIdentifierOf(c);
+        final InstanceIdentifier<T> profileId = child.firstIdentifierOf(className);
         final FluentFuture<Optional<T>> profileFuture = read.read(store, profileId);
         try {
             return profileFuture.get();
@@ -351,6 +347,7 @@ public final class LegatoUtils {
         }
     }
 
+    @SuppressWarnings("checkstyle:lineLength")
     public static Optional<?> readProfile(String string, DataBroker dataBroker, LogicalDatastoreType store,
             InstanceIdentifier<?> child) {
         final ReadTransaction read = dataBroker.newReadOnlyTransaction();
@@ -428,7 +425,7 @@ public final class LegatoUtils {
             transaction.commit().get();
             result = true;
         } catch (InterruptedException | ExecutionException e) {
-            LOG.error("Unable to remove node ", nodeIdentifier, e);
+            LOG.error("Unable to remove node {} ", nodeIdentifier, e);
         }
         return result;
     }
@@ -476,7 +473,7 @@ public final class LegatoUtils {
             transaction.commit().get();
             result = true;
         } catch (InterruptedException | ExecutionException e) {
-            LOG.error("Unable to update node in OperationalDB() ", nodeIdentifier, e);
+            LOG.error("Unable to update node {} in OperationalDB() ", nodeIdentifier, e);
         }
         return result;
 
@@ -485,7 +482,7 @@ public final class LegatoUtils {
 
     public static List<String> validateVlanTag(EVCDao evcDao) {
         List<String> vlanIdList = new ArrayList<String>();
-        List<String> vlanTagList = new ArrayList<String>();
+        List<String> vlanTagList;
 
         for (String uniId : evcDao.getUniIdList()) {
             vlanTagList = evcDao.getUniVlanIdList().get(uniId);
@@ -497,8 +494,6 @@ public final class LegatoUtils {
             } else if (!vlanIdList.equals(vlanTagList)) {
                 LOG.error("All end points should have same vlan tags");
                 vlanIdList = new ArrayList<String>();
-
-                return vlanIdList;
             }
         }
         if (Collections.frequency(vlanIdList, "0") == vlanIdList.size()) {
@@ -511,7 +506,7 @@ public final class LegatoUtils {
     public static boolean removeFlowFromConfigDatastore(InstanceIdentifier<?> nodeIdentifier,
             DataBroker dataBroker) {
 
-        LOG.trace("Removing EVC from CONFIGURATION datastore ", nodeIdentifier);
+        LOG.trace("Removing EVC from CONFIGURATION datastore {} ", nodeIdentifier);
         boolean result = false;
 
         final WriteTransaction transaction = dataBroker.newWriteOnlyTransaction();
@@ -521,7 +516,7 @@ public final class LegatoUtils {
             transaction.commit().get();
             result = true;
         } catch (InterruptedException | ExecutionException e) {
-            LOG.error("Unable to remove evc from CONFIGURATION datastore  ", nodeIdentifier, e);
+            LOG.error("Unable to remove evc {} from CONFIGURATION datastore  ", nodeIdentifier, e);
         }
         return result;
     }
old mode 100644 (file)
new mode 100755 (executable)
index 33395b6..efb58a9
@@ -17,12 +17,13 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import com.google.common.util.concurrent.FluentFuture;
+import com.google.common.util.concurrent.ListenableFuture;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -64,9 +65,6 @@ import org.powermock.api.mockito.PowerMockito;
 import org.powermock.core.classloader.annotations.PrepareForTest;
 import org.powermock.modules.junit4.PowerMockRunner;
 
-import com.google.common.util.concurrent.FluentFuture;
-import com.google.common.util.concurrent.ListenableFuture;
-
 
 /*
  * @author Om.SAwasthi@Xoriant.Com
@@ -79,7 +77,6 @@ public class EpLanIntegrationTest {
     private TapiConnectivityService prestoConnectivityService;
     @Mock
     private DataBroker dataBroker;
-
     @Mock
     private WriteTransaction transaction;
     @Mock
@@ -125,6 +122,7 @@ public class EpLanIntegrationTest {
                 .setEvcId(new EvcIdType(Constants.EVC_ID_TYPE))
                 .setConnectionType(ConnectionType.MultipointToMultipoint)
                 .setSvcType(MefServiceType.Eplan).build();
+
     }
 
     @SuppressWarnings({"unchecked"})
@@ -168,12 +166,14 @@ public class EpLanIntegrationTest {
         PowerMockito.stub(
                 PowerMockito.method(LegatoUtils.class,
                         "readEvc", DataBroker.class, LogicalDatastoreType.class, InstanceIdentifier.class))
-        .toReturn(optEvc);
+            .toReturn(optEvc);
 
         when(transaction.commit()).thenReturn(fluentFuture);
 
         assertEquals(true,LegatoUtils.updateEvcInOperationalDB(evc, instanceIdentifier, dataBroker));
-        verify(transaction).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(SubscriberServices.class));
+        verify(transaction).put(any(LogicalDatastoreType.class),
+                any(InstanceIdentifier.class),
+                any(SubscriberServices.class));
         verify(transaction).commit();
     }
 
@@ -274,14 +274,6 @@ public class EpLanIntegrationTest {
 
         verify(transaction).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
         verify(transaction).commit();
-//        verify(mockAppender).doAppend(argThat(new ArgumentMatcher() {
-//            @Override
-//            public boolean matches(final Object argument) {
-//                return ((LoggingEvent) argument).getFormattedMessage()
-//                        .contains("Received a request to delete node");
-//            }
-//        }));
-
     }
 
     @Test
old mode 100644 (file)
new mode 100755 (executable)
index b31d418..2190d59
@@ -18,12 +18,13 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import com.google.common.util.concurrent.FluentFuture;
+import com.google.common.util.concurrent.ListenableFuture;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -67,9 +68,6 @@ import org.powermock.api.mockito.PowerMockito;
 import org.powermock.core.classloader.annotations.PrepareForTest;
 import org.powermock.modules.junit4.PowerMockRunner;
 
-import com.google.common.util.concurrent.FluentFuture;
-import com.google.common.util.concurrent.ListenableFuture;
-
 /*
  * @author Arif.Hussain@Xoriant.Com
  * @author Om.SAwasthi@Xoriant.Com
@@ -85,7 +83,6 @@ public class EpLineIntegrationTest {
     private TapiConnectivityService prestoConnectivityService;
     @Mock
     private DataBroker dataBroker;
-
     @Mock
     private WriteTransaction transaction;
     @Mock
@@ -171,12 +168,14 @@ public class EpLineIntegrationTest {
         PowerMockito.stub(
                 PowerMockito.method(LegatoUtils.class,
                         "readEvc", DataBroker.class, LogicalDatastoreType.class, InstanceIdentifier.class))
-        .toReturn(optEvc);
+            .toReturn(optEvc);
 
         when(transaction.commit()).thenReturn(fluentFuture);
 
         assertEquals(true,LegatoUtils.updateEvcInOperationalDB(evc, instanceIdentifier, dataBroker));
-        verify(transaction).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(SubscriberServices.class));
+        verify(transaction).put(any(LogicalDatastoreType.class),
+                any(InstanceIdentifier.class),
+                any(SubscriberServices.class));
         verify(transaction).commit();
     }
 
@@ -274,13 +273,6 @@ public class EpLineIntegrationTest {
 
         verify(transaction).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
         verify(transaction).commit();
-//        verify(mockAppender).doAppend(argThat(new ArgumentMatcher() {
-//            @Override
-//            public boolean matches(final Object argument) {
-//                return ((LoggingEvent) argument).getFormattedMessage()
-//                        .contains("Received a request to delete node");
-//            }
-//        }));
     }
 
     @Test
old mode 100644 (file)
new mode 100755 (executable)
index 4bd29f6..c2b86c5
@@ -18,12 +18,13 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import com.google.common.util.concurrent.FluentFuture;
+import com.google.common.util.concurrent.ListenableFuture;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -66,8 +67,6 @@ import org.powermock.api.mockito.PowerMockito;
 import org.powermock.core.classloader.annotations.PrepareForTest;
 import org.powermock.modules.junit4.PowerMockRunner;
 
-import com.google.common.util.concurrent.FluentFuture;
-import com.google.common.util.concurrent.ListenableFuture;
 
 /*
  * @author OmS.awasthi@Xoriant.Com
@@ -83,7 +82,6 @@ public class EpTreeIntegrationTest {
     private TapiConnectivityService prestoConnectivityService;
     @Mock
     private DataBroker dataBroker;
-
     @Mock
     private WriteTransaction transaction;
     @Mock
@@ -171,12 +169,14 @@ public class EpTreeIntegrationTest {
         PowerMockito.stub(
                 PowerMockito.method(LegatoUtils.class,
                         "readEvc", DataBroker.class, LogicalDatastoreType.class, InstanceIdentifier.class))
-        .toReturn(optEvc);
+            .toReturn(optEvc);
 
         when(transaction.commit()).thenReturn(fluentFuture);
 
         assertEquals(true,LegatoUtils.updateEvcInOperationalDB(evc, instanceIdentifier, dataBroker));
-        verify(transaction).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(SubscriberServices.class));
+        verify(transaction).put(any(LogicalDatastoreType.class),
+                any(InstanceIdentifier.class),
+                any(SubscriberServices.class));
         verify(transaction).commit();
     }
 
old mode 100644 (file)
new mode 100755 (executable)
index dc698eb..e941b7b
@@ -18,7 +18,6 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Optional;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -81,7 +80,7 @@ public class EvcDataTreeChangeListenerTest {
         PowerMockito.stub(
                 PowerMockito.method(LegatoUtils.class,
                         "readEvc", DataBroker.class, LogicalDatastoreType.class, InstanceIdentifier.class))
-        .toReturn(Optional.empty());
+            .toReturn(Optional.empty());
 
         legatoServiceController.onDataTreeChanged(collection);
         verify(legatoServiceController, times(1)).add(any(DataTreeModification.class));
@@ -90,13 +89,29 @@ public class EvcDataTreeChangeListenerTest {
     }
 
 
+    @SuppressWarnings("checkstyle:lineLength")
     private DataTreeModification<Evc> getDataTree(final ModificationType modificationType, Evc before, Evc after) {
         final DataObjectModification<Evc> evcDataObjModification = new DataObjectModification<Evc>() {
+
             @Override
             public Collection<DataObjectModification<? extends DataObject>> getModifiedChildren() {
                 return Collections.emptyList();
             }
 
+            @Override
+            public <C extends ChildOf<? super Evc>> Collection<DataObjectModification<C>> getModifiedChildren(
+                    Class<C> childType) {
+                // TODO Auto-generated method stub
+                return null;
+            }
+
+            @Override
+            public <H extends ChoiceIn<? super Evc> & DataObject, C extends ChildOf<? super H>> Collection<DataObjectModification<C>> getModifiedChildren(
+                    Class<H> caseType, Class<C> childType) {
+                // TODO Auto-generated method stub
+                return null;
+            }
+
             @Override
             public <C extends Identifiable<K> & ChildOf<? super Evc>, K extends
                 Identifier<C>> DataObjectModification<C> getModifiedChildListItem(
@@ -105,12 +120,26 @@ public class EvcDataTreeChangeListenerTest {
                 return null;
             }
 
+            @Override
+            public <H extends ChoiceIn<? super Evc> & DataObject, C extends Identifiable<K> & ChildOf<? super H>, K extends Identifier<C>> DataObjectModification<C> getModifiedChildListItem(
+                    Class<H> caseType, Class<C> listItem, K listKey) {
+                // TODO Auto-generated method stub
+                return null;
+            }
+
             @Override
             public <C extends ChildOf<? super Evc>> DataObjectModification<C> getModifiedChildContainer(Class<C> arg0) {
                 // TODO Auto-generated method stub
                 return null;
             }
 
+            @Override
+            public <H extends ChoiceIn<? super Evc> & DataObject, C extends ChildOf<? super H>> DataObjectModification<C> getModifiedChildContainer(
+                    Class<H> caseType, Class<C> child) {
+                // TODO Auto-generated method stub
+                return null;
+            }
+
             @Override
             public DataObjectModification<? extends DataObject> getModifiedChild(PathArgument arg0) {
                 // TODO Auto-generated method stub
@@ -149,34 +178,6 @@ public class EvcDataTreeChangeListenerTest {
             public Evc getDataAfter() {
                 return after;
             }
-
-            @Override
-            public <C extends ChildOf<? super Evc>> Collection<DataObjectModification<C>> getModifiedChildren(
-                    Class<C> childType) {
-                // TODO Auto-generated method stub
-                return null;
-            }
-
-            @Override
-            public <H extends ChoiceIn<? super Evc> & DataObject, C extends ChildOf<? super H>> Collection<DataObjectModification<C>> getModifiedChildren(
-                    Class<H> caseType, Class<C> childType) {
-                // TODO Auto-generated method stub
-                return null;
-            }
-
-            @Override
-            public <H extends ChoiceIn<? super Evc> & DataObject, C extends ChildOf<? super H>> DataObjectModification<C> getModifiedChildContainer(
-                    Class<H> caseType, Class<C> child) {
-                // TODO Auto-generated method stub
-                return null;
-            }
-
-            @Override
-            public <H extends ChoiceIn<? super Evc> & DataObject, C extends Identifiable<K> & ChildOf<? super H>, K extends Identifier<C>> DataObjectModification<C> getModifiedChildListItem(
-                    Class<H> caseType, Class<C> listItem, K listKey) {
-                // TODO Auto-generated method stub
-                return null;
-            }
         };
 
         DataTreeModification<Evc> modifiedEvc = new DataTreeModification<Evc>() {
old mode 100644 (file)
new mode 100755 (executable)
index cb3dc88..c1f198b
@@ -17,12 +17,13 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import com.google.common.util.concurrent.FluentFuture;
+import com.google.common.util.concurrent.ListenableFuture;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -69,9 +70,6 @@ import org.powermock.api.support.membermodification.MemberModifier;
 import org.powermock.core.classloader.annotations.PrepareForTest;
 import org.powermock.modules.junit4.PowerMockRunner;
 
-import com.google.common.util.concurrent.FluentFuture;
-import com.google.common.util.concurrent.ListenableFuture;
-
 
 /*
  * @author Arif.Hussain@Xoriant.Com
@@ -85,7 +83,6 @@ public class EvcUnitTest {
     @Mock  private DataBroker dataBroker;
     @SuppressWarnings("rawtypes")
     @Mock  private FluentFuture checkedFuture;
-
     @Mock  private WriteTransaction transaction;
     @Mock  private ReadTransaction readTxn ;
     private EndPointBuilder endPointBuilder;
@@ -126,6 +123,7 @@ public class EvcUnitTest {
                 .setEvcId(new EvcIdType(Constants.EVC_ID_TYPE)).setSvcType(MefServiceType.Epl)
                 .setConnectionType(ConnectionType.PointToPoint).setCosNames(cosNamesBuilder.build())
                 .setEndPoints(new EndPointsBuilder().setEndPoint(endPointList).build()).build();
+
     }
 
     @SuppressWarnings("unchecked")
@@ -146,7 +144,7 @@ public class EvcUnitTest {
 
         PowerMockito.stub(PowerMockito.method(
                 LegatoUtils.class, "buildCreateConnectivityServiceInput", EVCDao.class, String.class, List.class))
-        .toReturn(future);
+            .toReturn(future);
 
         // then
         final Optional<Evc> optEvc = mock(Optional.class);
@@ -162,12 +160,14 @@ public class EvcUnitTest {
         PowerMockito.stub(
                 PowerMockito.method(LegatoUtils.class,
                         "readEvc", DataBroker.class, LogicalDatastoreType.class, InstanceIdentifier.class))
-        .toReturn(optEvc);
+            .toReturn(optEvc);
 
         when(transaction.commit()).thenReturn(checkedFuture);
 
         assertEquals(true, LegatoUtils.updateEvcInOperationalDB(evc, instanceIdentifier, dataBroker));
-        verify(transaction).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(SubscriberServices.class));
+        verify(transaction).put(any(LogicalDatastoreType.class),
+                any(InstanceIdentifier.class),
+                any(SubscriberServices.class));
         verify(transaction).commit();
     }
 
@@ -237,7 +237,6 @@ public class EvcUnitTest {
 
         verify(transaction).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
         verify(transaction).commit();
-
     }
 
 }
old mode 100644 (file)
new mode 100755 (executable)
index 4181a4e..ef1b35b
@@ -18,12 +18,13 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import com.google.common.util.concurrent.FluentFuture;
+import com.google.common.util.concurrent.ListenableFuture;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -66,10 +67,6 @@ import org.powermock.api.mockito.PowerMockito;
 import org.powermock.core.classloader.annotations.PrepareForTest;
 import org.powermock.modules.junit4.PowerMockRunner;
 
-import com.google.common.util.concurrent.FluentFuture;
-import com.google.common.util.concurrent.ListenableFuture;
-
-
 /*
  * @author Om.SAwasthi@Xoriant.Com
  */
@@ -83,7 +80,6 @@ public class EvpLanIntegrationTest {
     private TapiConnectivityService prestoConnectivityService;
     @Mock
     private DataBroker dataBroker;
-
     @Mock
     private WriteTransaction transaction;
     @Mock
@@ -128,10 +124,6 @@ public class EvpLanIntegrationTest {
                 .setConnectionType(ConnectionType.MultipointToMultipoint)
                 .setSvcType(MefServiceType.Evplan).build();
 
-//        root = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
-//        when(mockAppender.getName()).thenReturn("MOCK");
-//        root.addAppender(mockAppender);
-
     }
 
     @SuppressWarnings({"unchecked"})
@@ -175,12 +167,14 @@ public class EvpLanIntegrationTest {
         PowerMockito.stub(
                 PowerMockito.method(LegatoUtils.class,
                         "readEvc", DataBroker.class, LogicalDatastoreType.class, InstanceIdentifier.class))
-        .toReturn(optEvc);
+            .toReturn(optEvc);
 
         when(transaction.commit()).thenReturn(fluentFuture);
 
         assertEquals(true,LegatoUtils.updateEvcInOperationalDB(evc, instanceIdentifier, dataBroker));
-        verify(transaction).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(SubscriberServices.class));
+        verify(transaction).put(any(LogicalDatastoreType.class),
+                any(InstanceIdentifier.class),
+                any(SubscriberServices.class));
         verify(transaction).commit();
 
     }
old mode 100644 (file)
new mode 100755 (executable)
index af8f365..ed8ea84
@@ -17,12 +17,13 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import com.google.common.util.concurrent.FluentFuture;
+import com.google.common.util.concurrent.ListenableFuture;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -65,9 +66,6 @@ import org.powermock.api.mockito.PowerMockito;
 import org.powermock.core.classloader.annotations.PrepareForTest;
 import org.powermock.modules.junit4.PowerMockRunner;
 
-import com.google.common.util.concurrent.FluentFuture;
-import com.google.common.util.concurrent.ListenableFuture;
-
 
 /*
  * @author Om.SAwasthi@Xoriant.Com
@@ -83,7 +81,6 @@ public class EvpLineIntegrationTest {
     private TapiConnectivityService prestoConnectivityService;
     @Mock
     private DataBroker dataBroker;
-
     @Mock
     private WriteTransaction transaction;
     @Mock
@@ -164,12 +161,14 @@ public class EvpLineIntegrationTest {
         PowerMockito.stub(
                 PowerMockito.method(LegatoUtils.class,
                         "readEvc", DataBroker.class, LogicalDatastoreType.class, InstanceIdentifier.class))
-        .toReturn(optEvc);
+            .toReturn(optEvc);
 
         when(transaction.commit()).thenReturn(fluentFuture);
 
         assertEquals(true,LegatoUtils.updateEvcInOperationalDB(evc, instanceIdentifier, dataBroker));
-        verify(transaction).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(SubscriberServices.class));
+        verify(transaction).put(any(LogicalDatastoreType.class),
+                any(InstanceIdentifier.class),
+                any(SubscriberServices.class));
         verify(transaction).commit();
     }
 
old mode 100644 (file)
new mode 100755 (executable)
index b7d7c5a..2473b5c
@@ -18,12 +18,13 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import com.google.common.util.concurrent.FluentFuture;
+import com.google.common.util.concurrent.ListenableFuture;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -66,8 +67,6 @@ import org.powermock.api.mockito.PowerMockito;
 import org.powermock.core.classloader.annotations.PrepareForTest;
 import org.powermock.modules.junit4.PowerMockRunner;
 
-import com.google.common.util.concurrent.FluentFuture;
-import com.google.common.util.concurrent.ListenableFuture;
 
 /*
  * @author OmS.awasthi@Xoriant.Com
@@ -83,7 +82,6 @@ public class EvpTreeIntegrationTest {
     private TapiConnectivityService prestoConnectivityService;
     @Mock
     private DataBroker dataBroker;
-
     @Mock
     private WriteTransaction transaction;
     @Mock
@@ -170,12 +168,14 @@ public class EvpTreeIntegrationTest {
         PowerMockito.stub(
                 PowerMockito.method(LegatoUtils.class,
                         "readEvc", DataBroker.class, LogicalDatastoreType.class, InstanceIdentifier.class))
-        .toReturn(optEvc);
+            .toReturn(optEvc);
 
         when(transaction.commit()).thenReturn(fluentFuture);
 
         assertEquals(true,LegatoUtils.updateEvcInOperationalDB(evc, instanceIdentifier, dataBroker));
-        verify(transaction).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(SubscriberServices.class));
+        verify(transaction).put(any(LogicalDatastoreType.class),
+                any(InstanceIdentifier.class),
+                any(SubscriberServices.class));
         verify(transaction).commit();
     }
 
old mode 100644 (file)
new mode 100755 (executable)
index 567a64e..88aa064
@@ -16,11 +16,11 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import com.google.common.util.concurrent.FluentFuture;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
 import java.util.concurrent.ExecutionException;
-
 import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Rule;
@@ -73,7 +73,6 @@ import org.powermock.api.support.membermodification.MemberModifier;
 import org.powermock.core.classloader.annotations.PrepareForTest;
 import org.powermock.modules.junit4.PowerMockRunner;
 
-import com.google.common.util.concurrent.FluentFuture;
 
 /*
  * @author Arif.Hussain@Xoriant.Com