Introduce testtool-parent 71/66971/4
authorClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Tue, 9 Jan 2018 12:24:33 +0000 (13:24 +0100)
committerClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Tue, 9 Jan 2018 20:49:56 +0000 (21:49 +0100)
to enforce findbug and checkstyle
under testtools

Change-Id: I971c273cbfd739e308d3548faf664af7812cc30c
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
32 files changed:
bgp/testtool/pom.xml
bmp/bmp-mock/pom.xml
pcep/pcc-mock/pom.xml
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/Main.java
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PCCActivator.java
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PCCEndPointIpv4ObjectParser.java
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PCCSyncOptimization.java
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PCCTunnel.java
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PCCTunnelBuilder.java
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PCCTunnelManagerImpl.java
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PCCsBuilder.java
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/TimerHandler.java
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/protocol/PCCDispatcherImpl.java
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/protocol/PCCPeerProposal.java
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/protocol/PCCReconnectPromise.java
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/protocol/PCCServerPeerProposal.java
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/protocol/PCCSessionListener.java
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/spi/MsgBuilderUtil.java
pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCDispatcherImplTest.java
pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCEndPointIpv4ObjectParserTest.java
pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCIncrementalSyncTest.java
pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCMockCommon.java
pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCMockTest.java
pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCTunnelManagerImplTest.java
pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/TestingSessionListener.java
pcep/testtool/pom.xml
pcep/testtool/src/main/java/org/opendaylight/protocol/pcep/testtool/Main.java
pcep/testtool/src/main/java/org/opendaylight/protocol/pcep/testtool/TestingSessionListener.java
pcep/testtool/src/test/java/org/opendaylight/protocol/pcep/testtool/PCCMock.java
pcep/testtool/src/test/java/org/opendaylight/protocol/pcep/testtool/SimpleSessionListener.java
pom.xml
testtool-parent/pom.xml [new file with mode: 0644]

index 538a2a254446deeaf803f51c1c4fe15503e31cf2..9eda6b3fe76325cd22beef1004d1a4b4231da755 100644 (file)
         <tag>HEAD</tag>
     </scm>
     <parent>
-        <groupId>org.opendaylight.odlparent</groupId>
-        <artifactId>odlparent</artifactId>
-        <version>2.0.5</version>
-        <relativePath/>
+        <groupId>org.opendaylight.bgpcep</groupId>
+        <artifactId>testtool-parent</artifactId>
+        <version>0.9.0-SNAPSHOT</version>
+        <relativePath>../../testtool-parent</relativePath>
     </parent>
 
-    <groupId>org.opendaylight.bgpcep</groupId>
     <artifactId>bgp-testtool</artifactId>
     <version>0.9.0-SNAPSHOT</version>
     <packaging>jar</packaging>
     <description>BGP Interop Testing Tool</description>
     <name>${project.artifactId}</name>
 
-    <dependencyManagement>
-        <dependencies>
-            <dependency>
-                <groupId>org.opendaylight.bgpcep</groupId>
-                <artifactId>bgpcep-parent</artifactId>
-                <version>0.9.0-SNAPSHOT</version>
-                <type>pom</type>
-                <scope>import</scope>
-            </dependency>
-        </dependencies>
-    </dependencyManagement>
-
     <dependencies>
         <dependency>
             <groupId>${project.groupId}</groupId>
index dc6edf987b5332603435cdbae9f9031f365d9008..35f32d5aabe56c9d4fd92c19b2a232f55f3094c2 100644 (file)
@@ -4,29 +4,16 @@
         xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
     <modelVersion>4.0.0</modelVersion>
     <parent>
-        <groupId>org.opendaylight.odlparent</groupId>
-        <artifactId>odlparent</artifactId>
-        <version>2.0.5</version>
-        <relativePath/>
+        <groupId>org.opendaylight.bgpcep</groupId>
+        <artifactId>testtool-parent</artifactId>
+        <version>0.9.0-SNAPSHOT</version>
+        <relativePath>../../testtool-parent</relativePath>
     </parent>
 
-    <groupId>org.opendaylight.bgpcep</groupId>
     <artifactId>bgp-bmp-mock</artifactId>
     <version>0.9.0-SNAPSHOT</version>
     <name>bmp-mock</name>
 
-    <dependencyManagement>
-        <dependencies>
-            <dependency>
-                <groupId>org.opendaylight.bgpcep</groupId>
-                <artifactId>bgpcep-parent</artifactId>
-                <version>0.9.0-SNAPSHOT</version>
-                <type>pom</type>
-                <scope>import</scope>
-            </dependency>
-        </dependencies>
-    </dependencyManagement>
-
     <dependencies>
         <dependency>
             <groupId>org.opendaylight.bgpcep</groupId>
index 4e8851dce701bad4794610935d343430259cc968..6ba6295b2714ac45bf6d90fcd2c0214a1f85b330 100644 (file)
 
     <modelVersion>4.0.0</modelVersion>
     <parent>
-        <groupId>org.opendaylight.odlparent</groupId>
-        <artifactId>odlparent</artifactId>
-        <version>2.0.5</version>
-        <relativePath/>
+        <groupId>org.opendaylight.bgpcep</groupId>
+        <artifactId>testtool-parent</artifactId>
+        <version>0.9.0-SNAPSHOT</version>
+        <relativePath>../../testtool-parent</relativePath>
     </parent>
 
-    <groupId>org.opendaylight.bgpcep</groupId>
     <artifactId>pcep-pcc-mock</artifactId>
     <version>0.9.0-SNAPSHOT</version>
     <packaging>jar</packaging>
 
-    <dependencyManagement>
-        <dependencies>
-            <dependency>
-                <groupId>org.opendaylight.bgpcep</groupId>
-                <artifactId>bgpcep-parent</artifactId>
-                <version>0.9.0-SNAPSHOT</version>
-                <type>pom</type>
-                <scope>import</scope>
-            </dependency>
-        </dependencies>
-    </dependencyManagement>
-
     <dependencies>
         <dependency>
             <groupId>${project.groupId}</groupId>
index 12cf98d92251903866e49a18b7700c5f5f55c570..03d0bdac840c8f192da1ae9de5e45e743e033b0f 100755 (executable)
@@ -12,12 +12,12 @@ import ch.qos.logback.classic.Level;
 import ch.qos.logback.classic.LoggerContext;
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
-import com.google.common.collect.Lists;
 import com.google.common.net.InetAddresses;
 import java.math.BigInteger;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
 import java.net.UnknownHostException;
+import java.util.Collections;
 import java.util.List;
 import java.util.concurrent.ExecutionException;
 import org.opendaylight.protocol.pcep.PCEPCapability;
@@ -50,7 +50,8 @@ public final class Main {
 
     public static void main(final String[] args) throws InterruptedException, ExecutionException, UnknownHostException {
         InetSocketAddress localAddress = new InetSocketAddress(LOCALHOST, DEFAULT_LOCAL_PORT);
-        List<InetSocketAddress> remoteAddress = Lists.newArrayList(new InetSocketAddress(LOCALHOST, DEFAULT_REMOTE_PORT));
+        List<InetSocketAddress> remoteAddress = Collections
+                .singletonList(new InetSocketAddress(LOCALHOST, DEFAULT_REMOTE_PORT));
         int pccCount = 1;
         int lsps = 1;
         boolean pcError = false;
@@ -137,8 +138,8 @@ public final class Main {
 
         if (incrementalSync) {
             Preconditions.checkArgument(syncOptDBVersion.intValue() > lsps,
-                    "Synchronization Database Version which will be used after " +
-                "reconnectes requires to be higher than lsps");
+                    "Synchronization Database Version which will be used after "
+                            + "reconnectes requires to be higher than lsps");
         }
 
         final Optional<BigInteger> dBVersion = Optional.fromNullable(syncOptDBVersion);
index c19684886f84d5856f18ada12bf4d04364256d71..ea12231295606ea1160e32b8dfc66f15345c1d7c 100644 (file)
@@ -18,7 +18,8 @@ public class PCCActivator extends AbstractPCEPExtensionProviderActivator {
     @Override
     protected List<AutoCloseable> startImpl(final PCEPExtensionProviderContext context) {
         final List<AutoCloseable> regs = new ArrayList<>();
-        regs.add(context.registerObjectParser(PCCEndPointIpv4ObjectParser.CLASS, PCCEndPointIpv4ObjectParser.TYPE, new PCCEndPointIpv4ObjectParser()));
+        regs.add(context.registerObjectParser(PCCEndPointIpv4ObjectParser.CLASS, PCCEndPointIpv4ObjectParser.TYPE,
+                new PCCEndPointIpv4ObjectParser()));
         return regs;
     }
 
index 304ccf0dbb5bdee551905c2f6e44cf2897b719ec..71dc78e5fda90d1cefb70681e804995d8f9ad298 100644 (file)
@@ -23,7 +23,8 @@ public class PCCEndPointIpv4ObjectParser extends PCEPEndPointsIpv4ObjectParser {
 
     @Override
     public Object parseObject(ObjectHeader header, ByteBuf bytes) throws PCEPDeserializerException {
-        Preconditions.checkArgument(bytes != null && bytes.isReadable(), "Array of bytes is mandatory. Can't be null or empty.");
+        Preconditions.checkArgument(bytes != null && bytes.isReadable(),
+                "Array of bytes is mandatory. Can't be null or empty.");
         final EndpointsObjBuilder builder = new EndpointsObjBuilder();
         if (bytes.readableBytes() != Ipv4Util.IP4_LENGTH * 2) {
             throw new PCEPDeserializerException("Wrong length of array of bytes.");
index 192c0250e7b758f2f3b75bdeffa4c0e14ebd28e6..03aaa4d0af64b50b824677c3a1c4a7feb457d295 100644 (file)
@@ -31,7 +31,7 @@ final class PCCSyncOptimization {
     private BigInteger lspDBVersion = BigInteger.ONE;
     private Boolean resynchronizing = Boolean.FALSE;
 
-    public PCCSyncOptimization(@Nonnull final PCCSession session) {
+    PCCSyncOptimization(@Nonnull final PCCSession session) {
         requireNonNull(session);
         final Tlvs remote = session.getRemoteTlvs();
         final Tlvs local = session.localSessionCharacteristics();
@@ -40,8 +40,8 @@ final class PCCSyncOptimization {
         this.dbVersionMatch = compareLspDbVersion(this.localLspDbVersion, this.remoteLspDbVersion);
         this.isSyncAvoidanceEnabled = isSyncAvoidance(local) && isSyncAvoidance(remote);
         this.isDeltaSyncEnabled = isDeltaSync(local) && isDeltaSync(remote);
-        this.isTriggeredInitialSynEnable = isTriggeredInitialSync(local) && isTriggeredInitialSync(remote) &&
-            (this.isDeltaSyncEnabled || this.isSyncAvoidanceEnabled);
+        this.isTriggeredInitialSynEnable = isTriggeredInitialSync(local) && isTriggeredInitialSync(remote)
+                && (this.isDeltaSyncEnabled || this.isSyncAvoidanceEnabled);
         this.isTriggeredReSyncEnable = isTriggeredReSync(local) && isTriggeredReSync(remote);
     }
 
index 262f8e5f27cc1c72a52570564090f02045d0a3fa..7867acf7c5e56cbde5c138d42222164eea27cfbc 100644 (file)
@@ -21,7 +21,7 @@ final class PCCTunnel {
     private Timeout redelegationTimeout;
     private Timeout stateTimeout;
 
-    public PCCTunnel(final byte[] pathName, final int delegationHolder, final LspType type, final Path lspState) {
+    PCCTunnel(final byte[] pathName, final int delegationHolder, final LspType type, final Path lspState) {
         if (pathName != null) {
             this.pathName = pathName.clone();
         } else {
index c361f2e65718af21f7c623243110a009f10ddb96..29e0c9ae82c8568e5b64f8c1e0d586f38f0a3c66 100644 (file)
@@ -28,7 +28,7 @@ final class PCCTunnelBuilder {
     private static final Subobject DEFAULT_ENDPOINT_HOP = getDefaultEROEndpointHop();
     private static final String ENDPOINT_ADDRESS = "1.1.1.1";
     private static final String ENDPOINT_PREFIX = ENDPOINT_ADDRESS + "/32";
-    public static final int PCC_DELEGATION = -1;
+    static final int PCC_DELEGATION = -1;
 
     private PCCTunnelBuilder() {
         throw new UnsupportedOperationException();
@@ -38,8 +38,8 @@ final class PCCTunnelBuilder {
     static Map<PlspId, PCCTunnel> createTunnels(final String address, final int lsps) {
         final Map<PlspId, PCCTunnel> tunnels = new HashMap<>();
         for (int i = 1; i <= lsps; i++) {
-            final PCCTunnel tunnel = new PCCTunnel(MsgBuilderUtil.getDefaultPathName(address, i), PCC_DELEGATION, LspType.PCC_LSP,
-                createPath(Lists.newArrayList(DEFAULT_ENDPOINT_HOP)));
+            final PCCTunnel tunnel = new PCCTunnel(MsgBuilderUtil.getDefaultPathName(address, i),
+                    PCC_DELEGATION, LspType.PCC_LSP, createPath(Lists.newArrayList(DEFAULT_ENDPOINT_HOP)));
             tunnels.put(new PlspId((long) i), tunnel);
         }
         return tunnels;
index 58d8b016db1fb72789150bd64c64087b662c40bf..4368d3f5704dcf41a74aa86e567c63c17785a33c 100644 (file)
@@ -117,8 +117,9 @@ public final class PCCTunnelManagerImpl implements PCCTunnelManager {
             if (hasDelegation(tunnel, session)) {
                 //send report D=0
                 final Tlvs tlvs = buildTlvs(tunnel, plspId.getValue(), Optional.absent());
-                final Pcrpt pcrtp = createPcRtpMessage(new LspBuilder(update.getLsp()).setSync(true).setOperational(OperationalStatus.Up).setDelegate(false).
-                    setTlvs(tlvs).build(), Optional.of(createSrp(srpId)), tunnel.getLspState());
+                final Pcrpt pcrtp = createPcRtpMessage(new LspBuilder(update.getLsp()).setSync(true)
+                        .setOperational(OperationalStatus.Up).setDelegate(false)
+                        .setTlvs(tlvs).build(), Optional.of(createSrp(srpId)), tunnel.getLspState());
                 session.sendReport(pcrtp);
                 //start state timer
                 startStateTimeout(tunnel, plspId);
@@ -143,14 +144,16 @@ public final class PCCTunnelManagerImpl implements PCCTunnelManager {
         final long srpId = request.getSrp().getOperationId().getValue();
         if (tunnel != null) {
             //check if tunnel has no delegation
-            if ((tunnel.getType() == LspType.PCE_LSP) && ((tunnel.getDelegationHolder() == -1) || (tunnel.getDelegationHolder() == session.getId()))) {
+            if ((tunnel.getType() == LspType.PCE_LSP) && ((tunnel.getDelegationHolder() == -1)
+                    || (tunnel.getDelegationHolder() == session.getId()))) {
                 //set delegation
                 tunnel.cancelTimeouts();
                 setDelegation(plspId, session);
                 //send report
                 final Tlvs tlvs = buildTlvs(tunnel, plspId.getValue(), Optional.absent());
                 session.sendReport(createPcRtpMessage(
-                    new LspBuilder(request.getLsp()).setSync(true).setOperational(OperationalStatus.Up).setDelegate(true).setTlvs(tlvs).build(),
+                    new LspBuilder(request.getLsp()).setSync(true).setOperational(OperationalStatus.Up)
+                            .setDelegate(true).setTlvs(tlvs).build(),
                     Optional.of(createSrp(srpId)), tunnel.getLspState()));
             } else {
                 session.sendError(MsgBuilderUtil.createErrorMsg(PCEPErrors.LSP_NOT_PCE_INITIATED, srpId));
@@ -193,10 +196,12 @@ public final class PCCTunnelManagerImpl implements PCCTunnelManager {
 
     protected void addTunnel(final Requests request, final PCCSession session) {
         final PlspId plspId = new PlspId(this.plspIDsCounter.incrementAndGet());
-        final PCCTunnel tunnel = new PCCTunnel(request.getLsp().getTlvs().getSymbolicPathName().getPathName().getValue(),
-            session.getId(), LspType.PCE_LSP, reqToRptPath(request));
-        sendToAll(tunnel, plspId, request.getEro().getSubobject(), createSrp(request.getSrp().getOperationId().getValue()),
-            tunnel.getLspState(), new LspBuilder(request.getLsp()).addAugmentation(Lsp1.class, new Lsp1Builder().setCreate(true).build()).build());
+        final PCCTunnel tunnel = new PCCTunnel(request.getLsp().getTlvs().getSymbolicPathName()
+                .getPathName().getValue(), session.getId(), LspType.PCE_LSP, reqToRptPath(request));
+        sendToAll(tunnel, plspId, request.getEro().getSubobject(),
+                createSrp(request.getSrp().getOperationId().getValue()), tunnel.getLspState(),
+                new LspBuilder(request.getLsp())
+                        .addAugmentation(Lsp1.class, new Lsp1Builder().setCreate(true).build()).build());
         this.tunnels.put(plspId, tunnel);
     }
 
@@ -209,7 +214,8 @@ public final class PCCTunnelManagerImpl implements PCCTunnelManager {
                 if (hasDelegation(tunnel, session)) {
                     this.tunnels.remove(plspId);
                     sendToAll(tunnel, plspId, tunnel.getLspState().getEro().getSubobject(),
-                        new SrpBuilder(request.getSrp()).addAugmentation(Srp1.class, new Srp1Builder().setRemove(true).build()).build(),
+                        new SrpBuilder(request.getSrp())
+                                .addAugmentation(Srp1.class, new Srp1Builder().setRemove(true).build()).build(),
                         reqToRptPath(request), request.getLsp());
                 } else {
                     session.sendError(MsgBuilderUtil.createErrorMsg(PCEPErrors.UPDATE_REQ_FOR_NON_LSP, srpId));
@@ -243,10 +249,12 @@ public final class PCCTunnelManagerImpl implements PCCTunnelManager {
 
     @Override
     public void onMessagePcInitiate(@Nonnull final Requests request, @Nonnull final PCCSession session) {
-        if ((request.getSrp().getAugmentation(Srp1.class) != null) && request.getSrp().getAugmentation(Srp1.class).isRemove()) {
+        if ((request.getSrp().getAugmentation(Srp1.class) != null)
+                && request.getSrp().getAugmentation(Srp1.class).isRemove()) {
             //remove LSP
             removeTunnel(request, session);
-        } else if ((request.getLsp().isDelegate() != null) && request.getLsp().isDelegate() && (request.getEndpointsObj() == null)) {
+        } else if ((request.getLsp().isDelegate() != null) && request.getLsp().isDelegate()
+                && (request.getEndpointsObj() == null)) {
             //take LSP delegation
             takeDelegation(request, session);
         } else {
@@ -313,9 +321,7 @@ public final class PCCTunnelManagerImpl implements PCCTunnelManager {
     }
 
     /**
-     * Reports Missed Lsp when DbVersion doesnt match
-     *
-     * @param session
+     * Reports Missed Lsp when DbVersion doesnt match.
      */
     private void reportMissedLsp(final PCCSession session) {
         for (long missedLsp = this.syncOptimization.getRemoteLspDbVersionValue().longValue() + 1;
@@ -326,14 +332,16 @@ public final class PCCTunnelManagerImpl implements PCCTunnelManager {
         }
     }
 
-    private void createLspAndSendReport(final long plspId, final PCCTunnel tunnel, final PCCSession session, final Optional<Boolean> isSync, final Optional<Srp> srp) {
+    private void createLspAndSendReport(final long plspId, final PCCTunnel tunnel, final PCCSession session,
+            final Optional<Boolean> isSync, final Optional<Srp> srp) {
         final boolean delegation = hasDelegation(tunnel, session);
         if (delegation) {
             tunnel.cancelTimeouts();
         }
-        final String destinationAddress = getDestinationAddress(tunnel.getLspState().getEro().getSubobject(), this.address);
-        final Tlvs tlvs = createLspTlvs(plspId, true, destinationAddress, this.address, this.address, Optional.of(tunnel.getPathName()),
-            this.syncOptimization.incrementLspDBVersion());
+        final String destinationAddress
+                = getDestinationAddress(tunnel.getLspState().getEro().getSubobject(), this.address);
+        final Tlvs tlvs = createLspTlvs(plspId, true, destinationAddress, this.address,
+                this.address, Optional.of(tunnel.getPathName()), this.syncOptimization.incrementLspDBVersion());
 
         final boolean sync = isSync.isPresent() ? isSync.get() : this.syncOptimization.isSyncNeedIt();
         final Lsp lsp = createLsp(plspId, sync, Optional.fromNullable(tlvs), delegation, false);
@@ -354,8 +362,8 @@ public final class PCCTunnelManagerImpl implements PCCTunnelManager {
         if (this.syncOptimization.isSyncAvoidanceEnabled()) {
             tlv = createLspTlvsEndofSync(this.syncOptimization.incrementLspDBVersion().get());
         }
-        final Pcrpt pcrtp = createPcRtpMessage(createLsp(0, false, tlv, true, false), Optional.fromNullable(srp), createPath(Collections
-            .emptyList()));
+        final Pcrpt pcrtp = createPcRtpMessage(createLsp(0, false, tlv, true, false),
+                Optional.fromNullable(srp), createPath(Collections.emptyList()));
         session.sendReport(pcrtp);
     }
 
@@ -385,7 +393,8 @@ public final class PCCTunnelManagerImpl implements PCCTunnelManager {
         createLspAndSendReport(plspId.getValue(), tunnel, session, Optional.of(Boolean.TRUE), Optional.of(srp));
     }
 
-    private void sendToAll(final PCCTunnel tunnel, final PlspId plspId, final List<Subobject> subobjects, final Srp srp, final Path path, final Lsp lsp) {
+    private void sendToAll(final PCCTunnel tunnel, final PlspId plspId, final List<Subobject> subobjects, final Srp srp,
+            final Path path, final Lsp lsp) {
         for (final PCCSession session : this.sessions.values()) {
             final boolean isDelegated = hasDelegation(tunnel, session);
             final Tlvs tlvs = buildTlvs(tunnel, plspId.getValue(), Optional.of(subobjects));
@@ -396,7 +405,8 @@ public final class PCCTunnelManagerImpl implements PCCTunnelManager {
                     .setOperational(OperationalStatus.Up)
                     .setDelegate(isDelegated)
                     .setSync(true)
-                    .addAugmentation(Lsp1.class, new Lsp1Builder().setCreate(tunnel.getType() == LspType.PCE_LSP).build())
+                    .addAugmentation(Lsp1.class, new Lsp1Builder()
+                            .setCreate(tunnel.getType() == LspType.PCE_LSP).build())
                     .setTlvs(tlvs).build(),
                 Optional.fromNullable(srp), path);
             session.sendReport(pcRpt);
index e43b7b9c6b243999b09dde7cba2553346c1eaf9e..689590df25b10ffcdb275980651e00ab2adb4c95 100644 (file)
@@ -51,10 +51,10 @@ final class PCCsBuilder {
     private final Timer timer = new HashedWheelTimer();
     private PCCDispatcherImpl pccDispatcher;
 
-    PCCsBuilder(final int lsps, final boolean pcError, final int pccCount, @Nonnull final InetSocketAddress localAddress,
-        @Nonnull final List<InetSocketAddress> remoteAddress, final short keepAlive, final short deadTimer,
-        @Nullable final String password, final long reconnectTime, final int redelegationTimeout, final int stateTimeout,
-        @Nonnull final PCEPCapability pcepCapabilities) {
+    PCCsBuilder(final int lsps, final boolean pcError, final int pccCount,
+            @Nonnull final InetSocketAddress localAddress, @Nonnull final List<InetSocketAddress> remoteAddress,
+            final short keepAlive, final short deadTimer, @Nullable final String password, final long reconnectTime,
+            final int redelegationTimeout, final int stateTimeout, @Nonnull final PCEPCapability pcepCapabilities) {
         this.lsps = lsps;
         this.pcError = pcError;
         this.pccCount = pccCount;
@@ -81,7 +81,8 @@ final class PCCsBuilder {
         for (int i = 0; i < this.pccCount; i++) {
             final PCCTunnelManager tunnelManager = new PCCTunnelManagerImpl(this.lsps, currentAddress,
                 this.redelegationTimeout, this.stateTimeout, this.timer, timerHandler);
-            createPCC(new InetSocketAddress(currentAddress, this.localAddress.getPort()), tunnelManager, initialDBVersion);
+            createPCC(new InetSocketAddress(currentAddress, this.localAddress.getPort()), tunnelManager,
+                    initialDBVersion);
             currentAddress = InetAddresses.increment(currentAddress);
         }
     }
index f48768e4c3daf80c0c99f02088e99bd67706ab2f..1141965c09a8152e5c67e3d17b7b10f51efc669d 100644 (file)
@@ -28,7 +28,8 @@ public class TimerHandler {
     private final PCCsBuilder pcCsBuilder;
     private boolean reconnectActive = false;
 
-    public TimerHandler(final PCCsBuilder pcCsBuilder, final Optional<BigInteger> syncOptDBVersion, final int disconnectAfter, final int reconnectAfter) {
+    public TimerHandler(final PCCsBuilder pcCsBuilder, final Optional<BigInteger> syncOptDBVersion,
+            final int disconnectAfter, final int reconnectAfter) {
         this.pcCsBuilder = pcCsBuilder;
         this.syncOptDBVersion = syncOptDBVersion;
         this.disconnectAfter = disconnectAfter;
@@ -41,7 +42,8 @@ public class TimerHandler {
             LOG.debug("Disconnects PCCs, reconnect after {} seconds", TimerHandler.this.reconnectAfter);
             TimerHandler.this.pccDispatcher.close();
             if (TimerHandler.this.reconnectAfter > 0) {
-                TimerHandler.this.timer.newTimeout(new ReconnectTask(), TimerHandler.this.reconnectAfter, TimeUnit.SECONDS);
+                TimerHandler.this.timer.newTimeout(new ReconnectTask(),
+                        TimerHandler.this.reconnectAfter, TimeUnit.SECONDS);
             }
         }
     }
@@ -50,7 +52,8 @@ public class TimerHandler {
         @Override
         public void run(final Timeout timeout) throws Exception {
             LOG.debug("Reconnecting PCCs}");
-            TimerHandler.this.pcCsBuilder.createPCCs(TimerHandler.this.syncOptDBVersion.isPresent() ? TimerHandler.this.syncOptDBVersion.get() : BigInteger.ONE, Optional.absent());
+            TimerHandler.this.pcCsBuilder.createPCCs(TimerHandler.this.syncOptDBVersion.isPresent()
+                    ? TimerHandler.this.syncOptDBVersion.get() : BigInteger.ONE, Optional.absent());
         }
     }
 
index d6645c55bdbfaeaee08984ca67437f5cb3316aa0..969a45b896f318edd1159ab31944aca3c86cde63 100755 (executable)
@@ -96,8 +96,7 @@ public final class PCCDispatcherImpl implements PCCDispatcher, AutoCloseable {
                             public PCEPPeerProposal getPeerProposal() {
                                 return new PCCPeerProposal(dbVersion);
                             }
-                        }
-                        , ch, promise));
+                        }, ch, promise));
                 ch.pipeline().addLast(PCCDispatcherImpl.this.factory.getEncoders());
                 ch.pipeline().addLast(new ChannelInboundHandlerAdapter() {
                     @Override
index 4af4dcca1f621f67d913e774dab1be4da699d4c3..96ec511dcd0379bb647b66c48ca03050ff8b1644 100644 (file)
@@ -32,7 +32,8 @@ public final class PCCPeerProposal implements PCEPPeerProposal {
     }
 
     @Override
-    public void setPeerSpecificProposal(@Nonnull final InetSocketAddress address, @Nonnull final TlvsBuilder openBuilder) {
+    public void setPeerSpecificProposal(@Nonnull final InetSocketAddress address,
+            @Nonnull final TlvsBuilder openBuilder) {
         requireNonNull(address);
         final LspDbVersion lspDbVersion = new LspDbVersionBuilder().setLspDbVersionValue(this.dbVersion).build();
         openBuilder.addAugmentation(Tlvs3.class, new Tlvs3Builder().setLspDbVersion(lspDbVersion).build());
index f912f214e69364cef9a0a9158bbf25aef52d9e58..207baf228df06c32d0771954d1e2b1dc90a59211 100755 (executable)
@@ -32,25 +32,26 @@ final class PCCReconnectPromise extends DefaultPromise<PCEPSession> {
     private final InetSocketAddress address;
     private final int retryTimer;
     private final int connectTimeout;
-    private final Bootstrap b;
+    private final Bootstrap bootstrap;
 
     @GuardedBy("this")
     private Future<?> pending;
 
     PCCReconnectPromise(final InetSocketAddress address, final int retryTimer,
-                        final int connectTimeout, final Bootstrap b) {
+                        final int connectTimeout, final Bootstrap bootstrap) {
         super(GlobalEventExecutor.INSTANCE);
         this.address = address;
         this.retryTimer = retryTimer;
         this.connectTimeout = connectTimeout;
-        this.b = b;
+        this.bootstrap = bootstrap;
     }
 
+    @SuppressWarnings("checkstyle:IllegalCatch")
     synchronized void connect() {
         try {
-            this.b.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, this.connectTimeout);
-            this.b.remoteAddress(this.address);
-            final ChannelFuture cf = this.b.connect();
+            this.bootstrap.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, this.connectTimeout);
+            this.bootstrap.remoteAddress(this.address);
+            final ChannelFuture cf = this.bootstrap.connect();
             cf.addListener(new BootstrapConnectListener(this));
             this.pending = cf;
         } catch (final Exception e) {
@@ -101,7 +102,8 @@ final class PCCReconnectPromise extends DefaultPromise<PCEPSession> {
                 } else if (cf.isSuccess()) {
                     PCCReconnectPromise.LOG.debug("Promise connection is successful.");
                 } else {
-                    PCCReconnectPromise.LOG.debug("Attempt to connect to {} failed", PCCReconnectPromise.this.address, cf.cause());
+                    PCCReconnectPromise.LOG.debug("Attempt to connect to {} failed",
+                            PCCReconnectPromise.this.address, cf.cause());
 
                     if (PCCReconnectPromise.this.retryTimer == 0) {
                         PCCReconnectPromise.LOG.debug("Retry timer value is 0. Reconnection will not be attempted");
@@ -112,13 +114,15 @@ final class PCCReconnectPromise extends DefaultPromise<PCEPSession> {
                     final EventLoop loop = cf.channel().eventLoop();
                     loop.schedule(() -> {
                         synchronized (PCCReconnectPromise.this) {
-                            PCCReconnectPromise.LOG.debug("Attempting to connect to {}", PCCReconnectPromise.this.address);
-                            final Future<Void> reconnectFuture = PCCReconnectPromise.this.b.connect();
+                            PCCReconnectPromise.LOG.debug("Attempting to connect to {}",
+                                    PCCReconnectPromise.this.address);
+                            final Future<Void> reconnectFuture = PCCReconnectPromise.this.bootstrap.connect();
                             reconnectFuture.addListener(this);
                             PCCReconnectPromise.this.pending = reconnectFuture;
                         }
                     }, PCCReconnectPromise.this.retryTimer, TimeUnit.SECONDS);
-                    PCCReconnectPromise.LOG.debug("Next reconnection attempt in {}s", PCCReconnectPromise.this.retryTimer);
+                    PCCReconnectPromise.LOG.debug("Next reconnection attempt in {}s",
+                            PCCReconnectPromise.this.retryTimer);
                 }
             }
         }
index 5e03201a6980026eac473a4194eab8e2e5a3ae89..2e8894e2c3f2387c4f677088ed209774b95c62c5 100644 (file)
@@ -27,7 +27,8 @@ public class PCCServerPeerProposal implements PCEPPeerProposal {
     }
 
     @Override
-    public void setPeerSpecificProposal(@Nonnull final InetSocketAddress address, @Nonnull final TlvsBuilder openBuilder) {
+    public void setPeerSpecificProposal(@Nonnull final InetSocketAddress address,
+            @Nonnull final TlvsBuilder openBuilder) {
         requireNonNull(address);
         final LspDbVersionBuilder lspDbVersionBuilder = new LspDbVersionBuilder();
         if (this.isAfterReconnection) {
@@ -35,6 +36,7 @@ public class PCCServerPeerProposal implements PCEPPeerProposal {
         } else {
             this.isAfterReconnection = true;
         }
-        openBuilder.addAugmentation(Tlvs3.class, new Tlvs3Builder().setLspDbVersion(lspDbVersionBuilder.build()).build());
+        openBuilder.addAugmentation(Tlvs3.class, new Tlvs3Builder()
+                .setLspDbVersion(lspDbVersionBuilder.build()).build());
     }
 }
\ No newline at end of file
index 1fa4ccf2b8b170bb0535c2e9ab7c72f876bf4a33..9c13931db33d4062ca2376e0a1eb9a0f64c41d90 100644 (file)
@@ -54,7 +54,8 @@ public final class PCCSessionListener implements PCEPSessionListener, PCCSession
             final Updates upd = ((Pcupd) message).getPcupdMessage().getUpdates().get(0);
             this.tunnelManager.onMessagePcupd(upd, this);
         } else if (message instanceof Pcinitiate) {
-            this.tunnelManager.onMessagePcInitiate(((Pcinitiate) message).getPcinitiateMessage().getRequests().get(0), this);
+            this.tunnelManager.onMessagePcInitiate(((Pcinitiate) message)
+                    .getPcinitiateMessage().getRequests().get(0), this);
         }
     }
 
@@ -66,6 +67,7 @@ public final class PCCSessionListener implements PCEPSessionListener, PCCSession
     }
 
     @Override
+    @SuppressWarnings("checkstyle:IllegalCatch")
     public void onSessionDown(final PCEPSession session, final Exception exception) {
         LOG.info("Session down with cause : {} or exception: {}", exception.getCause(), exception, exception);
         this.tunnelManager.onSessionDown(this);
index 17695a3b3c74bdabfba52ef0707af3b68a301863..bcd47ffcf18c8252156e2effd1f2813b012e2c29 100644 (file)
@@ -73,7 +73,8 @@ public final class MsgBuilderUtil {
         return rptBuilder.build();
     }
 
-    public static Lsp createLsp(final long plspId, final boolean sync, final Optional<Tlvs> tlvs, final boolean isDelegatedLsp, final boolean remove) {
+    public static Lsp createLsp(final long plspId, final boolean sync, final Optional<Tlvs> tlvs,
+            final boolean isDelegatedLsp, final boolean remove) {
         final LspBuilder lspBuilder = new LspBuilder();
         lspBuilder.setAdministrative(true);
         lspBuilder.setDelegate(isDelegatedLsp);
@@ -87,7 +88,8 @@ public final class MsgBuilderUtil {
         return lspBuilder.build();
     }
 
-    public static Lsp createLsp(final long plspId, final boolean sync, final Optional<Tlvs> tlvs, final boolean isDelegatedLspe) {
+    public static Lsp createLsp(final long plspId, final boolean sync, final Optional<Tlvs> tlvs,
+            final boolean isDelegatedLspe) {
         return createLsp(plspId, sync, tlvs, isDelegatedLspe, false);
     }
 
@@ -105,8 +107,8 @@ public final class MsgBuilderUtil {
         return srpBuilder.build();
     }
 
-    public static Path updToRptPath(
-            final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.pcupd.message.pcupd.message.updates.Path path) {
+    public static Path updToRptPath(final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf
+            .stateful.rev171025.pcupd.message.pcupd.message.updates.Path path) {
         final PathBuilder pathBuilder = new PathBuilder();
         if (path != null) {
             pathBuilder.fieldsFrom(path);
@@ -123,12 +125,14 @@ public final class MsgBuilderUtil {
     }
 
     public static Tlvs createLspTlvs(final long lspId, final boolean symbolicPathName, final String tunnelEndpoint,
-                                     final String tunnelSender, final String extendedTunnelAddress, final Optional<byte[]> symbolicName) {
-        return createLspTlvs(lspId, symbolicPathName, tunnelEndpoint, tunnelSender, extendedTunnelAddress, symbolicName, Optional.absent());
+            final String tunnelSender, final String extendedTunnelAddress, final Optional<byte[]> symbolicName) {
+        return createLspTlvs(lspId, symbolicPathName, tunnelEndpoint, tunnelSender, extendedTunnelAddress, symbolicName,
+                Optional.absent());
     }
 
     public static Tlvs createLspTlvs(final long lspId, final boolean symbolicPathName, final String tunnelEndpoint,
-                                     final String tunnelSender, final String extendedTunnelAddress, final Optional<byte[]> symbolicName, final Optional<BigInteger> lspDBVersion) {
+            final String tunnelSender, final String extendedTunnelAddress, final Optional<byte[]> symbolicName,
+            final Optional<BigInteger> lspDBVersion) {
         final TlvsBuilder tlvs = new TlvsBuilder().setLspIdentifiers(new LspIdentifiersBuilder()
                 .setLspId(new LspId(lspId))
                 .setAddressFamily(
@@ -150,8 +154,8 @@ public final class MsgBuilderUtil {
         }
 
         if (lspDBVersion.isPresent()) {
-            tlvs.addAugmentation(Tlvs1.class, new Tlvs1Builder().setLspDbVersion(new LspDbVersionBuilder().
-                setLspDbVersionValue(lspDBVersion.get()).build()).build());
+            tlvs.addAugmentation(Tlvs1.class, new Tlvs1Builder().setLspDbVersion(new LspDbVersionBuilder()
+                    .setLspDbVersionValue(lspDBVersion.get()).build()).build());
         }
         return tlvs.build();
     }
@@ -162,7 +166,7 @@ public final class MsgBuilderUtil {
         return Optional.of(tlvs);
     }
 
-    public static Pcerr createErrorMsg(@Nonnull final PCEPErrors e, final long srpId) {
+    public static Pcerr createErrorMsg(@Nonnull final PCEPErrors pcepErrors, final long srpId) {
         final PcerrMessageBuilder msgBuilder = new PcerrMessageBuilder();
         return new PcerrBuilder().setPcerrMessage(
             msgBuilder
@@ -175,7 +179,7 @@ public final class MsgBuilderUtil {
                                 .build())).build()).build())
                 .setErrors(
                     Collections.singletonList(new ErrorsBuilder().setErrorObject(
-                        new ErrorObjectBuilder().setType(e.getErrorType()).setValue(e.getErrorValue())
+                        new ErrorObjectBuilder().setType(pcepErrors.getErrorType()).setValue(pcepErrors.getErrorValue())
                             .build()).build())).build()).build();
     }
 
index e2ba4fb2bc74c33ec11c09472fcf5e1b2d54eff9..ea5bbcb7dc00cd7101ba128da88c29890083c2c3 100644 (file)
@@ -44,8 +44,10 @@ import org.opendaylight.protocol.util.InetSocketAddressUtil;
 public class PCCDispatcherImplTest {
 
     private static final List<PCEPCapability> CAPS = new ArrayList<>();
-    private static final PCEPSessionProposalFactory PROPOSAL = new BasePCEPSessionProposalFactory(10, 40, CAPS);
-    private final DefaultPCEPSessionNegotiatorFactory nf = new DefaultPCEPSessionNegotiatorFactory(PROPOSAL, 0);
+    private static final PCEPSessionProposalFactory PROPOSAL
+            = new BasePCEPSessionProposalFactory(10, 40, CAPS);
+    private final DefaultPCEPSessionNegotiatorFactory nf
+            = new DefaultPCEPSessionNegotiatorFactory(PROPOSAL, 0);
     private PCCDispatcherImpl dispatcher;
     private PCEPDispatcher pcepDispatcher;
     private InetSocketAddress serverAddress;
@@ -61,8 +63,10 @@ public class PCCDispatcherImplTest {
         MockitoAnnotations.initMocks(this);
         this.workerGroup = new NioEventLoopGroup();
         this.bossGroup = new NioEventLoopGroup();
-        this.dispatcher = new PCCDispatcherImpl(ServiceLoaderPCEPExtensionProviderContext.getSingletonInstance().getMessageHandlerRegistry());
-        this.pcepDispatcher = new PCEPDispatcherImpl(ServiceLoaderPCEPExtensionProviderContext.getSingletonInstance().getMessageHandlerRegistry(),
+        this.dispatcher = new PCCDispatcherImpl(ServiceLoaderPCEPExtensionProviderContext.getSingletonInstance()
+                .getMessageHandlerRegistry());
+        this.pcepDispatcher = new PCEPDispatcherImpl(ServiceLoaderPCEPExtensionProviderContext.getSingletonInstance()
+                .getMessageHandlerRegistry(),
             this.nf, this.bossGroup, this.workerGroup);
         this.serverAddress = InetSocketAddressUtil.getRandomLoopbackInetSocketAddress();
         this.clientAddress = InetSocketAddressUtil.getRandomLoopbackInetSocketAddress(0);
@@ -84,8 +88,9 @@ public class PCCDispatcherImplTest {
 
     @Test
     public void testClientReconnect() throws Exception {
-        final Future<PCEPSession> futureSession = this.dispatcher.createClient(this.serverAddress, 1, new TestingSessionListenerFactory(),
-            this.nf, KeyMapping.getKeyMapping(), this.clientAddress);
+        final Future<PCEPSession> futureSession = this.dispatcher
+                .createClient(this.serverAddress, 1, new TestingSessionListenerFactory(), this.nf,
+                        KeyMapping.getKeyMapping(), this.clientAddress);
         final TestingSessionListenerFactory slf = new TestingSessionListenerFactory();
         doReturn(slf).when(this.dispatcherDependencies).getListenerFactory();
 
@@ -94,7 +99,8 @@ public class PCCDispatcherImplTest {
         final Channel channel = futureServer.channel();
         Assert.assertNotNull(futureSession.get());
         checkSessionListenerNotNull(slf, this.clientAddress.getHostString());
-        final TestingSessionListener sl = checkSessionListenerNotNull(slf, this.clientAddress.getAddress().getHostAddress());
+        final TestingSessionListener sl
+                = checkSessionListenerNotNull(slf, this.clientAddress.getAddress().getHostAddress());
         Assert.assertNotNull(sl.getSession());
         Assert.assertTrue(sl.isUp());
         channel.close().get();
@@ -102,7 +108,8 @@ public class PCCDispatcherImplTest {
 
         this.workerGroup = new NioEventLoopGroup();
         this.bossGroup = new NioEventLoopGroup();
-        this.pcepDispatcher = new PCEPDispatcherImpl(ServiceLoaderPCEPExtensionProviderContext.getSingletonInstance().getMessageHandlerRegistry(),
+        this.pcepDispatcher = new PCEPDispatcherImpl(ServiceLoaderPCEPExtensionProviderContext.getSingletonInstance()
+                .getMessageHandlerRegistry(),
             this.nf, this.bossGroup, this.workerGroup);
 
         final TestingSessionListenerFactory slf2 = new TestingSessionListenerFactory();
@@ -110,7 +117,8 @@ public class PCCDispatcherImplTest {
         final ChannelFuture future2 = this.pcepDispatcher.createServer(this.dispatcherDependencies);
         waitFutureSuccess(future2);
         final Channel channel2 = future2.channel();
-        final TestingSessionListener sl2 = checkSessionListenerNotNull(slf2, this.clientAddress.getAddress().getHostAddress());
+        final TestingSessionListener sl2
+                = checkSessionListenerNotNull(slf2, this.clientAddress.getAddress().getHostAddress());
         Assert.assertNotNull(sl2.getSession());
         Assert.assertTrue(sl2.isUp());
         channel2.close();
index bb9f2cb94b8f1439fc1bb868f3ed7fcb5dc9bbbb..dda6c0b41cfb4ae9510a5522e5852d34d7b861fb 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.protocol.pcep.pcc.mock;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import org.junit.Test;
@@ -26,7 +27,7 @@ public class PCCEndPointIpv4ObjectParserTest {
     private static final String IP1 = "1.2.3.4";
     private static final String IP2 = "1.2.3.5";
 
-    @Test(expected=PCEPDeserializerException.class)
+    @Test(expected = PCEPDeserializerException.class)
     public void testParseEmptyObject() throws PCEPDeserializerException {
         final ObjectHeader header = new ObjectHeaderImpl(false, false);
         final ByteBuf bytes = Unpooled.buffer();
@@ -48,14 +49,14 @@ public class PCCEndPointIpv4ObjectParserTest {
         assertFalse(output.isProcessingRule());
     }
 
-    @Test(expected=IllegalArgumentException.class)
+    @Test(expected = IllegalArgumentException.class)
     public void testNullBytes() throws PCEPDeserializerException {
         final ObjectHeader header = new ObjectHeaderImpl(false, false);
         final ByteBuf bytes = null;
         new PCCEndPointIpv4ObjectParser().parseObject(header, bytes);
     }
 
-    @Test(expected=IllegalArgumentException.class)
+    @Test(expected = IllegalArgumentException.class)
     public void testEmptyBytes() throws PCEPDeserializerException {
         final ObjectHeader header = new ObjectHeaderImpl(false, false);
         final ByteBuf bytes = Unpooled.buffer();
index 4a71765f050e9a33956a3ec295616317edbee8c3..a1020ebb3157c55d3e9b886695f1ca39982c5248 100644 (file)
@@ -29,8 +29,8 @@ public class PCCIncrementalSyncTest extends PCCMockCommon {
      */
     private final String[] mainInputIncrementalSync = new String[]{"--local-address", this.localAddress.getHostString(),
         "--remote-address", InetSocketAddressUtil.toHostAndPort(this.remoteAddress).toString(), "--pcc", "1", "--lsp",
-        this.lsp.toString(), "--log-level", "DEBUG", "-ka", "30", "-d", "120", "--reconnect", "-1", "--redelegation-timeout",
-        "0", "--state-timeout", "-1", "--incremental-sync-procedure", "10", "5", "5"};
+        this.lsp.toString(), "--log-level", "DEBUG", "-ka", "30", "-d", "120", "--reconnect", "-1",
+        "--redelegation-timeout", "0", "--state-timeout", "-1", "--incremental-sync-procedure", "10", "5", "5"};
 
     @Test
     public void testSessionIncrementalSyncEstablishment() throws Exception {
@@ -44,7 +44,8 @@ public class PCCIncrementalSyncTest extends PCCMockCommon {
         final int expetecdNumberOfLspAndEndOfSync = 3;
         final BigInteger expectedFinalDBVersion = BigInteger.valueOf(10);
         final TestingSessionListener sessionListenerAfterReconnect = getListener(factory);
-        checkResyncSession(Optional.absent(), expetecdNumberOfLspAndEndOfSync, 3, numberOflspAndDBv, expectedFinalDBVersion, sessionListenerAfterReconnect);
+        checkResyncSession(Optional.absent(), expetecdNumberOfLspAndEndOfSync, 3, numberOflspAndDBv,
+                expectedFinalDBVersion, sessionListenerAfterReconnect);
         channel.close().get();
     }
 
index f6b42e46719ca3a526bab720d3242d6934b52a4f..8bd729c6ba92130d38094427fd4af4ad0d4fe4f5 100644 (file)
@@ -201,8 +201,8 @@ public abstract class PCCMockCommon {
                     assertEquals(true, lsp.isSync());
                 }
                 final BigInteger actuaLspDBVersion = lsp.getTlvs().getAugmentation(org.opendaylight.yang.gen
-                        .v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev171025.Tlvs1.class)
-                        .getLspDbVersion().getLspDbVersionValue();
+                    .v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev171025.Tlvs1.class)
+                    .getLspDbVersion().getLspDbVersionValue();
                 assertEquals(expectedDbVersion, actuaLspDBVersion);
             }
         }
@@ -214,11 +214,10 @@ public abstract class PCCMockCommon {
         final PCCTunnelManager tunnelManager = new PCCTunnelManagerImpl(3, this.localAddress.getAddress(),
                 0, -1, new HashedWheelTimer(), Optional.absent());
 
-        return pccDispatcher.createClient(this.remoteAddress, -1,
-                () -> {
-                    this.pccSessionListener = new PCCSessionListener(1, tunnelManager, false);
-                    return this.pccSessionListener;
-                }, snf, KeyMapping.getKeyMapping(), this.localAddress, dbVersion);
+        return pccDispatcher.createClient(this.remoteAddress, -1, () -> {
+            this.pccSessionListener = new PCCSessionListener(1, tunnelManager, false);
+            return this.pccSessionListener;
+        }, snf, KeyMapping.getKeyMapping(), this.localAddress, dbVersion);
     }
 
     private PCEPSessionNegotiatorFactory<PCEPSessionImpl> getSessionNegotiatorFactory() {
index 1c4093cb24cbd8d8f75c13f3ca6acd33e24c0843..1498a70b54f21bb8375b369b0a5506d1ac42cd41 100644 (file)
@@ -9,19 +9,17 @@
 package org.opendaylight.protocol.pcep.pcc.mock;
 
 import io.netty.channel.Channel;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
 import java.net.InetSocketAddress;
 import java.util.Collections;
 import java.util.List;
 import org.junit.Test;
 import org.opendaylight.protocol.pcep.PCEPCapability;
-import org.opendaylight.protocol.pcep.pcc.mock.spi.MsgBuilderUtil;
 import org.opendaylight.protocol.util.InetSocketAddressUtil;
 
 public final class PCCMockTest extends PCCMockCommon {
-    private final String[] mainInput = new String[] {"--local-address", this.localAddress.getHostString(), "--remote-address",
-        InetSocketAddressUtil.toHostAndPort(this.remoteAddress).toString(), "--pcc", "1", "--lsp", "3", "--log-level", "DEBUG", "-ka", "10", "-d", "40", "--reconnect", "-1",
+    private final String[] mainInput = new String[]{"--local-address", this.localAddress.getHostString(),
+        "--remote-address", InetSocketAddressUtil.toHostAndPort(this.remoteAddress).toString(), "--pcc", "1",
+        "--lsp", "3", "--log-level", "DEBUG", "-ka", "10", "-d", "40", "--reconnect", "-1",
         "--redelegation-timeout", "0", "--state-timeout", "-1"};
 
     @Test
@@ -32,7 +30,8 @@ public final class PCCMockTest extends PCCMockCommon {
         Thread.sleep(1000);
         //3 reported LSPs + syc
         final int numMessages = 4;
-        final TestingSessionListener sessionListener = checkSessionListener(numMessages, channel, factory, this.localAddress.getHostString());
+        final TestingSessionListener sessionListener = checkSessionListener(numMessages, channel, factory,
+                this.localAddress.getHostString());
         checkSession(sessionListener.getSession(), 40, 10);
     }
 
@@ -51,10 +50,10 @@ public final class PCCMockTest extends PCCMockCommon {
         final Channel channel2 = createServer(factory2, serverAddress3);
         final Channel channel3 = createServer(factory3, serverAddress4);
 
-        Main.main(new String[] {"--local-address", this.localAddress.getHostString(), "--remote-address",
-                InetSocketAddressUtil.toHostAndPort(serverAddress2).toString() + "," +
-                InetSocketAddressUtil.toHostAndPort(serverAddress3).toString() + "," +
-                InetSocketAddressUtil.toHostAndPort(serverAddress4).toString(),
+        Main.main(new String[]{"--local-address", this.localAddress.getHostString(), "--remote-address",
+            InetSocketAddressUtil.toHostAndPort(serverAddress2).toString() + ","
+                + InetSocketAddressUtil.toHostAndPort(serverAddress3).toString() + ","
+                InetSocketAddressUtil.toHostAndPort(serverAddress4).toString(),
             "--pcc", "2"});
         Thread.sleep(1000);
         //PCE1
@@ -69,17 +68,6 @@ public final class PCCMockTest extends PCCMockCommon {
         checkSessionListener(numMessages, channel3, factory3, localAddress2);
     }
 
-    @Test(expected = UnsupportedOperationException.class)
-    public void testPrivateConstructor() throws Throwable {
-        final Constructor<MsgBuilderUtil> c = MsgBuilderUtil.class.getDeclaredConstructor();
-        c.setAccessible(true);
-        try {
-            c.newInstance();
-        } catch (final InvocationTargetException e) {
-            throw e.getCause();
-        }
-    }
-
     @Override
     protected List<PCEPCapability> getCapabilities() {
         return Collections.emptyList();
index a6faf9ee98ac7eee756cc763bab313de1e9cbaad..e2671888198c0977bfe1619594c2f697ba5af386 100644 (file)
@@ -58,9 +58,9 @@ public class PCCTunnelManagerImplTest {
     private static final InetAddress ADDRESS = InetAddresses.forString("1.2.4.5");
     private static final Timer TIMER = new HashedWheelTimer();
     private static final byte[] SYMBOLIC_NAME = "tets".getBytes(StandardCharsets.UTF_8);
-    private static final Ero ERO = new EroBuilder()
-        .setSubobject(Lists.newArrayList(new SubobjectBuilder().setSubobjectType(new IpPrefixCaseBuilder().setIpPrefix(
-            new IpPrefixBuilder().setIpPrefix(new IpPrefix(new Ipv4Prefix("127.0.0.2/32"))).build()).build()).build())).build();
+    private static final Ero ERO = new EroBuilder().setSubobject(Lists.newArrayList(new SubobjectBuilder()
+        .setSubobjectType(new IpPrefixCaseBuilder().setIpPrefix(new IpPrefixBuilder()
+        .setIpPrefix(new IpPrefix(new Ipv4Prefix("127.0.0.2/32"))).build()).build()).build())).build();
     private final List<PCEPErrors> errorsSession1 = new ArrayList<>();
     private final List<PCEPErrors> errorsSession2 = new ArrayList<>();
     @Mock
@@ -314,10 +314,12 @@ public class PCCTunnelManagerImplTest {
         return updsBuilder.build();
     }
 
-    private static Requests createRequests(final long plspId, final Optional<Boolean> remove, final Optional<Boolean> delegate) {
+    private static Requests createRequests(final long plspId, final Optional<Boolean> remove,
+            final Optional<Boolean> delegate) {
         final RequestsBuilder reqBuilder = new RequestsBuilder();
         reqBuilder.setEro(ERO);
-        final LspBuilder lsp = new LspBuilder().setTlvs(new TlvsBuilder().setSymbolicPathName(new SymbolicPathNameBuilder().setPathName(
+        final LspBuilder lsp = new LspBuilder().setTlvs(new TlvsBuilder()
+            .setSymbolicPathName(new SymbolicPathNameBuilder().setPathName(
             new SymbolicPathName(SYMBOLIC_NAME)).build()).build()).setPlspId(new PlspId(plspId));
         if (delegate.isPresent()) {
             lsp.setDelegate(Boolean.TRUE);
@@ -340,6 +342,7 @@ public class PCCTunnelManagerImplTest {
         return createRequests(plspId, Optional.absent(), Optional.of(Boolean.TRUE));
     }
 
+    @SuppressWarnings("checkstyle:OverloadMethodsDeclarationOrder")
     private static Requests createRequests(final long plspId) {
         return createRequests(plspId, Optional.absent(), Optional.absent());
     }
index ca7b92bd276ebbbca388df45352adbbcf7fa18e4..b23c9285321753adcf47746b1c3556e3f982d2b2 100644 (file)
@@ -66,12 +66,13 @@ public class TestingSessionListener implements PCEPSessionListener, ListenerChec
         return ImmutableList.copyOf(this.messages);
     }
 
-    boolean isUp () {
+    boolean isUp() {
         return this.up;
     }
 
     public PCEPSession getSession() {
-        Assert.assertEquals("Session up", true, Uninterruptibles.awaitUninterruptibly(this.sessionLatch, 10, TimeUnit.SECONDS));
+        Assert.assertEquals("Session up", true,
+                Uninterruptibles.awaitUninterruptibly(this.sessionLatch, 10, TimeUnit.SECONDS));
         return this.session;
     }
 
index 40e40c3635c705d2cf885899ab2131ff1fd2259b..c7487e571e9c83802286234c6b7f9cabff2d9001 100644 (file)
 
     <modelVersion>4.0.0</modelVersion>
     <parent>
-        <groupId>org.opendaylight.odlparent</groupId>
-        <artifactId>odlparent</artifactId>
-        <version>2.0.5</version>
-        <relativePath/>
+        <groupId>org.opendaylight.bgpcep</groupId>
+        <artifactId>testtool-parent</artifactId>
+        <version>0.9.0-SNAPSHOT</version>
+        <relativePath>../../testtool-parent</relativePath>
     </parent>
 
-    <groupId>org.opendaylight.bgpcep</groupId>
     <artifactId>pcep-testtool</artifactId>
     <version>0.9.0-SNAPSHOT</version>
     <description>PCEP Interop Testing Tool</description>
     <packaging>jar</packaging>
     <name>${project.artifactId}</name>
 
-    <dependencyManagement>
-        <dependencies>
-            <dependency>
-                <groupId>org.opendaylight.bgpcep</groupId>
-                <artifactId>bgpcep-parent</artifactId>
-                <version>0.9.0-SNAPSHOT</version>
-                <type>pom</type>
-                <scope>import</scope>
-            </dependency>
-        </dependencies>
-    </dependencyManagement>
-
-
     <dependencies>
         <dependency>
             <groupId>${project.groupId}</groupId>
index ca961e415765762681904b1ee21d9fd9d5d44c7e..4f803b606214de7c87211fb38b33678305340236 100644 (file)
@@ -15,7 +15,6 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.ExecutionException;
 import org.opendaylight.protocol.pcep.PCEPCapability;
-import org.opendaylight.protocol.pcep.PCEPDispatcherDependencies;
 import org.opendaylight.protocol.pcep.PCEPSessionProposalFactory;
 import org.opendaylight.protocol.pcep.ietf.stateful07.PCEPStatefulCapability;
 import org.opendaylight.protocol.pcep.ietf.stateful07.StatefulActivator;
@@ -30,52 +29,52 @@ public final class Main {
 
     private static final Logger LOG = LoggerFactory.getLogger(Main.class);
 
-    public static final String USAGE = "DESCRIPTION:\n"
-            + "\tCreates a server with given parameters. As long as it runs, it accepts connections " + "from PCCs.\n" + "USAGE:\n"
+    private static final String USAGE = "DESCRIPTION:\n"
+            + "\tCreates a server with given parameters. As long as it runs, it accepts connections "
+            + "from PCCs.\n" + "USAGE:\n"
             + "\t-a, --address\n" + "\t\tthe ip address to which is this server bound.\n"
-            + "\t\tFormat: x.x.x.x:y where y is port number.\n\n" +
+            + "\t\tFormat: x.x.x.x:y where y is port number.\n\n"
 
-            "\t-d, --deadtimer\n" + "\t\tin seconds, value of the desired deadtimer\n"
+            "\t-d, --deadtimer\n" + "\t\tin seconds, value of the desired deadtimer\n"
             + "\t\tAccording to RFC5440, recommended value for deadtimer is 4 times the value\n"
             + "\t\tof KeepAlive timer. If it's not, a warning is printed.\n"
-            + "\t\tIf not set, it's value will be derived from KeepAlive timer value.\n\n" +
+            + "\t\tIf not set, it's value will be derived from KeepAlive timer value.\n\n"
 
-            "\t-ka, --keepalive\n" + "\t\tin seconds, value of the desired KeepAlive timer.\n"
-            + "\t\tIf not present, KeepAlive timer will be set to recommended value (30s).\n\n" +
+            "\t-ka, --keepalive\n" + "\t\tin seconds, value of the desired KeepAlive timer.\n"
+            + "\t\tIf not present, KeepAlive timer will be set to recommended value (30s).\n\n"
 
-            "\t--stateful\n" + "\t\tpassive stateful\n\n" +
+            + "\t--stateful\n" + "\t\tpassive stateful\n\n"
 
-            "\t--active\n" + "\t\tactive stateful (implies --stateful)\n\n" +
+            + "\t--active\n" + "\t\tactive stateful (implies --stateful)\n\n"
 
-            "\t--instant\n"
-            + "\t\tinstantiated stateful, <seconds> cleanup timeout (default value, if not included = 0) (implies --stateful)\n\n" +
+            + "\t--instant\n"
+            + "\t\tinstantiated stateful, <seconds> cleanup timeout "
+            + "(default value, if not included = 0) (implies --stateful)\n\n"
 
-            "\t-arm, --autoResponseMessages <path to file>\n"
+            "\t-arm, --autoResponseMessages <path to file>\n"
             + "\t\t <path to file> with groovy script which implements MessageGeneratorService.\n"
-            + "\t\t Messages are used as auto response for every message received. Purely for testing puposes! \n\n" +
+            + "\t\t Messages are used as auto response for every message received. Purely for testing puposes! \n\n"
 
-            "\t-psm, --periodicallySendMessages <path to file> <period>\n"
-            + "\t\t <path to file> with groovy script which implements MessageGeneratorService followed by <period> in seconds.\n"
-            + "\t\t Messages which are sent periodically. Purely for testing puposes! \n\n" +
+            + "\t-psm, --periodicallySendMessages <path to file> <period>\n"
+            + "\t\t <path to file> with groovy script which implements"
+            + " MessageGeneratorService followed by <period> in seconds.\n"
+            + "\t\t Messages which are sent periodically. Purely for testing puposes! \n\n"
 
-            "\t-snm, --sendNowMessage <path to file>\n"
+            "\t-snm, --sendNowMessage <path to file>\n"
             + "\t\t <path to file> with groovy script which implements MessageGeneratorService.\n"
-            + "\t\t Messages are sent in defined states defined by programmer. Purely for testing puposes! \n\n" +
+            + "\t\t Messages are sent in defined states defined by programmer. Purely for testing puposes! \n\n"
 
-            "\t--help\n" + "\t\tdisplay this help and exits\n\n" +
+            + "\t--help\n" + "\t\tdisplay this help and exits\n\n"
 
-            "With no parameters, this help is printed.";
+            + "With no parameters, this help is printed.";
+    private static final int KA_TO_DEADTIMER_RATIO = 4;
+    private static final int KA_DEFAULT = 30;
+    private static final int MAX_UNKNOWN_MESSAGES = 5;
 
     private Main() {
 
     }
 
-    private static final int KA_TO_DEADTIMER_RATIO = 4;
-
-    private static final int KA_DEFAULT = 30;
-
-    private static final int MAX_UNKNOWN_MESSAGES = 5;
-
     public static void main(final String[] args) throws UnknownHostException, InterruptedException, ExecutionException {
         if (args.length == 0 || (args.length == 1 && args[0].equalsIgnoreCase("--help"))) {
             LOG.info(Main.USAGE);
@@ -89,30 +88,30 @@ public final class Main {
         boolean active = false;
         boolean instant = false;
 
-        int i = 0;
-        while (i < args.length) {
-            if (args[i].equalsIgnoreCase("-a") || args[i].equalsIgnoreCase("--address")) {
-                final String[] ip = args[i + 1].split(":");
+        int pos = 0;
+        while (pos < args.length) {
+            if (args[pos].equalsIgnoreCase("-a") || args[pos].equalsIgnoreCase("--address")) {
+                final String[] ip = args[pos + 1].split(":");
                 address = new InetSocketAddress(InetAddress.getByName(ip[0]), Integer.parseInt(ip[1]));
-                i++;
-            } else if (args[i].equalsIgnoreCase("-d") || args[i].equalsIgnoreCase("--deadtimer")) {
-                deadTimerValue = Integer.parseInt(args[i + 1]);
-                i++;
-            } else if (args[i].equalsIgnoreCase("-ka") || args[i].equalsIgnoreCase("--keepalive")) {
-                keepAliveValue = Integer.parseInt(args[i + 1]);
-                i++;
-            } else if (args[i].equalsIgnoreCase("--stateful")) {
+                pos++;
+            } else if (args[pos].equalsIgnoreCase("-d") || args[pos].equalsIgnoreCase("--deadtimer")) {
+                deadTimerValue = Integer.parseInt(args[pos + 1]);
+                pos++;
+            } else if (args[pos].equalsIgnoreCase("-ka") || args[pos].equalsIgnoreCase("--keepalive")) {
+                keepAliveValue = Integer.parseInt(args[pos + 1]);
+                pos++;
+            } else if (args[pos].equalsIgnoreCase("--stateful")) {
                 stateful = true;
-            } else if (args[i].equalsIgnoreCase("--active")) {
+            } else if (args[pos].equalsIgnoreCase("--active")) {
                 stateful = true;
                 active = true;
-            } else if (args[i].equalsIgnoreCase("--instant")) {
+            } else if (args[pos].equalsIgnoreCase("--instant")) {
                 stateful = true;
                 instant = true;
             } else {
-                LOG.warn("WARNING: Unrecognized argument: {}", args[i]);
+                LOG.warn("WARNING: Unrecognized argument: {}", args[pos]);
             }
-            i++;
+            pos++;
         }
         if (deadTimerValue != 0 && deadTimerValue != keepAliveValue * KA_TO_DEADTIMER_RATIO) {
             LOG.warn("WARNING: The value of DeadTimer should be 4 times the value of KeepAlive.");
@@ -125,7 +124,7 @@ public final class Main {
         caps.add(new PCEPStatefulCapability(stateful, active, instant, false, false, false, false));
         final PCEPSessionProposalFactory spf = new BasePCEPSessionProposalFactory(deadTimerValue, keepAliveValue, caps);
 
-        try (final StatefulActivator activator07 = new StatefulActivator()) {
+        try (StatefulActivator activator07 = new StatefulActivator()) {
             activator07.start(ServiceLoaderPCEPExtensionProviderContext.getSingletonInstance());
 
             final PCEPDispatcherImpl dispatcher = new PCEPDispatcherImpl(
index 261a0e1dac0f464119578a70cc1b7c2a4a04c804..19924612206fe667c3da73a69d06b881e9a94f97 100644 (file)
@@ -18,15 +18,10 @@ import org.slf4j.LoggerFactory;
 
 public class TestingSessionListener implements PCEPSessionListener {
 
+    private static final Logger LOG = LoggerFactory.getLogger(TestingSessionListener.class);
     private final List<Message> messages = Lists.newArrayList();
-
     private boolean up = false;
 
-    private static final Logger LOG = LoggerFactory.getLogger(TestingSessionListener.class);
-
-    public TestingSessionListener() {
-    }
-
     @Override
     public void onMessage(final PCEPSession session, final Message message) {
         LOG.debug("Received message: {}", message);
@@ -50,11 +45,11 @@ public class TestingSessionListener implements PCEPSessionListener {
         LOG.debug("Session terminated. Cause : {}", cause);
     }
 
-    public List<Message> messages() {
+    List<Message> messages() {
         return this.messages;
     }
 
-    public boolean isUp () {
+    boolean isUp() {
         return this.up;
     }
 }
index ddc7e2b5d2a5af6ed71bde0d65edd62ba139b26e..473df47e1cd85f45994700f6190f7d1c70887bcb 100644 (file)
@@ -32,13 +32,13 @@ public class PCCMock {
         final PCEPSessionNegotiatorFactory snf = new DefaultPCEPSessionNegotiatorFactory(proposal, 0);
         final HostAndPort serverHostAndPort = HostAndPort.fromString(args[0]);
         final InetSocketAddress serverAddr = new InetSocketAddress(serverHostAndPort.getHost(), serverHostAndPort
-            .getPortOrDefault(12345));
+                .getPortOrDefault(12345));
         final InetSocketAddress clientAddr = InetSocketAddressUtil.getRandomLoopbackInetSocketAddress(0);
 
-        try (final PCCDispatcherImpl pccDispatcher = new PCCDispatcherImpl(ServiceLoaderPCEPExtensionProviderContext
-            .getSingletonInstance().getMessageHandlerRegistry())) {
+        try (PCCDispatcherImpl pccDispatcher = new PCCDispatcherImpl(ServiceLoaderPCEPExtensionProviderContext
+                .getSingletonInstance().getMessageHandlerRegistry())) {
             pccDispatcher.createClient(serverAddr, -1, SimpleSessionListener::new, snf,
-                KeyMapping.getKeyMapping(), clientAddr).get();
+                    KeyMapping.getKeyMapping(), clientAddr).get();
         }
     }
 }
index ebe30c77ec77f2e502f2cf38e7c5e5a406afabbe..173a696ae1f4fc212a31be944531a2ed6a94f85f 100644 (file)
@@ -40,6 +40,7 @@ public class SimpleSessionListener implements PCEPSessionListener {
     }
 
     @Override
+    @SuppressWarnings("checkstyle:IllegalCatch")
     public void onSessionDown(final PCEPSession session, final Exception exception) {
         LOG.debug("Session down with cause : {} or exception: {}", exception.getCause(), exception, exception);
         try {
diff --git a/pom.xml b/pom.xml
index 4d49ff313633375b08aed25c25a6bd550a174110..e885ab92a8abea7acdadfc2e455de9a182f3aab1 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -41,6 +41,7 @@
         <module>binding-parent</module>
         <module>bundle-parent</module>
         <module>config-parent</module>
+        <module>testtool-parent</module>
 
         <!-- Common infra -->
         <module>concepts</module>
diff --git a/testtool-parent/pom.xml b/testtool-parent/pom.xml
new file mode 100644 (file)
index 0000000..8a0747f
--- /dev/null
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.opendaylight.odlparent</groupId>
+        <artifactId>odlparent</artifactId>
+        <version>2.0.5</version>
+        <relativePath/>
+    </parent>
+
+    <groupId>org.opendaylight.bgpcep</groupId>
+    <artifactId>testtool-parent</artifactId>
+    <version>0.9.0-SNAPSHOT</version>
+    <packaging>pom</packaging>
+    <name>${project.artifactId}</name>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.opendaylight.bgpcep</groupId>
+                <artifactId>bgpcep-parent</artifactId>
+                <version>0.9.0-SNAPSHOT</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <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>
+        <url>https://wiki.opendaylight.org/view/BGP_LS_PCEP:Main</url>
+        <tag>HEAD</tag>
+    </scm>
+</project>
\ No newline at end of file