From: Robert Varga Date: Tue, 26 Nov 2019 21:24:51 +0000 (+0100) Subject: Use new Uint* constants X-Git-Tag: release/magnesium~54 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=6b27e3332095638be86ade68bad5b47c31aee73a;p=bgpcep.git Use new Uint* constants This uses public constants for TWO and TEN, speeding up things just a little bit. Change-Id: Ie9622d28293033b9fbb0bc7b6a5938763cacfe7b Signed-off-by: Robert Varga --- diff --git a/bgp/cli/src/test/java/org/opendaylight/protocol/bgp/cli/utils/GlobalStateCliUtilsTest.java b/bgp/cli/src/test/java/org/opendaylight/protocol/bgp/cli/utils/GlobalStateCliUtilsTest.java index 5ce10f47d4..6eed4e49d6 100644 --- a/bgp/cli/src/test/java/org/opendaylight/protocol/bgp/cli/utils/GlobalStateCliUtilsTest.java +++ b/bgp/cli/src/test/java/org/opendaylight/protocol/bgp/cli/utils/GlobalStateCliUtilsTest.java @@ -55,7 +55,7 @@ public class GlobalStateCliUtilsTest { final GlobalBuilder builder = new GlobalBuilder().setState(new StateBuilder() .setAs(AsNumber.getDefaultInstance("100")) .setTotalPaths(Uint32.ONE) - .setTotalPrefixes(Uint32.valueOf(2)) + .setTotalPrefixes(Uint32.TWO) .build()); final org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp diff --git a/bgp/cli/src/test/java/org/opendaylight/protocol/bgp/cli/utils/NeighborStateCliUtilsTest.java b/bgp/cli/src/test/java/org/opendaylight/protocol/bgp/cli/utils/NeighborStateCliUtilsTest.java index 3399429387..fcd6e77318 100644 --- a/bgp/cli/src/test/java/org/opendaylight/protocol/bgp/cli/utils/NeighborStateCliUtilsTest.java +++ b/bgp/cli/src/test/java/org/opendaylight/protocol/bgp/cli/utils/NeighborStateCliUtilsTest.java @@ -108,7 +108,7 @@ public class NeighborStateCliUtilsTest { .setPrefixes(new PrefixesBuilder() .setInstalled(Uint32.ONE) .setReceived(Uint32.ONE) - .setSent(Uint32.valueOf(2)).build()) + .setSent(Uint32.TWO).build()) .build()); final AfiSafi afiSafi = new AfiSafiBuilder().setAfiSafiName(IPV4UNICAST.class) .setState(builder.build()).build(); @@ -122,11 +122,11 @@ public class NeighborStateCliUtilsTest { final Received received = new ReceivedBuilder() .setNOTIFICATION(Uint64.ONE) - .setUPDATE(Uint64.valueOf(10)) + .setUPDATE(Uint64.TEN) .build(); final Sent sent = new SentBuilder() - .setNOTIFICATION(Uint64.valueOf(10)) + .setNOTIFICATION(Uint64.TEN) .setUPDATE(Uint64.ONE) .build(); diff --git a/bgp/cli/src/test/java/org/opendaylight/protocol/bgp/cli/utils/PeerGroupStateCliUtilsTest.java b/bgp/cli/src/test/java/org/opendaylight/protocol/bgp/cli/utils/PeerGroupStateCliUtilsTest.java index 45af340678..6d37d05bd9 100644 --- a/bgp/cli/src/test/java/org/opendaylight/protocol/bgp/cli/utils/PeerGroupStateCliUtilsTest.java +++ b/bgp/cli/src/test/java/org/opendaylight/protocol/bgp/cli/utils/PeerGroupStateCliUtilsTest.java @@ -43,7 +43,7 @@ public final class PeerGroupStateCliUtilsTest { final PeerGroupStateAugmentation groupState = new PeerGroupStateAugmentationBuilder() .setTotalPrefixes(Uint32.ONE) - .setTotalPaths(Uint32.valueOf(2)) + .setTotalPaths(Uint32.TWO) .build(); peerGroup.setState(new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group diff --git a/bgp/extensions/evpn/src/test/java/org/opendaylight/protocol/bgp/evpn/impl/EvpnTestUtil.java b/bgp/extensions/evpn/src/test/java/org/opendaylight/protocol/bgp/evpn/impl/EvpnTestUtil.java index 027636dc9a..107e090cab 100644 --- a/bgp/extensions/evpn/src/test/java/org/opendaylight/protocol/bgp/evpn/impl/EvpnTestUtil.java +++ b/bgp/extensions/evpn/src/test/java/org/opendaylight/protocol/bgp/evpn/impl/EvpnTestUtil.java @@ -5,7 +5,6 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.protocol.bgp.evpn.impl; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber; @@ -35,7 +34,7 @@ public final class EvpnTestUtil { public static final Uint32 MPLS_LABEL_MODEL = Uint32.valueOf(24001L); public static final MplsLabel MPLS_LABEL = new MplsLabel(MPLS_LABEL_MODEL); public static final int COMMUNITY_VALUE_SIZE = 6; - public static final Uint32 VLAN = Uint32.valueOf(10); + public static final Uint32 VLAN = Uint32.TEN; public static final String IP_MODEL = "127.0.0.1"; public static final IpAddress IP = new IpAddress(new Ipv4Address(IP_MODEL)); public static final String IPV6_MODEL = "2001::1"; @@ -54,7 +53,7 @@ public final class EvpnTestUtil { return ImmutableContainerNodeSchemaAwareBuilder.create().withNodeIdentifier(nid); } - public static ImmutableLeafNodeBuilder createValueBuilder(final T value, NodeIdentifier nid) { + public static ImmutableLeafNodeBuilder createValueBuilder(final T value, final NodeIdentifier nid) { final ImmutableLeafNodeBuilder valueBuilder = new ImmutableLeafNodeBuilder<>(); valueBuilder.withNodeIdentifier(nid).withValue(value); return valueBuilder; diff --git a/bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecL3vpnIpv4NlriParserTest.java b/bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecL3vpnIpv4NlriParserTest.java index fe4133479c..512fcad322 100644 --- a/bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecL3vpnIpv4NlriParserTest.java +++ b/bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecL3vpnIpv4NlriParserTest.java @@ -496,7 +496,7 @@ public class FlowspecL3vpnIpv4NlriParserTest { private static FlowspecType createIcmpType() { final List types = Lists.newArrayList( - new TypesBuilder().setOp(new NumericOperand(false, false, false, false, true)).setValue(Uint8.valueOf(2)) + new TypesBuilder().setOp(new NumericOperand(false, false, false, false, true)).setValue(Uint8.TWO) .build(), new TypesBuilder().setOp(new NumericOperand(false, true, false, false, true)).setValue(Uint8.valueOf(3)) .build()); diff --git a/bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecIpv4NlriParserTest.java b/bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecIpv4NlriParserTest.java index 1e8b7aa35f..feefb57308 100644 --- a/bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecIpv4NlriParserTest.java +++ b/bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecIpv4NlriParserTest.java @@ -460,7 +460,7 @@ public class SimpleFlowspecIpv4NlriParserTest { private static FlowspecType createIcmpType() { final List types = Lists.newArrayList( - new TypesBuilder().setOp(new NumericOperand(false, false, false, false, true)).setValue(Uint8.valueOf(2)) + new TypesBuilder().setOp(new NumericOperand(false, false, false, false, true)).setValue(Uint8.TWO) .build(), new TypesBuilder().setOp(new NumericOperand(false, true, false, false, true)).setValue(Uint8.valueOf(3)) .build()); diff --git a/bgp/extensions/labeled-unicast/src/test/java/org/opendaylight/protocol/bgp/labeled/unicast/BgpPrefixSidTlvsTest.java b/bgp/extensions/labeled-unicast/src/test/java/org/opendaylight/protocol/bgp/labeled/unicast/BgpPrefixSidTlvsTest.java index a23e64aa14..c3bb9c6dca 100644 --- a/bgp/extensions/labeled-unicast/src/test/java/org/opendaylight/protocol/bgp/labeled/unicast/BgpPrefixSidTlvsTest.java +++ b/bgp/extensions/labeled-unicast/src/test/java/org/opendaylight/protocol/bgp/labeled/unicast/BgpPrefixSidTlvsTest.java @@ -46,7 +46,7 @@ public final class BgpPrefixSidTlvsTest { final List list = new ArrayList<>(); final Srgb srgb1 = new Srgb(Uint32.ONE); - final Srgb srgb2 = new Srgb(Uint32.valueOf(2)); + final Srgb srgb2 = new Srgb(Uint32.TWO); list.add(new SrgbValueBuilder().setBase(srgb1).setRange(srgb2).build()); list.add(new SrgbValueBuilder().setBase(srgb2).setRange(srgb1).build()); diff --git a/bgp/extensions/linkstate/src/test/java/org/opendaylight/protocol/bgp/linkstate/LinkstateAttributeParserTest.java b/bgp/extensions/linkstate/src/test/java/org/opendaylight/protocol/bgp/linkstate/LinkstateAttributeParserTest.java index 45066cbf96..c506972307 100644 --- a/bgp/extensions/linkstate/src/test/java/org/opendaylight/protocol/bgp/linkstate/LinkstateAttributeParserTest.java +++ b/bgp/extensions/linkstate/src/test/java/org/opendaylight/protocol/bgp/linkstate/LinkstateAttributeParserTest.java @@ -238,7 +238,7 @@ public class LinkstateAttributeParserTest { assertEquals(LinkProtectionType.Dedicated1to1, ls.getLinkProtection()); assertTrue(ls.getMplsProtocol().isLdp()); assertTrue(ls.getMplsProtocol().isRsvpte()); - assertEquals(Uint32.valueOf(10), ls.getMetric().getValue()); + assertEquals(Uint32.TEN, ls.getMetric().getValue()); assertEquals(2, ls.getSharedRiskLinkGroups().size()); assertEquals(305419896, ls.getSharedRiskLinkGroups().get(0).getValue().intValue()); assertEquals("12K-2", ls.getLinkName()); @@ -267,7 +267,7 @@ public class LinkstateAttributeParserTest { assertEquals(Uint32.valueOf(5000L), ls.getLinkMinMaxDelay().getMinDelay().getValue()); assertEquals(Uint32.valueOf(20000L), ls.getLinkMinMaxDelay().getMaxDelay().getValue()); assertEquals(Uint32.valueOf(10000L), ls.getDelayVariation().getValue()); - assertEquals(Uint32.valueOf(0L), ls.getLinkLoss().getValue()); + assertEquals(Uint32.ZERO, ls.getLinkLoss().getValue()); assertArrayEquals(new byte[] { (byte) 0x46, (byte) 0x43, (byte) 0x50, (byte) 0x00 }, ls.getResidualBandwidth().getValue()); assertArrayEquals(new byte[] { (byte) 0x46, (byte) 0x43, (byte) 0x50, (byte) 0x00 }, diff --git a/bgp/extensions/linkstate/src/test/java/org/opendaylight/protocol/bgp/linkstate/SrAttributeParserTest.java b/bgp/extensions/linkstate/src/test/java/org/opendaylight/protocol/bgp/linkstate/SrAttributeParserTest.java index e65daa0624..1b707bff0d 100644 --- a/bgp/extensions/linkstate/src/test/java/org/opendaylight/protocol/bgp/linkstate/SrAttributeParserTest.java +++ b/bgp/extensions/linkstate/src/test/java/org/opendaylight/protocol/bgp/linkstate/SrAttributeParserTest.java @@ -180,10 +180,11 @@ public class SrAttributeParserTest { final SrCapabilities capsIsis = new SrCapabilitiesBuilder().setMplsIpv4(Boolean.TRUE).setMplsIpv6(Boolean.TRUE) .setSrIpv6(Boolean.FALSE) .setSidLabelIndex(new SidCaseBuilder().setSid(Uint32.valueOf(16909060L)).build()) - .setRangeSize(Uint32.valueOf(10)).build(); + .setRangeSize(Uint32.TEN).build(); final SrCapabilities capsOspf = new SrCapabilitiesBuilder().setMplsIpv4(Boolean.FALSE) - .setMplsIpv6(Boolean.FALSE).setSrIpv6(Boolean.FALSE).setSidLabelIndex(new SidCaseBuilder() - .setSid(Uint32.valueOf(16909060L)).build()).setRangeSize(Uint32.valueOf(10)).build(); + .setMplsIpv6(Boolean.FALSE).setSrIpv6(Boolean.FALSE) + .setSidLabelIndex(new SidCaseBuilder().setSid(Uint32.valueOf(16909060L)).build()) + .setRangeSize(Uint32.TEN).build(); assertEquals(capsIsis, SrNodeAttributesParser.parseSrCapabilities(Unpooled.wrappedBuffer(bytesIsis), ProtocolId.IsisLevel1)); assertEquals(capsOspf, @@ -391,12 +392,12 @@ public class SrAttributeParserTest { final byte[] sidLabel = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }; final SrAdjIds srAdjId = new SrAdjIdsBuilder() .setFlags(ISIS_ADJ_FLAGS) - .setWeight(new Weight(Uint8.valueOf(10))) + .setWeight(new Weight(Uint8.TEN)) .setSidLabelIndex(new Ipv6AddressCaseBuilder().setIpv6Address( Ipv6Util.addressForByteBuf(Unpooled.copiedBuffer(sidLabel))).build()).build(); final SrAdjIds ospfAdj = new SrAdjIdsBuilder() .setFlags(OSPF_ADJ_FLAGS) - .setWeight(new Weight(Uint8.valueOf(10))) + .setWeight(new Weight(Uint8.TEN)) .setSidLabelIndex(new Ipv6AddressCaseBuilder().setIpv6Address( Ipv6Util.addressForByteBuf(Unpooled.copiedBuffer(sidLabel))).build()).build(); @@ -415,7 +416,7 @@ public class SrAttributeParserTest { final byte[] tested = { (byte)0x60, 10, 0, 0, 1, 2, 3, 4, 0, 0x5d, (byte)0xc0 }; final SrLanAdjIds srLanAdjId = new SrLanAdjIdsBuilder() .setFlags(OSPF_LAN_ADJ_FLAGS) - .setWeight(new Weight(Uint8.valueOf(10))) + .setWeight(new Weight(Uint8.TEN)) .setNeighborId(new Ipv4Address("1.2.3.4")) .setSidLabelIndex(new LocalLabelCaseBuilder() .setLocalLabel(new MplsLabel(Uint32.valueOf(24000L))) @@ -435,7 +436,7 @@ public class SrAttributeParserTest { final byte[] systemId = { 1, 2, 3, 4, 5, 6 }; final SrLanAdjIds srLanAdjId = new SrLanAdjIdsBuilder() .setFlags(ISIS_ADJ_FLAGS) - .setWeight(new Weight(Uint8.valueOf(10))) + .setWeight(new Weight(Uint8.TEN)) .setIsoSystemId(new IsoSystemIdentifier(systemId)) .setSidLabelIndex(new Ipv6AddressCaseBuilder().setIpv6Address(Ipv6Util.addressForByteBuf( Unpooled.copiedBuffer(sidLabel))).build()).build(); diff --git a/bgp/extensions/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/attributes/PEDistinguisherLabelsAttributeHandlerTest.java b/bgp/extensions/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/attributes/PEDistinguisherLabelsAttributeHandlerTest.java index 12377cd3e0..5687a52e6c 100644 --- a/bgp/extensions/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/attributes/PEDistinguisherLabelsAttributeHandlerTest.java +++ b/bgp/extensions/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/attributes/PEDistinguisherLabelsAttributeHandlerTest.java @@ -81,7 +81,7 @@ public final class PEDistinguisherLabelsAttributeHandlerTest { .build()); peAtt.add(new PeDistinguisherLabelAttributeBuilder() .setPeAddress(new IpAddress(new Ipv4Address("127.0.0.2"))) - .setMplsLabel(new MplsLabel(Uint32.valueOf(2))) + .setMplsLabel(new MplsLabel(Uint32.TWO)) .build()); return new AttributesBuilder() .setUnrecognizedAttributes(Collections.emptyList()) diff --git a/bgp/extensions/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/attributes/PMSITunnelAttributeHandlerTestUtil.java b/bgp/extensions/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/attributes/PMSITunnelAttributeHandlerTestUtil.java index f4cfdffbf2..d54f55a8a7 100644 --- a/bgp/extensions/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/attributes/PMSITunnelAttributeHandlerTestUtil.java +++ b/bgp/extensions/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/attributes/PMSITunnelAttributeHandlerTestUtil.java @@ -399,7 +399,7 @@ final class PMSITunnelAttributeHandlerTestUtil { opaqueValues.add(new OpaqueValueBuilder().setOpaque(OPAQUE_TEST) .setOpaqueType(GENERIC_LSP_IDENTIFIER).build()); opaqueValues.add(new OpaqueValueBuilder().setOpaque(OPAQUE_TEST2) - .setOpaqueType(Uint8.valueOf(2)).setOpaqueType(EXTENDED_TYPE) + .setOpaqueType(Uint8.TWO).setOpaqueType(EXTENDED_TYPE) .setOpaqueExtendedType(Uint16.valueOf(4)).build()); return opaqueValues; } diff --git a/bgp/extensions/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/attributes/tunnel/identifier/OpaqueUtilTest.java b/bgp/extensions/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/attributes/tunnel/identifier/OpaqueUtilTest.java index 81c5c9fc59..414763844b 100644 --- a/bgp/extensions/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/attributes/tunnel/identifier/OpaqueUtilTest.java +++ b/bgp/extensions/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/attributes/tunnel/identifier/OpaqueUtilTest.java @@ -5,7 +5,6 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.protocol.bgp.mvpn.impl.attributes.tunnel.identifier; import static org.junit.Assert.assertArrayEquals; @@ -71,7 +70,7 @@ public final class OpaqueUtilTest { private static final Opaque OPAQUE = new OpaqueValueBuilder().setOpaque(OPAQUE_TEST) .setOpaqueType(Uint8.ONE).build(); private static final Opaque OPAQUE_EXTENDED = new OpaqueValueBuilder().setOpaque(OPAQUE_TEST2) - .setOpaqueType(Uint8.valueOf(2)).setOpaqueType(Uint8.MAX_VALUE).setOpaqueExtendedType(Uint16.valueOf(4)) + .setOpaqueType(Uint8.TWO).setOpaqueType(Uint8.MAX_VALUE).setOpaqueExtendedType(Uint16.valueOf(4)) .build(); private static final List OPAQUE_VALUE_LIST = Arrays.asList((OpaqueValue) OPAQUE, (OpaqueValue) OPAQUE_EXTENDED); diff --git a/bgp/extensions/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/nlri/SharedTreeJoinHandlerTest.java b/bgp/extensions/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/nlri/SharedTreeJoinHandlerTest.java index 75a6f0ae5b..02af8f00ef 100644 --- a/bgp/extensions/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/nlri/SharedTreeJoinHandlerTest.java +++ b/bgp/extensions/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/nlri/SharedTreeJoinHandlerTest.java @@ -5,7 +5,6 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.protocol.bgp.mvpn.impl.nlri; import static org.junit.Assert.assertArrayEquals; @@ -46,7 +45,7 @@ public final class SharedTreeJoinHandlerTest { .setSharedTreeJoin(new SharedTreeJoinBuilder() .setCMulticast(new CMulticastBuilder() .setRouteDistinguisher(new RouteDistinguisher(new RdIpv4("1.2.3.4:258"))) - .setSourceAs(new AsNumber(Uint32.valueOf(10))) + .setSourceAs(new AsNumber(Uint32.TEN)) .setMulticastSource(new IpAddress(new Ipv4Address("1.0.0.1"))) .setMulticastGroup(new CGAddressCaseBuilder() .setCGAddress(new IpAddress(new Ipv4Address("2.0.0.2"))).build()).build()) diff --git a/bgp/extensions/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/nlri/SourceTreeJoinHandlerTest.java b/bgp/extensions/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/nlri/SourceTreeJoinHandlerTest.java index 9e95d614a6..5aa191c577 100644 --- a/bgp/extensions/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/nlri/SourceTreeJoinHandlerTest.java +++ b/bgp/extensions/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/nlri/SourceTreeJoinHandlerTest.java @@ -5,7 +5,6 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.protocol.bgp.mvpn.impl.nlri; import static org.junit.Assert.assertArrayEquals; @@ -46,7 +45,7 @@ public final class SourceTreeJoinHandlerTest { .setSourceTreeJoin(new SourceTreeJoinBuilder() .setCMulticast(new CMulticastBuilder() .setRouteDistinguisher(new RouteDistinguisher(new RdIpv4("1.2.3.4:258"))) - .setSourceAs(new AsNumber(Uint32.valueOf(10))) + .setSourceAs(new AsNumber(Uint32.TEN)) .setMulticastSource(new IpAddress(new Ipv4Address("1.0.0.1"))) .setMulticastGroup(new CGAddressCaseBuilder().setCGAddress( new IpAddress(new Ipv4Address("2.0.0.2"))).build()).build()) diff --git a/bgp/openconfig-rp-statement/src/test/java/org/opendaylight/protocol/bgp/openconfig/routing/policy/statement/MatchCommunityTest.java b/bgp/openconfig-rp-statement/src/test/java/org/opendaylight/protocol/bgp/openconfig/routing/policy/statement/MatchCommunityTest.java index e982bc4a23..af1f7b036b 100644 --- a/bgp/openconfig-rp-statement/src/test/java/org/opendaylight/protocol/bgp/openconfig/routing/policy/statement/MatchCommunityTest.java +++ b/bgp/openconfig-rp-statement/src/test/java/org/opendaylight/protocol/bgp/openconfig/routing/policy/statement/MatchCommunityTest.java @@ -58,7 +58,7 @@ public class MatchCommunityTest extends AbstractStatementRegistryConsumerTest { attributeContainer = routeAttributeContainerFalse(new AttributesBuilder().setCommunities( Collections.singletonList(new CommunitiesBuilder() .setAsNumber(AsNumber.getDefaultInstance("65")) - .setSemantics(Uint16.valueOf(10)) + .setSemantics(Uint16.TEN) .build())).build()); result = this.statementRegistry.applyExportStatement( @@ -87,7 +87,7 @@ public class MatchCommunityTest extends AbstractStatementRegistryConsumerTest { attributeContainer = routeAttributeContainerFalse(new AttributesBuilder().setCommunities( Collections.singletonList(new CommunitiesBuilder() .setAsNumber(AsNumber.getDefaultInstance("65")) - .setSemantics(Uint16.valueOf(10)) + .setSemantics(Uint16.TEN) .build())).build()); result = this.statementRegistry.applyExportStatement( @@ -115,7 +115,7 @@ public class MatchCommunityTest extends AbstractStatementRegistryConsumerTest { attributeContainer = routeAttributeContainerFalse(new AttributesBuilder().setCommunities(Arrays.asList( new CommunitiesBuilder().setAsNumber(AsNumber.getDefaultInstance("65")) - .setSemantics(Uint16.valueOf(10)).build(), + .setSemantics(Uint16.TEN).build(), new CommunitiesBuilder().setAsNumber(AsNumber.getDefaultInstance("66")) .setSemantics(Uint16.valueOf(11)).build())).build()); diff --git a/bgp/openconfig-state/src/test/java/org/opendaylight/protocol/bgp/state/StateProviderImplTest.java b/bgp/openconfig-state/src/test/java/org/opendaylight/protocol/bgp/state/StateProviderImplTest.java index f169234cb4..4616cef50d 100644 --- a/bgp/openconfig-state/src/test/java/org/opendaylight/protocol/bgp/state/StateProviderImplTest.java +++ b/bgp/openconfig-state/src/test/java/org/opendaylight/protocol/bgp/state/StateProviderImplTest.java @@ -487,7 +487,7 @@ public class StateProviderImplTest extends AbstractDataBrokerTest { .setActive(true) .setPrefixes(new PrefixesBuilder() .setSent(Uint32.ONE) - .setReceived(Uint32.valueOf(2)) + .setReceived(Uint32.TWO) .setInstalled(Uint32.ONE) .build()); final AfiSafi afiSafi = new AfiSafiBuilder() diff --git a/bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/BGPParserTest.java b/bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/BGPParserTest.java index 8f1d77ae09..b88892b335 100644 --- a/bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/BGPParserTest.java +++ b/bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/BGPParserTest.java @@ -314,8 +314,7 @@ public class BGPParserTest { asNumbers.add(new AsNumber(Uint32.valueOf(30))); final List asPath = new ArrayList<>(); asPath.add(new SegmentsBuilder().setAsSequence(asNumbers).build()); - final List asSet = Lists.newArrayList(new AsNumber(Uint32.valueOf(10)), - new AsNumber(Uint32.valueOf(20))); + final List asSet = Lists.newArrayList(new AsNumber(Uint32.TEN), new AsNumber(Uint32.valueOf(20))); asPath.add(new SegmentsBuilder().setAsSet(asSet).build()); final Aggregator aggregator = new AggregatorBuilder().setAsNumber(new AsNumber(Uint32.valueOf(30))) @@ -667,7 +666,7 @@ public class BGPParserTest { final List nlris = new ArrayList<>(); nlris.add(new NlriBuilder().setPrefix(new Ipv4Prefix("172.17.1.0/24")).setPathId(new PathId(Uint32.ONE)) .build()); - nlris.add(new NlriBuilder().setPrefix(new Ipv4Prefix("172.17.1.0/24")).setPathId(new PathId(Uint32.valueOf(2))) + nlris.add(new NlriBuilder().setPrefix(new Ipv4Prefix("172.17.1.0/24")).setPathId(new PathId(Uint32.TWO)) .build()); nlris.add(new NlriBuilder().setPrefix(new Ipv4Prefix("172.17.0.0/24")).setPathId(new PathId(Uint32.ONE)) .build()); @@ -738,7 +737,7 @@ public class BGPParserTest { withdrawnRoutes.add(new WithdrawnRoutesBuilder().setPrefix(new Ipv4Prefix("172.16.0.4/30")) .setPathId(new PathId(Uint32.ONE)).build()); withdrawnRoutes.add(new WithdrawnRoutesBuilder().setPrefix(new Ipv4Prefix("172.16.0.4/30")) - .setPathId(new PathId(Uint32.valueOf(2))).build()); + .setPathId(new PathId(Uint32.TWO)).build()); // check API message final Update expectedMessage = new UpdateBuilder().setWithdrawnRoutes(withdrawnRoutes).build(); diff --git a/bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/LlGracefulCapabilityHandlerTest.java b/bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/LlGracefulCapabilityHandlerTest.java index 1c3ccba2b3..85d83cd1d2 100644 --- a/bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/LlGracefulCapabilityHandlerTest.java +++ b/bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/LlGracefulCapabilityHandlerTest.java @@ -63,7 +63,7 @@ public class LlGracefulCapabilityHandlerTest { .setAfi(Ipv4AddressFamily.class) .setSafi(UnicastSubsequentAddressFamily.class) .setAfiFlags(new Tables.AfiFlags(Boolean.FALSE)) - .setLongLivedStaleTime(Uint32.valueOf(10)) + .setLongLivedStaleTime(Uint32.TEN) .build(), new TablesBuilder() .setAfi(Ipv6AddressFamily.class) @@ -90,7 +90,7 @@ public class LlGracefulCapabilityHandlerTest { .setAfi(AddressFamily.class) .setSafi(UnicastSubsequentAddressFamily.class) .setAfiFlags(new Tables.AfiFlags(Boolean.FALSE)) - .setLongLivedStaleTime(Uint32.valueOf(10)) + .setLongLivedStaleTime(Uint32.TEN) .build())).build(); final CParameters cParameters = new CParametersBuilder().addAugmentation(CParameters1.class, @@ -106,7 +106,7 @@ public class LlGracefulCapabilityHandlerTest { .setAfi(Ipv4AddressFamily.class) .setSafi(SubsequentAddressFamily.class) .setAfiFlags(new Tables.AfiFlags(Boolean.FALSE)) - .setLongLivedStaleTime(Uint32.valueOf(10)) + .setLongLivedStaleTime(Uint32.TEN) .build())).build(); final CParameters cParameters = new CParametersBuilder().addAugmentation(CParameters1.class, diff --git a/bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/message/update/AsPathAttributeParserTest.java b/bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/message/update/AsPathAttributeParserTest.java index 8b9c8f30b3..c326f97e70 100644 --- a/bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/message/update/AsPathAttributeParserTest.java +++ b/bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/message/update/AsPathAttributeParserTest.java @@ -43,8 +43,7 @@ public class AsPathAttributeParserTest { public void testAttributeParser() throws BGPParsingException, BGPDocumentedException { final List segments = new ArrayList<>(); segments.add(new SegmentsBuilder() - .setAsSet(Arrays.asList(new AsNumber(Uint32.ONE), new AsNumber(Uint32.valueOf(2)))) - .build()); + .setAsSet(Arrays.asList(new AsNumber(Uint32.ONE), new AsNumber(Uint32.TWO))).build()); segments.add(new SegmentsBuilder() .setAsSequence(Arrays.asList(new AsNumber(Uint32.valueOf(3)), new AsNumber(Uint32.valueOf(4)))) .build()); diff --git a/bgp/parser-spi/src/test/java/org/opendaylight/protocol/bgp/parser/spi/PathIdUtilTest.java b/bgp/parser-spi/src/test/java/org/opendaylight/protocol/bgp/parser/spi/PathIdUtilTest.java index 2f1090f22d..f0afbd3062 100644 --- a/bgp/parser-spi/src/test/java/org/opendaylight/protocol/bgp/parser/spi/PathIdUtilTest.java +++ b/bgp/parser-spi/src/test/java/org/opendaylight/protocol/bgp/parser/spi/PathIdUtilTest.java @@ -46,7 +46,7 @@ public class PathIdUtilTest { @Test public void testWritePathId() { - PathIdUtil.writePathId(new PathId(Uint32.valueOf(10)), this.buffer); + PathIdUtil.writePathId(new PathId(Uint32.TEN), this.buffer); Assert.assertEquals(Integer.BYTES, this.buffer.readableBytes()); } diff --git a/bgp/path-selection-mode/src/test/java/org/opendaylight/protocol/bgp/mode/impl/base/BasePathSelectorTest.java b/bgp/path-selection-mode/src/test/java/org/opendaylight/protocol/bgp/mode/impl/base/BasePathSelectorTest.java index b65528002c..49cab41042 100644 --- a/bgp/path-selection-mode/src/test/java/org/opendaylight/protocol/bgp/mode/impl/base/BasePathSelectorTest.java +++ b/bgp/path-selection-mode/src/test/java/org/opendaylight/protocol/bgp/mode/impl/base/BasePathSelectorTest.java @@ -30,10 +30,10 @@ import org.opendaylight.yangtools.yang.common.Uint32; public class BasePathSelectorTest { private static final List SEQ_SEGMENT = Arrays.asList( - new AsNumber(Uint32.ONE), new AsNumber(Uint32.valueOf(2)), new AsNumber(Uint32.valueOf(3))); + new AsNumber(Uint32.ONE), new AsNumber(Uint32.TWO), new AsNumber(Uint32.valueOf(3))); static final RouterId ROUTER_ID2 = RouterId.forPeerId(new PeerId("bgp://127.0.0.1")); private static final List SEQ_SEGMENT2 = Arrays.asList( - new AsNumber(Uint32.valueOf(20)), new AsNumber(Uint32.valueOf(2)), new AsNumber(Uint32.valueOf(3))); + new AsNumber(Uint32.valueOf(20)), new AsNumber(Uint32.TWO), new AsNumber(Uint32.valueOf(3))); private static final RouterId ROUTER_ID = RouterId.forAddress("127.0.0.1"); private static final RouterId ROUTER_ID3 = RouterId.forPeerId(new PeerId("bgp://127.0.0.2")); private final BasePathSelector selector = new BasePathSelector(20L); diff --git a/bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/AbstractAddPathTest.java b/bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/AbstractAddPathTest.java index dc721a99c5..e6cf3a5fd0 100644 --- a/bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/AbstractAddPathTest.java +++ b/bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/AbstractAddPathTest.java @@ -110,7 +110,7 @@ public abstract class AbstractAddPathTest extends DefaultRibPoliciesMockTest { static final int HOLDTIMER = 2180; private static final Ipv4Address NH1 = new Ipv4Address("2.2.2.2"); static final Update UPD_100 = createSimpleUpdate(PREFIX1, new PathId(Uint32.ONE), CLUSTER_ID, 100); - static final Update UPD_50 = createSimpleUpdate(PREFIX1, new PathId(Uint32.valueOf(2)), CLUSTER_ID, 50); + static final Update UPD_50 = createSimpleUpdate(PREFIX1, new PathId(Uint32.TWO), CLUSTER_ID, 50); static final Update UPD_200 = createSimpleUpdate(PREFIX1, new PathId(Uint32.valueOf(3)), CLUSTER_ID, 200); static final Update UPD_20 = createSimpleUpdate(PREFIX1, new PathId(Uint32.ONE), CLUSTER_ID, 20); static final Update UPD_NA_100 = createSimpleUpdate(PREFIX1, null, CLUSTER_ID, 100); diff --git a/bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/config/OpenConfigMappingUtilTest.java b/bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/config/OpenConfigMappingUtilTest.java index f53716a5cf..49b13c3a6f 100644 --- a/bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/config/OpenConfigMappingUtilTest.java +++ b/bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/config/OpenConfigMappingUtilTest.java @@ -5,7 +5,6 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.protocol.bgp.rib.impl.config; import static junit.framework.TestCase.assertFalse; @@ -120,7 +119,7 @@ public class OpenConfigMappingUtilTest { private static final Ipv4Address LOCAL_HOST = new Ipv4Address("127.0.0.1"); private static final Uint8 ALL_PATHS = Uint8.ZERO; - private static final Uint8 N_PATHS = Uint8.valueOf(2); + private static final Uint8 N_PATHS = Uint8.TWO; private static final PathSelectionMode ADD_PATH_BEST_N_PATH_SELECTION = new AddPathBestNPathSelection(N_PATHS.toJava()); private static final PathSelectionMode ADD_PATH_BEST_ALL_PATH_SELECTION = new AllPathSelection(); diff --git a/bgp/topology-provider/src/test/java/org/opendaylight/bgpcep/bgp/topology/provider/LinkstateTopologyBuilderTest.java b/bgp/topology-provider/src/test/java/org/opendaylight/bgpcep/bgp/topology/provider/LinkstateTopologyBuilderTest.java index af78be6ee4..34d9df1e7d 100755 --- a/bgp/topology-provider/src/test/java/org/opendaylight/bgpcep/bgp/topology/provider/LinkstateTopologyBuilderTest.java +++ b/bgp/topology-provider/src/test/java/org/opendaylight/bgpcep/bgp/topology/provider/LinkstateTopologyBuilderTest.java @@ -109,7 +109,7 @@ public class LinkstateTopologyBuilderTest extends AbstractTopologyBuilderTest { private static final String ROUTER_2_ID = "127.0.0.2"; private static final String NODE_1_PREFIX = "127.0.1.1/32"; private static final AsNumber NODE_1_AS = new AsNumber(Uint32.ONE); - private static final AsNumber NODE_2_AS = new AsNumber(Uint32.valueOf(2)); + private static final AsNumber NODE_2_AS = new AsNumber(Uint32.TWO); private static final String NODE_1_ISIS_ID = "bgpls://IsisLevel2:1/type=node&as=1&router=0000.0102.0304"; private static final String NODE_2_ISIS_ID = "bgpls://IsisLevel2:1/type=node&as=2"; private static final String NODE_1_OSPF_ID = "bgpls://Ospf:1/type=node&as=1&router=0000.0102.0304"; diff --git a/bgp/topology-provider/src/test/java/org/opendaylight/bgpcep/bgp/topology/provider/UriBuilderTest.java b/bgp/topology-provider/src/test/java/org/opendaylight/bgpcep/bgp/topology/provider/UriBuilderTest.java index 0e33c94703..cee57b87db 100644 --- a/bgp/topology-provider/src/test/java/org/opendaylight/bgpcep/bgp/topology/provider/UriBuilderTest.java +++ b/bgp/topology-provider/src/test/java/org/opendaylight/bgpcep/bgp/topology/provider/UriBuilderTest.java @@ -42,7 +42,7 @@ public class UriBuilderTest { @Test public void test() { final LinkstateRouteBuilder routeB = new LinkstateRouteBuilder().setProtocolId(ProtocolId.Direct) - .setIdentifier(new Identifier(Uint64.valueOf(10))); + .setIdentifier(new Identifier(Uint64.TEN)); final UriBuilder a = new UriBuilder(routeB.build()); assertEquals("bgpls://Direct:10/", a.toString()); @@ -62,7 +62,7 @@ public class UriBuilderTest { .setIpv4NeighborAddress(new Ipv4InterfaceIdentifier("20.20.20.20")) .setMultiTopologyId(new TopologyIdentifier(Uint16.valueOf(55))) .setLinkLocalIdentifier(Uint32.ONE) - .setLinkRemoteIdentifier(Uint32.valueOf(2)) + .setLinkRemoteIdentifier(Uint32.TWO) .build()); final LocalNodeDescriptorsBuilder nodeB = new LocalNodeDescriptorsBuilder(); nodeB.setAsNumber(new AsNumber(Uint32.valueOf(12))).setDomainId(new DomainIdentifier(Uint32.valueOf(15))) @@ -74,7 +74,7 @@ public class UriBuilderTest { nodeR.setCRouterIdentifier(new IsisPseudonodeCaseBuilder().setIsisPseudonode(new IsisPseudonodeBuilder() .setIsIsRouterIdentifier(new IsIsRouterIdentifierBuilder() .setIsoSystemId(new IsoSystemIdentifier(new byte[]{1, 2, 3, 4, 5, 6})) - .build()).setPsn(Uint8.valueOf(2)).build()).build()); + .build()).setPsn(Uint8.TWO).build()).build()); linkB.setRemoteNodeDescriptors(nodeR.build()); c.add(linkB.build()); assertEquals("bgpls://1.2.3.4:258:Direct:10/type=foo&local-as=12&local-domain=15&local-area=17&" diff --git a/bmp/bmp-parser-impl/src/test/java/org/opendaylight/protocol/bmp/parser/message/TestUtil.java b/bmp/bmp-parser-impl/src/test/java/org/opendaylight/protocol/bmp/parser/message/TestUtil.java index f76c990879..08c7b78d80 100644 --- a/bmp/bmp-parser-impl/src/test/java/org/opendaylight/protocol/bmp/parser/message/TestUtil.java +++ b/bmp/bmp-parser-impl/src/test/java/org/opendaylight/protocol/bmp/parser/message/TestUtil.java @@ -5,7 +5,6 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.protocol.bmp.parser.message; import com.google.common.collect.ImmutableList; @@ -158,7 +157,7 @@ public final class TestUtil { .setAs(PEER_AS) .setBgpId(new Ipv4Address(bgpId)) .setAdjRibInType(ribType) - .setTimestampMicro(new Timestamp(Uint32.valueOf(10))) + .setTimestampMicro(new Timestamp(Uint32.TEN)) .setTimestampSec(new Timestamp(Uint32.valueOf(5))) .setIpv4(true) .setType(PeerType.forValue(0)); @@ -370,7 +369,7 @@ public final class TestUtil { new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev180329.stat .TlvsBuilder(); tlvsBuilder.setAdjRibsInRoutesTlv(new AdjRibsInRoutesTlvBuilder() - .setCount(new Gauge64(Uint64.valueOf(10L))).build()); + .setCount(new Gauge64(Uint64.TEN)).build()); tlvsBuilder.setDuplicatePrefixAdvertisementsTlv(new DuplicatePrefixAdvertisementsTlvBuilder() .setCount(new Counter32(Uint32.valueOf(16L))).build()); tlvsBuilder.setDuplicateWithdrawsTlv(new DuplicateWithdrawsTlvBuilder() @@ -392,7 +391,7 @@ public final class TestUtil { .setCount(new Gauge64(Uint64.valueOf(9L))).build()); tlvsBuilder.setPerAfiSafiLocRibTlv(new PerAfiSafiLocRibTlvBuilder() .setAfi(Ipv4AddressFamily.class).setSafi(UnicastSubsequentAddressFamily.class) - .setCount(new Gauge64(Uint64.valueOf(10L))).build()); + .setCount(new Gauge64(Uint64.TEN)).build()); tlvsBuilder.setUpdatesTreatedAsWithdrawTlv(new UpdatesTreatedAsWithdrawTlvBuilder() .setCount(new Counter32(Uint32.valueOf(11L))).build()); tlvsBuilder.setPrefixesTreatedAsWithdrawTlv(new PrefixesTreatedAsWithdrawTlvBuilder() diff --git a/pcep/ietf-stateful07/src/test/java/org/opendaylight/protocol/pcep/ietf/PCEPValidatorTest.java b/pcep/ietf-stateful07/src/test/java/org/opendaylight/protocol/pcep/ietf/PCEPValidatorTest.java index a27cad6e0c..f995cbcabc 100644 --- a/pcep/ietf-stateful07/src/test/java/org/opendaylight/protocol/pcep/ietf/PCEPValidatorTest.java +++ b/pcep/ietf-stateful07/src/test/java/org/opendaylight/protocol/pcep/ietf/PCEPValidatorTest.java @@ -582,7 +582,7 @@ public class PCEPValidatorTest { .setP2mp(false) .setEroCompression(false) .setPriority(Uint8.ONE) - .setRequestId(new RequestId(Uint32.valueOf(10))) + .setRequestId(new RequestId(Uint32.TEN)) .setTlvs(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109 .rp.object.rp.TlvsBuilder().build()) .setProcessingRule(false); diff --git a/pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/FiniteStateMachineTest.java b/pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/FiniteStateMachineTest.java index 82d9f98eef..b06570a8af 100644 --- a/pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/FiniteStateMachineTest.java +++ b/pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/FiniteStateMachineTest.java @@ -199,7 +199,7 @@ public class FiniteStateMachineTest extends AbstractPCEPSessionTest { if (m instanceof Pcerr) { final Errors obj = ((Pcerr) m).getPcerrMessage().getErrors().get(0); assertEquals(Uint8.ONE, obj.getErrorObject().getType()); - assertEquals(Uint8.valueOf(2), obj.getErrorObject().getValue()); + assertEquals(Uint8.TWO, obj.getErrorObject().getValue()); } } }); diff --git a/pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPObjectParserTest.java b/pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPObjectParserTest.java index 55192f468b..9db53cd60d 100644 --- a/pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPObjectParserTest.java +++ b/pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPObjectParserTest.java @@ -827,7 +827,7 @@ public class PCEPObjectParserTest { builder.setComputed(true) .setBound(false) - .setMetricType(Uint8.valueOf(2)) + .setMetricType(Uint8.TWO) .setValue(new Float32(new byte[] { (byte) 0x4f, (byte) 0x70, (byte) 0x00, (byte) 0x00 })); assertEquals(builder.build(), parser.parseObject(new ObjectHeaderImpl(true, true), @@ -923,7 +923,7 @@ public class PCEPObjectParserTest { result = Unpooled.wrappedBuffer(ByteArray.fileToBytes("src/test/resources/PCEPNotificationObject1WithTlv.bin")); - builder.setType(Uint8.valueOf(2)) + builder.setType(Uint8.TWO) .setValue(Uint8.ONE) .setTlvs(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109 .notification.object.c.notification.TlvsBuilder().setOverloadDuration( @@ -1511,7 +1511,7 @@ public class PCEPObjectParserTest { .setAverageProcTime(Uint32.valueOf(4)) .setCurrentProcTime(Uint32.ONE) .setMaxProcTime(Uint32.valueOf(3)) - .setMinProcTime(Uint32.valueOf(2)) + .setMinProcTime(Uint32.TWO) .setVarianceProcTime(Uint32.valueOf(5)) .build(); final ByteBuf result = Unpooled.wrappedBuffer(proctimeBytes); diff --git a/pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPValidatorTest.java b/pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPValidatorTest.java index eed8c4e849..d18048dc05 100644 --- a/pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPValidatorTest.java +++ b/pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPValidatorTest.java @@ -209,7 +209,7 @@ public class PCEPValidatorTest { .setP2mp(false) .setEroCompression(false) .setPriority(Uint8.ONE) - .setRequestId(new RequestId(Uint32.valueOf(10))) + .setRequestId(new RequestId(Uint32.TEN)) .setTlvs(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.rp .object.rp.TlvsBuilder().build()); this.rpTrue = rpBuilder.build(); @@ -339,7 +339,7 @@ public class PCEPValidatorTest { this.procTime = new ProcTimeBuilder() .setEstimated(false) .setCurrentProcTime(Uint32.ONE) - .setMinProcTime(Uint32.valueOf(2)) + .setMinProcTime(Uint32.TWO) .setMaxProcTime(Uint32.valueOf(3)) .setAverageProcTime(Uint32.valueOf(4)) .setVarianceProcTime(Uint32.valueOf(5)) diff --git a/pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCIncrementalSyncTest.java b/pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCIncrementalSyncTest.java index 8d772568c4..8863b4efdd 100644 --- a/pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCIncrementalSyncTest.java +++ b/pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCIncrementalSyncTest.java @@ -5,7 +5,6 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.protocol.pcep.pcc.mock; import io.netty.channel.Channel; @@ -43,7 +42,7 @@ public class PCCIncrementalSyncTest extends PCCMockCommon { checkSynchronizedSession(8, pceSessionListener, numberOflspAndDBv); Thread.sleep(6000); final int expetecdNumberOfLspAndEndOfSync = 3; - final Uint64 expectedFinalDBVersion = Uint64.valueOf(10); + final Uint64 expectedFinalDBVersion = Uint64.TEN; final TestingSessionListener sessionListenerAfterReconnect = getListener(factory); checkResyncSession(Optional.empty(), expetecdNumberOfLspAndEndOfSync, 3, numberOflspAndDBv, expectedFinalDBVersion, sessionListenerAfterReconnect); diff --git a/pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCSyncAvoidanceProcedureTest.java b/pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCSyncAvoidanceProcedureTest.java index 312c428449..6c2c4a6f67 100644 --- a/pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCSyncAvoidanceProcedureTest.java +++ b/pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCSyncAvoidanceProcedureTest.java @@ -26,12 +26,12 @@ public class PCCSyncAvoidanceProcedureTest extends PCCMockCommon { final TestingSessionListenerFactory factory = new TestingSessionListenerFactory(); final Channel channel = createServer(factory, this.remoteAddress, new PCCPeerProposal()); - final PCEPSession session = createPCCSession(Uint64.valueOf(10)).get(); + final PCEPSession session = createPCCSession(Uint64.TEN).get(); assertNotNull(session); final TestingSessionListener pceSessionListener = getListener(factory); assertNotNull(pceSessionListener); assertNotNull(pceSessionListener.getSession()); - checkResyncSession(Optional.empty(), 11, 11, null, Uint64.valueOf(10), pceSessionListener); + checkResyncSession(Optional.empty(), 11, 11, null, Uint64.TEN, pceSessionListener); channel.close().get(); } diff --git a/pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCTriggeredLspResyncTest.java b/pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCTriggeredLspResyncTest.java index 564e98e304..67dcd49ab4 100644 --- a/pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCTriggeredLspResyncTest.java +++ b/pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCTriggeredLspResyncTest.java @@ -58,7 +58,7 @@ public class PCCTriggeredLspResyncTest extends PCCMockCommon { srpBuilder.setProcessingRule(Boolean.TRUE); final Srp srp = srpBuilder.build(); - final Lsp lsp = new LspBuilder().setPlspId(new PlspId(Uint32.valueOf(2))).setSync(Boolean.TRUE).build(); + final Lsp lsp = new LspBuilder().setPlspId(new PlspId(Uint32.TWO)).setSync(Boolean.TRUE).build(); final UpdatesBuilder rb = new UpdatesBuilder(); rb.setSrp(srp); rb.setLsp(lsp); diff --git a/pcep/segment-routing/src/test/java/org/opendaylight/protocol/pcep/segment/routing/SrRroSubobjectParserTest.java b/pcep/segment-routing/src/test/java/org/opendaylight/protocol/pcep/segment/routing/SrRroSubobjectParserTest.java index bef4b2eb80..1d6a15c8c8 100644 --- a/pcep/segment-routing/src/test/java/org/opendaylight/protocol/pcep/segment/routing/SrRroSubobjectParserTest.java +++ b/pcep/segment-routing/src/test/java/org/opendaylight/protocol/pcep/segment/routing/SrRroSubobjectParserTest.java @@ -180,7 +180,7 @@ public class SrRroSubobjectParserTest { .setCFlag(false) .setMFlag(false) .setNai(new UnnumberedAdjacencyBuilder() - .setLocalNodeId(Uint32.ONE).setLocalInterfaceId(Uint32.valueOf(2)) + .setLocalNodeId(Uint32.ONE).setLocalInterfaceId(Uint32.TWO) .setRemoteNodeId(Uint32.valueOf(3)).setRemoteInterfaceId(Uint32.valueOf(4)) .build()); final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build()); diff --git a/pcep/segment-routing/src/test/java/org/opendaylight/protocol/pcep/segment/routing/TopologyProviderTest.java b/pcep/segment-routing/src/test/java/org/opendaylight/protocol/pcep/segment/routing/TopologyProviderTest.java index 6856297045..364c1d9344 100644 --- a/pcep/segment-routing/src/test/java/org/opendaylight/protocol/pcep/segment/routing/TopologyProviderTest.java +++ b/pcep/segment-routing/src/test/java/org/opendaylight/protocol/pcep/segment/routing/TopologyProviderTest.java @@ -88,7 +88,7 @@ public class TopologyProviderTest extends AbstractPCEPSessionTest { //check second lsp sr-path diff --git a/pcep/spi/src/test/java/org/opendaylight/protocol/pcep/spi/AbstractObjectWithTlvsTest.java b/pcep/spi/src/test/java/org/opendaylight/protocol/pcep/spi/AbstractObjectWithTlvsTest.java index 6b18576f82..e582069d2e 100644 --- a/pcep/spi/src/test/java/org/opendaylight/protocol/pcep/spi/AbstractObjectWithTlvsTest.java +++ b/pcep/spi/src/test/java/org/opendaylight/protocol/pcep/spi/AbstractObjectWithTlvsTest.java @@ -81,7 +81,7 @@ public class AbstractObjectWithTlvsTest { @Before public void setUp() throws PCEPDeserializerException { - this.tlv = new OfListBuilder().setCodes(Collections.singletonList(new OfId(Uint16.valueOf(10)))).build(); + this.tlv = new OfListBuilder().setCodes(Collections.singletonList(new OfId(Uint16.TEN))).build(); this.viTlv = new VendorInformationTlvBuilder().setEnterpriseNumber(EN).build(); doNothing().when(this.viTlvRegistry).serializeVendorInformationTlv(any(VendorInformationTlv.class), any(ByteBuf.class)); diff --git a/pcep/spi/src/test/java/org/opendaylight/protocol/pcep/spi/RegistryTest.java b/pcep/spi/src/test/java/org/opendaylight/protocol/pcep/spi/RegistryTest.java index 1bfa1a9b52..8a79003bad 100644 --- a/pcep/spi/src/test/java/org/opendaylight/protocol/pcep/spi/RegistryTest.java +++ b/pcep/spi/src/test/java/org/opendaylight/protocol/pcep/spi/RegistryTest.java @@ -162,7 +162,7 @@ public class RegistryTest { this.regs.add(this.ctx.registerLabelParser(7, this.labelParser)); this.regs.add(this.ctx.registerLabelSerializer(Type1LabelCase.class, this.labelSerializer)); - this.regs.add(this.ctx.registerVendorInformationObjectParser(new EnterpriseNumber(Uint32.valueOf(10)), + this.regs.add(this.ctx.registerVendorInformationObjectParser(new EnterpriseNumber(Uint32.TEN), this.objectParser)); this.regs.add(this.ctx.registerVendorInformationObjectSerializer(EnterpriseSpecificInformation.class, this.objectSerializer)); @@ -200,7 +200,7 @@ public class RegistryTest { this.ctx.getMessageHandlerRegistry().serializeMessage(new KeepaliveBuilder().build(), buffer); this.ctx.getVendorInformationObjectRegistry().parseVendorInformationObject( - new EnterpriseNumber(Uint32.valueOf(10)), new ObjectHeaderImpl(true, false), buffer); + new EnterpriseNumber(Uint32.TEN), new ObjectHeaderImpl(true, false), buffer); this.ctx.getVendorInformationObjectRegistry().serializeVendorInformationObject(this.esi, buffer); this.ctx.getVendorInformationTlvRegistry().parseVendorInformationTlv( diff --git a/pcep/topology/cli/src/test/java/org/opendaylight/protocol/pcep/cli/utils/PcepStateUtilsTest.java b/pcep/topology/cli/src/test/java/org/opendaylight/protocol/pcep/cli/utils/PcepStateUtilsTest.java index 72845c2650..d93c868e95 100644 --- a/pcep/topology/cli/src/test/java/org/opendaylight/protocol/pcep/cli/utils/PcepStateUtilsTest.java +++ b/pcep/topology/cli/src/test/java/org/opendaylight/protocol/pcep/cli/utils/PcepStateUtilsTest.java @@ -115,18 +115,18 @@ public class PcepStateUtilsTest extends AbstractConcurrentDataBrokerTest { final ReplyTime reply = new ReplyTimeBuilder() .setAverageTime(Uint32.ONE) .setMaxTime(Uint32.valueOf(3)) - .setMinTime(Uint32.valueOf(2)) + .setMinTime(Uint32.TWO) .build(); final ErrorMessages errorMsg = new ErrorMessagesBuilder() .setReceivedErrorMsgCount(Uint32.ONE) - .setSentErrorMsgCount(Uint32.valueOf(2)) + .setSentErrorMsgCount(Uint32.TWO) .build(); final StatefulMessagesStatsAug statefulMsg = new StatefulMessagesStatsAugBuilder() .setLastReceivedRptMsgTimestamp(Uint32.valueOf(1512043769L)) .setSentUpdMsgCount(Uint32.ONE) - .setReceivedRptMsgCount(Uint32.valueOf(2)) + .setReceivedRptMsgCount(Uint32.TWO) .setSentInitMsgCount(Uint32.valueOf(3)) .build(); @@ -150,4 +150,4 @@ public class PcepStateUtilsTest extends AbstractConcurrentDataBrokerTest { .setMessages(messages) .build(); } -} \ No newline at end of file +} diff --git a/pcep/topology/topology-provider/src/test/java/org/opendaylight/bgpcep/pcep/topology/provider/IncrementalSynchronizationProcedureTest.java b/pcep/topology/topology-provider/src/test/java/org/opendaylight/bgpcep/pcep/topology/provider/IncrementalSynchronizationProcedureTest.java index c7b843a9e3..cd69d3cf2f 100644 --- a/pcep/topology/topology-provider/src/test/java/org/opendaylight/bgpcep/pcep/topology/provider/IncrementalSynchronizationProcedureTest.java +++ b/pcep/topology/topology-provider/src/test/java/org/opendaylight/bgpcep/pcep/topology/provider/IncrementalSynchronizationProcedureTest.java @@ -5,7 +5,6 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.bgpcep.pcep.topology.provider; import static org.junit.Assert.assertEquals; @@ -73,7 +72,7 @@ public class IncrementalSynchronizationProcedureTest //session up - expect sync (LSP-DBs do not match) final LspDbVersion localDbVersion = new LspDbVersionBuilder() - .setLspDbVersionValue(Uint64.valueOf(2L)).build(); + .setLspDbVersionValue(Uint64.TWO).build(); session = getPCEPSession(getOpen(localDbVersion), getOpen(null)); this.listener.onSessionUp(session); readDataOperational(getDataBroker(), this.pathComputationClientIId, pcc -> { @@ -85,7 +84,7 @@ public class IncrementalSynchronizationProcedureTest }); //report LSP2 + LSP-DB version number 2 - final Pcrpt pcRpt2 = getPcrpt(Uint32.valueOf(2), "testsecond"); + final Pcrpt pcRpt2 = getPcrpt(Uint32.TWO, "testsecond"); this.listener.onMessage(session, pcRpt2); readDataOperational(getDataBroker(), this.pathComputationClientIId, pcc -> { //check node - synchronized diff --git a/pcep/topology/topology-provider/src/test/java/org/opendaylight/bgpcep/pcep/topology/provider/PCETriggeredInitialSyncProcedureTest.java b/pcep/topology/topology-provider/src/test/java/org/opendaylight/bgpcep/pcep/topology/provider/PCETriggeredInitialSyncProcedureTest.java index 6e6a57db1b..48ff42b74a 100644 --- a/pcep/topology/topology-provider/src/test/java/org/opendaylight/bgpcep/pcep/topology/provider/PCETriggeredInitialSyncProcedureTest.java +++ b/pcep/topology/topology-provider/src/test/java/org/opendaylight/bgpcep/pcep/topology/provider/PCETriggeredInitialSyncProcedureTest.java @@ -67,7 +67,7 @@ public class PCETriggeredInitialSyncProcedureTest final LspDbVersion localDbVersion = new LspDbVersionBuilder() .setLspDbVersionValue(Uint64.ONE).build(); final LspDbVersion localDbVersion2 = new LspDbVersionBuilder() - .setLspDbVersionValue(Uint64.valueOf(2L)).build(); + .setLspDbVersionValue(Uint64.TWO).build(); final PCEPSession session = getPCEPSession(getOpen(localDbVersion, Boolean.FALSE), getOpen(localDbVersion2, Boolean.FALSE)); this.listener.onSessionUp(session); diff --git a/pcep/topology/topology-provider/src/test/java/org/opendaylight/bgpcep/pcep/topology/provider/StateSynchronizationAvoidanceProcedureTest.java b/pcep/topology/topology-provider/src/test/java/org/opendaylight/bgpcep/pcep/topology/provider/StateSynchronizationAvoidanceProcedureTest.java index 087c14150a..e3b853ef29 100644 --- a/pcep/topology/topology-provider/src/test/java/org/opendaylight/bgpcep/pcep/topology/provider/StateSynchronizationAvoidanceProcedureTest.java +++ b/pcep/topology/topology-provider/src/test/java/org/opendaylight/bgpcep/pcep/topology/provider/StateSynchronizationAvoidanceProcedureTest.java @@ -133,7 +133,7 @@ public class StateSynchronizationAvoidanceProcedureTest extends //session up - expect sync (LSP-DBs do not match) final LspDbVersion localDbVersion = new LspDbVersionBuilder() - .setLspDbVersionValue(Uint64.valueOf(2L)).build(); + .setLspDbVersionValue(Uint64.TWO).build(); session = getPCEPSession(getOpen(localDbVersion), getOpen(null)); this.listener.onSessionUp(session); @@ -152,7 +152,7 @@ public class StateSynchronizationAvoidanceProcedureTest extends .params.xml.ns.yang.controller.pcep.sync.optimizations.rev181109.Tlvs1.class, new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync .optimizations.rev181109.Tlvs1Builder().setLspDbVersion(new LspDbVersionBuilder() - .setLspDbVersionValue(Uint64.valueOf(2L)).build()).build()).build()), + .setLspDbVersionValue(Uint64.TWO).build()).build()).build()), true, false), Optional.empty(), createPath(Collections.emptyList())); this.listener.onMessage(session, syncMsg); diff --git a/pcep/topology/topology-stats/src/test/java/org/opendaylight/bgpcep/pcep/topology/stats/rpc/TopologyStatsRpcServiceImplTest.java b/pcep/topology/topology-stats/src/test/java/org/opendaylight/bgpcep/pcep/topology/stats/rpc/TopologyStatsRpcServiceImplTest.java index f7b0694c69..5c20b0c40a 100644 --- a/pcep/topology/topology-stats/src/test/java/org/opendaylight/bgpcep/pcep/topology/stats/rpc/TopologyStatsRpcServiceImplTest.java +++ b/pcep/topology/topology-stats/src/test/java/org/opendaylight/bgpcep/pcep/topology/stats/rpc/TopologyStatsRpcServiceImplTest.java @@ -5,7 +5,6 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.bgpcep.pcep.topology.stats.rpc; import static org.junit.Assert.assertEquals; @@ -118,7 +117,7 @@ public class TopologyStatsRpcServiceImplTest extends AbstractConcurrentDataBroke final ReplyTime replyTime = new ReplyTimeBuilder() .setAverageTime(Uint32.ONE) .setMaxTime(Uint32.valueOf(3)) - .setMinTime(Uint32.valueOf(2)) + .setMinTime(Uint32.TWO) .build(); final ErrorMessages errorMsg = new ErrorMessagesBuilder() @@ -129,7 +128,7 @@ public class TopologyStatsRpcServiceImplTest extends AbstractConcurrentDataBroke final StatefulMessagesStatsAug statefulMsg = new StatefulMessagesStatsAugBuilder() .setLastReceivedRptMsgTimestamp(Uint32.valueOf(1553183614L)) .setSentUpdMsgCount(Uint32.ONE) - .setReceivedRptMsgCount(Uint32.valueOf(2)) + .setReceivedRptMsgCount(Uint32.TWO) .setSentInitMsgCount(Uint32.valueOf(3)) .build(); @@ -167,16 +166,16 @@ public class TopologyStatsRpcServiceImplTest extends AbstractConcurrentDataBroke final ReplyTime replyTime = new ReplyTimeBuilder() .setAverageTime(Uint32.ONE) .setMaxTime(Uint32.valueOf(3)) - .setMinTime(Uint32.valueOf(2)) + .setMinTime(Uint32.TWO) .build(); final ErrorMessages errorMsg = new ErrorMessagesBuilder() - .setReceivedErrorMsgCount(Uint32.ONE).setSentErrorMsgCount(Uint32.valueOf(2)).build(); + .setReceivedErrorMsgCount(Uint32.ONE).setSentErrorMsgCount(Uint32.TWO).build(); final StatefulMessagesRpcAug statefulMsg = new StatefulMessagesRpcAugBuilder() .setLastReceivedRptMsgTimestamp(Uint32.valueOf(1553183614L)) .setSentUpdMsgCount(Uint32.ONE) - .setReceivedRptMsgCount(Uint32.valueOf(2)) + .setReceivedRptMsgCount(Uint32.TWO) .setSentInitMsgCount(Uint32.valueOf(3)) .build(); diff --git a/pcep/tunnel/tunnel-provider/src/test/java/org/opendaylight/bgpcep/pcep/tunnel/provider/NodeChangedListenerTest.java b/pcep/tunnel/tunnel-provider/src/test/java/org/opendaylight/bgpcep/pcep/tunnel/provider/NodeChangedListenerTest.java index 1d9a0e2687..9ba1b763a8 100644 --- a/pcep/tunnel/tunnel-provider/src/test/java/org/opendaylight/bgpcep/pcep/tunnel/provider/NodeChangedListenerTest.java +++ b/pcep/tunnel/tunnel-provider/src/test/java/org/opendaylight/bgpcep/pcep/tunnel/provider/NodeChangedListenerTest.java @@ -76,7 +76,7 @@ public class NodeChangedListenerTest extends AbstractConcurrentDataBrokerTest { private static final String NODE2_IPV4 = "40.40.40.40"; private static final NodeId NODE2_ID = new NodeId("pcc://" + NODE2_IPV4); private static final String LSP2_NAME = "lsp2"; - private static final Uint32 LSP2_ID = Uint32.valueOf(2); + private static final Uint32 LSP2_ID = Uint32.TWO; private static final InstanceIdentifier PCEP_TOPO_IID = InstanceIdentifier.builder(NetworkTopology.class) .child(Topology.class, new TopologyKey(PCEP_TOPOLOGY_ID)).build(); diff --git a/util/src/test/java/org/opendaylight/protocol/util/IPAddressesAndPrefixesTest.java b/util/src/test/java/org/opendaylight/protocol/util/IPAddressesAndPrefixesTest.java index dca0543f69..3489023407 100644 --- a/util/src/test/java/org/opendaylight/protocol/util/IPAddressesAndPrefixesTest.java +++ b/util/src/test/java/org/opendaylight/protocol/util/IPAddressesAndPrefixesTest.java @@ -204,12 +204,12 @@ public class IPAddressesAndPrefixesTest { @Test public void testToInetSocketAddress() { final InetSocketAddress isa = Ipv4Util.toInetSocketAddress(new IpAddress(new Ipv4Address("123.42.13.8")), - new PortNumber(Uint16.valueOf(10))); + new PortNumber(Uint16.TEN)); Assert.assertEquals(10, isa.getPort()); Assert.assertEquals("123.42.13.8", InetAddresses.toAddrString(isa.getAddress())); final InetSocketAddress isa2 = Ipv4Util.toInetSocketAddress(new IpAddress(new Ipv6Address("2001:db8:1:2::")), - new PortNumber(Uint16.valueOf(10))); + new PortNumber(Uint16.TEN)); Assert.assertEquals(10, isa2.getPort()); Assert.assertEquals("2001:db8:1:2::", InetAddresses.toAddrString(isa2.getAddress())); }