clean pcep/impl 02/85102/21
authorguillaume.lambert <guillaume.lambert@orange.com>
Mon, 14 Oct 2019 09:34:05 +0000 (11:34 +0200)
committerRobert Varga <nite@hq.sk>
Tue, 26 Nov 2019 15:11:30 +0000 (15:11 +0000)
  - Fix remaining checkstyle errors, mainly IllegalCatch
  - Remove superfluous from PCEPValidatorTest, PcepXROSubobjectParserTest,
    PcepRROSubobjectParserTest and PcepEROSubobjectParserTest
  - Remove call to deprecated functions

JIRA: BGPCEP-715

Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Co-authored-by: Olivier Dugeon <olivier.dugeon@orange.com>
Change-Id: Ifff40512f2861246692fbad41de77882c461b2d0
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
16 files changed:
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/AbstractSessionNegotiator.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/DefaultPCEPSessionNegotiator.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPProtocolSessionPromise.java [changed mode: 0755->0644]
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPSessionImpl.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPSessionNegotiator.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPSessionState.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/spi/Util.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/tls/SslContextFactory.java
pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/AbstractPCEPSessionTest.java
pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPDispatcherImplTest.java [changed mode: 0755->0644]
pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPSessionImplTest.java
pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPValidatorTest.java
pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PcepEROSubobjectParserTest.java [moved from pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPEROSubobjectParserTest.java with 93% similarity]
pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PcepRROSubobjectParserTest.java [moved from pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPRROSubobjectParserTest.java with 83% similarity]
pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PcepXROSubobjectParserTest.java [moved from pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPXROSubobjectParserTest.java with 97% similarity]
pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/UtilTest.java

index 5d6407dde33669ab0aee495cfbf61c0c3cfcd512..85cdc6ec1b38172b1c98060c0d9242c18c4f07d0 100644 (file)
@@ -55,6 +55,7 @@ public abstract class AbstractSessionNegotiator extends ChannelInboundHandlerAda
     }
 
     @Override
+    @SuppressWarnings("checkstyle:IllegalCatch")
     public final void channelActive(final ChannelHandlerContext ctx) {
         LOG.debug("Starting session negotiation on channel {}", this.channel);
 
@@ -68,6 +69,7 @@ public abstract class AbstractSessionNegotiator extends ChannelInboundHandlerAda
     }
 
     @Override
+    @SuppressWarnings("checkstyle:IllegalCatch")
     public final void channelRead(final ChannelHandlerContext ctx, final Object msg) {
         LOG.debug("Negotiation read invoked on channel {}", this.channel);
 
index e676f403b14ecfd831be30089e484bbc488b9079..b24189d8de9914a23a64713578f64ad3e05828f0 100644 (file)
@@ -16,6 +16,7 @@ import org.opendaylight.protocol.pcep.PCEPSessionListener;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.app.config.rev160707.pcep.dispatcher.config.Tls;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.Open;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.OpenBuilder;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 public final class DefaultPCEPSessionNegotiator extends AbstractPCEPSessionNegotiator {
     private final PCEPSessionListener listener;
@@ -27,9 +28,12 @@ public final class DefaultPCEPSessionNegotiator extends AbstractPCEPSessionNegot
         super(promise, channel);
         super.setTlsConfiguration(tlsConfiguration);
         this.maxUnknownMessages = maxUnknownMessages;
-        this.myLocalPrefs = new OpenBuilder().setKeepalive(localPrefs.getKeepalive())
-                .setDeadTimer(localPrefs.getDeadTimer()).setSessionId(
-                sessionId).setTlvs(localPrefs.getTlvs()).build();
+        this.myLocalPrefs = new OpenBuilder()
+                .setKeepalive(localPrefs.getKeepalive())
+                .setDeadTimer(localPrefs.getDeadTimer())
+                .setSessionId(Uint8.valueOf(sessionId))
+                .setTlvs(localPrefs.getTlvs())
+                .build();
         this.listener = requireNonNull(listener);
     }
 
old mode 100755 (executable)
new mode 100644 (file)
index 80aa222..971ce73
@@ -45,6 +45,7 @@ public final class PCEPProtocolSessionPromise<S extends PCEPSession> extends Def
         this.bootstrap = requireNonNull(bootstrap);
     }
 
+    @SuppressWarnings("checkstyle:IllegalCatch")
     synchronized void connect() {
         final PCEPProtocolSessionPromise<?> lock = this;
 
@@ -59,7 +60,7 @@ public final class PCEPProtocolSessionPromise<S extends PCEPSession> extends Def
             final ChannelFuture connectFuture = this.bootstrap.connect();
             connectFuture.addListener(new BootstrapConnectListener());
             this.pending = connectFuture;
-        } catch (Exception e) {
+        } catch (RuntimeException e) {
             LOG.info("Failed to connect to {}", this.address, e);
             this.setFailure(e);
         }
index ba52e0ef2b44a59358eada240e5f1a8ccd1a8e95..ef17f90f4db52420a0f770a5c3dfcfc482f1516d 100644 (file)
@@ -50,6 +50,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.typ
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.keepalive.message.KeepaliveMessageBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.Open;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.open.Tlvs;
+import org.opendaylight.yangtools.yang.common.Uint8;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -248,7 +249,7 @@ public class PCEPSessionImpl extends SimpleChannelInboundHandler<Message> implem
             LOG.info("Closing PCEP session with reason {}: {}", reason, this);
             sendMessage(new CloseBuilder().setCCloseMessage(
                     new CCloseMessageBuilder().setCClose(new CCloseBuilder()
-                        .setReason(reason.getShortValue()).build()).build()).build());
+                        .setReason(Uint8.valueOf(reason.getShortValue())).build()).build()).build());
         } else {
             LOG.info("Closing PCEP session: {}", this);
         }
@@ -370,10 +371,11 @@ public class PCEPSessionImpl extends SimpleChannelInboundHandler<Message> implem
     }
 
     @VisibleForTesting
+    @SuppressWarnings("checkstyle:IllegalCatch")
     void sessionUp() {
         try {
             this.listener.onSessionUp(this);
-        } catch (final Exception e) {
+        } catch (final RuntimeException e) {
             handleException(e);
             throw e;
         }
@@ -405,15 +407,11 @@ public class PCEPSessionImpl extends SimpleChannelInboundHandler<Message> implem
     }
 
     @Override
-    public final synchronized void channelInactive(final ChannelHandlerContext ctx) {
+    //similar to bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPSessionImpl.java
+    public final synchronized void channelInactive(final ChannelHandlerContext ctx) throws Exception {
         LOG.debug("Channel {} inactive.", ctx.channel());
         endOfInput();
-
-        try {
-            super.channelInactive(ctx);
-        } catch (final Exception e) {
-            throw new IllegalStateException("Failed to delegate channel inactive event on channel " + ctx.channel(), e);
-        }
+        super.channelInactive(ctx);
     }
 
     @Override
index a6cdeade712a9ffb7536c3ab8d3286ef65b55507..022e3f1ee46ff8c4e22e5f4b956f021ed4b8d873 100644 (file)
@@ -38,6 +38,8 @@ public class PCEPSessionNegotiator extends AbstractSessionNegotiator {
     }
 
     @Override
+    @SuppressWarnings("checkstyle:IllegalCatch")
+    //similar to bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/AbstractBGPSessionNegotiator.java
     protected void startNegotiation() throws ExecutionException {
         final Object lock = this;
 
index 72edcd73bed67e63550ad69d600d8d324f4f2dd7..ce5dd96852b28298adda651912b3840289263aeb 100644 (file)
@@ -26,6 +26,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.typ
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.PcerrMessage;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open.object.Open;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcep.error.object.ErrorObject;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 final class PCEPSessionState {
     private final Open localOpen;
@@ -55,15 +57,15 @@ final class PCEPSessionState {
     }
 
     Messages getMessages(final int unknownMessagesCount) {
-        this.errorsBuilder.setReceivedErrorMsgCount(this.receivedErrMsgCount);
-        this.errorsBuilder.setSentErrorMsgCount(this.sentErrMsgCount);
-        this.errorsBuilder.setLastReceivedError(this.lastReceivedErrorBuilder.build());
-        this.errorsBuilder.setLastSentError(this.lastSentErrorBuilder.build());
-        this.msgsBuilder.setLastSentMsgTimestamp(this.lastSentMsgTimestamp);
-        this.msgsBuilder.setReceivedMsgCount(this.receivedMsgCount);
-        this.msgsBuilder.setSentMsgCount(this.sentMsgCount);
-        this.msgsBuilder.setUnknownMsgReceived(unknownMessagesCount);
-        this.msgsBuilder.setErrorMessages(this.errorsBuilder.build());
+        this.errorsBuilder.setReceivedErrorMsgCount(Uint32.valueOf(this.receivedErrMsgCount))
+            .setSentErrorMsgCount(Uint32.valueOf(this.sentErrMsgCount))
+            .setLastReceivedError(this.lastReceivedErrorBuilder.build())
+            .setLastSentError(this.lastSentErrorBuilder.build());
+        this.msgsBuilder.setLastSentMsgTimestamp(Uint32.valueOf(this.lastSentMsgTimestamp))
+            .setReceivedMsgCount(Uint32.valueOf(this.receivedMsgCount))
+            .setSentMsgCount(Uint32.valueOf(this.sentMsgCount))
+            .setUnknownMsgReceived(Uint16.valueOf(unknownMessagesCount))
+            .setErrorMessages(this.errorsBuilder.build());
         return this.msgsBuilder.build();
     }
 
@@ -72,11 +74,11 @@ final class PCEPSessionState {
     }
 
     private static LocalPref getLocalPref(final Open open, final Channel channel) {
-        final LocalPrefBuilder peerBuilder = new LocalPrefBuilder();
-        peerBuilder.setDeadtimer(open.getDeadTimer());
-        peerBuilder.setKeepalive(open.getKeepalive());
-        peerBuilder.setIpAddress(((InetSocketAddress) channel.localAddress()).getAddress().getHostAddress());
-        peerBuilder.setSessionId(open.getSessionId().intValue());
+        final LocalPrefBuilder peerBuilder = new LocalPrefBuilder()
+                .setDeadtimer(open.getDeadTimer())
+                .setKeepalive(open.getKeepalive())
+                .setIpAddress(((InetSocketAddress) channel.localAddress()).getAddress().getHostAddress())
+                .setSessionId(Uint16.valueOf(open.getSessionId().intValue()));
         return peerBuilder.build();
     }
 
@@ -87,15 +89,13 @@ final class PCEPSessionState {
     void setLastSentError(final Message msg) {
         this.sentErrMsgCount++;
         final ErrorObject errObj = getErrorObject(msg);
-        this.lastSentErrorBuilder.setErrorType(errObj.getType());
-        this.lastSentErrorBuilder.setErrorValue(errObj.getValue());
+        this.lastSentErrorBuilder.setErrorType(errObj.getType()).setErrorValue(errObj.getValue());
     }
 
     void setLastReceivedError(final Message msg) {
         final ErrorObject errObj = getErrorObject(msg);
         this.receivedErrMsgCount++;
-        this.lastReceivedErrorBuilder.setErrorType(errObj.getType());
-        this.lastReceivedErrorBuilder.setErrorValue(errObj.getValue());
+        this.lastReceivedErrorBuilder.setErrorType(errObj.getType()).setErrorValue(errObj.getValue());
     }
 
     void updateLastReceivedMsg() {
@@ -116,10 +116,10 @@ final class PCEPSessionState {
 
     private static PeerPref getRemotePref(final Open open, final Channel channel) {
         final PeerPrefBuilder peerBuilder = new PeerPrefBuilder();
-        peerBuilder.setDeadtimer(open.getDeadTimer());
-        peerBuilder.setKeepalive(open.getKeepalive());
-        peerBuilder.setIpAddress(((InetSocketAddress) channel.remoteAddress()).getAddress().getHostAddress());
-        peerBuilder.setSessionId(open.getSessionId().intValue());
+        peerBuilder.setDeadtimer(open.getDeadTimer())
+            .setKeepalive(open.getKeepalive())
+            .setIpAddress(((InetSocketAddress) channel.remoteAddress()).getAddress().getHostAddress())
+            .setSessionId(Uint16.valueOf(open.getSessionId().intValue()));
         return peerBuilder.build();
     }
 
index 4b7619874e3ad60c9637f50c351f6114de66ee7f..ca2330208a7d154d49be2da0eb641fff1c5df971 100644 (file)
@@ -29,16 +29,17 @@ public final class Util {
         throw new UnsupportedOperationException();
     }
 
-    public static Message createErrorMessage(final PCEPErrors error, final Open t) {
+    public static Message createErrorMessage(final PCEPErrors error, final Open openObject) {
         final PcerrBuilder errMessageBuilder = new PcerrBuilder();
         final ErrorObject err =
             new ErrorObjectBuilder().setType(error.getErrorType()).setValue(error.getErrorValue()).build();
-        if (t == null) {
+        if (openObject == null) {
             return errMessageBuilder.setPcerrMessage(new PcerrMessageBuilder().setErrors(Collections.singletonList(
                 new ErrorsBuilder().setErrorObject(err).build())).build()).build();
         }
 
-        final ErrorType type = new SessionCaseBuilder().setSession(new SessionBuilder().setOpen(t).build()).build();
+        final ErrorType type =
+            new SessionCaseBuilder().setSession(new SessionBuilder().setOpen(openObject).build()).build();
         return errMessageBuilder.setPcerrMessage(
             new PcerrMessageBuilder()
                 .setErrors(Collections.singletonList(new ErrorsBuilder().setErrorObject(err).build()))
index 1681ec59b867c50bb4f923491eb8420cf2eabf0f..bd71f1f274d83e565e41bcea9ceae85af1bf8d14 100644 (file)
@@ -10,8 +10,11 @@ package org.opendaylight.protocol.pcep.impl.tls;
 import static java.util.Objects.requireNonNull;
 
 import java.io.IOException;
+import java.security.KeyManagementException;
 import java.security.KeyStore;
+import java.security.KeyStoreException;
 import java.security.NoSuchAlgorithmException;
+import java.security.UnrecoverableKeyException;
 import java.security.cert.CertificateException;
 import javax.net.ssl.KeyManagerFactory;
 import javax.net.ssl.SSLContext;
@@ -57,7 +60,7 @@ public class SslContextFactory {
             final SSLContext serverContext = SSLContext.getInstance(PROTOCOL);
             serverContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
             return serverContext;
-        } catch (final IOException e) {
+        } catch (final IOException | KeyStoreException e) {
             LOG.warn(
                 "IOException - Failed to load keystore / truststore. Failed to initialize the server-side SSLContext",
                 e);
@@ -65,8 +68,10 @@ public class SslContextFactory {
             LOG.warn(
                 "NoSuchAlgorithmException - Unsupported algorithm. Failed to initialize the server-side SSLContext", e);
         } catch (final CertificateException e) {
-            LOG.warn("CertificateException - Unable to access certificate (check password). Failed to initialize the server-side SSLContext", e);
-        } catch (final Exception e) {
+            LOG.warn(
+                "CertificateException - Unable to get a certificate (check password) to set the server-side SSLContext",
+                e);
+        } catch (final KeyManagementException | UnrecoverableKeyException | NullPointerException e) {
             LOG.warn("Exception - Failed to initialize the server-side SSLContext", e);
         }
         //TODO try to use default SSLContext instance?
index 0749d17766aef113881dfb381e7a1d3eeb941005..b3d2a67cb6b5ca614f7644764340e63c12ebcfe9 100644 (file)
@@ -82,14 +82,15 @@ public class AbstractPCEPSessionTest {
 
     protected SimpleSessionListener listener;
 
+    @SuppressWarnings("unchecked")
     @Before
     public final void setUp() {
         MockitoAnnotations.initMocks(this);
-        final ChannelFuture future = new DefaultChannelPromise(this.channel);
+        final ChannelFuture cfuture = new DefaultChannelPromise(this.channel);
         doAnswer(invocation -> {
             final Object[] args = invocation.getArguments();
             AbstractPCEPSessionTest.this.msgsSend.add((Notification) args[0]);
-            return future;
+            return cfuture;
         }).when(this.channel).writeAndFlush(any(Notification.class));
         doReturn(this.channelFuture).when(this.channel).closeFuture();
         doReturn(this.channelFuture).when(this.channelFuture).addListener(any(GenericFutureListener.class));
old mode 100755 (executable)
new mode 100644 (file)
index 8369fc6..a72396e
@@ -245,6 +245,7 @@ public class PCEPDispatcherImplTest {
             return p;
         }
 
+        @SuppressWarnings("checkstyle:EmptyBlock")
         private static void setChannelFactory(final Bootstrap bootstrap) {
             try {
                 bootstrap.channel(NioSocketChannel.class);
index b6009dc54749b338d4dc6ef226be43f209b08241..6efb76b25749c13d8c03296b1fa0f1beec64f111 100644 (file)
@@ -71,7 +71,8 @@ public class PCEPSessionImplTest extends AbstractPCEPSessionTest {
         Assert.assertTrue(this.msgsSend.get(0) instanceof Pcerr);
         final Pcerr pcErr = (Pcerr) this.msgsSend.get(0);
         final ErrorObject errorObj = pcErr.getPcerrMessage().getErrors().get(0).getErrorObject();
-        Assert.assertEquals(PCEPErrors.ATTEMPT_2ND_SESSION, PCEPErrors.forValue(errorObj.getType(), errorObj.getValue()));
+        Assert.assertEquals(
+            PCEPErrors.ATTEMPT_2ND_SESSION, PCEPErrors.forValue(errorObj.getType(), errorObj.getValue()));
     }
 
     @Test
@@ -162,6 +163,7 @@ public class PCEPSessionImplTest extends AbstractPCEPSessionTest {
     }
 
     @Test
+    @SuppressWarnings({"checkstyle:IllegalCatch","checkstyle:EmptyBlock"})
     public void testSessionRecoveryOnException() {
         this.listener = new SimpleExceptionSessionListener();
         this.session = Mockito.spy(new PCEPSessionImpl(this.listener, 0, this.channel,
index 3239ffc27d937c66a420b0033805576cca7ba320..eed8c4e84996107825030294e2f20366bc0d3b86 100644 (file)
@@ -473,15 +473,15 @@ public class PCEPValidatorTest {
                 new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcreq.message
                     .pcreq.message.RequestsBuilder();
         rBuilder1.setRp(this.rpTrue);
-        final P2pBuilder p2pBuilder = new P2pBuilder();
-        p2pBuilder.setEndpointsObj(this.endpoints);
-        p2pBuilder.setMetrics(Lists.newArrayList(this.metrics));
-        p2pBuilder.setIro(this.iro);
+        final P2pBuilder p2pBuilder = new P2pBuilder()
+                .setEndpointsObj(this.endpoints)
+                .setMetrics(Lists.newArrayList(this.metrics))
+                .setIro(this.iro);
         rBuilder1.setSegmentComputation(new SegmentComputationBuilder().setP2p(p2pBuilder.build()).build());
         reqs2.add(rBuilder1.build());
-        builder.setRequests(reqs2);
-        builder.setSvec(Lists.newArrayList(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep
-            .types.rev181109.pcreq.message.pcreq.message.SvecBuilder().setSvec(this.svec).build()));
+        builder.setRequests(reqs2)
+            .setSvec(Lists.newArrayList(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep
+                .types.rev181109.pcreq.message.pcreq.message.SvecBuilder().setSvec(this.svec).build()));
 
         assertEquals(new PcreqBuilder().setPcreqMessage(builder.build()).build(), parser.parseMessage(result.slice(4,
             result.readableBytes() - 4), Collections.emptyList()));
@@ -498,10 +498,10 @@ public class PCEPValidatorTest {
                 new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcreq.message
                     .pcreq.message.RequestsBuilder();
         rBuilder2.setRp(new RpBuilder(this.rpTrue).setP2mp(true).build());
-        final EndpointsObjBuilder epBuilder = new EndpointsObjBuilder();
-        epBuilder.setIgnore(false);
-        epBuilder.setProcessingRule(true);
-        epBuilder.setAddressFamily(new P2mpIpv4CaseBuilder()
+        final EndpointsObjBuilder epBuilder = new EndpointsObjBuilder()
+                .setIgnore(false)
+                .setProcessingRule(true)
+                .setAddressFamily(new P2mpIpv4CaseBuilder()
                 .setP2mpIpv4(new P2mpIpv4Builder()
                         .setP2mpLeaves(P2mpLeaves.NewLeavesToAdd)
                         .setSourceIpv4Address(new Ipv4AddressNoZone("255.255.255.255"))
@@ -565,8 +565,7 @@ public class PCEPValidatorTest {
             .build());
         rBuilder2.setSegmentComputation(new SegmentComputationBuilder().setP2mp(p2mpBuilder.build()).build());
         reqs3.add(rBuilder2.build());
-        builder.setRequests(reqs3);
-        builder.setSvec(null);
+        builder.setRequests(reqs3).setSvec(null);
 
         assertEquals(new PcreqBuilder().setPcreqMessage(builder.build()).build(), parser.parseMessage(result.slice(4,
                 result.readableBytes() - 4), Collections.emptyList()));
@@ -651,12 +650,12 @@ public class PCEPValidatorTest {
         repliesBuilder = new RepliesBuilder();
         repliesBuilder.setRp(this.rpTrue);
         final List<Paths> paths = new ArrayList<>();
-        final PathsBuilder paBuilder = new PathsBuilder();
-        paBuilder.setEro(this.ero);
-        paBuilder.setLspa(this.lspa);
-        paBuilder.setMetrics(Lists.newArrayList(this.metrics));
-        paBuilder.setIro(this.iro);
-        paBuilder.setOf(this.of);
+        final PathsBuilder paBuilder = new PathsBuilder()
+                .setEro(this.ero)
+                .setLspa(this.lspa)
+                .setMetrics(Lists.newArrayList(this.metrics))
+                .setIro(this.iro)
+                .setOf(this.of);
         paths.add(paBuilder.build());
         repliesBuilder.setResult(new SuccessCaseBuilder()
             .setSuccess(new SuccessBuilder().setPaths(paths).build()).build()).build();
@@ -833,9 +832,9 @@ public class PCEPValidatorTest {
         RepliesBuilder repliesBuilder = new RepliesBuilder();
         final ByteBuf result = Unpooled.wrappedBuffer(ByteArray.fileToBytes("src/test/resources/PCRep.6.bin"));
         final List<Replies> replies = new ArrayList<>();
-        repliesBuilder = new RepliesBuilder();
-        repliesBuilder.setRp(this.rpTrue);
-        repliesBuilder.setVendorInformationObject(this.viObjects);
+        repliesBuilder = new RepliesBuilder()
+                .setRp(this.rpTrue)
+                .setVendorInformationObject(this.viObjects);
         final List<Paths> paths = new ArrayList<>();
         final PathsBuilder paBuilder = new PathsBuilder();
         paBuilder.setEro(this.ero);
@@ -856,9 +855,9 @@ public class PCEPValidatorTest {
     public void testMonRepMsg() throws PCEPDeserializerException, IOException {
         final PCEPMonitoringReplyMessageParser parser = new PCEPMonitoringReplyMessageParser(this.objectRegistry);
         final PcmonrepMessageBuilder builder = new PcmonrepMessageBuilder();
-        builder.setMonitoring(this.monitoring);
-        builder.setMonitoringMetricsList(new GeneralMetricsListBuilder()
-            .setMetricPce(Lists.newArrayList(new MetricPceBuilder().setPceId(this.pceId).build())).build());
+        builder.setMonitoring(this.monitoring)
+                .setMonitoringMetricsList(new GeneralMetricsListBuilder()
+                .setMetricPce(Lists.newArrayList(new MetricPceBuilder().setPceId(this.pceId).build())).build());
 
         final byte[] msgBytes = {
             0x20, 0x09, 0x00, 0x18,
@@ -911,18 +910,18 @@ public class PCEPValidatorTest {
 
         final ByteBuf result = Unpooled.wrappedBuffer(ByteArray.fileToBytes("src/test/resources/PCRepMon.5.bin"));
         final List<Replies> replies4 = new ArrayList<>();
-        repliesBuilder = new RepliesBuilder();
-        repliesBuilder.setRp(this.rpTrue);
-        repliesBuilder.setMonitoring(this.monitoring);
-        repliesBuilder.setPccIdReq(this.pccIdReq);
-        repliesBuilder.setMetricPce(Lists.newArrayList(new MetricPceBuilder().setPceId(this.pceId).build()));
+        repliesBuilder = new RepliesBuilder()
+                .setRp(this.rpTrue)
+                .setMonitoring(this.monitoring)
+                .setPccIdReq(this.pccIdReq)
+                .setMetricPce(Lists.newArrayList(new MetricPceBuilder().setPceId(this.pceId).build()));
         final List<Paths> paths = new ArrayList<>();
-        final PathsBuilder paBuilder = new PathsBuilder();
-        paBuilder.setEro(this.ero);
-        paBuilder.setLspa(this.lspa);
-        paBuilder.setMetrics(Lists.newArrayList(this.metrics));
-        paBuilder.setIro(this.iro);
-        paBuilder.setOf(this.of);
+        final PathsBuilder paBuilder = new PathsBuilder()
+                .setEro(this.ero)
+                .setLspa(this.lspa)
+                .setMetrics(Lists.newArrayList(this.metrics))
+                .setIro(this.iro)
+                .setOf(this.of);
         paths.add(paBuilder.build());
         repliesBuilder.setResult(new SuccessCaseBuilder().setSuccess(new SuccessBuilder().setPaths(paths).build())
             .build()).build();
@@ -949,16 +948,15 @@ public class PCEPValidatorTest {
             .message.RequestsBuilder rBuilder =
                 new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcreq.message
                     .pcreq.message.RequestsBuilder();
-        rBuilder.setRp(this.rpTrue);
-        rBuilder.setSegmentComputation(new SegmentComputationBuilder().setP2p(new P2pBuilder()
-            .setEndpointsObj(this.endpoints).build()).build());
+        rBuilder.setRp(this.rpTrue)
+                .setSegmentComputation(new SegmentComputationBuilder().setP2p(new P2pBuilder()
+                .setEndpointsObj(this.endpoints).build()).build());
         reqs1.add(rBuilder.build());
-        final MonitoringRequestBuilder monReqBuilder = new MonitoringRequestBuilder();
-        monReqBuilder.setMonitoring(this.monitoring);
-        monReqBuilder.setPccIdReq(this.pccIdReq);
-        monReqBuilder.setPceIdList(Lists.newArrayList(new PceIdListBuilder().setPceId(this.pceId).build()));
-        builder.setMonitoringRequest(monReqBuilder.build());
-        builder.setRequests(reqs1);
+        final MonitoringRequestBuilder monReqBuilder = new MonitoringRequestBuilder()
+                .setMonitoring(this.monitoring)
+                .setPccIdReq(this.pccIdReq)
+                .setPceIdList(Lists.newArrayList(new PceIdListBuilder().setPceId(this.pceId).build()));
+        builder.setMonitoringRequest(monReqBuilder.build()).setRequests(reqs1);
 
         assertEquals(new PcreqBuilder().setPcreqMessage(builder.build()).build(), parser.parseMessage(result.slice(4,
                 result.readableBytes() - 4), Collections.emptyList()));
@@ -973,9 +971,9 @@ public class PCEPValidatorTest {
         final PCEPMonitoringRequestMessageParser parser = new PCEPMonitoringRequestMessageParser(this.objectRegistry);
 
         final PcreqMessageBuilder builder = new PcreqMessageBuilder();
-        final MonitoringRequestBuilder monReqBuilder = new MonitoringRequestBuilder();
-        monReqBuilder.setMonitoring(this.monitoring);
-        monReqBuilder.setPceIdList(Lists.newArrayList(new PceIdListBuilder().setPceId(this.pceId).build()));
+        final MonitoringRequestBuilder monReqBuilder = new MonitoringRequestBuilder()
+                .setMonitoring(this.monitoring)
+                .setPceIdList(Lists.newArrayList(new PceIdListBuilder().setPceId(this.pceId).build()));
         builder.setMonitoringRequest(monReqBuilder.build());
         final byte[] msgBytes = {
             0x20, 0x08, 0x00, 0x18,
@@ -999,17 +997,16 @@ public class PCEPValidatorTest {
                 new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcreq.message
                     .pcreq.message.RequestsBuilder();
         rBuilder1.setRp(this.rpTrue);
-        final P2pBuilder p2pBuilder = new P2pBuilder();
-        p2pBuilder.setEndpointsObj(this.endpoints);
-        p2pBuilder.setMetrics(Lists.newArrayList(this.metrics));
-        p2pBuilder.setIro(this.iro);
+        final P2pBuilder p2pBuilder = new P2pBuilder()
+                .setEndpointsObj(this.endpoints)
+                .setMetrics(Lists.newArrayList(this.metrics))
+                .setIro(this.iro);
         rBuilder1.setSegmentComputation(new SegmentComputationBuilder().setP2p(p2pBuilder.build()).build());
         reqs2.add(rBuilder1.build());
-        builder.setRequests(reqs2);
-        builder.setSvec(Lists.newArrayList(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep
-            .types.rev181109.pcreq.message.pcreq.message.SvecBuilder().setSvec(this.svec).build()));
-        monReqBuilder.setMonitoring(this.monitoring);
-        monReqBuilder.setPccIdReq(this.pccIdReq);
+        builder.setRequests(reqs2)
+                .setSvec(Lists.newArrayList(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep
+                    .types.rev181109.pcreq.message.pcreq.message.SvecBuilder().setSvec(this.svec).build()));
+        monReqBuilder.setMonitoring(this.monitoring).setPccIdReq(this.pccIdReq);
         final PceIdList pceIdList = new PceIdListBuilder().setPceId(this.pceId).build();
         monReqBuilder.setPceIdList(Lists.newArrayList(pceIdList, pceIdList));
         builder.setMonitoringRequest(monReqBuilder.build());
@@ -1040,10 +1037,10 @@ public class PCEPValidatorTest {
         repliesBuilder = new RepliesBuilder();
         repliesBuilder.setRp(this.rpTrue);
         final List<Paths> paths = new ArrayList<>();
-        final PathsBuilder paBuilder1 = new PathsBuilder();
-        paBuilder1.setEro(this.ero);
-        paBuilder1.setBandwidth(bwBuilder.build());
-        paBuilder1.setMetrics(Lists.newArrayList(this.metrics));
+        final PathsBuilder paBuilder1 = new PathsBuilder()
+                .setEro(this.ero)
+                .setBandwidth(bwBuilder.build())
+                .setMetrics(Lists.newArrayList(this.metrics));
         paths.add(paBuilder1.build());
         final PathsBuilder paBuilder2 = new PathsBuilder();
         paBuilder2.setEro(this.ero);
similarity index 93%
rename from pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPEROSubobjectParserTest.java
rename to pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PcepEROSubobjectParserTest.java
index 0ce2bf7dd93174a6334ec861a80cbe9bb6f933ba..b93ae3effb9aec17e33c9937da0021b7900f20bd 100644 (file)
@@ -53,7 +53,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev
 import org.opendaylight.yangtools.yang.common.Uint16;
 import org.opendaylight.yangtools.yang.common.Uint32;
 
-public class PCEPEROSubobjectParserTest {
+public class PcepEROSubobjectParserTest {
     private static final byte[] IP4_PREFIX_BYTES = {
         (byte) 0x81, (byte) 0x08, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0x16, (byte) 0x00
     };
@@ -95,10 +95,11 @@ public class PCEPEROSubobjectParserTest {
     @Test
     public void testEROIp4PrefixSubobject() throws PCEPDeserializerException {
         final EROIpv4PrefixSubobjectParser parser = new EROIpv4PrefixSubobjectParser();
-        final SubobjectBuilder subs = new SubobjectBuilder();
-        subs.setLoose(true);
-        subs.setSubobjectType(new IpPrefixCaseBuilder().setIpPrefix(
-                new IpPrefixBuilder().setIpPrefix(new IpPrefix(new Ipv4Prefix("255.255.255.255/22"))).build()).build());
+        final SubobjectBuilder subs = new SubobjectBuilder()
+                .setLoose(true)
+                .setSubobjectType(new IpPrefixCaseBuilder().setIpPrefix(
+                    new IpPrefixBuilder().setIpPrefix(new IpPrefix(new Ipv4Prefix("255.255.255.255/22"))).build())
+                    .build());
         assertEquals(subs.build(),
             parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(IP4_PREFIX_BYTES, 2)), true));
         final ByteBuf buff = Unpooled.buffer();
@@ -215,11 +216,10 @@ public class PCEPEROSubobjectParserTest {
     @Test
     public void testEROPathKey32Subobject() throws PCEPDeserializerException {
         final EROPathKey32SubobjectParser parser = new EROPathKey32SubobjectParser();
-        final SubobjectBuilder subs = new SubobjectBuilder();
-        subs.setLoose(true);
-        final PathKeyBuilder pBuilder = new PathKeyBuilder();
-        pBuilder.setPceId(new PceId(new byte[] { (byte) 0x12, (byte) 0x34, (byte) 0x50, (byte) 0x00 }));
-        pBuilder.setPathKey(new PathKey(Uint16.valueOf(4660)));
+        final SubobjectBuilder subs = new SubobjectBuilder().setLoose(true);
+        final PathKeyBuilder pBuilder = new PathKeyBuilder()
+                .setPceId(new PceId(new byte[] { (byte) 0x12, (byte) 0x34, (byte) 0x50, (byte) 0x00 }))
+                .setPathKey(new PathKey(Uint16.valueOf(4660)));
         subs.setSubobjectType(new PathKeyCaseBuilder().setPathKey(pBuilder.build()).build());
         assertEquals(subs.build(),
             parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(PATH_KEY32_BYTES, 2)), true));
@@ -244,15 +244,14 @@ public class PCEPEROSubobjectParserTest {
     @Test
     public void testEROPathKey128Subobject() throws PCEPDeserializerException {
         final EROPathKey128SubobjectParser parser = new EROPathKey128SubobjectParser();
-        final SubobjectBuilder subs = new SubobjectBuilder();
-        subs.setLoose(true);
-        final PathKeyBuilder pBuilder = new PathKeyBuilder();
-        pBuilder.setPceId(new PceId(new byte[] {
-            (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78, (byte) 0x9A, (byte) 0xBC, (byte) 0xDE,
-            (byte) 0x12, (byte) 0x34, (byte) 0x54, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
-            (byte) 0x00, (byte) 0x00
-        }));
-        pBuilder.setPathKey(new PathKey(Uint16.valueOf(4660)));
+        final SubobjectBuilder subs = new SubobjectBuilder().setLoose(true);
+        final PathKeyBuilder pBuilder = new PathKeyBuilder()
+                .setPceId(new PceId(new byte[] {
+                    (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78, (byte) 0x9A, (byte) 0xBC, (byte) 0xDE,
+                    (byte) 0x12, (byte) 0x34, (byte) 0x54, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+                    (byte) 0x00, (byte) 0x00
+                }))
+                .setPathKey(new PathKey(Uint16.valueOf(4660)));
         subs.setSubobjectType(new PathKeyCaseBuilder().setPathKey(pBuilder.build()).build());
         assertEquals(subs.build(),
             parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(PATH_KEY128_BYTES, 2)), true));
@@ -311,7 +310,7 @@ public class PCEPEROSubobjectParserTest {
     }
 
     @Test
-    public void testEROEXRSSubobject() throws Exception {
+    public void testERO_EXRSSubobject() throws Exception {
         final EROExplicitExclusionRouteSubobjectParser parser = new EROExplicitExclusionRouteSubobjectParser(
             this.ctx.getXROSubobjectHandlerRegistry());
         final List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.explicit.route
similarity index 83%
rename from pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPRROSubobjectParserTest.java
rename to pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PcepRROSubobjectParserTest.java
index 15e2673d4324994b69cffdbd457c0488f880c843..d1941d9c1d969e7502d08e74903226b4a835f931 100644 (file)
@@ -43,7 +43,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev
 import org.opendaylight.yangtools.yang.common.Uint16;
 import org.opendaylight.yangtools.yang.common.Uint32;
 
-public class PCEPRROSubobjectParserTest {
+public class PcepRROSubobjectParserTest {
 
     private static final byte[] IP4_PREFIX_BYTES = {
         (byte) 0x01, (byte) 0x08, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0x16, (byte) 0x01
@@ -70,11 +70,12 @@ public class PCEPRROSubobjectParserTest {
     @Test
     public void testRROIp4PrefixSubobject() throws PCEPDeserializerException {
         final RROIpv4PrefixSubobjectParser parser = new RROIpv4PrefixSubobjectParser();
-        final SubobjectBuilder subs = new SubobjectBuilder();
-        subs.setProtectionAvailable(true);
-        subs.setProtectionInUse(false);
-        subs.setSubobjectType(new IpPrefixCaseBuilder().setIpPrefix(
-                new IpPrefixBuilder().setIpPrefix(new IpPrefix(new Ipv4Prefix("255.255.255.255/22"))).build()).build());
+        final SubobjectBuilder subs = new SubobjectBuilder()
+                .setProtectionAvailable(true)
+                .setProtectionInUse(false)
+                .setSubobjectType(new IpPrefixCaseBuilder().setIpPrefix(
+                    new IpPrefixBuilder().setIpPrefix(new IpPrefix(new Ipv4Prefix("255.255.255.255/22"))).build())
+                    .build());
         assertEquals(
             subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(IP4_PREFIX_BYTES, 2))));
         final ByteBuf buff = Unpooled.buffer();
@@ -98,15 +99,17 @@ public class PCEPRROSubobjectParserTest {
     @Test
     public void testRROIp6PrefixSubobject() throws PCEPDeserializerException {
         final RROIpv6PrefixSubobjectParser parser = new RROIpv6PrefixSubobjectParser();
-        final SubobjectBuilder subs = new SubobjectBuilder();
-        subs.setProtectionAvailable(false);
-        subs.setProtectionInUse(true);
-        subs.setSubobjectType(new IpPrefixCaseBuilder().setIpPrefix(
-            new IpPrefixBuilder().setIpPrefix(new IpPrefix(Ipv6Util.prefixForBytes(new byte[] {
-                (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
-                (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF
-            },
-            22))).build()).build());
+        final SubobjectBuilder subs = new SubobjectBuilder()
+                .setProtectionAvailable(false)
+                .setProtectionInUse(true)
+                .setSubobjectType(new IpPrefixCaseBuilder().setIpPrefix(
+                    new IpPrefixBuilder().setIpPrefix(new IpPrefix(Ipv6Util.prefixForBytes(new byte[] {
+                        (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+                        (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+                        (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+                        (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF
+                    },
+                    22))).build()).build());
         assertEquals(
             subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(IP6_PREFIX_BYTES, 2))));
         final ByteBuf buff = Unpooled.buffer();
@@ -162,9 +165,9 @@ public class PCEPRROSubobjectParserTest {
     public void testRROPathKey32Subobject() throws PCEPDeserializerException {
         final RROPathKey32SubobjectParser parser = new RROPathKey32SubobjectParser();
         final SubobjectBuilder subs = new SubobjectBuilder();
-        final PathKeyBuilder pBuilder = new PathKeyBuilder();
-        pBuilder.setPceId(new PceId(new byte[] { (byte) 0x12, (byte) 0x34, (byte) 0x50, (byte) 0x00 }));
-        pBuilder.setPathKey(new PathKey(Uint16.valueOf(4660)));
+        final PathKeyBuilder pBuilder = new PathKeyBuilder()
+                .setPceId(new PceId(new byte[] { (byte) 0x12, (byte) 0x34, (byte) 0x50, (byte) 0x00 }))
+                .setPathKey(new PathKey(Uint16.valueOf(4660)));
         subs.setSubobjectType(new PathKeyCaseBuilder().setPathKey(pBuilder.build()).build());
         assertEquals(
             subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(PATH_KEY32_BYTES, 2))));
@@ -190,12 +193,14 @@ public class PCEPRROSubobjectParserTest {
     public void testRROPathKey128Subobject() throws PCEPDeserializerException {
         final RROPathKey128SubobjectParser parser = new RROPathKey128SubobjectParser();
         final SubobjectBuilder subs = new SubobjectBuilder();
-        final PathKeyBuilder pBuilder = new PathKeyBuilder();
-        pBuilder.setPceId(new PceId(new byte[] {
-            (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78, (byte) 0x9A, (byte) 0xBC, (byte) 0xDE, (byte) 0x12,
-            (byte) 0x34, (byte) 0x54, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00
-        }));
-        pBuilder.setPathKey(new PathKey(Uint16.valueOf(4660)));
+        final PathKeyBuilder pBuilder = new PathKeyBuilder()
+                .setPceId(new PceId(new byte[] {
+                    (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78,
+                    (byte) 0x9A, (byte) 0xBC, (byte) 0xDE, (byte) 0x12,
+                    (byte) 0x34, (byte) 0x54, (byte) 0x00, (byte) 0x00,
+                    (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00
+                }))
+                .setPathKey(new PathKey(Uint16.valueOf(4660)));
         subs.setSubobjectType(new PathKeyCaseBuilder().setPathKey(pBuilder.build()).build());
         assertEquals(
             subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(PATH_KEY128_BYTES, 2))));
@@ -223,13 +228,13 @@ public class PCEPRROSubobjectParserTest {
         try (BaseParserExtensionActivator a = new BaseParserExtensionActivator()) {
             a.start(ctx);
             final RROLabelSubobjectParser parser = new RROLabelSubobjectParser(ctx.getLabelHandlerRegistry());
-            final SubobjectBuilder subs = new SubobjectBuilder();
-            subs.setSubobjectType(new LabelCaseBuilder().setLabel(
-                new LabelBuilder().setUniDirectional(true).setGlobal(false).setLabelType(
-                    new GeneralizedLabelCaseBuilder().setGeneralizedLabel(
-                       new GeneralizedLabelBuilder().setGeneralizedLabel(
-                            new byte[] { (byte) 0x12, (byte) 0x00, (byte) 0x25, (byte) 0xFF })
-                       .build()).build()).build()).build());
+            final SubobjectBuilder subs = new SubobjectBuilder()
+                    .setSubobjectType(new LabelCaseBuilder().setLabel(
+                        new LabelBuilder().setUniDirectional(true).setGlobal(false).setLabelType(
+                        new GeneralizedLabelCaseBuilder().setGeneralizedLabel(
+                            new GeneralizedLabelBuilder().setGeneralizedLabel(
+                                new byte[] { (byte) 0x12, (byte) 0x00, (byte) 0x25, (byte) 0xFF })
+                            .build()).build()).build()).build());
             assertEquals(
                 subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(LABEL_BYTES, 2))));
             final ByteBuf buff = Unpooled.buffer();
similarity index 97%
rename from pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPXROSubobjectParserTest.java
rename to pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PcepXROSubobjectParserTest.java
index 4ff958db3311843932cbcf17f7d2d2168a5c7884..782ae5fad46e7e9d74fc35953135628b42b88880 100644 (file)
@@ -45,7 +45,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev
 import org.opendaylight.yangtools.yang.common.Uint16;
 import org.opendaylight.yangtools.yang.common.Uint32;
 
-public class PCEPXROSubobjectParserTest {
+public class PcepXROSubobjectParserTest {
 
     private static final byte[] IP4_PREFIX_BYTES = {
         (byte) 0x01, (byte) 0x08, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0x16, (byte) 0x00
@@ -75,11 +75,12 @@ public class PCEPXROSubobjectParserTest {
     @Test
     public void testXROIp4PrefixSubobject() throws PCEPDeserializerException {
         final XROIpv4PrefixSubobjectParser parser = new XROIpv4PrefixSubobjectParser();
-        final SubobjectBuilder subs = new SubobjectBuilder();
-        subs.setMandatory(false);
-        subs.setAttribute(Attribute.Interface);
-        subs.setSubobjectType(new IpPrefixCaseBuilder().setIpPrefix(
-            new IpPrefixBuilder().setIpPrefix(new IpPrefix(new Ipv4Prefix("255.255.255.255/22"))).build()).build());
+        final SubobjectBuilder subs = new SubobjectBuilder()
+                .setMandatory(false)
+                .setAttribute(Attribute.Interface)
+                .setSubobjectType(new IpPrefixCaseBuilder().setIpPrefix(
+                    new IpPrefixBuilder().setIpPrefix(new IpPrefix(new Ipv4Prefix("255.255.255.255/22"))).build())
+                    .build());
         assertEquals(subs.build(), parser.parseSubobject(
             Unpooled.wrappedBuffer(ByteArray.cutBytes(IP4_PREFIX_BYTES, 2)), false));
         final ByteBuf buff = Unpooled.buffer();
index 8475f45d896c10aee5409f3bacf1cb68f43a8bef..a64b42e2d7979b10d696302a6120fa2df13b37a9 100644 (file)
@@ -49,6 +49,7 @@ public class UtilTest {
     }
 
     @Test(expected = UnsupportedOperationException.class)
+    @SuppressWarnings({"checkstyle:IllegalThrows","checkstyle:AvoidHidingCauseException"})
     public void testPrivateConstructor() throws Throwable {
         final Constructor<Util> c = Util.class.getDeclaredConstructor();
         c.setAccessible(true);