Enforce findbug and checkstyle under l3vpn 82/66582/3
authorClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Mon, 18 Dec 2017 16:57:16 +0000 (17:57 +0100)
committerClaudio David Gasparini <claudio.gasparini@pantheon.tech>
Wed, 20 Dec 2017 20:08:33 +0000 (20:08 +0000)
Change-Id: I049c4941cc69bddb1f1db2f7713a6127a02a2b0d
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
23 files changed:
bgp/l3vpn/pom.xml
bgp/l3vpn/src/main/java/org/opendaylight/protocol/bgp/l3vpn/AbstractVpnNextHopParserSerializer.java
bgp/l3vpn/src/main/java/org/opendaylight/protocol/bgp/l3vpn/AbstractVpnNlriParser.java
bgp/l3vpn/src/main/java/org/opendaylight/protocol/bgp/l3vpn/AbstractVpnRIBSupport.java
bgp/l3vpn/src/main/java/org/opendaylight/protocol/bgp/l3vpn/TableTypeActivator.java
bgp/l3vpn/src/main/java/org/opendaylight/protocol/bgp/l3vpn/VpnDestinationUtil.java [new file with mode: 0644]
bgp/l3vpn/src/main/java/org/opendaylight/protocol/bgp/l3vpn/ipv4/RibIpv4Activator.java
bgp/l3vpn/src/main/java/org/opendaylight/protocol/bgp/l3vpn/ipv4/VpnIpv4NlriParser.java
bgp/l3vpn/src/main/java/org/opendaylight/protocol/bgp/l3vpn/ipv4/VpnIpv4RIBSupport.java
bgp/l3vpn/src/main/java/org/opendaylight/protocol/bgp/l3vpn/ipv6/BgpIpv6Activator.java
bgp/l3vpn/src/main/java/org/opendaylight/protocol/bgp/l3vpn/ipv6/RibIpv6Activator.java
bgp/l3vpn/src/main/java/org/opendaylight/protocol/bgp/l3vpn/ipv6/VpnIpv6NextHopParserSerializer.java
bgp/l3vpn/src/main/java/org/opendaylight/protocol/bgp/l3vpn/ipv6/VpnIpv6NlriParser.java
bgp/l3vpn/src/main/java/org/opendaylight/protocol/bgp/l3vpn/ipv6/VpnIpv6RIBSupport.java
bgp/l3vpn/src/test/java/org/opendaylight/protocol/bgp/l3vpn/TableTypeActivatorTest.java
bgp/l3vpn/src/test/java/org/opendaylight/protocol/bgp/l3vpn/ipv4/BgpIpv4ActivatorTest.java
bgp/l3vpn/src/test/java/org/opendaylight/protocol/bgp/l3vpn/ipv4/VpnIpv4NextHopTest.java
bgp/l3vpn/src/test/java/org/opendaylight/protocol/bgp/l3vpn/ipv4/VpnIpv4NlriParserTest.java
bgp/l3vpn/src/test/java/org/opendaylight/protocol/bgp/l3vpn/ipv4/VpnIpv4RIBSupportTest.java
bgp/l3vpn/src/test/java/org/opendaylight/protocol/bgp/l3vpn/ipv6/BgpIpv6ActivatorTest.java
bgp/l3vpn/src/test/java/org/opendaylight/protocol/bgp/l3vpn/ipv6/VpnIpv6NextHopTest.java
bgp/l3vpn/src/test/java/org/opendaylight/protocol/bgp/l3vpn/ipv6/VpnIpv6NlriParserTest.java
bgp/l3vpn/src/test/java/org/opendaylight/protocol/bgp/l3vpn/ipv6/VpnIpv6RIBSupportTest.java

index ed10b1f0b04b5e9e2f54d85c43d4b2613a76354c..b8d578e8bfde8c6a4dc6590fe895f02916ced5e8 100644 (file)
         </dependency>
     </dependencies>
 
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-checkstyle-plugin</artifactId>
+                <configuration>
+                    <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>findbugs-maven-plugin</artifactId>
+                <configuration>
+                    <failOnError>true</failOnError>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
     <scm>
         <connection>scm:git:ssh://git.opendaylight.org:29418/bgpcep.git</connection>
         <developerConnection>scm:git:ssh://git.opendaylight.org:29418/bgpcep.git</developerConnection>
index a03f2ac5bd730da0882b7e36f8fd7d6dd6d16828..44482529a4f94992874bf7a1458acee42209276a 100644 (file)
@@ -15,9 +15,6 @@ import org.opendaylight.protocol.bgp.parser.BGPParsingException;
 import org.opendaylight.protocol.bgp.parser.spi.NextHopParserSerializer;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.next.hop.CNextHop;
 
-/**
- * @author Kevin Wang
- */
 public abstract class AbstractVpnNextHopParserSerializer implements NextHopParserSerializer {
     private final int ipAddrLength;
     private final Class<?> ipNextHopCaseClazz;
@@ -29,15 +26,18 @@ public abstract class AbstractVpnNextHopParserSerializer implements NextHopParse
 
     @Override
     public CNextHop parseNextHop(final ByteBuf buffer) throws BGPParsingException {
-        Preconditions.checkArgument(buffer.readableBytes() == (this.ipAddrLength + RouteDistinguisherUtil.RD_LENGTH), "Length of byte array for NEXT_HOP should be %s, but is %s", this.ipAddrLength + RouteDistinguisherUtil.RD_LENGTH, buffer.readableBytes());
+        Preconditions.checkArgument(buffer.readableBytes() == (this.ipAddrLength + RouteDistinguisherUtil.RD_LENGTH),
+                "Length of byte array for NEXT_HOP should be %s, but is %s",
+                this.ipAddrLength + RouteDistinguisherUtil.RD_LENGTH, buffer.readableBytes());
         buffer.readBytes(RouteDistinguisherUtil.RD_LENGTH);
         return NextHopUtil.parseNextHop(buffer.readBytes(this.ipAddrLength));
     }
 
     @Override
-    public void serializeNextHop(final CNextHop cNextHop, final ByteBuf byteAggregator) {
-        Preconditions.checkArgument(this.ipNextHopCaseClazz.isInstance(cNextHop), "cNextHop is not a VPN %s NextHop object.", this.ipNextHopCaseClazz.getSimpleName());
+    public void serializeNextHop(final CNextHop nextHop, final ByteBuf byteAggregator) {
+        Preconditions.checkArgument(this.ipNextHopCaseClazz.isInstance(nextHop),
+                "cNextHop is not a VPN %s NextHop object.", this.ipNextHopCaseClazz.getSimpleName());
         byteAggregator.writeZero(RouteDistinguisherUtil.RD_LENGTH);
-        NextHopUtil.serializeNextHop(cNextHop, byteAggregator);
+        NextHopUtil.serializeNextHop(nextHop, byteAggregator);
     }
 }
index b650bf622f5c90febb96412b2933653d505fb99e..51a87cdbf234f9a7b0a8483e7af381ad0b3ca85f 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.protocol.bgp.l3vpn;
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-import java.util.ArrayList;
 import java.util.List;
 import org.opendaylight.bgp.concepts.RouteDistinguisherUtil;
 import org.opendaylight.protocol.bgp.labeled.unicast.LUNlriParser;
@@ -27,9 +26,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mult
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.update.attributes.MpUnreachNlriBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.update.attributes.mp.reach.nlri.AdvertizedRoutes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.update.attributes.mp.unreach.nlri.WithdrawnRoutes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.AddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.rev171207.l3vpn.ip.destination.type.VpnDestination;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.rev171207.l3vpn.ip.destination.type.VpnDestinationBuilder;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -45,7 +42,8 @@ public abstract class AbstractVpnNlriParser implements NlriParser, NlriSerialize
 
     protected abstract AdvertizedRoutes getAdvertizedRoutesByDestination(List<VpnDestination> dst);
 
-    private static void serializeNlri(final List<VpnDestination> dests, final boolean isWithdrawnRoute, final ByteBuf buffer) {
+    private static void serializeNlri(final List<VpnDestination> dests,
+            final boolean isWithdrawnRoute, final ByteBuf buffer) {
         final ByteBuf nlriByteBuf = Unpooled.buffer();
         for (final VpnDestination dest : dests) {
             final List<LabelStack> labelStack = dest.getLabelStack();
@@ -54,52 +52,35 @@ public abstract class AbstractVpnNlriParser implements NlriParser, NlriSerialize
             AbstractVpnNlriParser.serializeLengtField(prefix, labelStack, nlriByteBuf);
             LUNlriParser.serializeLabelStackEntries(labelStack, isWithdrawnRoute, nlriByteBuf);
             RouteDistinguisherUtil.serializeRouteDistinquisher(dest.getRouteDistinguisher(), nlriByteBuf);
-            Preconditions.checkArgument(prefix.getIpv6Prefix() != null || prefix.getIpv4Prefix() != null, "Ipv6 or Ipv4 prefix is missing.");
+            Preconditions.checkArgument(prefix.getIpv6Prefix() != null || prefix.getIpv4Prefix() != null,
+                    "Ipv6 or Ipv4 prefix is missing.");
             LUNlriParser.serializePrefixField(prefix, nlriByteBuf);
         }
         buffer.writeBytes(nlriByteBuf);
     }
 
     /**
-     * Serialize the length field Length field contains one Byte which represents the length of label stack and prefix in bits
-     * @param prefix ipPrefix
-     * @param labelStack list of labelStack
+     * Serialize the length field Length field contains one Byte which represents the length of label stack and prefix
+     * in bits.
+     *
+     * @param prefix      ipPrefix
+     * @param labelStack  list of labelStack
      * @param nlriByteBuf ByteBuf
      */
-    static void serializeLengtField(final IpPrefix prefix, final List<LabelStack> labelStack, final ByteBuf nlriByteBuf) {
+    static void serializeLengtField(final IpPrefix prefix, final List<LabelStack> labelStack,
+            final ByteBuf nlriByteBuf) {
         final int prefixLenght = LUNlriParser.getPrefixLength(prefix);
         int labelStackLenght = 0;
-        if(labelStack != null) {
+        if (labelStack != null) {
             labelStackLenght = LUNlriParser.LABEL_LENGTH * labelStack.size();
         }
         nlriByteBuf.writeByte((labelStackLenght + prefixLenght + RouteDistinguisherUtil.RD_LENGTH) * Byte.SIZE);
     }
 
-
-    private static List<VpnDestination> parseNlri(final ByteBuf nlri, final Class<? extends AddressFamily> afi) {
-        if (!nlri.isReadable()) {
-            return null;
-        }
-        final List<VpnDestination> dests = new ArrayList<>();
-
-        while (nlri.isReadable()) {
-            final VpnDestinationBuilder builder = new VpnDestinationBuilder();
-            final short length = nlri.readUnsignedByte();
-            final List<LabelStack> labels = LUNlriParser.parseLabel(nlri);
-            builder.setLabelStack(labels);
-            final int labelNum = labels != null ? labels.size() : 1;
-            final int prefixLen = length - (LUNlriParser.LABEL_LENGTH * Byte.SIZE * labelNum) - (RouteDistinguisherUtil.RD_LENGTH * Byte.SIZE);
-            builder.setRouteDistinguisher(RouteDistinguisherUtil.parseRouteDistinguisher(nlri));
-            Preconditions.checkState(prefixLen > 0, "A valid VPN IP prefix is required.");
-            builder.setPrefix(LUNlriParser.parseIpPrefix(nlri, prefixLen, afi));
-            dests.add(builder.build());
-        }
-        return dests;
-    }
-
     @Override
     public void serializeAttribute(final DataObject attribute, final ByteBuf byteAggregator) {
-        Preconditions.checkArgument(attribute instanceof Attributes, "Attribute parameter is not a Attributes object");
+        Preconditions.checkArgument(attribute instanceof Attributes,
+                "Attribute parameter is not a Attributes object");
         final Attributes pathAttributes = (Attributes) attribute;
         final Attributes1 pathAttributes1 = pathAttributes.getAugmentation(Attributes1.class);
         final Attributes2 pathAttributes2 = pathAttributes.getAugmentation(Attributes2.class);
@@ -127,7 +108,7 @@ public abstract class AbstractVpnNlriParser implements NlriParser, NlriSerialize
         if (!nlri.isReadable()) {
             return;
         }
-        final List<VpnDestination> dst = parseNlri(nlri, builder.getAfi());
+        final List<VpnDestination> dst = VpnDestinationUtil.parseNlri(nlri, builder.getAfi());
         builder.setWithdrawnRoutes(getWithdrawnRoutesByDestination(dst));
     }
 
@@ -136,7 +117,7 @@ public abstract class AbstractVpnNlriParser implements NlriParser, NlriSerialize
         if (!nlri.isReadable()) {
             return;
         }
-        final List<VpnDestination> dst = parseNlri(nlri, builder.getAfi());
+        final List<VpnDestination> dst = VpnDestinationUtil.parseNlri(nlri, builder.getAfi());
         builder.setAdvertizedRoutes(getAdvertizedRoutesByDestination(dst));
     }
 }
index 8ce20f7dac40efc0d6dcfb5828716ee404b2345c..d0f461455df3b3ff279707c83b43da5f6d1d210b 100644 (file)
@@ -69,9 +69,11 @@ public abstract class AbstractVpnRIBSupport extends AbstractRIBSupport {
      * @param containerClass Binding class of the container in routes choice, must not be null.
      * @param listClass      Binding class of the route list, nust not be null;
      */
-    protected AbstractVpnRIBSupport(final Class<? extends Routes> cazeClass, final Class<? extends DataObject> containerClass, final Class<? extends Route> listClass,
+    protected AbstractVpnRIBSupport(final Class<? extends Routes> cazeClass,
+            final Class<? extends DataObject> containerClass, final Class<? extends Route> listClass,
         final Class<? extends AddressFamily> afiClass, final QName vpnDstContainerClassQname) {
-        super(cazeClass, containerClass, listClass, afiClass, MplsLabeledVpnSubsequentAddressFamily.class, vpnDstContainerClassQname);
+        super(cazeClass, containerClass, listClass, afiClass,
+                MplsLabeledVpnSubsequentAddressFamily.class, vpnDstContainerClassQname);
         final QName classQname = BindingReflections.findQName(containerClass).intern();
         this.routeKey = QName.create(routeQName(), "route-key").intern();
         final QName vpnDstClassQname = QName.create(classQname, VpnDestination.QNAME.getLocalName());
@@ -91,9 +93,11 @@ public abstract class AbstractVpnRIBSupport extends AbstractRIBSupport {
         return dst;
     }
 
-    protected abstract IpPrefix extractPrefix(final DataContainerNode<? extends PathArgument> route, final NodeIdentifier prefixTypeNid);
+    protected abstract IpPrefix extractPrefix(DataContainerNode<? extends PathArgument> route,
+            NodeIdentifier prefixTypeNid);
 
-    private RouteDistinguisher extractRouteDistinguisher(final DataContainerNode<? extends YangInstanceIdentifier.PathArgument> route) {
+    private RouteDistinguisher extractRouteDistinguisher(
+            final DataContainerNode<? extends YangInstanceIdentifier.PathArgument> route) {
         if (route.getChild(this.rdNid).isPresent()) {
             return RouteDistinguisherBuilder.getDefaultInstance((String) route.getChild(this.rdNid).get().getValue());
         }
@@ -139,9 +143,10 @@ public abstract class AbstractVpnRIBSupport extends AbstractRIBSupport {
 
     @Override
     protected void processDestination(final DOMDataWriteTransaction tx, final YangInstanceIdentifier routesPath,
-                                    final ContainerNode destination, final ContainerNode attributes, final ApplyRoute function) {
+        final ContainerNode destination, final ContainerNode attributes, final ApplyRoute function) {
         if (destination != null) {
-            final Optional<DataContainerChild<? extends PathArgument, ?>> maybeRoutes = destination.getChild(this.nlriRoutesListNid);
+            final Optional<DataContainerChild<? extends PathArgument, ?>> maybeRoutes =
+                    destination.getChild(this.nlriRoutesListNid);
             if (maybeRoutes.isPresent()) {
                 final DataContainerChild<? extends PathArgument, ?> routes = maybeRoutes.get();
                 if (routes instanceof UnkeyedListNode) {
@@ -173,7 +178,8 @@ public abstract class AbstractVpnRIBSupport extends AbstractRIBSupport {
             LOG.debug("Serializing Nlri: VpnDestination={}, IpPrefix={}", dest, prefix);
             AbstractVpnNlriParser.serializeLengtField(prefix, null, nlriByteBuf);
             RouteDistinguisherUtil.serializeRouteDistinquisher(dest.getRouteDistinguisher(), nlriByteBuf);
-            Preconditions.checkArgument(prefix.getIpv6Prefix() != null || prefix.getIpv4Prefix() != null, "Ipv6 or Ipv4 prefix is missing.");
+            Preconditions.checkArgument(prefix.getIpv6Prefix() != null || prefix.getIpv4Prefix() != null,
+                    "Ipv6 or Ipv4 prefix is missing.");
             LUNlriParser.serializePrefixField(prefix, nlriByteBuf);
         }
         buffer.writeBytes(nlriByteBuf);
index bf2549cd6b537040e5bae5171b57c6086e0e69cc..e8e0a88c465f37e5008f0c3b74bb8f196d0b4b31 100644 (file)
@@ -22,10 +22,13 @@ import org.opendaylight.yangtools.concepts.AbstractRegistration;
 public final class TableTypeActivator extends AbstractBGPTableTypeRegistryProviderActivator {
 
     @Override
-    protected List<AbstractRegistration> startBGPTableTypeRegistryProviderImpl(final BGPTableTypeRegistryProvider provider) {
+    protected List<AbstractRegistration> startBGPTableTypeRegistryProviderImpl(
+            final BGPTableTypeRegistryProvider provider) {
         return Lists.newArrayList(
-                provider.registerBGPTableType(Ipv4AddressFamily.class, MplsLabeledVpnSubsequentAddressFamily.class, L3VPNIPV4UNICAST.class),
-                provider.registerBGPTableType(Ipv6AddressFamily.class, MplsLabeledVpnSubsequentAddressFamily.class, L3VPNIPV6UNICAST.class));
+                provider.registerBGPTableType(Ipv4AddressFamily.class,
+                        MplsLabeledVpnSubsequentAddressFamily.class, L3VPNIPV4UNICAST.class),
+                provider.registerBGPTableType(Ipv6AddressFamily.class,
+                        MplsLabeledVpnSubsequentAddressFamily.class, L3VPNIPV6UNICAST.class));
     }
 
 }
diff --git a/bgp/l3vpn/src/main/java/org/opendaylight/protocol/bgp/l3vpn/VpnDestinationUtil.java b/bgp/l3vpn/src/main/java/org/opendaylight/protocol/bgp/l3vpn/VpnDestinationUtil.java
new file mode 100644 (file)
index 0000000..bce87f4
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.protocol.bgp.l3vpn;
+
+import com.google.common.base.Preconditions;
+import io.netty.buffer.ByteBuf;
+import java.util.ArrayList;
+import java.util.List;
+import org.opendaylight.bgp.concepts.RouteDistinguisherUtil;
+import org.opendaylight.protocol.bgp.labeled.unicast.LUNlriParser;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev171207.labeled.unicast.LabelStack;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.AddressFamily;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.rev171207.l3vpn.ip.destination.type.VpnDestination;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.rev171207.l3vpn.ip.destination.type.VpnDestinationBuilder;
+
+final class VpnDestinationUtil {
+    private VpnDestinationUtil() {
+        throw new UnsupportedOperationException();
+    }
+
+    static List<VpnDestination> parseNlri(final ByteBuf nlri, final Class<? extends AddressFamily> afi) {
+        if (!nlri.isReadable()) {
+            return null;
+        }
+        final List<VpnDestination> dests = new ArrayList<>();
+
+        while (nlri.isReadable()) {
+            final VpnDestinationBuilder builder = new VpnDestinationBuilder();
+            final short length = nlri.readUnsignedByte();
+            final List<LabelStack> labels = LUNlriParser.parseLabel(nlri);
+            builder.setLabelStack(labels);
+            final int labelNum = labels != null ? labels.size() : 1;
+            final int prefixLen = length - (LUNlriParser.LABEL_LENGTH * Byte.SIZE * labelNum)
+                    - (RouteDistinguisherUtil.RD_LENGTH * Byte.SIZE);
+            builder.setRouteDistinguisher(RouteDistinguisherUtil.parseRouteDistinguisher(nlri));
+            Preconditions.checkState(prefixLen > 0, "A valid VPN IP prefix is required.");
+            builder.setPrefix(LUNlriParser.parseIpPrefix(nlri, prefixLen, afi));
+            dests.add(builder.build());
+        }
+        return dests;
+    }
+}
index c8876c1155a71f1e8667b9526c28f931c3fcf725..b511a5651ef5d42f250d849bfb5fb035add535dc 100644 (file)
@@ -19,7 +19,8 @@ public class RibIpv4Activator extends AbstractRIBExtensionProviderActivator {
     @Override
     protected List<AutoCloseable> startRIBExtensionProviderImpl(final RIBExtensionProviderContext context) {
         final List<AutoCloseable> regs = new ArrayList<>();
-        regs.add(context.registerRIBSupport(Ipv4AddressFamily.class, MplsLabeledVpnSubsequentAddressFamily.class, new VpnIpv4RIBSupport()));
+        regs.add(context.registerRIBSupport(Ipv4AddressFamily.class,
+                MplsLabeledVpnSubsequentAddressFamily.class, new VpnIpv4RIBSupport()));
         return regs;
     }
 
index e47c0a26c2151b0c797b235ba4b2f30c1f132954..95bffff00cf49679443c0d7822fe205a82c03b58 100644 (file)
@@ -20,7 +20,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.
 
 final class VpnIpv4NlriParser extends AbstractVpnNlriParser {
 
-    private <T extends L3vpnIpv4Destination> List<VpnDestination> getVpnDestination(DestinationType dst, Class<T> dstTypeCaseClazz) {
+    private <T extends L3vpnIpv4Destination> List<VpnDestination> getVpnDestination(DestinationType dst,
+            Class<T> dstTypeCaseClazz) {
         if (dstTypeCaseClazz.isInstance(dst)) {
             return dstTypeCaseClazz.cast(dst).getVpnIpv4Destination().getVpnDestination();
         } else {
@@ -30,29 +31,33 @@ final class VpnIpv4NlriParser extends AbstractVpnNlriParser {
 
     @Override
     protected List<VpnDestination> getWithdrawnVpnDestination(DestinationType dstType) {
-        return getVpnDestination(dstType, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev171207.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationVpnIpv4Case.class);
+        return getVpnDestination(dstType, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4
+                .rev171207.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type
+                .DestinationVpnIpv4Case.class);
     }
 
     @Override
     protected List<VpnDestination> getAdvertizedVpnDestination(DestinationType dstType) {
-        return getVpnDestination(dstType, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev171207.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationVpnIpv4Case.class);
+        return getVpnDestination(dstType, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4
+                .rev171207.update.attributes.mp.reach.nlri.advertized.routes.destination.type
+                .DestinationVpnIpv4Case.class);
     }
 
     @Override
     protected WithdrawnRoutes getWithdrawnRoutesByDestination(List<VpnDestination> dst) {
         return new WithdrawnRoutesBuilder().setDestinationType(
-            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev171207.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationVpnIpv4CaseBuilder().setVpnIpv4Destination(
-                new VpnIpv4DestinationBuilder().setVpnDestination(dst).build()
-            ).build()
-        ).build();
+            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev171207.update
+                    .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationVpnIpv4CaseBuilder()
+                    .setVpnIpv4Destination(new VpnIpv4DestinationBuilder()
+                            .setVpnDestination(dst).build()).build()).build();
     }
 
     @Override
     protected AdvertizedRoutes getAdvertizedRoutesByDestination(List<VpnDestination> dst) {
         return new AdvertizedRoutesBuilder().setDestinationType(
-            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev171207.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationVpnIpv4CaseBuilder().setVpnIpv4Destination(
-                new VpnIpv4DestinationBuilder().setVpnDestination(dst).build()
-            ).build()
-        ).build();
+            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev171207.update
+                    .attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationVpnIpv4CaseBuilder()
+                    .setVpnIpv4Destination(new VpnIpv4DestinationBuilder()
+                            .setVpnDestination(dst).build()).build()).build();
     }
 }
index 51a0788008176ec59c8f20da9e39e671b4b51d45..bcee4558f5c784a3ce9e86de603fe7c6fb4dec6c 100644 (file)
@@ -29,12 +29,14 @@ final class VpnIpv4RIBSupport extends AbstractVpnRIBSupport {
      * the same model which populates it with route grouping instantiation, and by extension with
      * the route attributes container.
      */
-    public VpnIpv4RIBSupport() {
-        super(VpnIpv4RoutesCase.class, VpnIpv4Routes.class, VpnRoute.class, Ipv4AddressFamily.class, VpnIpv4Destination.QNAME);
+    VpnIpv4RIBSupport() {
+        super(VpnIpv4RoutesCase.class, VpnIpv4Routes.class, VpnRoute.class,
+                Ipv4AddressFamily.class, VpnIpv4Destination.QNAME);
     }
 
     @Override
-    protected IpPrefix extractPrefix(final DataContainerNode<? extends YangInstanceIdentifier.PathArgument> route, final YangInstanceIdentifier.NodeIdentifier prefixTypeNid) {
+    protected IpPrefix extractPrefix(final DataContainerNode<? extends YangInstanceIdentifier.PathArgument> route,
+            final YangInstanceIdentifier.NodeIdentifier prefixTypeNid) {
         if (route.getChild(prefixTypeNid).isPresent()) {
             final String prefixType = (String) route.getChild(prefixTypeNid).get().getValue();
             return new IpPrefix(new Ipv4Prefix(prefixType));
@@ -44,15 +46,15 @@ final class VpnIpv4RIBSupport extends AbstractVpnRIBSupport {
 
     @Override
     protected DestinationType getAdvertisedDestinationType(List<VpnDestination> dests) {
-        return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev171207.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationVpnIpv4CaseBuilder().setVpnIpv4Destination(
-            new VpnIpv4DestinationBuilder().setVpnDestination(dests).build()
-        ).build();
+        return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev171207.update
+                .attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationVpnIpv4CaseBuilder()
+                .setVpnIpv4Destination(new VpnIpv4DestinationBuilder().setVpnDestination(dests).build()).build();
     }
 
     @Override
     protected DestinationType getWithdrawnDestinationType(List<VpnDestination> dests) {
-        return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev171207.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationVpnIpv4CaseBuilder().setVpnIpv4Destination(
-            new VpnIpv4DestinationBuilder().setVpnDestination(dests).build()
-        ).build();
+        return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev171207.update
+                .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationVpnIpv4CaseBuilder()
+                .setVpnIpv4Destination(new VpnIpv4DestinationBuilder().setVpnDestination(dests).build()).build();
     }
 }
index d671f7867779ebecf47a544f9c61e58319d78fbb..f480295f70ebd8fa8a275f11c854f0b8b8d7e26d 100644 (file)
@@ -16,9 +16,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.next.hop.c.next.hop.Ipv6NextHopCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv6.rev171207.l3vpn.ipv6.routes.VpnIpv6Routes;
 
-/**
- * @author Kevin Wang
- */
 public final class BgpIpv6Activator extends AbstractBGPExtensionProviderActivator {
 
     @Override
index d5f766706f12bbf75d0db71e67b096bbe8ea1f75..625a866986d3683f043cbfe352fccb2a961acb25 100644 (file)
@@ -14,15 +14,13 @@ import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderContext;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.Ipv6AddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.MplsLabeledVpnSubsequentAddressFamily;
 
-/**
- * @author Kevin Wang
- */
 public class RibIpv6Activator extends AbstractRIBExtensionProviderActivator {
 
     @Override
     protected List<AutoCloseable> startRIBExtensionProviderImpl(final RIBExtensionProviderContext context) {
         final List<AutoCloseable> regs = new ArrayList<>();
-        regs.add(context.registerRIBSupport(Ipv6AddressFamily.class, MplsLabeledVpnSubsequentAddressFamily.class, new VpnIpv6RIBSupport()));
+        regs.add(context.registerRIBSupport(Ipv6AddressFamily.class,
+                MplsLabeledVpnSubsequentAddressFamily.class, new VpnIpv6RIBSupport()));
         return regs;
     }
 
index cc6a699739796048428471480a21b6915666c3ad..ce3bae3dce582c7594e39d1188c56228d3027339 100644 (file)
@@ -11,9 +11,6 @@ import org.opendaylight.protocol.bgp.l3vpn.AbstractVpnNextHopParserSerializer;
 import org.opendaylight.protocol.util.Ipv6Util;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.next.hop.c.next.hop.Ipv6NextHopCase;
 
-/**
- * @author Kevin Wang
- */
 public final class VpnIpv6NextHopParserSerializer extends AbstractVpnNextHopParserSerializer {
     public VpnIpv6NextHopParserSerializer() {
         super(Ipv6Util.IPV6_LENGTH, Ipv6NextHopCase.class);
index 38d19c00804332204ed958f99d04b47b9da480ee..5f2b761e3b84235b9e58dc9a204f35ed44a6595f 100644 (file)
@@ -20,7 +20,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.
 
 class VpnIpv6NlriParser extends AbstractVpnNlriParser {
 
-    private <T extends L3vpnIpv6Destination> List<VpnDestination> getVpnDestination(DestinationType dst, Class<T> dstTypeCaseClazz) {
+    private <T extends L3vpnIpv6Destination> List<VpnDestination> getVpnDestination(DestinationType dst,
+            Class<T> dstTypeCaseClazz) {
         if (dstTypeCaseClazz.isInstance(dst)) {
             return dstTypeCaseClazz.cast(dst).getVpnIpv6Destination().getVpnDestination();
         } else {
@@ -30,35 +31,35 @@ class VpnIpv6NlriParser extends AbstractVpnNlriParser {
 
     @Override
     protected List<VpnDestination> getWithdrawnVpnDestination(DestinationType dstType) {
-        return getVpnDestination(
-            dstType,
-            org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv6.rev171207.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationVpnIpv6Case.class);
+        return getVpnDestination(dstType,
+            org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv6.rev171207.update.attributes
+                    .mp.unreach.nlri.withdrawn.routes.destination.type.DestinationVpnIpv6Case.class);
     }
 
     @Override
     protected List<VpnDestination> getAdvertizedVpnDestination(DestinationType dstType) {
         return getVpnDestination(
             dstType,
-            org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv6.rev171207.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationVpnIpv6Case.class
-        );
+            org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv6.rev171207.update.attributes
+                    .mp.reach.nlri.advertized.routes.destination.type.DestinationVpnIpv6Case.class);
     }
 
     @Override
     protected WithdrawnRoutes getWithdrawnRoutesByDestination(List<VpnDestination> dst) {
         return new WithdrawnRoutesBuilder().setDestinationType(
-            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv6.rev171207.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationVpnIpv6CaseBuilder().setVpnIpv6Destination(
-                new VpnIpv6DestinationBuilder().setVpnDestination(dst).build()
-            ).build()
-        ).build();
+            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv6.rev171207.update
+                    .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationVpnIpv6CaseBuilder()
+                    .setVpnIpv6Destination(new VpnIpv6DestinationBuilder()
+                            .setVpnDestination(dst).build()).build()).build();
     }
 
     @Override
     protected AdvertizedRoutes getAdvertizedRoutesByDestination(List<VpnDestination> dst) {
         return new AdvertizedRoutesBuilder().setDestinationType(
-            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv6.rev171207.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationVpnIpv6CaseBuilder().setVpnIpv6Destination(
-                new VpnIpv6DestinationBuilder().setVpnDestination(dst).build()
-            ).build()
-        ).build();
+            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv6.rev171207.update
+                    .attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationVpnIpv6CaseBuilder()
+                    .setVpnIpv6Destination(new VpnIpv6DestinationBuilder()
+                            .setVpnDestination(dst).build()).build()).build();
     }
 
 }
index 3529b5ba0a493588f7fc88dfc47c71dd09a6ecb3..38b69e4da804dd6ba1100952762844fe2c132321 100644 (file)
@@ -22,9 +22,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode;
 
-/**
- * @author Kevin Wang
- */
 final class VpnIpv6RIBSupport extends AbstractVpnRIBSupport {
 
     /**
@@ -33,12 +30,14 @@ final class VpnIpv6RIBSupport extends AbstractVpnRIBSupport {
      * the same model which populates it with route grouping instantiation, and by extension with
      * the route attributes container.
      */
-    public VpnIpv6RIBSupport() {
-        super(VpnIpv6RoutesCase.class, VpnIpv6Routes.class, VpnRoute.class, Ipv6AddressFamily.class, VpnIpv6Destination.QNAME);
+    VpnIpv6RIBSupport() {
+        super(VpnIpv6RoutesCase.class, VpnIpv6Routes.class, VpnRoute.class,
+                Ipv6AddressFamily.class, VpnIpv6Destination.QNAME);
     }
 
     @Override
-    protected IpPrefix extractPrefix(final DataContainerNode<? extends YangInstanceIdentifier.PathArgument> route, final YangInstanceIdentifier.NodeIdentifier prefixTypeNid) {
+    protected IpPrefix extractPrefix(final DataContainerNode<? extends YangInstanceIdentifier.PathArgument> route,
+            final YangInstanceIdentifier.NodeIdentifier prefixTypeNid) {
         if (route.getChild(prefixTypeNid).isPresent()) {
             final String prefixType = (String) route.getChild(prefixTypeNid).get().getValue();
             return new IpPrefix(new Ipv6Prefix(prefixType));
@@ -48,13 +47,15 @@ final class VpnIpv6RIBSupport extends AbstractVpnRIBSupport {
 
     @Override
     protected DestinationType getAdvertisedDestinationType(List<VpnDestination> dests) {
-        return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv6.rev171207.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationVpnIpv6CaseBuilder().setVpnIpv6Destination(
-            new VpnIpv6DestinationBuilder().setVpnDestination(dests).build()).build();
+        return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv6.rev171207.update
+                .attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationVpnIpv6CaseBuilder()
+                .setVpnIpv6Destination(new VpnIpv6DestinationBuilder().setVpnDestination(dests).build()).build();
     }
 
     @Override
     protected DestinationType getWithdrawnDestinationType(List<VpnDestination> dests) {
-        return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv6.rev171207.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationVpnIpv6CaseBuilder().setVpnIpv6Destination(
-            new VpnIpv6DestinationBuilder().setVpnDestination(dests).build()).build();
+        return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv6.rev171207.update
+                .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationVpnIpv6CaseBuilder()
+                .setVpnIpv6Destination(new VpnIpv6DestinationBuilder().setVpnDestination(dests).build()).build();
     }
 }
index a2ba0ea26277ee45da8186dbc621d344963b4885..607c9600acb9b9037b0ad77337dc2aa94934f95d 100644 (file)
@@ -23,8 +23,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 
 public class TableTypeActivatorTest {
 
-    private static final BgpTableType IPV4 = new BgpTableTypeImpl(Ipv4AddressFamily.class, MplsLabeledVpnSubsequentAddressFamily.class);
-    private static final BgpTableType IPV6 = new BgpTableTypeImpl(Ipv6AddressFamily.class, MplsLabeledVpnSubsequentAddressFamily.class);
+    private static final BgpTableType IPV4 = new BgpTableTypeImpl(Ipv4AddressFamily.class,
+            MplsLabeledVpnSubsequentAddressFamily.class);
+    private static final BgpTableType IPV6 = new BgpTableTypeImpl(Ipv6AddressFamily.class,
+            MplsLabeledVpnSubsequentAddressFamily.class);
 
     @Test
     public void testActivator() {
index 602ab61f484758652afba35d79d27ada33c26dab..e95d4ae1674a42806b6c54473c77089450977ea6 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.protocol.bgp.l3vpn.ipv4;
 
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
+
 import org.junit.Test;
 import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext;
 import org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleBGPExtensionProviderContext;
index 9c0fe00f40700c3cddcfb8071f2da3f252cc7ffe..f64ae12ded55abb84a60c1d0e86bd55c27f17e5d 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.protocol.bgp.l3vpn.ipv4;
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
+
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import org.junit.Test;
@@ -30,7 +31,7 @@ public class VpnIpv4NextHopTest {
         final ByteBuf buffer = Unpooled.buffer();
         final byte[] nextHop = {0, 0, 0, 0, 0, 0, 0, 0, 42, 42, 42, 42};
         final CNextHop hop = new Ipv4NextHopCaseBuilder().setIpv4NextHop(new Ipv4NextHopBuilder()
-            .setGlobal(new Ipv4Address("42.42.42.42")).build()).build();
+                .setGlobal(new Ipv4Address("42.42.42.42")).build()).build();
 
         HANDLER.serializeNextHop(hop, buffer);
         assertArrayEquals(nextHop, ByteArray.readAllBytes(buffer));
index 576559ceab79ec37f5130b200c1e02033d6ccc1f..ae1f1395dd0681eab350d18cd21b4cf47bd03a7f 100755 (executable)
@@ -10,6 +10,7 @@ package org.opendaylight.protocol.bgp.l3vpn.ipv4;
 import com.google.common.collect.Lists;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import java.util.Collections;
 import java.util.List;
 import org.junit.Assert;
 import org.junit.Test;
@@ -77,12 +78,15 @@ public class VpnIpv4NlriParserTest {
         (byte) 0x22, (byte) 0x01, (byte) 0x16,
     };
 
-    static final IpPrefix IPv4_PREFIX = new IpPrefix(new Ipv4Prefix("34.1.22.0/24"));
+    static final IpPrefix IPV4_PREFIX = new IpPrefix(new Ipv4Prefix("34.1.22.0/24"));
     static final List<LabelStack> LABEL_STACK = Lists.newArrayList(
         new LabelStackBuilder().setLabelValue(new MplsLabel(355L)).build());
-    static final RouteDistinguisher DISTINGUISHER = RouteDistinguisherBuilder.getDefaultInstance("1.2.3.4:258");
-    static final VpnDestination IPV4_VPN = new VpnDestinationBuilder().setRouteDistinguisher(DISTINGUISHER).setPrefix(IPv4_PREFIX).setLabelStack(LABEL_STACK).build();
-    private static final VpnDestination IPV4_VPN_WITHOUT_LABELS = new VpnDestinationBuilder().setRouteDistinguisher(DISTINGUISHER).setPrefix(IPv4_PREFIX).build();
+    static final RouteDistinguisher DISTINGUISHER = RouteDistinguisherBuilder
+            .getDefaultInstance("1.2.3.4:258");
+    static final VpnDestination IPV4_VPN = new VpnDestinationBuilder().setRouteDistinguisher(DISTINGUISHER)
+            .setPrefix(IPV4_PREFIX).setLabelStack(LABEL_STACK).build();
+    private static final VpnDestination IPV4_VPN_WITHOUT_LABELS = new VpnDestinationBuilder()
+            .setRouteDistinguisher(DISTINGUISHER).setPrefix(IPV4_PREFIX).build();
 
     @Test
     public void testMpReachNlri() throws BGPParsingException {
@@ -90,11 +94,10 @@ public class VpnIpv4NlriParserTest {
         mpBuilder.setAfi(Ipv4AddressFamily.class);
         mpBuilder.setAdvertizedRoutes(
             new AdvertizedRoutesBuilder().setDestinationType(
-                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev171207.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationVpnIpv4CaseBuilder().setVpnIpv4Destination(
-                    new VpnIpv4DestinationBuilder().setVpnDestination(Lists.newArrayList(IPV4_VPN)).build()
-                ).build()
-            ).build()
-        ).build();
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev171207.update
+                        .attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationVpnIpv4CaseBuilder()
+                        .setVpnIpv4Destination(new VpnIpv4DestinationBuilder().setVpnDestination(
+                                Collections.singletonList(IPV4_VPN)).build()).build()).build()).build();
 
         final MpReachNlri mpReachExpected = mpBuilder.build();
 
@@ -119,20 +122,18 @@ public class VpnIpv4NlriParserTest {
 
         mpBuilder.setWithdrawnRoutes(
             new WithdrawnRoutesBuilder().setDestinationType(
-                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev171207.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationVpnIpv4CaseBuilder().setVpnIpv4Destination(
-                    new VpnIpv4DestinationBuilder().setVpnDestination(Lists.newArrayList(IPV4_VPN_WITHOUT_LABELS)).build()
-                ).build()
-            ).build()
-        ).build();
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev171207.update
+                        .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationVpnIpv4CaseBuilder()
+                        .setVpnIpv4Destination(new VpnIpv4DestinationBuilder().setVpnDestination(
+                                Collections.singletonList(IPV4_VPN_WITHOUT_LABELS)).build()).build()).build()).build();
         final MpUnreachNlri mpUnreachExpected1 = mpBuilder.build();
 
         mpBuilder.setWithdrawnRoutes(
             new WithdrawnRoutesBuilder().setDestinationType(
-                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev171207.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationVpnIpv4CaseBuilder().setVpnIpv4Destination(
-                    new VpnIpv4DestinationBuilder().setVpnDestination(Lists.newArrayList(IPV4_VPN)).build()
-                ).build()
-            ).build()
-        ).build();
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev171207.update
+                        .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationVpnIpv4CaseBuilder()
+                        .setVpnIpv4Destination(new VpnIpv4DestinationBuilder().setVpnDestination(
+                                Collections.singletonList(IPV4_VPN)).build()).build()).build()).build();
         final MpUnreachNlri mpUnreachExpected2 = mpBuilder.build();
 
         final MpUnreachNlriBuilder testBuilder = new MpUnreachNlriBuilder();
index 6ceb22c0d4a08c714306eba6f99e48878b8f95f2..3d4c946999de40ab69d2d27b2d51a99883e1e4be 100644 (file)
@@ -10,14 +10,14 @@ package org.opendaylight.protocol.bgp.l3vpn.ipv4;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 import static org.opendaylight.protocol.bgp.l3vpn.ipv4.VpnIpv4NlriParserTest.DISTINGUISHER;
+import static org.opendaylight.protocol.bgp.l3vpn.ipv4.VpnIpv4NlriParserTest.IPV4_PREFIX;
 import static org.opendaylight.protocol.bgp.l3vpn.ipv4.VpnIpv4NlriParserTest.IPV4_VPN;
-import static org.opendaylight.protocol.bgp.l3vpn.ipv4.VpnIpv4NlriParserTest.IPv4_PREFIX;
 import static org.opendaylight.protocol.bgp.l3vpn.ipv4.VpnIpv4NlriParserTest.LABEL_STACK;
 import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID;
 
 import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Lists;
 import java.util.Collection;
 import java.util.Collections;
 import org.junit.Assert;
@@ -51,16 +51,21 @@ public class VpnIpv4RIBSupportTest extends AbstractRIBSupportTest {
     private static final VpnIpv4RIBSupport RIB_SUPPORT = new VpnIpv4RIBSupport();
 
     private static final DestinationVpnIpv4Case REACH_NLRI = new DestinationVpnIpv4CaseBuilder().setVpnIpv4Destination(
-        new VpnIpv4DestinationBuilder().setVpnDestination(Lists.newArrayList(IPV4_VPN)).build()).build();
-
-    private static final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev171207.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.
-        DestinationVpnIpv4Case UNREACH_NLRI = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev171207.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.
-        DestinationVpnIpv4CaseBuilder().setVpnIpv4Destination(new VpnIpv4DestinationBuilder().setVpnDestination(Lists.newArrayList(IPV4_VPN)).build()).build();
+        new VpnIpv4DestinationBuilder().setVpnDestination(Collections.singletonList(IPV4_VPN)).build()).build();
+
+    private static final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev171207.update
+            .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationVpnIpv4Case UNREACH_NLRI =
+            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev171207.update
+                    .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationVpnIpv4CaseBuilder()
+                    .setVpnIpv4Destination(new VpnIpv4DestinationBuilder()
+                            .setVpnDestination(Collections.singletonList(IPV4_VPN)).build()).build();
     private static final VpnRouteKey ROUTE_KEY = new VpnRouteKey("WAABAQIDBAECIgEW");
 
-    private static final VpnRoute ROUTE = new VpnRouteBuilder().setPathId(new PathId(NON_PATH_ID)).setAttributes(ATTRIBUTES).setPrefix(IPv4_PREFIX)
+    private static final VpnRoute ROUTE = new VpnRouteBuilder().setPathId(new PathId(NON_PATH_ID))
+            .setAttributes(ATTRIBUTES).setPrefix(IPV4_PREFIX)
         .setLabelStack(LABEL_STACK).setRouteDistinguisher(DISTINGUISHER).setKey(ROUTE_KEY).build();
-    private static final VpnIpv4Routes ROUTES = new VpnIpv4RoutesBuilder().setVpnRoute(Collections.singletonList(ROUTE)).build();
+    private static final VpnIpv4Routes ROUTES = new VpnIpv4RoutesBuilder()
+            .setVpnRoute(Collections.singletonList(ROUTE)).build();
 
     @Override
     public void setUp() throws Exception {
@@ -71,7 +76,9 @@ public class VpnIpv4RIBSupportTest extends AbstractRIBSupportTest {
     @Test
     public void testDeleteRoutes() {
         RIB_SUPPORT.deleteRoutes(this.tx, getTablePath(), createNlriWithDrawnRoute(UNREACH_NLRI));
-        final InstanceIdentifier<VpnRoute> instanceIdentifier = (InstanceIdentifier<VpnRoute>) this.deletedRoutes.get(0);
+        @SuppressWarnings("unchecked")
+        final InstanceIdentifier<VpnRoute> instanceIdentifier =
+                (InstanceIdentifier<VpnRoute>) this.deletedRoutes.get(0);
         assertEquals(ROUTE_KEY, instanceIdentifier.firstKeyOf(VpnRoute.class));
     }
 
@@ -85,7 +92,8 @@ public class VpnIpv4RIBSupportTest extends AbstractRIBSupportTest {
 
     @Test
     public void testEmptyRoute() throws Exception {
-        final Routes empty = new VpnIpv4RoutesCaseBuilder().setVpnIpv4Routes(new VpnIpv4RoutesBuilder().setVpnRoute(Collections.emptyList()).build()).build();
+        final Routes empty = new VpnIpv4RoutesCaseBuilder().setVpnIpv4Routes(new VpnIpv4RoutesBuilder()
+                .setVpnRoute(Collections.emptyList()).build()).build();
         final ChoiceNode emptyRoutes = RIB_SUPPORT.emptyRoutes();
         assertEquals(createRoutes(empty), emptyRoutes);
     }
@@ -101,23 +109,24 @@ public class VpnIpv4RIBSupportTest extends AbstractRIBSupportTest {
     @Test
     public void testBuildMpReachNlriUpdate() {
         final Update update = RIB_SUPPORT.buildUpdate(createRoutes(ROUTES), Collections.emptyList(), ATTRIBUTES);
-        assertEquals(REACH_NLRI, update.getAttributes().getAugmentation(Attributes1.class).getMpReachNlri().getAdvertizedRoutes().getDestinationType());
+        assertEquals(REACH_NLRI, update.getAttributes().getAugmentation(Attributes1.class).getMpReachNlri()
+                .getAdvertizedRoutes().getDestinationType());
         assertNull(update.getAttributes().getAugmentation(Attributes2.class));
     }
 
     @Test
     public void testIsComplexRoute() {
-        Assert.assertTrue(RIB_SUPPORT.isComplexRoute());
+        assertTrue(RIB_SUPPORT.isComplexRoute());
     }
 
     @Test
     public void testCacheableNlriObjects() {
-        Assert.assertEquals(ImmutableSet.of(), RIB_SUPPORT.cacheableNlriObjects());
+        assertEquals(ImmutableSet.of(), RIB_SUPPORT.cacheableNlriObjects());
     }
 
     @Test
     public void testCacheableAttributeObjects() {
-        Assert.assertEquals(ImmutableSet.of(), RIB_SUPPORT.cacheableAttributeObjects());
+        assertEquals(ImmutableSet.of(), RIB_SUPPORT.cacheableAttributeObjects());
     }
 
     @Test
@@ -128,44 +137,47 @@ public class VpnIpv4RIBSupportTest extends AbstractRIBSupportTest {
     @Test
     public void testRoutePath() {
         final NodeIdentifierWithPredicates prefixNii = createRouteNIWP(ROUTES);
-        Assert.assertEquals(getRoutePath().node(prefixNii), RIB_SUPPORT.routePath(getTablePath().node(Routes.QNAME), prefixNii));
+        assertEquals(getRoutePath().node(prefixNii), RIB_SUPPORT
+                .routePath(getTablePath().node(Routes.QNAME), prefixNii));
     }
 
     @Test
     public void testExtractPathId() {
-        Assert.assertEquals((Long) NON_PATH_ID, RIB_SUPPORT.extractPathId(null));
+        assertEquals((Long) NON_PATH_ID, RIB_SUPPORT.extractPathId(null));
     }
 
     @Test
     public void testRouteAttributesIdentifier() {
-        Assert.assertEquals(new NodeIdentifier(QName.create(VpnIpv4Routes.QNAME, Attributes.QNAME.getLocalName().intern())), RIB_SUPPORT
-            .routeAttributesIdentifier());
+        assertEquals(new NodeIdentifier(QName.create(VpnIpv4Routes.QNAME,
+                Attributes.QNAME.getLocalName().intern())), RIB_SUPPORT.routeAttributesIdentifier());
     }
 
     @Test
     public void testRoutesCaseClass() {
-        Assert.assertEquals(VpnIpv4RoutesCase.class, RIB_SUPPORT.routesCaseClass());
+        assertEquals(VpnIpv4RoutesCase.class, RIB_SUPPORT.routesCaseClass());
     }
 
     @Test
     public void testRoutesContainerClass() {
-        Assert.assertEquals(VpnIpv4Routes.class, RIB_SUPPORT.routesContainerClass());
+        assertEquals(VpnIpv4Routes.class, RIB_SUPPORT.routesContainerClass());
     }
 
     @Test
     public void testRoutesListClass() {
-        Assert.assertEquals(VpnRoute.class, RIB_SUPPORT.routesListClass());
+        assertEquals(VpnRoute.class, RIB_SUPPORT.routesListClass());
     }
 
     @Test
     public void testChangedRoutes() {
         final Routes emptyCase = new VpnIpv4RoutesCaseBuilder().build();
-        DataTreeCandidateNode tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyCase)).getRootNode();
-        Assert.assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty());
+        DataTreeCandidateNode tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(),
+                createRoutes(emptyCase)).getRootNode();
+        assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty());
 
-        final Routes emptyRoutes = new VpnIpv4RoutesCaseBuilder().setVpnIpv4Routes(new VpnIpv4RoutesBuilder().build()).build();
+        final Routes emptyRoutes = new VpnIpv4RoutesCaseBuilder().setVpnIpv4Routes(
+                new VpnIpv4RoutesBuilder().build()).build();
         tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyRoutes)).getRootNode();
-        Assert.assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty());
+        assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty());
 
         final Routes routes = new VpnIpv4RoutesCaseBuilder().setVpnIpv4Routes(ROUTES).build();
         tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(routes)).getRootNode();
index 89648571890c13e8af4c5c284ad4cd8434655adc..00e3463413a178f0beb01432d21d613d048ae8b5 100644 (file)
@@ -9,13 +9,11 @@ package org.opendaylight.protocol.bgp.l3vpn.ipv6;
 
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
+
 import org.junit.Test;
 import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext;
 import org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleBGPExtensionProviderContext;
 
-/**
- * @author Kevin Wang
- */
 public class BgpIpv6ActivatorTest {
 
     @Test
index df7028af6e693e2cec023d44b6cc66b984ff4e70..43024534974eec8668b9420304c1cb9aa5410746 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.protocol.bgp.l3vpn.ipv6;
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
+
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.net.Inet6Address;
@@ -23,23 +24,21 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.next.hop.c.next.hop.Ipv6NextHopCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.next.hop.c.next.hop.ipv6.next.hop._case.Ipv6NextHopBuilder;
 
-/**
- * @author Kevin Wang
- */
 public class VpnIpv6NextHopTest {
 
     private static final VpnIpv6NextHopParserSerializer HANDLER = new VpnIpv6NextHopParserSerializer();
 
     @Test
     public void testSerializeIpv6NextHopCase() throws Exception {
-        final String TEST_IPV6_ADDRESS = "2001::1234:5678:90ab:cdef";   // put some random valid IPv6 address here
+        final String TEST_IPV6 = "2001::1234:5678:90ab:cdef";   // put some random valid IPv6 address here
 
         final ByteBuf buffer = Unpooled.buffer();
         final byte[] nextHop = new byte[Ipv6Util.IPV6_LENGTH + RouteDistinguisherUtil.RD_LENGTH];
         // now copy the IPv6 address to the byte array
-        System.arraycopy(Inet6Address.getByName(TEST_IPV6_ADDRESS).getAddress(), 0, nextHop, RouteDistinguisherUtil.RD_LENGTH, Ipv6Util.IPV6_LENGTH);
+        System.arraycopy(Inet6Address.getByName(TEST_IPV6).getAddress(), 0, nextHop,
+                RouteDistinguisherUtil.RD_LENGTH, Ipv6Util.IPV6_LENGTH);
         final CNextHop hop = new Ipv6NextHopCaseBuilder().setIpv6NextHop(new Ipv6NextHopBuilder()
-                .setGlobal(new Ipv6Address(TEST_IPV6_ADDRESS)).build()).build();
+                .setGlobal(new Ipv6Address(TEST_IPV6)).build()).build();
 
         HANDLER.serializeNextHop(hop, buffer);
         assertArrayEquals(nextHop, ByteArray.readAllBytes(buffer));
index 6de11fd1b2783f13c45cece0a225b17370689331..24c56a9f15129f887ef8a89c789f08d4767b6acf 100755 (executable)
@@ -10,6 +10,7 @@ package org.opendaylight.protocol.bgp.l3vpn.ipv6;
 import com.google.common.collect.Lists;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import java.util.Collections;
 import java.util.List;
 import org.junit.Assert;
 import org.junit.Test;
@@ -38,9 +39,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.rev171207.l3vpn.ip.destination.type.VpnDestinationBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125.MplsLabel;
 
-/**
- * @author Kevin Wang
- */
 public class VpnIpv6NlriParserTest {
 
     private static final VpnIpv6NlriParser PARSER = new VpnIpv6NlriParser();
@@ -80,23 +78,25 @@ public class VpnIpv6NlriParserTest {
         (byte) 0x20, (byte) 0x01, (byte) 0x23, (byte) 0x45, (byte) 0x56, (byte) 0x89
     };
 
-    static final IpPrefix IPv6_PREFIX = new IpPrefix(new Ipv6Prefix("2001:2345:5689::/48"));
+    static final IpPrefix IPV6PREFIX = new IpPrefix(new Ipv6Prefix("2001:2345:5689::/48"));
     static final List<LabelStack> LABEL_STACK = Lists.newArrayList(
         new LabelStackBuilder().setLabelValue(new MplsLabel(355L)).build());
-    static final RouteDistinguisher DISTINGUISHER = RouteDistinguisherBuilder.getDefaultInstance("1.2.3.4:258");
-    static final VpnDestination IPV6_VPN = new VpnDestinationBuilder().setRouteDistinguisher(DISTINGUISHER).setPrefix(IPv6_PREFIX).setLabelStack(LABEL_STACK).build();
-    private static final VpnDestination IPV6_VPN_WITHOUT_LABELS = new VpnDestinationBuilder().setRouteDistinguisher(DISTINGUISHER).setPrefix(IPv6_PREFIX).build();
+    static final RouteDistinguisher DISTINGUISHER = RouteDistinguisherBuilder
+            .getDefaultInstance("1.2.3.4:258");
+    static final VpnDestination IPV6_VPN = new VpnDestinationBuilder().setRouteDistinguisher(DISTINGUISHER)
+            .setPrefix(IPV6PREFIX).setLabelStack(LABEL_STACK).build();
+    private static final VpnDestination IPV6_VPN_WITHOUT_LABELS = new VpnDestinationBuilder()
+            .setRouteDistinguisher(DISTINGUISHER).setPrefix(IPV6PREFIX).build();
 
     @Test
     public void testMpReachNlri() throws BGPParsingException {
         final MpReachNlriBuilder mpBuilder = new MpReachNlriBuilder();
         mpBuilder.setAfi(Ipv6AddressFamily.class);
         mpBuilder.setAdvertizedRoutes(new AdvertizedRoutesBuilder().setDestinationType(
-            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv6.rev171207.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationVpnIpv6CaseBuilder().setVpnIpv6Destination(
-                new VpnIpv6DestinationBuilder().setVpnDestination(Lists.newArrayList(IPV6_VPN)).build()
-            ).build()
-            ).build()
-        ).build();
+            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv6.rev171207.update
+                    .attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationVpnIpv6CaseBuilder()
+                    .setVpnIpv6Destination(new VpnIpv6DestinationBuilder().setVpnDestination(
+                            Collections.singletonList(IPV6_VPN)).build()).build()).build()).build();
 
         final MpReachNlri mpReachExpected = mpBuilder.build();
 
@@ -121,20 +121,18 @@ public class VpnIpv6NlriParserTest {
 
         mpBuilder.setWithdrawnRoutes(
             new WithdrawnRoutesBuilder().setDestinationType(
-                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv6.rev171207.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationVpnIpv6CaseBuilder().setVpnIpv6Destination(
-                    new VpnIpv6DestinationBuilder().setVpnDestination(Lists.newArrayList(IPV6_VPN_WITHOUT_LABELS)).build()
-                ).build()
-            ).build()
-        ).build();
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv6.rev171207.update
+                        .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationVpnIpv6CaseBuilder()
+                        .setVpnIpv6Destination(new VpnIpv6DestinationBuilder().setVpnDestination(
+                                Collections.singletonList(IPV6_VPN_WITHOUT_LABELS)).build()).build()).build()).build();
         final MpUnreachNlri mpUnreachExpected1 = mpBuilder.build();
 
         mpBuilder.setWithdrawnRoutes(
             new WithdrawnRoutesBuilder().setDestinationType(
-                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv6.rev171207.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationVpnIpv6CaseBuilder().setVpnIpv6Destination(
-                    new VpnIpv6DestinationBuilder().setVpnDestination(Lists.newArrayList(IPV6_VPN)).build()
-                ).build()
-            ).build()
-        ).build();
+                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv6.rev171207.update
+                        .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationVpnIpv6CaseBuilder()
+                        .setVpnIpv6Destination(new VpnIpv6DestinationBuilder().setVpnDestination(
+                                Collections.singletonList(IPV6_VPN)).build()).build()).build()).build();
         final MpUnreachNlri mpUnreachExpected2 = mpBuilder.build();
 
         final MpUnreachNlriBuilder testBuilder = new MpUnreachNlriBuilder();
index fb847e53d3715c3c5c0f813880a137ebb2c50527..9f44af58f1a62d5040cf65d58517c04428a409c8 100644 (file)
@@ -11,8 +11,8 @@ package org.opendaylight.protocol.bgp.l3vpn.ipv6;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
 import static org.opendaylight.protocol.bgp.l3vpn.ipv6.VpnIpv6NlriParserTest.DISTINGUISHER;
+import static org.opendaylight.protocol.bgp.l3vpn.ipv6.VpnIpv6NlriParserTest.IPV6PREFIX;
 import static org.opendaylight.protocol.bgp.l3vpn.ipv6.VpnIpv6NlriParserTest.IPV6_VPN;
-import static org.opendaylight.protocol.bgp.l3vpn.ipv6.VpnIpv6NlriParserTest.IPv6_PREFIX;
 import static org.opendaylight.protocol.bgp.l3vpn.ipv6.VpnIpv6NlriParserTest.LABEL_STACK;
 import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID;
 
@@ -50,16 +50,22 @@ import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidates;
 public class VpnIpv6RIBSupportTest extends AbstractRIBSupportTest {
     private static final VpnIpv6RIBSupport RIB_SUPPORT = new VpnIpv6RIBSupport();
 
-    private static final DestinationVpnIpv6Case REACH_NLRI = new DestinationVpnIpv6CaseBuilder().setVpnIpv6Destination(new VpnIpv6DestinationBuilder()
-        .setVpnDestination(Lists.newArrayList(IPV6_VPN)).build()).build();
+    private static final DestinationVpnIpv6Case REACH_NLRI = new DestinationVpnIpv6CaseBuilder()
+            .setVpnIpv6Destination(new VpnIpv6DestinationBuilder()
+                    .setVpnDestination(Lists.newArrayList(IPV6_VPN)).build()).build();
 
-    private static final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv6.rev171207.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.
-        DestinationVpnIpv6Case UNREACH_NLRI = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv6.rev171207.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.
-        DestinationVpnIpv6CaseBuilder().setVpnIpv6Destination(new VpnIpv6DestinationBuilder().setVpnDestination(Lists.newArrayList(IPV6_VPN)).build()).build();
+    private static final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv6.rev171207.update
+            .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationVpnIpv6Case UNREACH_NLRI =
+            new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv6.rev171207.update
+                    .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationVpnIpv6CaseBuilder()
+                    .setVpnIpv6Destination(new VpnIpv6DestinationBuilder()
+                            .setVpnDestination(Collections.singletonList(IPV6_VPN)).build()).build();
     private static final VpnRouteKey ROUTE_KEY = new VpnRouteKey("cAABAQIDBAECIAEjRVaJ");
-    private static final VpnRoute ROUTE = new VpnRouteBuilder().setPathId(new PathId(NON_PATH_ID)).setAttributes(ATTRIBUTES).setPrefix(IPv6_PREFIX)
-        .setLabelStack(LABEL_STACK).setRouteDistinguisher(DISTINGUISHER).setKey(ROUTE_KEY).build();
-    private static final VpnIpv6Routes ROUTES = new VpnIpv6RoutesBuilder().setVpnRoute(Collections.singletonList(ROUTE)).build();
+    private static final VpnRoute ROUTE = new VpnRouteBuilder().setPathId(new PathId(NON_PATH_ID))
+            .setAttributes(ATTRIBUTES).setPrefix(IPV6PREFIX)
+            .setLabelStack(LABEL_STACK).setRouteDistinguisher(DISTINGUISHER).setKey(ROUTE_KEY).build();
+    private static final VpnIpv6Routes ROUTES = new VpnIpv6RoutesBuilder()
+            .setVpnRoute(Collections.singletonList(ROUTE)).build();
 
     @Override
     public void setUp() throws Exception {
@@ -70,7 +76,8 @@ public class VpnIpv6RIBSupportTest extends AbstractRIBSupportTest {
     @Test
     public void testDeleteRoutes() {
         RIB_SUPPORT.deleteRoutes(this.tx, getTablePath(), createNlriWithDrawnRoute(UNREACH_NLRI));
-        final InstanceIdentifier<VpnRoute> instanceIdentifier = (InstanceIdentifier<VpnRoute>) this.deletedRoutes.get(0);
+        @SuppressWarnings("unchecked") final InstanceIdentifier<VpnRoute> instanceIdentifier =
+                (InstanceIdentifier<VpnRoute>) this.deletedRoutes.get(0);
         assertEquals(ROUTE_KEY, instanceIdentifier.firstKeyOf(VpnRoute.class));
     }
 
@@ -83,7 +90,8 @@ public class VpnIpv6RIBSupportTest extends AbstractRIBSupportTest {
 
     @Test
     public void testEmptyRoute() throws Exception {
-        final Routes empty = new VpnIpv6RoutesCaseBuilder().setVpnIpv6Routes(new VpnIpv6RoutesBuilder().setVpnRoute(Collections.emptyList()).build()).build();
+        final Routes empty = new VpnIpv6RoutesCaseBuilder().setVpnIpv6Routes(new VpnIpv6RoutesBuilder()
+                .setVpnRoute(Collections.emptyList()).build()).build();
         final ChoiceNode emptyRoutes = RIB_SUPPORT.emptyRoutes();
         assertEquals(createRoutes(empty), emptyRoutes);
     }
@@ -92,14 +100,15 @@ public class VpnIpv6RIBSupportTest extends AbstractRIBSupportTest {
     public void testBuildMpUnreachNlriUpdate() {
         final Update update = RIB_SUPPORT.buildUpdate(Collections.emptyList(), createRoutes(ROUTES), ATTRIBUTES);
         assertEquals(UNREACH_NLRI, update.getAttributes().getAugmentation(Attributes2.class)
-            .getMpUnreachNlri().getWithdrawnRoutes().getDestinationType());
+                .getMpUnreachNlri().getWithdrawnRoutes().getDestinationType());
         assertNull(update.getAttributes().getAugmentation(Attributes1.class));
     }
 
     @Test
     public void testBuildMpReachNlriUpdate() {
         final Update update = RIB_SUPPORT.buildUpdate(createRoutes(ROUTES), Collections.emptyList(), ATTRIBUTES);
-        assertEquals(REACH_NLRI, update.getAttributes().getAugmentation(Attributes1.class).getMpReachNlri().getAdvertizedRoutes().getDestinationType());
+        assertEquals(REACH_NLRI, update.getAttributes().getAugmentation(Attributes1.class).getMpReachNlri()
+                .getAdvertizedRoutes().getDestinationType());
         assertNull(update.getAttributes().getAugmentation(Attributes2.class));
     }
 
@@ -110,12 +119,12 @@ public class VpnIpv6RIBSupportTest extends AbstractRIBSupportTest {
 
     @Test
     public void testCacheableNlriObjects() {
-        Assert.assertEquals(ImmutableSet.of(), RIB_SUPPORT.cacheableNlriObjects());
+        assertEquals(ImmutableSet.of(), RIB_SUPPORT.cacheableNlriObjects());
     }
 
     @Test
     public void testCacheableAttributeObjects() {
-        Assert.assertEquals(ImmutableSet.of(), RIB_SUPPORT.cacheableAttributeObjects());
+        assertEquals(ImmutableSet.of(), RIB_SUPPORT.cacheableAttributeObjects());
     }
 
     @Test
@@ -126,42 +135,45 @@ public class VpnIpv6RIBSupportTest extends AbstractRIBSupportTest {
     @Test
     public void testRoutePath() {
         final NodeIdentifierWithPredicates prefixNii = createRouteNIWP(ROUTES);
-        Assert.assertEquals(getRoutePath().node(prefixNii), RIB_SUPPORT.routePath(getTablePath().node(Routes.QNAME), prefixNii));
+        assertEquals(getRoutePath().node(prefixNii),
+                RIB_SUPPORT.routePath(getTablePath().node(Routes.QNAME), prefixNii));
     }
 
     @Test
     public void testExtractPathId() {
-        Assert.assertEquals((Long) NON_PATH_ID, RIB_SUPPORT.extractPathId(null));
+        assertEquals((Long) NON_PATH_ID, RIB_SUPPORT.extractPathId(null));
     }
 
     @Test
     public void testRouteAttributesIdentifier() {
-        Assert.assertEquals(new NodeIdentifier(QName.create(VpnIpv6Routes.QNAME, Attributes.QNAME.getLocalName().intern())), RIB_SUPPORT
-            .routeAttributesIdentifier());
+        assertEquals(new NodeIdentifier(QName.create(VpnIpv6Routes.QNAME,
+                Attributes.QNAME.getLocalName().intern())), RIB_SUPPORT.routeAttributesIdentifier());
     }
 
     @Test
     public void testRoutesCaseClass() {
-        Assert.assertEquals(VpnIpv6RoutesCase.class, RIB_SUPPORT.routesCaseClass());
+        assertEquals(VpnIpv6RoutesCase.class, RIB_SUPPORT.routesCaseClass());
     }
 
     @Test
     public void testRoutesContainerClass() {
-        Assert.assertEquals(VpnIpv6Routes.class, RIB_SUPPORT.routesContainerClass());
+        assertEquals(VpnIpv6Routes.class, RIB_SUPPORT.routesContainerClass());
     }
 
     @Test
     public void testRoutesListClass() {
-        Assert.assertEquals(VpnRoute.class, RIB_SUPPORT.routesListClass());
+        assertEquals(VpnRoute.class, RIB_SUPPORT.routesListClass());
     }
 
     @Test
     public void testChangedRoutes() {
         final Routes emptyCase = new VpnIpv6RoutesCaseBuilder().build();
-        DataTreeCandidateNode tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyCase)).getRootNode();
+        DataTreeCandidateNode tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(),
+                createRoutes(emptyCase)).getRootNode();
         Assert.assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty());
 
-        final Routes emptyRoutes = new VpnIpv6RoutesCaseBuilder().setVpnIpv6Routes(new VpnIpv6RoutesBuilder().build()).build();
+        final Routes emptyRoutes = new VpnIpv6RoutesCaseBuilder()
+                .setVpnIpv6Routes(new VpnIpv6RoutesBuilder().build()).build();
         tree = DataTreeCandidates.fromNormalizedNode(getRoutePath(), createRoutes(emptyRoutes)).getRootNode();
         Assert.assertTrue(RIB_SUPPORT.changedRoutes(tree).isEmpty());