clean pcep/impl
[bgpcep.git] / pcep / impl / src / test / java / org / opendaylight / protocol / pcep / impl / PcepRROSubobjectParserTest.java
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();