apply checkstyle check during build for location-providers 14/64714/2
authorMichal Cmarada <mcmarada@cisco.com>
Wed, 25 Oct 2017 13:35:03 +0000 (15:35 +0200)
committerMichal Cmarada <mcmarada@cisco.com>
Wed, 25 Oct 2017 13:35:03 +0000 (15:35 +0200)
enabling checkstyle checks on build which should prevent
checkstyle violations in future.

Change-Id: I6aba04ad46b317179a158fa7ce13b67882cfd942
Signed-off-by: Michal Cmarada <mcmarada@cisco.com>
location-providers/ne-location-provider/src/main/java/org/opendaylight/groupbasedpolicy/ne/location/provider/EndpointsListener.java
location-providers/ne-location-provider/src/main/java/org/opendaylight/groupbasedpolicy/ne/location/provider/NeLocationProvider.java
location-providers/ne-location-provider/src/test/java/org/opendaylight/groupbasedpolicy/ne/location/provider/EndpointsListenerTest.java
location-providers/ne-location-provider/src/test/java/org/opendaylight/groupbasedpolicy/ne/location/provider/NeLocationProviderTest.java
location-providers/pom.xml

index c7a15e07a7b54a784b4a2015e9a2e07800adc14a..ebc9cd1a19c49b902534a8bed1a84685461dd848 100644 (file)
@@ -23,17 +23,17 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class EndpointsListener implements ClusteredDataTreeChangeListener<AddressEndpoint>{
+public class EndpointsListener implements ClusteredDataTreeChangeListener<AddressEndpoint> {
 
     private static final Logger LOG = LoggerFactory.getLogger(EndpointsListener.class);
 
     private NeLocationProvider listener;
     private ListenerRegistration<EndpointsListener> listenerRegistration;
 
-    public EndpointsListener (DataBroker dataBroker, NeLocationProvider listener) {
+    public EndpointsListener(DataBroker dataBroker, NeLocationProvider listener) {
         this.listener = listener;
-        this.listenerRegistration = dataBroker.registerDataTreeChangeListener(new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL,
-                InstanceIdentifier.builder(Endpoints.class)
+        this.listenerRegistration = dataBroker.registerDataTreeChangeListener(new DataTreeIdentifier<>(
+            LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.builder(Endpoints.class)
                 .child(AddressEndpoints.class).child(AddressEndpoint.class).build()), this);
         LOG.info("NE location provider registered for Endpoints listening");
     }
index 1bd15620953909f5590a8d92b29b0672791d5dcc..ac0f06f951d7f85727d03aeafcd4eb7d39902e99 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.groupbasedpolicy.ne.location.provider;
 
+import com.google.common.annotations.VisibleForTesting;
+
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -43,8 +45,6 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.annotations.VisibleForTesting;
-
 public class NeLocationProvider implements ClusteredDataTreeChangeListener<NetworkElements>, AutoCloseable {
 
     private static final Logger LOG = LoggerFactory.getLogger(NeLocationProvider.class);
@@ -100,6 +100,9 @@ public class NeLocationProvider implements ClusteredDataTreeChangeListener<Netwo
                     this.endpoints.add(change.getRootNode().getDataAfter());
                     break;
                 }
+                default:
+                    //noop
+                    break;
             }
         }
         DataStoreHelper.submitToDs(wtx);
@@ -117,7 +120,8 @@ public class NeLocationProvider implements ClusteredDataTreeChangeListener<Netwo
                             .providerAddressEndpointLocationIid(NE_LOCATION_PROVIDER_NAME, IpPrefixType.class,
                                     endpoint.getAddress(), endpoint.getContextType(), endpoint.getContextId())
                             .child(AbsoluteLocation.class);
-                        wtx.put(LogicalDatastoreType.CONFIGURATION, iid, createRealLocation(ne.getIid(), iface.getIid()),
+                        wtx.put(LogicalDatastoreType.CONFIGURATION, iid,
+                            createRealLocation(ne.getIid(), iface.getIid()),
                                 true);
                         LOG.debug("New location created for endpoint {}", endpoint);
                         return;
@@ -197,6 +201,9 @@ public class NeLocationProvider implements ClusteredDataTreeChangeListener<Netwo
                     }
                     break;
                 }
+                default:
+                    //noop
+                    break;
             }
         }
         DataStoreHelper.submitToDs(wtx);
@@ -204,15 +211,12 @@ public class NeLocationProvider implements ClusteredDataTreeChangeListener<Netwo
 
     private List<DataObjectModification<NetworkElement>> getModifiedNetworkElements(
             DataObjectModification<NetworkElements> modifiedNEs) {
-        Collection<DataObjectModification<? extends DataObject>> potentialModifiedNetworkElements =
+        Collection<DataObjectModification<? extends DataObject>> modifiedNetworkElements =
                 modifiedNEs.getModifiedChildren();
-        if (potentialModifiedNetworkElements == null) {
-            return Collections.emptyList();
-        }
         List<DataObjectModification<NetworkElement>> nes = new ArrayList<>();
-        for (DataObjectModification<? extends DataObject> potentialModifiedNetworkElement : potentialModifiedNetworkElements) {
-            if (potentialModifiedNetworkElement.getDataType().isAssignableFrom(NetworkElement.class)) {
-                nes.add((DataObjectModification<NetworkElement>) potentialModifiedNetworkElement);
+        for (DataObjectModification<? extends DataObject> modifiedNetworkElement : modifiedNetworkElements) {
+            if (modifiedNetworkElement.getDataType().isAssignableFrom(NetworkElement.class)) {
+                nes.add((DataObjectModification<NetworkElement>) modifiedNetworkElement);
             }
         }
         return nes;
@@ -258,6 +262,9 @@ public class NeLocationProvider implements ClusteredDataTreeChangeListener<Netwo
                 }
                 break;
             }
+            default:
+                //noop
+                break;
         }
     }
 
@@ -315,6 +322,9 @@ public class NeLocationProvider implements ClusteredDataTreeChangeListener<Netwo
                 }
                 break;
             }
+            default:
+                //noop
+                break;
         }
     }
 
@@ -367,6 +377,9 @@ public class NeLocationProvider implements ClusteredDataTreeChangeListener<Netwo
                 LOG.debug("EndpointNetwork {} changed", modifiedEN.getDataAfter().getKey());
                 break;
             }
+            default:
+                //noop
+                break;
         }
     }
 
index bb90273624a9c6fc4b0fa86751d2fb138b90609d..328d9b8fa3531ab30625b680c5ff8a4ac9370423 100644 (file)
@@ -33,30 +33,30 @@ public class EndpointsListenerTest {
     private ListenerRegistration<EndpointsListener> listenerRegistration;
 
     @Before
-    public void init () {
+    public void init() {
         dataBroker = mock(DataBroker.class);
         listenerRegistration = mock(ListenerRegistration.class);
         when(dataBroker.registerDataTreeChangeListener(any(), Matchers.any(EndpointsListener.class)))
-        .thenReturn(listenerRegistration);
+            .thenReturn(listenerRegistration);
         listener = mock(NeLocationProvider.class);
         endpointsListener = new EndpointsListener(dataBroker, listener);
     }
 
     @Test
-    public void test_RegistrationDone () {
+    public void test_RegistrationDone() {
         verify(dataBroker).registerDataTreeChangeListener(new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL,
                 InstanceIdentifier.builder(Endpoints.class).child(AddressEndpoints.class)
                 .child(AddressEndpoint.class).build()), endpointsListener);
     }
 
     @Test
-    public void test_ListenerNotification () {
+    public void test_ListenerNotification() {
         endpointsListener.onDataTreeChanged(null);
         verify(listener).onEndpointsChange(any());
     }
 
     @Test
-    public void test_UnregiserOnClose () {
+    public void test_UnregiserOnClose() {
         endpointsListener.close();
         verify(listenerRegistration).close();
     }
index aa64733942553fb07db2e5ebfd9a8038cefa3d20..5267f5592992c980283dbc372d9784932da7a91b 100644 (file)
@@ -19,6 +19,10 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import com.google.common.base.Optional;
+import com.google.common.collect.ImmutableList;
+import com.google.common.util.concurrent.CheckedFuture;
+
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
@@ -79,26 +83,21 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.N
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
-import com.google.common.base.Optional;
-import com.google.common.collect.ImmutableList;
-import com.google.common.util.concurrent.CheckedFuture;
-
 public class NeLocationProviderTest extends CustomDataBrokerTest {
 
     private static final TenantId TENANT = new TenantId("Tenant");
     private static final List<EndpointGroupId> DEFAULT_EPG =
         Collections.singletonList(new EndpointGroupId("defaultEPG"));
+    private static final String L3_CONTEXT_ID = "l3Context";
+    private static final String IP_V4_HOST_ADDRESS_1 = "192.168.50.71/24";
+    private static final String IP_V4_NETWORK_ADDRESS_1 = "192.168.50.0/24";
+    private static final String IP_V4_NETWORK_ADDRESS_2 = "192.168.51.0/24";
+    private static final String NODE_ID_1 = "node1";
+    private static final String NODE_ID_2 = "node2";
+    private static final String CONNECTOR_ID_1 = "connector:1";
+    private static final String CONNECTOR_ID_2 = "connector:2";
     private DataBroker dataBroker;
     private NeLocationProvider neProvider;
-    private String L3_CONTEXT_ID = "l3Context";
-    private String IPv4_HOST_ADDRESS_1 = "192.168.50.71/24";
-    private String IPv4_HOST_ADDRESS_2 = "192.168.50.72/24";
-    private String IPv4_NETWORK_ADDRESS_1 = "192.168.50.0/24";
-    private String IPv4_NETWORK_ADDRESS_2 = "192.168.51.0/24";
-    private String NODE_ID_1 = "node1";
-    private String NODE_ID_2 = "node2";
-    private String CONNECTOR_ID_1 = "connector:1";
-    private String CONNECTOR_ID_2 = "connector:2";
 
     @Override
     public Collection<Class<?>> getClassesFromModules() {
@@ -136,13 +135,13 @@ public class NeLocationProviderTest extends CustomDataBrokerTest {
         ListenerRegistration<EndpointsListener> endpointsListenerRegistration = mock(ListenerRegistration.class);
         when(dataBroker.registerDataTreeChangeListener(any(), isA(EndpointsListener.class)))
             .thenReturn(endpointsListenerRegistration);
-        ListenerRegistration<NeLocationProvider> NEListenerRegistration = mock(ListenerRegistration.class);
+        ListenerRegistration<NeLocationProvider> nelistenerregistration = mock(ListenerRegistration.class);
         when(dataBroker.registerDataTreeChangeListener(any(), isA(NeLocationProvider.class)))
-            .thenReturn(NEListenerRegistration);
+            .thenReturn(nelistenerregistration);
         NeLocationProvider provider = new NeLocationProvider(dataBroker);
         provider.close();
         verify(endpointsListenerRegistration).close();
-        verify(NEListenerRegistration).close();
+        verify(nelistenerregistration).close();
     }
 
     @Test
@@ -161,7 +160,7 @@ public class NeLocationProviderTest extends CustomDataBrokerTest {
             new NetworkDomainContainmentBuilder().setNetworkDomainId(new NetworkDomainId(L3_CONTEXT_ID)).build())
             .build();
         AddressEndpoint endpoint = new AddressEndpointBuilder().setKey(
-                new AddressEndpointKey(IPv4_HOST_ADDRESS_1, IpPrefixType.class, new ContextId(L3_CONTEXT_ID),
+                new AddressEndpointKey(IP_V4_HOST_ADDRESS_1, IpPrefixType.class, new ContextId(L3_CONTEXT_ID),
                     L3Context.class)).setNetworkContainment(nc).setTenant(TENANT).setEndpointGroup(DEFAULT_EPG).build();
         InstanceIdentifier<AddressEndpoint> iid = IidFactory.addressEndpointIid(endpoint.getKey());
         WriteTransaction wtx = dataBroker.newWriteOnlyTransaction();
@@ -183,7 +182,7 @@ public class NeLocationProviderTest extends CustomDataBrokerTest {
         InstanceIdentifier<NetworkContainment> iid = InstanceIdentifier
                 .builder(Endpoints.class)
                 .child(AddressEndpoints.class)
-                .child(AddressEndpoint.class, new AddressEndpointKey(IPv4_HOST_ADDRESS_1, IpPrefixType.class,
+                .child(AddressEndpoint.class, new AddressEndpointKey(IP_V4_HOST_ADDRESS_1, IpPrefixType.class,
                         new ContextId(L3_CONTEXT_ID), L3Context.class))
                 .child(NetworkContainment.class)
                 .build();
@@ -234,7 +233,7 @@ public class NeLocationProviderTest extends CustomDataBrokerTest {
     @Test
     public void test_NetworkElementsWrite_NoEP_Overwrite() throws Exception {
         writeBaseNetworkElements();
-        NetworkElements nes = createNetworkElements(NODE_ID_2, CONNECTOR_ID_2, L3_CONTEXT_ID, IPv4_NETWORK_ADDRESS_1);
+        NetworkElements nes = createNetworkElements(NODE_ID_2, CONNECTOR_ID_2, L3_CONTEXT_ID, IP_V4_NETWORK_ADDRESS_1);
         InstanceIdentifier<NetworkElements> iid = InstanceIdentifier.builder(NetworkElements.class).build();
         WriteTransaction wtx = dataBroker.newWriteOnlyTransaction();
         wtx.put(LogicalDatastoreType.CONFIGURATION, iid, nes);
@@ -247,7 +246,7 @@ public class NeLocationProviderTest extends CustomDataBrokerTest {
     @Test
     public void test_NetworkElementWrite_NoEP_Overwrite() throws Exception {
         writeBaseNetworkElements();
-        NetworkElement ne = createNetworkElement(NODE_ID_1, CONNECTOR_ID_1, L3_CONTEXT_ID, IPv4_NETWORK_ADDRESS_2);
+        NetworkElement ne = createNetworkElement(NODE_ID_1, CONNECTOR_ID_1, L3_CONTEXT_ID, IP_V4_NETWORK_ADDRESS_2);
         InstanceIdentifier<NetworkElement> iid = InstanceIdentifier.builder(NetworkElements.class)
             .child(NetworkElement.class, new NetworkElementKey(ne.getKey()))
             .build();
@@ -264,7 +263,7 @@ public class NeLocationProviderTest extends CustomDataBrokerTest {
     @Test
     public void test_InterfaceWrite_NoEP_Overwrite() throws Exception {
         writeBaseNetworkElements();
-        Interface iface = createInterface(NODE_ID_1, CONNECTOR_ID_1, L3_CONTEXT_ID, IPv4_NETWORK_ADDRESS_2);
+        Interface iface = createInterface(NODE_ID_1, CONNECTOR_ID_1, L3_CONTEXT_ID, IP_V4_NETWORK_ADDRESS_2);
         InstanceIdentifier<Interface> iid = InstanceIdentifier.builder(NetworkElements.class)
             .child(NetworkElement.class, new NetworkElementKey(createNetworkElementIid(NODE_ID_1)))
             .child(Interface.class, new InterfaceKey(iface.getKey()))
@@ -284,7 +283,7 @@ public class NeLocationProviderTest extends CustomDataBrokerTest {
     @Test
     public void test_EndpointNetworkChange_NoEP() throws Exception {
         writeBaseNetworkElements();
-        EndpointNetwork en = createEndpointNetwork(L3_CONTEXT_ID, IPv4_NETWORK_ADDRESS_2);
+        EndpointNetwork en = createEndpointNetwork(L3_CONTEXT_ID, IP_V4_NETWORK_ADDRESS_2);
         InstanceIdentifier<EndpointNetwork> iid = InstanceIdentifier.builder(NetworkElements.class)
             .child(NetworkElement.class, new NetworkElementKey(createNetworkElementIid(NODE_ID_1)))
             .child(Interface.class, new InterfaceKey(CONNECTOR_ID_1))
@@ -295,7 +294,7 @@ public class NeLocationProviderTest extends CustomDataBrokerTest {
                     .child(NetworkElement.class, new NetworkElementKey(createNetworkElementIid(NODE_ID_1)))
                     .child(Interface.class, new InterfaceKey(CONNECTOR_ID_1))
                     .child(EndpointNetwork.class, new EndpointNetworkKey(
-                            new IpPrefix(new Ipv4Prefix(IPv4_NETWORK_ADDRESS_1)),new ContextId(L3_CONTEXT_ID)))
+                            new IpPrefix(new Ipv4Prefix(IP_V4_NETWORK_ADDRESS_1)),new ContextId(L3_CONTEXT_ID)))
                     .build();
         WriteTransaction wtx = dataBroker.newWriteOnlyTransaction();
         wtx.delete(LogicalDatastoreType.CONFIGURATION, removeIid);
@@ -360,13 +359,13 @@ public class NeLocationProviderTest extends CustomDataBrokerTest {
     @Test
     public void test_CreateLocationForAddrEndpoint_EndpointWriteFirst() throws Exception {
         AddressEndpoint endpoint =
-                createAddressEndpoint(IPv4_HOST_ADDRESS_1, IpPrefixType.class, L3_CONTEXT_ID, L3Context.class);
+                createAddressEndpoint(IP_V4_HOST_ADDRESS_1, IpPrefixType.class, L3_CONTEXT_ID, L3Context.class);
         InstanceIdentifier<AddressEndpoint> iid = IidFactory.addressEndpointIid(endpoint.getKey());
         WriteTransaction wtx = dataBroker.newWriteOnlyTransaction();
         wtx.put(LogicalDatastoreType.OPERATIONAL, iid, endpoint, true);
         wtx.submit().get();
 
-        NetworkElements nes = createNetworkElements(NODE_ID_1, CONNECTOR_ID_1, L3_CONTEXT_ID, IPv4_NETWORK_ADDRESS_1);
+        NetworkElements nes = createNetworkElements(NODE_ID_1, CONNECTOR_ID_1, L3_CONTEXT_ID, IP_V4_NETWORK_ADDRESS_1);
         InstanceIdentifier<NetworkElements> neIid = InstanceIdentifier.builder(NetworkElements.class).build();
         wtx = dataBroker.newWriteOnlyTransaction();
         wtx.put(LogicalDatastoreType.CONFIGURATION, neIid, nes);
@@ -385,7 +384,7 @@ public class NeLocationProviderTest extends CustomDataBrokerTest {
                             .setProvider(new ProviderName(NeLocationProvider.NE_LOCATION_PROVIDER_NAME))
                             .setProviderAddressEndpointLocation(Collections.singletonList(
                                     new ProviderAddressEndpointLocationBuilder()
-                                    .setAddress(IPv4_HOST_ADDRESS_1)
+                                    .setAddress(IP_V4_HOST_ADDRESS_1)
                                     .setAddressType(IpPrefixType.class)
                                     .setContextId(new ContextId(L3_CONTEXT_ID))
                                     .setContextType(L3Context.class)
@@ -403,13 +402,13 @@ public class NeLocationProviderTest extends CustomDataBrokerTest {
 
     @Test
     public void test_CreateLocationForAddrEndpoint_NEWriteFirst() throws Exception {
-        NetworkElements nes = createNetworkElements(NODE_ID_1, CONNECTOR_ID_1, L3_CONTEXT_ID, IPv4_NETWORK_ADDRESS_1);
+        NetworkElements nes = createNetworkElements(NODE_ID_1, CONNECTOR_ID_1, L3_CONTEXT_ID, IP_V4_NETWORK_ADDRESS_1);
         InstanceIdentifier<NetworkElements> neIid = InstanceIdentifier.builder(NetworkElements.class).build();
         WriteTransaction wtx = dataBroker.newWriteOnlyTransaction();
         wtx.put(LogicalDatastoreType.CONFIGURATION, neIid, nes);
 
         AddressEndpoint endpoint =
-                createAddressEndpoint(IPv4_HOST_ADDRESS_1, IpPrefixType.class, L3_CONTEXT_ID, L3Context.class);
+                createAddressEndpoint(IP_V4_HOST_ADDRESS_1, IpPrefixType.class, L3_CONTEXT_ID, L3Context.class);
         InstanceIdentifier<AddressEndpoint> iid = IidFactory.addressEndpointIid(endpoint.getKey());
         wtx.put(LogicalDatastoreType.OPERATIONAL, iid, endpoint, true);
         wtx.submit().get();
@@ -427,7 +426,7 @@ public class NeLocationProviderTest extends CustomDataBrokerTest {
                             .setProvider(new ProviderName(NeLocationProvider.NE_LOCATION_PROVIDER_NAME))
                             .setProviderAddressEndpointLocation(Collections.singletonList(
                                     new ProviderAddressEndpointLocationBuilder()
-                                    .setAddress(IPv4_HOST_ADDRESS_1)
+                                    .setAddress(IP_V4_HOST_ADDRESS_1)
                                     .setAddressType(IpPrefixType.class)
                                     .setContextId(new ContextId(L3_CONTEXT_ID))
                                     .setContextType(L3Context.class)
@@ -445,14 +444,14 @@ public class NeLocationProviderTest extends CustomDataBrokerTest {
 
     @Test
     public void test_CreateLocationForAddrEndpoint_SimultaneousWrite() throws Exception {
-        NetworkElements nes = createNetworkElements(NODE_ID_1, CONNECTOR_ID_1, L3_CONTEXT_ID, IPv4_NETWORK_ADDRESS_1);
+        NetworkElements nes = createNetworkElements(NODE_ID_1, CONNECTOR_ID_1, L3_CONTEXT_ID, IP_V4_NETWORK_ADDRESS_1);
         InstanceIdentifier<NetworkElements> neIid = InstanceIdentifier.builder(NetworkElements.class).build();
         WriteTransaction wtx = dataBroker.newWriteOnlyTransaction();
         wtx.put(LogicalDatastoreType.CONFIGURATION, neIid, nes);
         wtx.submit().get();
 
         AddressEndpoint endpoint =
-                createAddressEndpoint(IPv4_HOST_ADDRESS_1, IpPrefixType.class, L3_CONTEXT_ID, L3Context.class);
+                createAddressEndpoint(IP_V4_HOST_ADDRESS_1, IpPrefixType.class, L3_CONTEXT_ID, L3Context.class);
         InstanceIdentifier<AddressEndpoint> iid = IidFactory.addressEndpointIid(endpoint.getKey());
         wtx = dataBroker.newWriteOnlyTransaction();
         wtx.put(LogicalDatastoreType.OPERATIONAL, iid, endpoint, true);
@@ -471,7 +470,7 @@ public class NeLocationProviderTest extends CustomDataBrokerTest {
                             .setProvider(new ProviderName(NeLocationProvider.NE_LOCATION_PROVIDER_NAME))
                             .setProviderAddressEndpointLocation(Collections.singletonList(
                                     new ProviderAddressEndpointLocationBuilder()
-                                    .setAddress(IPv4_HOST_ADDRESS_1)
+                                    .setAddress(IP_V4_HOST_ADDRESS_1)
                                     .setAddressType(IpPrefixType.class)
                                     .setContextId(new ContextId(L3_CONTEXT_ID))
                                     .setContextType(L3Context.class)
@@ -487,9 +486,9 @@ public class NeLocationProviderTest extends CustomDataBrokerTest {
         assertEquals(locationReference, locations);
     }
 
-    private AddressEndpoint writeBaseAddrEndpoint () throws Exception {
+    private AddressEndpoint writeBaseAddrEndpoint() throws Exception {
         AddressEndpoint endpoint =
-                createAddressEndpoint(IPv4_HOST_ADDRESS_1, IpPrefixType.class, L3_CONTEXT_ID, L3Context.class);
+                createAddressEndpoint(IP_V4_HOST_ADDRESS_1, IpPrefixType.class, L3_CONTEXT_ID, L3Context.class);
         InstanceIdentifier<AddressEndpoint> iid = IidFactory.addressEndpointIid(endpoint.getKey());
         WriteTransaction wtx = dataBroker.newWriteOnlyTransaction();
         wtx.put(LogicalDatastoreType.OPERATIONAL, iid, endpoint, true);
@@ -497,8 +496,8 @@ public class NeLocationProviderTest extends CustomDataBrokerTest {
         return endpoint;
     }
 
-    private NetworkElements writeBaseNetworkElements () throws Exception {
-        NetworkElements nes = createNetworkElements(NODE_ID_1, CONNECTOR_ID_1, L3_CONTEXT_ID, IPv4_NETWORK_ADDRESS_1);
+    private NetworkElements writeBaseNetworkElements() throws Exception {
+        NetworkElements nes = createNetworkElements(NODE_ID_1, CONNECTOR_ID_1, L3_CONTEXT_ID, IP_V4_NETWORK_ADDRESS_1);
         InstanceIdentifier<NetworkElements> iid = InstanceIdentifier.builder(NetworkElements.class).build();
         WriteTransaction wtx = dataBroker.newWriteOnlyTransaction();
         wtx.put(LogicalDatastoreType.CONFIGURATION, iid, nes);
@@ -507,12 +506,12 @@ public class NeLocationProviderTest extends CustomDataBrokerTest {
     }
 
     private AddressEndpoint createAddressEndpoint(String ipAddr, Class<? extends AddressType> addrType,
-            String context, Class<? extends ContextType> cType) {
+            String context, Class<? extends ContextType> contextType) {
         return new AddressEndpointBuilder()
             .setAddress(ipAddr)
             .setAddressType(addrType)
             .setContextId(new ContextId(context))
-            .setContextType(cType).setTenant(TENANT)
+            .setContextType(contextType).setTenant(TENANT)
             .setEndpointGroup(DEFAULT_EPG).build();
     }
 
index ff5903e3d19630a81af75e5aa3434aa11808aeeb..3be3c60eee194320d8c4edfa19af82a5a6ac80f9 100644 (file)
       <scope>test</scope>
     </dependency>
   </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <configuration>
+          <excludes>org/opendaylight/yang/gen/**,**/yang/**</excludes>
+          <consoleOutput>true</consoleOutput>
+          <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
+        </configuration>
+        <executions>
+          <execution>
+            <goals>
+              <goal>check</goal>
+            </goals>
+            <phase>process-sources</phase>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
 </project>