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
.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();
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();
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
* 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;
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";
return ImmutableContainerNodeSchemaAwareBuilder.create().withNodeIdentifier(nid);
}
- public static <T> ImmutableLeafNodeBuilder<T> createValueBuilder(final T value, NodeIdentifier nid) {
+ public static <T> ImmutableLeafNodeBuilder<T> createValueBuilder(final T value, final NodeIdentifier nid) {
final ImmutableLeafNodeBuilder<T> valueBuilder = new ImmutableLeafNodeBuilder<>();
valueBuilder.withNodeIdentifier(nid).withValue(value);
return valueBuilder;
private static FlowspecType createIcmpType() {
final List<Types> 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());
private static FlowspecType createIcmpType() {
final List<Types> 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());
final List<SrgbValue> 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());
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());
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 },
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,
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();
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)))
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();
.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())
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;
}
* 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;
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<OpaqueValue> OPAQUE_VALUE_LIST = Arrays.asList((OpaqueValue) OPAQUE,
(OpaqueValue) OPAQUE_EXTENDED);
* 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;
.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())
* 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;
.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())
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(
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(
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());
.setActive(true)
.setPrefixes(new PrefixesBuilder()
.setSent(Uint32.ONE)
- .setReceived(Uint32.valueOf(2))
+ .setReceived(Uint32.TWO)
.setInstalled(Uint32.ONE)
.build());
final AfiSafi afiSafi = new AfiSafiBuilder()
asNumbers.add(new AsNumber(Uint32.valueOf(30)));
final List<Segments> asPath = new ArrayList<>();
asPath.add(new SegmentsBuilder().setAsSequence(asNumbers).build());
- final List<AsNumber> asSet = Lists.newArrayList(new AsNumber(Uint32.valueOf(10)),
- new AsNumber(Uint32.valueOf(20)));
+ final List<AsNumber> 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)))
final List<Nlri> 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());
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();
.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)
.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,
.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,
public void testAttributeParser() throws BGPParsingException, BGPDocumentedException {
final List<Segments> 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());
@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());
}
public class BasePathSelectorTest {
private static final List<AsNumber> 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<AsNumber> 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);
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);
* 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;
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();
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";
@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());
.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)))
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&"
* 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;
.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));
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()
.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()
.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);
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());
}
}
});
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),
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(
.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);
.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();
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))
* 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;
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);
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();
}
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);
.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());
return pcc;
});
- pcRptMsg = createSrPcRpt("1.1.1.3", "sr-path2", Uint32.valueOf(2), false);
+ pcRptMsg = createSrPcRpt("1.1.1.3", "sr-path2", Uint32.TWO, false);
this.listener.onMessage(this.session, pcRptMsg);
readDataOperational(getDataBroker(), this.pathComputationClientIId, pcc -> {
//check second lsp sr-path
@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));
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));
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(
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();
.setMessages(messages)
.build();
}
-}
\ No newline at end of file
+}
* 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;
//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 -> {
});
//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
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);
//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);
.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);
* 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;
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()
final StatefulMessagesStatsAug statefulMsg = new StatefulMessagesStatsAugBuilder()
.setLastReceivedRptMsgTimestamp(Uint32.valueOf(1553183614L))
.setSentUpdMsgCount(Uint32.ONE)
- .setReceivedRptMsgCount(Uint32.valueOf(2))
+ .setReceivedRptMsgCount(Uint32.TWO)
.setSentInitMsgCount(Uint32.valueOf(3))
.build();
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();
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<Topology> PCEP_TOPO_IID = InstanceIdentifier.builder(NetworkTopology.class)
.child(Topology.class, new TopologyKey(PCEP_TOPOLOGY_ID)).build();
@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()));
}