Enforce check-style under rsvp spi tests 78/61578/2
authorClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Sun, 13 Aug 2017 20:54:08 +0000 (22:54 +0200)
committerClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Sun, 20 Aug 2017 17:57:23 +0000 (17:57 +0000)
Change-Id: If52a4ab3a18c3618009127cd14ac7f3fa53a09dd
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
12 files changed:
rsvp/spi/src/test/java/org/opendaylight/protocol/rsvp/parser/spi/EROSubobjectUtilTest.java
rsvp/spi/src/test/java/org/opendaylight/protocol/rsvp/parser/spi/pojo/ServiceLoaderRSVPExtensionProviderContextTest.java
rsvp/spi/src/test/java/org/opendaylight/protocol/rsvp/parser/spi/pojo/SimpleEROSubobjectRegistryTest.java
rsvp/spi/src/test/java/org/opendaylight/protocol/rsvp/parser/spi/pojo/SimpleLabelRegistryTest.java
rsvp/spi/src/test/java/org/opendaylight/protocol/rsvp/parser/spi/pojo/SimpleRROSubobjectRegistryTest.java
rsvp/spi/src/test/java/org/opendaylight/protocol/rsvp/parser/spi/pojo/SimpleRSVPObjectRegistryTest.java
rsvp/spi/src/test/java/org/opendaylight/protocol/rsvp/parser/spi/pojo/SimpleXROSubobjectRegistryTest.java
rsvp/spi/src/test/java/org/opendaylight/protocol/rsvp/parser/spi/subobjects/CUISubobjectParserTest.java
rsvp/spi/src/test/java/org/opendaylight/protocol/rsvp/parser/spi/subobjects/CommonPathKeyParserTest.java
rsvp/spi/src/test/java/org/opendaylight/protocol/rsvp/parser/spi/subobjects/EROSubobjectListParserTest.java
rsvp/spi/src/test/java/org/opendaylight/protocol/rsvp/parser/spi/subobjects/RROSubobjectListParserTest.java
rsvp/spi/src/test/java/org/opendaylight/protocol/rsvp/parser/spi/subobjects/XROSubobjectListParserTest.java

index 391d1ac965d44b8fd97b0788eedad58f10754823..746a971a5f6efafdafebd7118cdde4e3c4ee2a89 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.protocol.rsvp.parser.spi;
 
 import static org.junit.Assert.assertArrayEquals;
+
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.lang.reflect.Constructor;
@@ -16,7 +17,8 @@ import org.junit.Test;
 
 public class EROSubobjectUtilTest {
 
-    @Test(expected=UnsupportedOperationException.class)
+    @Test(expected = UnsupportedOperationException.class)
+    @SuppressWarnings({"checkstyle:IllegalCatch", "checkstyle:IllegalThrows"})
     public void testPrivateConstructor() throws Throwable {
         final Constructor<EROSubobjectUtil> c = EROSubobjectUtil.class.getDeclaredConstructor();
         c.setAccessible(true);
@@ -29,8 +31,8 @@ public class EROSubobjectUtilTest {
 
     @Test
     public void testFormatSubobject1() {
-        final byte[] array = new byte[] {2, 3};
-        final byte[] expected = new byte[] {(byte)0x81, 4, 2, 3};
+        final byte[] array = new byte[]{2, 3};
+        final byte[] expected = new byte[]{(byte) 0x81, 4, 2, 3};
         final ByteBuf body = Unpooled.copiedBuffer(array);
         final ByteBuf aggregator = Unpooled.buffer(4);
         EROSubobjectUtil.formatSubobject(1, Boolean.TRUE, body, aggregator);
@@ -39,8 +41,8 @@ public class EROSubobjectUtilTest {
 
     @Test
     public void testFormatSubobject2() {
-        final byte[] array = new byte[] {2, 3};
-        final byte[] expected = new byte[] {1, 4, 2, 3};
+        final byte[] array = new byte[]{2, 3};
+        final byte[] expected = new byte[]{1, 4, 2, 3};
         final ByteBuf body = Unpooled.copiedBuffer(array);
         final ByteBuf aggregator = Unpooled.buffer(4);
         EROSubobjectUtil.formatSubobject(1, Boolean.FALSE, body, aggregator);
@@ -49,8 +51,8 @@ public class EROSubobjectUtilTest {
 
     @Test
     public void testFormatSubobject3() {
-        final byte[] array = new byte[] {2, 3};
-        final byte[] expected = new byte[] {1, 4, 2, 3};
+        final byte[] array = new byte[]{2, 3};
+        final byte[] expected = new byte[]{1, 4, 2, 3};
         final ByteBuf body = Unpooled.copiedBuffer(array);
         final ByteBuf aggregator = Unpooled.buffer(4);
         EROSubobjectUtil.formatSubobject(1, null, body, aggregator);
index 75633fe1b3f81ea3635a895cebda693dc5b166a3..5446932329b4ffe1e3be889a9951012b9bca620a 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.protocol.rsvp.parser.spi.pojo;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
+
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.lang.reflect.Constructor;
@@ -35,7 +36,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev
 
 public class ServiceLoaderRSVPExtensionProviderContextTest {
 
-    private final SimpleRSVPExtensionProviderContext context = (SimpleRSVPExtensionProviderContext) ServiceLoaderRSVPExtensionProviderContext.getSingletonInstance();
+    private final SimpleRSVPExtensionProviderContext context = (SimpleRSVPExtensionProviderContext)
+        ServiceLoaderRSVPExtensionProviderContext.getSingletonInstance();
 
     private final RSVPTeObjectParser rsvpTeParser = Mockito.mock(RSVPTeObjectParser.class);
     private final RSVPTeObjectSerializer rsvpTeSerializer = Mockito.mock(RSVPTeObjectSerializer.class);
@@ -48,12 +50,18 @@ public class ServiceLoaderRSVPExtensionProviderContextTest {
 
     private final RROSubobjectParser rroParser = Mockito.mock(RROSubobjectParser.class);
     private final RROSubobjectSerializer rroSerializer = Mockito.mock(RROSubobjectSerializer.class);
-    private final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.record.route.subobjects.list.SubobjectContainer rroSubObj = Mockito.mock(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.record.route.subobjects.list.SubobjectContainer.class);
-    private final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.record.route.subobjects.SubobjectType rroSubObjType = Mockito.mock(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.record.route.subobjects.SubobjectType.class);
+    private final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.record.route
+        .subobjects.list.SubobjectContainer rroSubObj = Mockito.mock(org.opendaylight.yang.gen.v1.urn.opendaylight
+        .params.xml.ns.yang.rsvp.rev150820.record.route.subobjects.list.SubobjectContainer.class);
+    private final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.record.route
+        .subobjects.SubobjectType rroSubObjType = Mockito.mock(org.opendaylight.yang.gen.v1.urn.opendaylight.params
+        .xml.ns.yang.rsvp.rev150820.record.route.subobjects.SubobjectType.class);
 
     private final EROSubobjectParser eroParser = Mockito.mock(EROSubobjectParser.class);
     private final EROSubobjectSerializer eroSerializer = Mockito.mock(EROSubobjectSerializer.class);
-    private final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.explicit.route.subobjects.list.SubobjectContainer eroSubObj = Mockito.mock(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.explicit.route.subobjects.list.SubobjectContainer.class);
+    private final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.explicit.route
+        .subobjects.list.SubobjectContainer eroSubObj = Mockito.mock(org.opendaylight.yang.gen.v1.urn.opendaylight
+        .params.xml.ns.yang.rsvp.rev150820.explicit.route.subobjects.list.SubobjectContainer.class);
 
     private final LabelParser labelParser = Mockito.mock(LabelParser.class);
     private final LabelSerializer labelSerializer = Mockito.mock(LabelSerializer.class);
@@ -64,30 +72,40 @@ public class ServiceLoaderRSVPExtensionProviderContextTest {
         Mockito.doReturn(this.parsedRsvpTeObj).when(this.rsvpTeParser).parseObject(Mockito.any(ByteBuf.class));
         Mockito.doReturn(RsvpTeObject.class).when(this.parsedRsvpTeObj).getImplementedInterface();
         Mockito.doReturn("parsedRsvpTeObj").when(this.parsedRsvpTeObj).toString();
-        Mockito.doNothing().when(this.rsvpTeSerializer).serializeObject(Mockito.any(RsvpTeObject.class), Mockito.any(ByteBuf.class));
+        Mockito.doNothing().when(this.rsvpTeSerializer).serializeObject(Mockito.any(RsvpTeObject.class),
+            Mockito.any(ByteBuf.class));
 
-        Mockito.doReturn(this.subObj).when(this.xroObjParser).parseSubobject(Mockito.any(ByteBuf.class), Mockito.any(Boolean.class));
+        Mockito.doReturn(this.subObj).when(this.xroObjParser).parseSubobject(Mockito.any(ByteBuf.class),
+            Mockito.any(Boolean.class));
         Mockito.doReturn(this.subObjType).when(this.subObj).getSubobjectType();
         Mockito.doReturn("SubobjectContainer").when(this.subObj).toString();
         Mockito.doReturn(SubobjectType.class).when(this.subObjType).getImplementedInterface();
-        Mockito.doNothing().when(this.xroObjSerializer).serializeSubobject(Mockito.any(SubobjectContainer.class), Mockito.any(ByteBuf.class));
+        Mockito.doNothing().when(this.xroObjSerializer).serializeSubobject(Mockito.any(SubobjectContainer.class),
+            Mockito.any(ByteBuf.class));
 
         Mockito.doReturn(this.rroSubObj).when(this.rroParser).parseSubobject(Mockito.any(ByteBuf.class));
         Mockito.doReturn(this.rroSubObjType).when(this.rroSubObj).getSubobjectType();
         Mockito.doReturn("SubobjectContainer").when(this.rroSubObj).toString();
-        Mockito.doReturn(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.record.route.subobjects.SubobjectType.class).when(this.rroSubObjType).getImplementedInterface();
-        Mockito.doNothing().when(this.rroSerializer).serializeSubobject(Mockito.any(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.record.route.subobjects.list.SubobjectContainer.class), Mockito.any(ByteBuf.class));
-
-        Mockito.doReturn(this.eroSubObj).when(this.eroParser).parseSubobject(Mockito.any(ByteBuf.class), Mockito.any(Boolean.class));
+        Mockito.doReturn(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.record.route
+            .subobjects.SubobjectType.class).when(this.rroSubObjType).getImplementedInterface();
+        Mockito.doNothing().when(this.rroSerializer).serializeSubobject(Mockito.any(org.opendaylight.yang.gen.v1.urn
+                .opendaylight.params.xml.ns.yang.rsvp.rev150820.record.route.subobjects.list.SubobjectContainer.class),
+            Mockito.any(ByteBuf.class));
+
+        Mockito.doReturn(this.eroSubObj).when(this.eroParser).parseSubobject(Mockito.any(ByteBuf.class),
+            Mockito.any(Boolean.class));
         Mockito.doReturn(this.subObjType).when(this.eroSubObj).getSubobjectType();
         Mockito.doReturn("EROSubobjectContainer").when(this.eroSubObj).toString();
         Mockito.doReturn(SubobjectType.class).when(this.subObjType).getImplementedInterface();
-        Mockito.doNothing().when(this.eroSerializer).serializeSubobject(Mockito.any(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.explicit.route.subobjects.list.SubobjectContainer.class), Mockito.any(ByteBuf.class));
+        Mockito.doNothing().when(this.eroSerializer).serializeSubobject(Mockito.any(org.opendaylight.yang.gen.v1.urn
+            .opendaylight.params.xml.ns.yang.rsvp.rev150820.explicit.route.subobjects.list.SubobjectContainer.class),
+            Mockito.any(ByteBuf.class));
 
         Mockito.doReturn(this.labelType).when(this.labelParser).parseLabel(Mockito.any(ByteBuf.class));
         Mockito.doReturn(LabelType.class).when(this.labelType).getImplementedInterface();
         Mockito.doReturn("LabelType").when(this.labelType).toString();
-        Mockito.doNothing().when(this.labelSerializer).serializeLabel(Mockito.anyBoolean(), Mockito.anyBoolean(), Mockito.any(LabelType.class), Mockito.any(ByteBuf.class));
+        Mockito.doNothing().when(this.labelSerializer).serializeLabel(Mockito.anyBoolean(), Mockito.anyBoolean(),
+            Mockito.any(LabelType.class), Mockito.any(ByteBuf.class));
     }
 
     @Test
@@ -102,7 +120,8 @@ public class ServiceLoaderRSVPExtensionProviderContextTest {
         assertEquals(this.parsedRsvpTeObj, this.context.getRsvpRegistry().parseRSPVTe(1, 1, buffer));
         this.context.registerRsvpObjectSerializer(RsvpTeObject.class, this.rsvpTeSerializer);
         this.context.getRsvpRegistry().serializeRSPVTe(this.parsedRsvpTeObj, buffer);
-        Mockito.verify(this.rsvpTeSerializer).serializeObject(Mockito.any(RsvpTeObject.class), Mockito.any(ByteBuf.class));
+        Mockito.verify(this.rsvpTeSerializer).serializeObject(Mockito.any(RsvpTeObject.class),
+            Mockito.any(ByteBuf.class));
     }
 
     @Test
@@ -120,7 +139,8 @@ public class ServiceLoaderRSVPExtensionProviderContextTest {
         this.context.registerRROSubobjectParser(3, this.rroParser);
         final ByteBuf buffer = Unpooled.buffer();
         assertEquals(this.rroSubObj, this.context.getRROSubobjectHandlerRegistry().parseSubobject(3, buffer));
-        this.context.registerRROSubobjectSerializer(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.record.route.subobjects.SubobjectType.class, this.rroSerializer);
+        this.context.registerRROSubobjectSerializer(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
+            .rsvp.rev150820.record.route.subobjects.SubobjectType.class, this.rroSerializer);
         this.context.getRROSubobjectHandlerRegistry().serializeSubobject(this.rroSubObj, buffer);
         Mockito.verify(this.rroSerializer).serializeSubobject(this.rroSubObj, buffer);
     }
@@ -130,7 +150,8 @@ public class ServiceLoaderRSVPExtensionProviderContextTest {
         this.context.registerEROSubobjectParser(4, this.eroParser);
         final ByteBuf buffer = Unpooled.buffer();
         assertEquals(this.eroSubObj, this.context.getEROSubobjectHandlerRegistry().parseSubobject(4, buffer, false));
-        this.context.registerEROSubobjectSerializer(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.SubobjectType.class, this.eroSerializer);
+        this.context.registerEROSubobjectSerializer(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
+            .rsvp.rev150820.basic.explicit.route.subobjects.SubobjectType.class, this.eroSerializer);
         this.context.getEROSubobjectHandlerRegistry().serializeSubobject(this.eroSubObj, buffer);
         Mockito.verify(this.eroSerializer).serializeSubobject(this.eroSubObj, buffer);
     }
@@ -146,8 +167,10 @@ public class ServiceLoaderRSVPExtensionProviderContextTest {
     }
 
     @Test(expected = UnsupportedOperationException.class)
+    @SuppressWarnings("checkstyle:IllegalThrows")
     public void testPrivateConstructor() throws Throwable {
-        final Constructor<ServiceLoaderRSVPExtensionProviderContext> c = ServiceLoaderRSVPExtensionProviderContext.class.getDeclaredConstructor();
+        final Constructor<ServiceLoaderRSVPExtensionProviderContext> c =
+            ServiceLoaderRSVPExtensionProviderContext.class.getDeclaredConstructor();
         c.setAccessible(true);
         try {
             c.newInstance();
index bd9afc90c9659493c10c9c5d81d9674abca4398c..50cf01daf463adb2ec7fb65239e55d35ef5bacb4 100644 (file)
@@ -11,6 +11,7 @@ package org.opendaylight.protocol.rsvp.parser.spi.pojo;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
+
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import org.junit.Before;
@@ -41,7 +42,8 @@ public class SimpleEROSubobjectRegistryTest {
     public void setUp() throws RSVPParsingException {
         MockitoAnnotations.initMocks(this);
         this.simpleEROSubobjectRegistry.registerSubobjectParser(this.subObjectTypeOne, this.rroSubobjectParser);
-        Mockito.doReturn(new SubobjectContainerBuilder().build()).when(this.rroSubobjectParser).parseSubobject(this.input, false);
+        Mockito.doReturn(new SubobjectContainerBuilder().build()).when(this.rroSubobjectParser)
+            .parseSubobject(this.input, false);
         final ArgumentCaptor<SubobjectContainer> arg = ArgumentCaptor.forClass(SubobjectContainer.class);
         final ArgumentCaptor<ByteBuf> bufArg = ArgumentCaptor.forClass(ByteBuf.class);
         Mockito.doAnswer(invocation -> {
@@ -56,8 +58,8 @@ public class SimpleEROSubobjectRegistryTest {
         final int wrongType = 99;
         assertNull(this.simpleEROSubobjectRegistry.parseSubobject(wrongType, this.input, false));
         final ByteBuf output = Unpooled.EMPTY_BUFFER;
-        final SubobjectContainer container = new SubobjectContainerBuilder().setSubobjectType(new
-            LabelCaseBuilder().build()).build();
+        final SubobjectContainer container = new SubobjectContainerBuilder()
+            .setSubobjectType(new LabelCaseBuilder().build()).build();
         this.simpleEROSubobjectRegistry.serializeSubobject(container, output);
         assertEquals(0, output.readableBytes());
     }
@@ -76,8 +78,8 @@ public class SimpleEROSubobjectRegistryTest {
 
     @Test
     public void testParserRegistration() throws RSVPParsingException {
-        assertNotNull(this.simpleEROSubobjectRegistry.registerSubobjectParser(this.subObjectTypeOne, this
-            .rroSubobjectParser));
+        assertNotNull(this.simpleEROSubobjectRegistry.registerSubobjectParser(this.subObjectTypeOne,
+            this.rroSubobjectParser));
         assertNotNull(this.simpleEROSubobjectRegistry.parseSubobject(this.subObjectTypeOne, this.input, false));
     }
 
@@ -85,8 +87,8 @@ public class SimpleEROSubobjectRegistryTest {
     public void testSerializerRegistration() {
         assertNotNull(this.simpleEROSubobjectRegistry.registerSubobjectSerializer(LabelCase.class, this
             .rroSubobjectSerializer));
-        final SubobjectContainer container = new SubobjectContainerBuilder().setSubobjectType(new
-            LabelCaseBuilder().build()).build();
+        final SubobjectContainer container = new SubobjectContainerBuilder().setSubobjectType(
+            new LabelCaseBuilder().build()).build();
         final ByteBuf output = Unpooled.buffer();
         this.simpleEROSubobjectRegistry.serializeSubobject(container, output);
         assertEquals(1, output.readableBytes());
index 52b30202f349194b6fc25fee7d637799a0f7ea67..29524767ee6052504d4e609dea92b3bab18c9d61 100644 (file)
@@ -28,7 +28,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev
 import org.opendaylight.yangtools.yang.binding.DataContainer;
 
 public class SimpleLabelRegistryTest {
-    final short cTypeOne = 1;
+    private final short ctype = 1;
     private final SimpleLabelRegistry simpleLabelRegistry = new SimpleLabelRegistry();
     private final ByteBuf input = Unpooled.wrappedBuffer(new byte[]{1, 2, 3});
     @Mock
@@ -39,17 +39,18 @@ public class SimpleLabelRegistryTest {
     @Before
     public void setUp() throws RSVPParsingException {
         MockitoAnnotations.initMocks(this);
-        this.simpleLabelRegistry.registerLabelParser(this.cTypeOne, this.labelParser);
+        this.simpleLabelRegistry.registerLabelParser(this.ctype, this.labelParser);
         this.simpleLabelRegistry.registerLabelSerializer(MockLabel.class, this.labelSerializer);
         Mockito.doReturn(new MockLabel()).when(this.labelParser).parseLabel(this.input);
         final ArgumentCaptor<LabelType> tlvArg = ArgumentCaptor.forClass(LabelType.class);
         final ArgumentCaptor<ByteBuf> bufArg = ArgumentCaptor.forClass(ByteBuf.class);
-        Mockito.doNothing().when(this.labelSerializer).serializeLabel(Mockito.anyBoolean(), Mockito.anyBoolean(), tlvArg.capture(), bufArg.capture());
+        Mockito.doNothing().when(this.labelSerializer).serializeLabel(Mockito.anyBoolean(), Mockito.anyBoolean(),
+            tlvArg.capture(), bufArg.capture());
     }
 
     @Test
     public void testParserRegistration() {
-        assertNotNull(this.simpleLabelRegistry.registerLabelParser(this.cTypeOne, this.labelParser));
+        assertNotNull(this.simpleLabelRegistry.registerLabelParser(this.ctype, this.labelParser));
     }
 
     @Test
@@ -80,7 +81,7 @@ public class SimpleLabelRegistryTest {
 
     @Test
     public void testParseLabel() throws RSVPParsingException {
-        final LabelType output = this.simpleLabelRegistry.parseLabel(this.cTypeOne, this.input);
+        final LabelType output = this.simpleLabelRegistry.parseLabel(this.ctype, this.input);
         assertNotNull(output);
         assertTrue(output instanceof MockLabel);
 
index 9d116824bce59cd8ad4a1c3a6b7b892fa7b49b05..b6a0b2fa5aa022843239b6cef706d406c251c37e 100644 (file)
@@ -11,6 +11,7 @@ package org.opendaylight.protocol.rsvp.parser.spi.pojo;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
+
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import org.junit.Before;
@@ -42,7 +43,8 @@ public class SimpleRROSubobjectRegistryTest {
     public void setUp() throws RSVPParsingException {
         MockitoAnnotations.initMocks(this);
         this.simpleRROSubobjectRegistry.registerSubobjectParser(this.subObjectTypeOne, this.rroSubobjectParser);
-        Mockito.doReturn(new SubobjectContainerBuilder().build()).when(this.rroSubobjectParser).parseSubobject(this.input);
+        Mockito.doReturn(new SubobjectContainerBuilder().build()).when(this.rroSubobjectParser)
+            .parseSubobject(this.input);
         final ArgumentCaptor<SubobjectContainer> arg = ArgumentCaptor.forClass(SubobjectContainer.class);
         final ArgumentCaptor<ByteBuf> bufArg = ArgumentCaptor.forClass(ByteBuf.class);
         Mockito.doAnswer(invocation -> {
@@ -57,8 +59,8 @@ public class SimpleRROSubobjectRegistryTest {
         final int wrongType = 99;
         assertNull(this.simpleRROSubobjectRegistry.parseSubobject(wrongType, this.input));
         final ByteBuf output = Unpooled.EMPTY_BUFFER;
-        final SubobjectContainer container = new SubobjectContainerBuilder().setSubobjectType(new
-            LabelCaseBuilder().build()).build();
+        final SubobjectContainer container = new SubobjectContainerBuilder()
+            .setSubobjectType(new LabelCaseBuilder().build()).build();
         this.simpleRROSubobjectRegistry.serializeSubobject(container, output);
         assertEquals(0, output.readableBytes());
     }
@@ -77,18 +79,18 @@ public class SimpleRROSubobjectRegistryTest {
 
     @Test
     public void testParserRegistration() throws RSVPParsingException {
-        assertNotNull(this.simpleRROSubobjectRegistry.registerSubobjectParser(this.subObjectTypeOne, this
-            .rroSubobjectParser));
+        assertNotNull(this.simpleRROSubobjectRegistry.registerSubobjectParser(this.subObjectTypeOne,
+            this.rroSubobjectParser));
         assertNotNull(this.simpleRROSubobjectRegistry.parseSubobject(this.subObjectTypeOne, this.input));
     }
 
     @Test
     public void testSerializerRegistration() {
-        assertNotNull(this.simpleRROSubobjectRegistry.registerSubobjectSerializer(LabelCase.class, this
-            .rroSubobjectSerializer));
+        assertNotNull(this.simpleRROSubobjectRegistry.registerSubobjectSerializer(LabelCase.class,
+            this.rroSubobjectSerializer));
         final ByteBuf output = Unpooled.buffer();
-        final SubobjectContainer container = new SubobjectContainerBuilder().setSubobjectType(new
-            LabelCaseBuilder().build()).build();
+        final SubobjectContainer container = new SubobjectContainerBuilder().setSubobjectType(
+            new LabelCaseBuilder().build()).build();
         this.simpleRROSubobjectRegistry.serializeSubobject(container, output);
         assertEquals(1, output.readableBytes());
     }
index 2b94326379517bd8fb37e19a8da2e5ac2d8ec537..10adbcb4d1cf704089c1cfbf3629ea4a7416172f 100644 (file)
@@ -12,6 +12,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
+
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import org.junit.Before;
@@ -40,9 +41,12 @@ public class SimpleRSVPObjectRegistryTest {
     @Before
     public void setUp() throws RSVPParsingException {
         MockitoAnnotations.initMocks(this);
-        this.simpleRSVPObjectRegistry.registerRsvpObjectParser(this.subObjectTypeOne, this.subObjectCTypeOne, this.rsvpTeObjectParser);
-        this.simpleRSVPObjectRegistry.registerRsvpObjectSerializer(SecondaryExplicitRouteObject.class, this.rsvpTeObjectSerializer);
-        Mockito.doReturn(new SecondaryExplicitRouteObjectBuilder().build()).when(this.rsvpTeObjectParser).parseObject(this.input);
+        this.simpleRSVPObjectRegistry.registerRsvpObjectParser(this.subObjectTypeOne, this.subObjectCTypeOne,
+            this.rsvpTeObjectParser);
+        this.simpleRSVPObjectRegistry.registerRsvpObjectSerializer(SecondaryExplicitRouteObject.class,
+            this.rsvpTeObjectSerializer);
+        Mockito.doReturn(new SecondaryExplicitRouteObjectBuilder().build()).when(this.rsvpTeObjectParser)
+            .parseObject(this.input);
         final ArgumentCaptor<RsvpTeObject> arg = ArgumentCaptor.forClass(RsvpTeObject.class);
         final ArgumentCaptor<ByteBuf> bufArg = ArgumentCaptor.forClass(ByteBuf.class);
         Mockito.doNothing().when(this.rsvpTeObjectSerializer).serializeObject(arg.capture(), bufArg.capture());
@@ -50,12 +54,14 @@ public class SimpleRSVPObjectRegistryTest {
 
     @Test
     public void testParserRegistration() {
-        this.simpleRSVPObjectRegistry.registerRsvpObjectParser(this.subObjectTypeOne, this.subObjectCTypeOne, this.rsvpTeObjectParser);
+        this.simpleRSVPObjectRegistry.registerRsvpObjectParser(this.subObjectTypeOne, this.subObjectCTypeOne,
+            this.rsvpTeObjectParser);
     }
 
     @Test
     public void testSerializerRegistration() {
-        this.simpleRSVPObjectRegistry.registerRsvpObjectSerializer(SecondaryExplicitRouteObject.class, this.rsvpTeObjectSerializer);
+        this.simpleRSVPObjectRegistry.registerRsvpObjectSerializer(SecondaryExplicitRouteObject.class,
+            this.rsvpTeObjectSerializer);
     }
 
     @Test
@@ -75,7 +81,8 @@ public class SimpleRSVPObjectRegistryTest {
 
     @Test
     public void testParseRSVP() throws RSVPParsingException {
-        final RsvpTeObject output = this.simpleRSVPObjectRegistry.parseRSPVTe(this.subObjectTypeOne, this.subObjectCTypeOne, this.input);
+        final RsvpTeObject output = this.simpleRSVPObjectRegistry.parseRSPVTe(this.subObjectTypeOne,
+            this.subObjectCTypeOne, this.input);
         assertNotNull(output);
         assertTrue(output instanceof SecondaryExplicitRouteObject);
 
@@ -94,7 +101,8 @@ public class SimpleRSVPObjectRegistryTest {
     @Test(expected = IllegalArgumentException.class)
     public void testRegisterWrongType() {
         final int wrongType = 65536;
-        this.simpleRSVPObjectRegistry.registerRsvpObjectParser(wrongType, this.subObjectCTypeOne, this.rsvpTeObjectParser);
+        this.simpleRSVPObjectRegistry.registerRsvpObjectParser(wrongType, this.subObjectCTypeOne,
+            this.rsvpTeObjectParser);
     }
 
 }
\ No newline at end of file
index 71bb0b0e6671bfd4fbff74e111ef2eac90c32cec..2133f430458d2da32ff3ab558239db51bc52b802 100644 (file)
@@ -11,6 +11,7 @@ package org.opendaylight.protocol.rsvp.parser.spi.pojo;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
+
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import org.junit.Before;
index 5f19dad89aec224b60b9df585f28a84cb04b32dc..0e2c3d52d8a50c69e44229f4747db8263cfdd197 100644 (file)
@@ -20,9 +20,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev
 public class CUISubobjectParserTest {
     private final Long routerId = 3735928559L;
     private final Long interfaceId = 3736059631L;
-    final CommonUnnumberedInterfaceSubobjectParser parser = new CommonUnnumberedInterfaceSubobjectParser();
-    final Unnumbered unnumbered1 = new UnnumberedBuilder().setRouterId(null).build();
-    final Unnumbered unnumbered2 = new UnnumberedBuilder().setRouterId(1L).setInterfaceId(null).build();
+    private final Unnumbered unnumbered1 = new UnnumberedBuilder().setRouterId(null).build();
+    private final Unnumbered unnumbered2 = new UnnumberedBuilder().setRouterId(1L).setInterfaceId(null).build();
 
     @Test
     public void testProcessing() {
@@ -38,12 +37,12 @@ public class CUISubobjectParserTest {
         assertArrayEquals(input.array(), bytebuf.array());
     }
 
-    @Test(expected=IllegalArgumentException.class)
+    @Test(expected = IllegalArgumentException.class)
     public void testException1() {
         CommonUnnumberedInterfaceSubobjectParser.serializeUnnumeredInterface(this.unnumbered1, Unpooled.EMPTY_BUFFER);
     }
 
-    @Test(expected=IllegalArgumentException.class)
+    @Test(expected = IllegalArgumentException.class)
     public void testException2() {
         CommonUnnumberedInterfaceSubobjectParser.serializeUnnumeredInterface(this.unnumbered2, Unpooled.buffer(4));
     }
index a561d51d44b8ce5a3e5aa03be6e1cfdb317e163e..d7bd64f567c06df80d9ed42526a02f3ce2b1c4e0 100644 (file)
@@ -20,29 +20,29 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.explicit.route.subobjects.subobject.type.path.key._case.PathKeyBuilder;
 
 public class CommonPathKeyParserTest {
+    private final byte[] bytes = new byte[]{0, 1, 2, 3};
     private PathKey key1;
     private PathKey key2;
     private PathKey key3;
-    private final byte[] bytes = new byte[] {0,1,2,3};
 
     @Before
     public void setUp() {
         this.key1 = new PathKeyBuilder().build();
-        this.key2 = new PathKeyBuilder()
-            .setPathKey(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.PathKey(1))
+        this.key2 = new PathKeyBuilder().setPathKey(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns
+            .yang.rsvp.rev150820.PathKey(1))
             .build();
-        this.key3 = new PathKeyBuilder()
-            .setPathKey(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.PathKey(1))
-            .setPceId(new PceId(new byte[] {2, 3}))
+        this.key3 = new PathKeyBuilder().setPathKey(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns
+            .yang.rsvp.rev150820.PathKey(1))
+            .setPceId(new PceId(new byte[]{2, 3}))
             .build();
     }
 
-    @Test(expected=IllegalArgumentException.class)
+    @Test(expected = IllegalArgumentException.class)
     public void testSerializationExcption1() {
         CommonPathKeyParser.serializePathKey(this.key1);
     }
 
-    @Test(expected=IllegalArgumentException.class)
+    @Test(expected = IllegalArgumentException.class)
     public void testSerializationExcption2() {
         CommonPathKeyParser.serializePathKey(this.key2);
     }
index 43af25a55fdd8e063716422ea917fa1b341b671c..9933bc46552205c5467a23148fc8c844067fa4af 100644 (file)
@@ -31,9 +31,9 @@ public class EROSubobjectListParserTest {
     private final SubobjectContainer subObj = Mockito.mock(SubobjectContainer.class);
     private final RsvpTeObject rsvpTeObj = Mockito.mock(RsvpTeObject.class);
     private final EroListParser parser = new EroListParser(this.registry);
-    private final byte[] inputList = new byte[] {1, 3, 1, 2, 4, 1, 2};
-    private final byte[] emptyInput = new byte[] {1, 2};
-    private final byte[] wrongInput = new byte[] {1, 3};
+    private final byte[] inputList = new byte[]{1, 3, 1, 2, 4, 1, 2};
+    private final byte[] emptyInput = new byte[]{1, 2};
+    private final byte[] wrongInput = new byte[]{1, 3};
     private final List<SubobjectContainer> subobjects = Arrays.asList(this.subObj, this.subObj);
 
     @Before
@@ -51,12 +51,12 @@ public class EROSubobjectListParserTest {
         }).when(this.registry).serializeSubobject(Mockito.any(SubobjectContainer.class), Mockito.any(ByteBuf.class));
     }
 
-    @Test(expected=IllegalArgumentException.class)
+    @Test(expected = IllegalArgumentException.class)
     public void testParsingException() throws RSVPParsingException {
         this.parser.parseList(null);
     }
 
-    @Test(expected=RSVPParsingException.class)
+    @Test(expected = RSVPParsingException.class)
     public void testWrongInput() throws RSVPParsingException {
         this.parser.parseList(Unpooled.copiedBuffer(this.wrongInput));
     }
@@ -79,12 +79,12 @@ public class EROSubobjectListParserTest {
     @Test
     public void testAbstractRSVPObjParser() throws RSVPParsingException {
         final ByteBuf byteAggregator = Unpooled.buffer(4);
-        byte[] output = new byte[] {0, 1, 2, 3};
+        byte[] output = new byte[]{0, 1, 2, 3};
         EroListParser.serializeAttributeHeader(1, (short) 2, (short) 3, byteAggregator);
         assertArrayEquals(output, byteAggregator.array());
 
         final ByteBuf body = Unpooled.buffer(4);
-        output = new byte[] {0, 0, 0, 1};
+        output = new byte[]{0, 0, 0, 1};
         final AttributeFilter filter = new AttributeFilter(1L);
         EroListParser.writeAttributeFilter(filter, body);
         assertArrayEquals(output, body.array());
@@ -102,13 +102,15 @@ public class EROSubobjectListParserTest {
     }
 
     private class EroListParser extends EROSubobjectListParser {
-        public EroListParser(final EROSubobjectRegistry subobjReg) {
+        EroListParser(final EROSubobjectRegistry subobjReg) {
             super(subobjReg);
         }
+
         @Override
         protected void localSerializeObject(final RsvpTeObject rsvpTeObject, final ByteBuf output) {
             output.writeByte(3);
         }
+
         @Override
         protected RsvpTeObject localParseObject(final ByteBuf byteBuf) throws RSVPParsingException {
             return EROSubobjectListParserTest.this.rsvpTeObj;
index 6912aac3911b1e7f43af2680f852fbcbb02e5c8b..d2ea4ad14a9ece8d74bea8d7a25df1853e72d8d6 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.protocol.rsvp.parser.spi.subobjects;
 
 import static org.junit.Assert.assertEquals;
+
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.Arrays;
@@ -25,9 +26,9 @@ public class RROSubobjectListParserTest {
     private final RROSubobjectRegistry registry = Mockito.mock(RROSubobjectRegistry.class);
     private final SubobjectContainer subObj = Mockito.mock(SubobjectContainer.class);
     private final RroListParser parser = new RroListParser(this.registry);
-    private final byte[] inputList = new byte[] {1, 3, 1, 2, 4, 1, 2};
-    private final byte[] emptyInput = new byte[] {1, 2};
-    private final byte[] wrongInput = new byte[] {1, 3};
+    private final byte[] inputList = new byte[]{1, 3, 1, 2, 4, 1, 2};
+    private final byte[] emptyInput = new byte[]{1, 2};
+    private final byte[] wrongInput = new byte[]{1, 3};
     private final List<SubobjectContainer> subobjects = Arrays.asList(this.subObj, this.subObj);
 
     @Before
@@ -45,12 +46,12 @@ public class RROSubobjectListParserTest {
         }).when(this.registry).serializeSubobject(Mockito.any(SubobjectContainer.class), Mockito.any(ByteBuf.class));
     }
 
-    @Test(expected=IllegalArgumentException.class)
+    @Test(expected = IllegalArgumentException.class)
     public void testParsingException() throws RSVPParsingException {
         this.parser.parseList(null);
     }
 
-    @Test(expected=RSVPParsingException.class)
+    @Test(expected = RSVPParsingException.class)
     public void testWrongInput() throws RSVPParsingException {
         this.parser.parseList(Unpooled.copiedBuffer(this.wrongInput));
     }
@@ -71,12 +72,14 @@ public class RROSubobjectListParserTest {
     }
 
     private class RroListParser extends RROSubobjectListParser {
-        public RroListParser(final RROSubobjectRegistry subobjReg) {
+        RroListParser(final RROSubobjectRegistry subobjReg) {
             super(subobjReg);
         }
+
         @Override
         protected void localSerializeObject(final RsvpTeObject rsvpTeObject, final ByteBuf output) {
         }
+
         @Override
         protected RsvpTeObject localParseObject(final ByteBuf byteBuf) throws RSVPParsingException {
             return null;
index 7c2cc8bf1480d2d042f1308a47664b2a9b7fc1b9..706774cca31ed7bfbc16031c8de2a227d1e82f09 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.protocol.rsvp.parser.spi.subobjects;
 
 import static org.junit.Assert.assertEquals;
+
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.Arrays;
@@ -25,9 +26,9 @@ public class XROSubobjectListParserTest {
     private final XROSubobjectRegistry registry = Mockito.mock(XROSubobjectRegistry.class);
     private final SubobjectContainer subObj = Mockito.mock(SubobjectContainer.class);
     private final XroListParser parser = new XroListParser(this.registry);
-    private final byte[] inputList = new byte[] {1, 3, 1, 2, 4, 1, 2};
-    private final byte[] emptyInput = new byte[] {1, 2};
-    private final byte[] wrongInput = new byte[] {1, 3};
+    private final byte[] inputList = new byte[]{1, 3, 1, 2, 4, 1, 2};
+    private final byte[] emptyInput = new byte[]{1, 2};
+    private final byte[] wrongInput = new byte[]{1, 3};
     private final List<SubobjectContainer> subobjects = Arrays.asList(this.subObj, this.subObj);
 
     @Before
@@ -45,7 +46,7 @@ public class XROSubobjectListParserTest {
         }).when(this.registry).serializeSubobject(Mockito.any(SubobjectContainer.class), Mockito.any(ByteBuf.class));
     }
 
-    @Test(expected=RSVPParsingException.class)
+    @Test(expected = RSVPParsingException.class)
     public void testWrongInput() throws RSVPParsingException {
         this.parser.parseList(Unpooled.copiedBuffer(this.wrongInput));
     }
@@ -66,12 +67,14 @@ public class XROSubobjectListParserTest {
     }
 
     private class XroListParser extends XROSubobjectListParser {
-        public XroListParser(final XROSubobjectRegistry subobjReg) {
+        XroListParser(final XROSubobjectRegistry subobjReg) {
             super(subobjReg);
         }
+
         @Override
         protected void localSerializeObject(final RsvpTeObject rsvpTeObject, final ByteBuf output) {
         }
+
         @Override
         protected RsvpTeObject localParseObject(final ByteBuf byteBuf) throws RSVPParsingException {
             return null;