Migrate away from legacy setters 15/85115/7
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 15 Oct 2019 07:09:57 +0000 (09:09 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 15 Oct 2019 13:58:09 +0000 (15:58 +0200)
This migrates away from deprecated setters.

Change-Id: I50acf46d1d13ff88deb46b838a5e524cd89e203a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
117 files changed:
bgp/benchmark-app/src/main/java/org/opendaylight/protocol/bgp/benchmark/app/AppPeerBenchmark.java
bgp/benchmark-app/src/test/java/org/opendaylight/protocol/bgp/benchmark/app/AppPeerBenchmarkTest.java
bgp/extensions/evpn/src/test/java/org/opendaylight/protocol/bgp/evpn/impl/EvpnRibSupportTest.java
bgp/extensions/evpn/src/test/java/org/opendaylight/protocol/bgp/evpn/impl/extended/communities/Layer2AttributesExtComTest.java
bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecIpv4RIBSupportTest.java
bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecIpv6RIBSupportTest.java
bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecL3vpnIpv4NlriParserTest.java
bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecL3vpnIpv4RIBSupportTest.java
bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecL3vpnIpv6NlriParserTest.java
bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecL3vpnIpv6RIBSupportTest.java
bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecIpv4NlriParserTest.java
bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecIpv6NlriParserTest.java
bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/extended/communities/FSExtendedCommunitiesTest.java
bgp/extensions/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/handlers/NumericOperandParserTest.java
bgp/extensions/inet/src/test/java/org/opendaylight/protocol/bgp/inet/IPv4RIBSupportTest.java
bgp/extensions/inet/src/test/java/org/opendaylight/protocol/bgp/inet/IPv6RIBSupportTest.java
bgp/extensions/inet/src/test/java/org/opendaylight/protocol/bgp/inet/codec/BGPParserTest.java
bgp/extensions/inet/src/test/java/org/opendaylight/protocol/bgp/inet/codec/Ipv4NlriParserTest.java
bgp/extensions/l3vpn/src/main/java/org/opendaylight/protocol/bgp/l3vpn/mcast/AbstractL3vpnMcastIpRIBSupport.java
bgp/extensions/l3vpn/src/main/java/org/opendaylight/protocol/bgp/l3vpn/unicast/AbstractVpnRIBSupport.java
bgp/extensions/l3vpn/src/test/java/org/opendaylight/protocol/bgp/l3vpn/mcast/L3vpnMcastIpv4RIBSupportTest.java
bgp/extensions/l3vpn/src/test/java/org/opendaylight/protocol/bgp/l3vpn/mcast/L3vpnMcastIpv6RIBSupportTest.java
bgp/extensions/l3vpn/src/test/java/org/opendaylight/protocol/bgp/l3vpn/unicast/ipv4/VpnIpv4NlriParserTest.java
bgp/extensions/l3vpn/src/test/java/org/opendaylight/protocol/bgp/l3vpn/unicast/ipv4/VpnIpv4RIBSupportTest.java
bgp/extensions/l3vpn/src/test/java/org/opendaylight/protocol/bgp/l3vpn/unicast/ipv6/VpnIpv6NlriParserTest.java
bgp/extensions/l3vpn/src/test/java/org/opendaylight/protocol/bgp/l3vpn/unicast/ipv6/VpnIpv6RIBSupportTest.java
bgp/extensions/labeled-unicast/src/main/java/org/opendaylight/protocol/bgp/labeled/unicast/AbstractLabeledUnicastRIBSupport.java
bgp/extensions/labeled-unicast/src/test/java/org/opendaylight/protocol/bgp/labeled/unicast/BgpPrefixSidTlvsTest.java
bgp/extensions/labeled-unicast/src/test/java/org/opendaylight/protocol/bgp/labeled/unicast/LUNlriParserTest.java
bgp/extensions/labeled-unicast/src/test/java/org/opendaylight/protocol/bgp/labeled/unicast/LabeledUnicastIpv4RIBSupportTest.java
bgp/extensions/labeled-unicast/src/test/java/org/opendaylight/protocol/bgp/labeled/unicast/LabeledUnicastIpv6RIBSupportTest.java
bgp/extensions/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/impl/LinkstateRIBSupport.java
bgp/extensions/linkstate/src/test/java/org/opendaylight/protocol/bgp/linkstate/LinkstateNlriParserTest.java
bgp/extensions/linkstate/src/test/java/org/opendaylight/protocol/bgp/linkstate/LinkstateRIBSupportTest.java
bgp/extensions/linkstate/src/test/java/org/opendaylight/protocol/bgp/linkstate/ParserTest.java
bgp/extensions/linkstate/src/test/java/org/opendaylight/protocol/bgp/linkstate/SrAttributeParserTest.java
bgp/extensions/mvpn/src/main/java/org/opendaylight/protocol/bgp/mvpn/impl/AbstractMvpnRIBSupport.java
bgp/extensions/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/MvpnIpv4RIBSupportTest.java
bgp/extensions/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/MvpnIpv6RIBSupportTest.java
bgp/extensions/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/attributes/PEDistinguisherLabelsAttributeHandlerTest.java
bgp/extensions/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/attributes/PMSITunnelAttributeHandlerTestUtil.java
bgp/extensions/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/attributes/tunnel/identifier/OpaqueUtilTest.java
bgp/extensions/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/nlri/InterASIPmsiADHandlerTest.java
bgp/extensions/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/nlri/LeafADHandlerTest.java
bgp/extensions/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/nlri/SharedTreeJoinHandlerTest.java
bgp/extensions/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/nlri/SourceTreeJoinHandlerTest.java
bgp/extensions/route-target/src/main/java/org/opendaylight/protocol/bgp/route/targetcontrain/impl/RouteTargetConstrainRIBSupport.java
bgp/extensions/route-target/src/test/java/org/opendaylight/protocol/bgp/route/targetcontrain/impl/RouteTargetConstrainRIBSupportTest.java
bgp/extensions/route-target/src/test/java/org/opendaylight/protocol/bgp/route/targetcontrain/impl/nlri/SimpleRouteTargetConstrainNlriRegistryTest.java
bgp/openconfig-rp-spi/src/test/java/org/opendaylight/protocol/bgp/openconfig/routing/policy/spi/AppendActionTest.java
bgp/openconfig-rp-spi/src/test/java/org/opendaylight/protocol/bgp/openconfig/routing/policy/spi/AttributesEqualTests.java
bgp/openconfig-rp-statement/src/main/java/org/opendaylight/protocol/bgp/openconfig/routing/policy/statement/actions/AbstractPrependAsPath.java
bgp/openconfig-rp-statement/src/main/java/org/opendaylight/protocol/bgp/openconfig/routing/policy/statement/actions/NonTransitiveAttributesFilterHandler.java
bgp/openconfig-rp-statement/src/main/java/org/opendaylight/protocol/bgp/openconfig/routing/policy/statement/actions/SetClusterIdPrependHandler.java
bgp/openconfig-rp-statement/src/main/java/org/opendaylight/protocol/bgp/openconfig/routing/policy/statement/actions/SetCommunityHandler.java
bgp/openconfig-rp-statement/src/main/java/org/opendaylight/protocol/bgp/openconfig/routing/policy/statement/actions/SetExtCommunityHandler.java
bgp/openconfig-rp-statement/src/main/java/org/opendaylight/protocol/bgp/openconfig/routing/policy/statement/actions/SetOriginatorIdPrependHandler.java
bgp/openconfig-rp-statement/src/test/java/org/opendaylight/protocol/bgp/openconfig/routing/policy/statement/ExportAttributeTestUtil.java
bgp/openconfig-rp-statement/src/test/java/org/opendaylight/protocol/bgp/openconfig/routing/policy/statement/ImportAttributeTestUtil.java
bgp/openconfig-rp-statement/src/test/java/org/opendaylight/protocol/bgp/openconfig/routing/policy/statement/MatchAfiSafiNotInTest.java
bgp/openconfig-rp-statement/src/test/java/org/opendaylight/protocol/bgp/openconfig/routing/policy/statement/MatchCommunityTest.java
bgp/openconfig-rp-statement/src/test/java/org/opendaylight/protocol/bgp/openconfig/routing/policy/statement/MatchExtComTest.java
bgp/openconfig-rp-statement/src/test/java/org/opendaylight/protocol/bgp/openconfig/routing/policy/statement/SetCommunityTest.java
bgp/openconfig-rp-statement/src/test/java/org/opendaylight/protocol/bgp/openconfig/routing/policy/statement/SetExtCommunityTest.java
bgp/openconfig-rp-statement/src/test/java/org/opendaylight/protocol/bgp/openconfig/routing/policy/statement/VpnNonMemberHandlerTest.java
bgp/openconfig-state/src/main/java/org/opendaylight/protocol/bgp/state/NeighborUtil.java
bgp/openconfig-state/src/test/java/org/opendaylight/protocol/bgp/state/NeighborUtilTest.java
bgp/openconfig-state/src/test/java/org/opendaylight/protocol/bgp/state/StateProviderImplTest.java
bgp/parser-api/src/test/java/org/opendaylight/protocol/bgp/parser/APITest.java
bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/BGPParserTest.java
bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/ComplementaryTest.java
bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/GracefulCapabilityHandlerTest.java
bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/OpenTest.java
bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/ParserTest.java
bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/message/update/ExtendedCommunitiesAttributeParserTest.java
bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/message/update/LocalPreferenceAttributeParserTest.java
bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/message/update/MultiExitDiscriminatorAttributeParserTest.java
bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/message/update/UnrecognizedAttributesSerializerTest.java
bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/message/update/extended/communities/RouteOrigin4OctectASEcHandlerTest.java
bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/message/update/extended/communities/RouteOriginAsTwoOctetEcHandlerTest.java
bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/message/update/extended/communities/RouteOriginIpv4EcHandlerTest.java
bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/message/update/extended/communities/SourceAS4OctectASHandlerTest.java
bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/message/update/extended/communities/SourceASHandlerTest.java
bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/message/update/extended/communities/route/target/RouteTargetAsTwoOctetEcHandlerTest.java
bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/message/update/extended/communities/route/target/RouteTargetIpv4EcHandlerTest.java
bgp/parser-mock/pom.xml
bgp/parser-mock/src/test/java/org/opendaylight/protocol/bgp/parser/mock/BGPMessageParserMockTest.java
bgp/parser-spi/src/test/java/org/opendaylight/protocol/bgp/parser/spi/PathIdUtilTest.java
bgp/path-selection-mode/src/test/java/org/opendaylight/protocol/bgp/mode/impl/base/BasePathSelectorTest.java
bgp/peer-acceptor/src/test/java/org/opendaylight/protocol/bgp/peer/acceptor/BGPPeerAcceptorImplTest.java
bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/AbstractAddPathTest.java
bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/AbstractBGPDispatcherTest.java
bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/AbstractRIBTestSetup.java
bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/AddPathAllPathsTest.java
bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/AddPathBasePathsTest.java
bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/AddPathNPathsTest.java
bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/BGPSessionImplTest.java
bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/BgpPeerRpcTest.java
bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/CheckUtil.java
bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/FSMTest.java
bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/GracefulRestartTest.java
bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/PeerTest.java
bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/StrictBGPPeerRegistryTest.java
bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/SynchronizationAndExceptionTest.java
bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/config/AbstractConfig.java
bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/config/BgpPeerTest.java
bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/config/GracefulRestartUtilTest.java
bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/config/OpenConfigMappingUtilTest.java
bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/config/RIBTestsUtil.java
bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/config/RibImplTest.java
bgp/rib-spi/src/test/java/org/opendaylight/protocol/bgp/rib/spi/AbstractRIBSupportTest.java
rsvp/impl/src/test/java/org/opendaylight/protocol/rsvp/parser/impl/EROSubobjectParserTest.java
rsvp/impl/src/test/java/org/opendaylight/protocol/rsvp/parser/impl/LabelSubobjectParserTest.java
rsvp/impl/src/test/java/org/opendaylight/protocol/rsvp/parser/impl/RROSubobjectParserTest.java
rsvp/impl/src/test/java/org/opendaylight/protocol/rsvp/parser/impl/XROSubobjectParserTest.java
rsvp/spi/src/test/java/org/opendaylight/protocol/rsvp/parser/spi/subobjects/CommonPathKeyParserTest.java
rsvp/spi/src/test/java/org/opendaylight/protocol/rsvp/parser/spi/subobjects/EROSubobjectListParserTest.java

index 92f20a4a51072be9a1808da1949e031d3e938bd7..bfd7949833333a5ee505866062de121861765e77 100644 (file)
@@ -83,8 +83,8 @@ public class AppPeerBenchmark implements OdlBgpAppPeerBenchmarkService, Transact
 
     private static final AsPath AS_PATH = new AsPathBuilder().build();
     private static final Origin ORIGIN = new OriginBuilder().setValue(BgpOrigin.Igp).build();
-    private static final MultiExitDisc MED = new MultiExitDiscBuilder().setMed(0L).build();
-    private static final LocalPref LOC_PREF = new LocalPrefBuilder().setPref(100L).build();
+    private static final MultiExitDisc MED = new MultiExitDiscBuilder().setMed(Uint32.ZERO).build();
+    private static final LocalPref LOC_PREF = new LocalPrefBuilder().setPref(Uint32.valueOf(100)).build();
     private static final List<Tables> EMPTY_TABLES = Collections.singletonList(new TablesBuilder()
         .setAfi(Ipv4AddressFamily.class).setSafi(UnicastSubsequentAddressFamily.class).setRoutes(
             new Ipv4RoutesCaseBuilder().setIpv4Routes(new Ipv4RoutesBuilder().setIpv4Route(Collections.emptyList())
@@ -271,7 +271,8 @@ public class AppPeerBenchmark implements OdlBgpAppPeerBenchmarkService, Transact
     }
 
     private static Result createResult(final Uint32 count, final long duration, final long rate) {
-        return new ResultBuilder().setCount(count).setDuration(duration).setRate(rate).build();
+        return new ResultBuilder().setCount(count).setDuration(Uint32.valueOf(duration)).setRate(Uint32.valueOf(rate))
+                .build();
     }
 
     private static String getAdddressFromPrefix(final Ipv4Prefix prefix) {
index a9ff6a3dc9486946b8d37a9b676cec642ab6fc3c..e0bce080ff627a3e36999c5f7cd59ce726ae591c 100644 (file)
@@ -36,6 +36,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.odl.bgp.
 import org.opendaylight.yangtools.concepts.ObjectRegistration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class AppPeerBenchmarkTest extends AbstractConcurrentDataBrokerTest {
 
@@ -62,7 +63,7 @@ public class AppPeerBenchmarkTest extends AbstractConcurrentDataBrokerTest {
         appPeerBenchmark.start();
         final InstanceIdentifier<Ipv4Routes> routesIID = appPeerBenchmark.getIpv4RoutesIID();
 
-        final AddPrefixInput addPrefix = new AddPrefixInputBuilder().setBatchsize(1L).setCount(1L)
+        final AddPrefixInput addPrefix = new AddPrefixInputBuilder().setBatchsize(Uint32.ONE).setCount(Uint32.ONE)
                 .setNexthop(new Ipv4Address(NH)).setPrefix(new Ipv4Prefix(PREFIX)).build();
 
         final RpcResult<AddPrefixOutput> addRpcResult = appPeerBenchmark.addPrefix(addPrefix).get();
@@ -76,8 +77,8 @@ public class AppPeerBenchmarkTest extends AbstractConcurrentDataBrokerTest {
             return routes;
         });
 
-        final DeletePrefixInput deletePrefix = new DeletePrefixInputBuilder().setBatchsize(1L).setCount(1L)
-                .setPrefix(new Ipv4Prefix(PREFIX)).build();
+        final DeletePrefixInput deletePrefix = new DeletePrefixInputBuilder().setBatchsize(Uint32.ONE)
+                .setCount(Uint32.ONE).setPrefix(new Ipv4Prefix(PREFIX)).build();
         final RpcResult<DeletePrefixOutput> deleteRpcResult = appPeerBenchmark
                 .deletePrefix(deletePrefix).get();
         final Result deleteResult = deleteRpcResult.getResult().getResult();
index 1cd4e725484933fc5ba0b784838083f99c20c8e1..a0b21dff2f2742ef7f1fdd4f0b9a44d67225c049 100644 (file)
@@ -46,6 +46,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.tables.Routes;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode;
@@ -82,7 +83,7 @@ public final class EvpnRibSupportTest extends AbstractRIBSupportTest<EvpnRoutesC
         final ByteBuf buffer = Unpooled.buffer();
         EvpnNlriParser.serializeNlri(Collections.singletonList(new EvpnDestinationBuilder()
                 .setRouteDistinguisher(RD).setEvpnChoice(ETHERNET_AD_ROUTE_CASE_KEY).build()), buffer);
-        ROUTE_KEY = new EvpnRouteKey(new PathId(0L), ByteArray.encodeBase64(buffer));
+        ROUTE_KEY = new EvpnRouteKey(new PathId(Uint32.ZERO), ByteArray.encodeBase64(buffer));
         ROUTE = new EvpnRouteBuilder().setRouteKey(ROUTE_KEY.getRouteKey())
                 .setPathId(ROUTE_KEY.getPathId())
                 .setAttributes(ATTRIBUTES).setRouteDistinguisher(RD).setEvpnChoice(ETHERNET_AD_ROUTE_CASE).build();
index 2b5db3628b1cab4ce4c000eb39d5202a46fb3ecc..6ea8d100e970ec3c460776e57a42a4f44cbe5030 100644 (file)
@@ -5,9 +5,9 @@
  * 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.extended.communities;
 
+import static java.lang.Boolean.TRUE;
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
 import static org.opendaylight.protocol.bgp.evpn.impl.EvpnTestUtil.COMMUNITY_VALUE_SIZE;
@@ -26,6 +26,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev180329.evpn.routes.evpn.routes.evpn.route.attributes.extended.communities.extended.community.Layer2AttributesExtendedCommunityCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev180329.layer._2.attributes.extended.community.Layer2AttributesExtendedCommunityBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.ExtendedCommunity;
+import org.opendaylight.yangtools.yang.common.Uint16;
 
 public class Layer2AttributesExtComTest {
     private static final byte[] EXPECTEDS = {(byte) 0x00, (byte) 0x07, (byte) 0x01, (byte) 0x01,
@@ -46,8 +47,8 @@ public class Layer2AttributesExtComTest {
         final ByteBuf buff = Unpooled.buffer(COMMUNITY_VALUE_SIZE);
 
         final Layer2AttributesExtendedCommunityCase expected = new Layer2AttributesExtendedCommunityCaseBuilder()
-                .setLayer2AttributesExtendedCommunity(new Layer2AttributesExtendedCommunityBuilder().setBackupPe(true)
-                        .setControlWord(true).setPrimaryPe(true).setL2Mtu(257).build()).build();
+                .setLayer2AttributesExtendedCommunity(new Layer2AttributesExtendedCommunityBuilder().setBackupPe(TRUE)
+                        .setControlWord(TRUE).setPrimaryPe(TRUE).setL2Mtu(Uint16.valueOf(257)).build()).build();
         this.parser.serializeExtendedCommunity(expected, buff);
         final byte[] resultByte = ByteArray.getAllBytes(buff);
         assertArrayEquals(EXPECTEDS, resultByte);
@@ -61,8 +62,8 @@ public class Layer2AttributesExtComTest {
         final ByteBuf buff = Unpooled.buffer(COMMUNITY_VALUE_SIZE);
 
         final Layer2AttributesExtendedCommunityCase expected = new Layer2AttributesExtendedCommunityCaseBuilder()
-                .setLayer2AttributesExtendedCommunity(new Layer2AttributesExtendedCommunityBuilder().setBackupPe(true)
-                        .setControlWord(true).setPrimaryPe(true).setL2Mtu(257)
+                .setLayer2AttributesExtendedCommunity(new Layer2AttributesExtendedCommunityBuilder().setBackupPe(TRUE)
+                        .setControlWord(TRUE).setPrimaryPe(TRUE).setL2Mtu(Uint16.valueOf(257))
                         .setModeOfOperation(OperationalMode.VlanAwareFxc)
                         .setOperatingPer(NormalizationType.SingleVid)
                         .build()).build();
@@ -75,8 +76,8 @@ public class Layer2AttributesExtComTest {
 
         final ByteBuf buff2 = Unpooled.buffer(COMMUNITY_VALUE_SIZE);
         final Layer2AttributesExtendedCommunityCase expected2 = new Layer2AttributesExtendedCommunityCaseBuilder()
-                .setLayer2AttributesExtendedCommunity(new Layer2AttributesExtendedCommunityBuilder().setBackupPe(true)
-                        .setControlWord(true).setPrimaryPe(true).setL2Mtu(257)
+                .setLayer2AttributesExtendedCommunity(new Layer2AttributesExtendedCommunityBuilder().setBackupPe(TRUE)
+                        .setControlWord(TRUE).setPrimaryPe(TRUE).setL2Mtu(Uint16.valueOf(257))
                         .setModeOfOperation(OperationalMode.VlanUnawareFxc)
                         .setOperatingPer(NormalizationType.DoubleVid)
                         .build()).build();
index a724b93db3e9390183fba7e0c1e08239764851c7..c36ee776bae73c994c559500bdeba1ced175e45d 100644 (file)
@@ -44,6 +44,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mult
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.tables.Routes;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode;
@@ -56,7 +57,7 @@ public class FlowspecIpv4RIBSupportTest extends AbstractRIBSupportTest<FlowspecR
     private FlowspecRoute route;
     private FlowspecRoutes routes;
     private FlowspecRouteKey routeKey;
-    private static final PathId PATH_ID = new PathId(1L);
+    private static final PathId PATH_ID = new PathId(Uint32.ONE);
 
     private static final DestinationPrefixCase DEST_PREFIX = new DestinationPrefixCaseBuilder()
             .setDestinationPrefix(new Ipv4Prefix("10.0.1.0/32")).build();
index 21d788350ef5628c56287865f2c6b50ed0567702..325eac0b81318b9fc445174c4200e0db6e467687 100644 (file)
@@ -44,6 +44,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mult
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.tables.Routes;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode;
@@ -52,7 +53,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidates;
 public class FlowspecIpv6RIBSupportTest extends AbstractRIBSupportTest<FlowspecIpv6RoutesCase, FlowspecIpv6Routes,
         FlowspecRoute, FlowspecRouteKey> {
 
-    private static final PathId PATH_ID = new PathId(1L);
+    private static final PathId PATH_ID = new PathId(Uint32.ONE);
     private static final DestinationIpv6PrefixCase DEST_PREFIX = new DestinationIpv6PrefixCaseBuilder()
             .setDestinationPrefix(new Ipv6Prefix("2001:db8:1:2::/64")).build();
     private static final List<Flowspec> FLOW_LIST = Collections.singletonList(new FlowspecBuilder()
index eafd07c872d052424344dc0392501ebd22d20aa8..fe4133479cf3c38d9c636bd99f27f626a4dab16e 100644 (file)
@@ -98,6 +98,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.RouteDistinguisherBuilder;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.common.Uint8;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
@@ -113,7 +114,7 @@ public class FlowspecL3vpnIpv4NlriParserTest {
 
     private static final String ROUTE_DISTINGUISHER = "1.2.3.4:10";
 
-    private static final PathId PATH_ID = new PathId(1L);
+    private static final PathId PATH_ID = new PathId(Uint32.ONE);
 
     @Mock
     private PeerSpecificParserConstraint constraint;
@@ -275,22 +276,22 @@ public class FlowspecL3vpnIpv4NlriParserTest {
 
     private static FlowspecType createSps() {
         final List<SourcePorts> sports = Lists.newArrayList(new SourcePortsBuilder().setOp(
-            new NumericOperand(false, true, true, false, false)).setValue(8080).build());
+            new NumericOperand(false, true, true, false, false)).setValue(Uint16.valueOf(8080)).build());
         return new SourcePortCaseBuilder().setSourcePorts(sports).build();
     }
 
     private static FlowspecType createProts() {
         final List<ProtocolIps> protocols = Lists.newArrayList(new ProtocolIpsBuilder().setOp(
-            new NumericOperand(false, true, true, false, false)).setValue((short) 6).build());
+            new NumericOperand(false, true, true, false, false)).setValue(Uint8.valueOf(6)).build());
         return new ProtocolIpCaseBuilder().setProtocolIps(protocols).build();
     }
 
     private static FlowspecType createDps() {
         final List<DestinationPorts> destports = Lists.newArrayList(
-            new DestinationPortsBuilder().setOp(new NumericOperand(false, false, false, true, false)).setValue(4089)
-            .build(),
-            new DestinationPortsBuilder().setOp(new NumericOperand(false, true, true, false, false)).setValue(179)
-            .build());
+            new DestinationPortsBuilder().setOp(new NumericOperand(false, false, false, true, false))
+                .setValue(Uint16.valueOf(4089)).build(),
+            new DestinationPortsBuilder().setOp(new NumericOperand(false, true, true, false, false))
+                .setValue(Uint16.valueOf(179)).build());
         return new DestinationPortCaseBuilder().setDestinationPorts(destports).build();
     }
 
@@ -371,9 +372,12 @@ public class FlowspecL3vpnIpv4NlriParserTest {
 
     private static PortCase createPorts() {
         final List<Ports> ports = Lists.newArrayList(
-            new PortsBuilder().setOp(new NumericOperand(false, false, true, true, false)).setValue(137).build(),
-            new PortsBuilder().setOp(new NumericOperand(true, false, true, false, true)).setValue(139).build(),
-            new PortsBuilder().setOp(new NumericOperand(false, true, true, false, false)).setValue(8080).build());
+            new PortsBuilder().setOp(new NumericOperand(false, false, true, true, false)).setValue(Uint16.valueOf(137))
+                .build(),
+            new PortsBuilder().setOp(new NumericOperand(true, false, true, false, true)).setValue(Uint16.valueOf(139))
+                .build(),
+            new PortsBuilder().setOp(new NumericOperand(false, true, true, false, false)).setValue(Uint16.valueOf(8080))
+                .build());
 
         return new PortCaseBuilder().setPorts(ports).build();
     }
@@ -462,34 +466,40 @@ public class FlowspecL3vpnIpv4NlriParserTest {
 
     private static FlowspecType createDscp() {
         final List<Dscps> dscps = Lists.newArrayList(new DscpsBuilder().setOp(
-            new NumericOperand(false, true, false, true, false)).setValue(new Dscp((short) 42)).build());
+            new NumericOperand(false, true, false, true, false)).setValue(new Dscp(Uint8.valueOf(42))).build());
         return new DscpCaseBuilder().setDscps(dscps).build();
     }
 
     private static PacketLengthCase createPackets() {
         final List<PacketLengths> packets = Lists.newArrayList(new PacketLengthsBuilder().setOp(
-            new NumericOperand(false, true, false, false, true)).setValue(57005).build());
+            new NumericOperand(false, true, false, false, true)).setValue(Uint16.valueOf(57005)).build());
         return new PacketLengthCaseBuilder().setPacketLengths(packets).build();
     }
 
     private static TcpFlagsCase createTcp() {
         final List<TcpFlags> flags = Lists.newArrayList(
-            new TcpFlagsBuilder().setOp(new BitmaskOperand(false, false, false, true)).setValue(1025).build(),
-            new TcpFlagsBuilder().setOp(new BitmaskOperand(false, true, true, false)).setValue(22193).build());
+            new TcpFlagsBuilder().setOp(new BitmaskOperand(false, false, false, true)).setValue(Uint16.valueOf(1025))
+                .build(),
+            new TcpFlagsBuilder().setOp(new BitmaskOperand(false, true, true, false)).setValue(Uint16.valueOf(22193))
+                .build());
         return new TcpFlagsCaseBuilder().setTcpFlags(flags).build();
     }
 
     private static FlowspecType createIcmpCode() {
         final List<Codes> codes = Lists.newArrayList(
-            new CodesBuilder().setOp(new NumericOperand(false, false, false, false, true)).setValue((short) 4).build(),
-            new CodesBuilder().setOp(new NumericOperand(false, true, false, false, false)).setValue((short) 5).build());
+            new CodesBuilder().setOp(new NumericOperand(false, false, false, false, true)).setValue(Uint8.valueOf(4))
+                .build(),
+            new CodesBuilder().setOp(new NumericOperand(false, true, false, false, false)).setValue(Uint8.valueOf(5))
+                .build());
         return new IcmpCodeCaseBuilder().setCodes(codes).build();
     }
 
     private static FlowspecType createIcmpType() {
         final List<Types> types = Lists.newArrayList(
-            new TypesBuilder().setOp(new NumericOperand(false, false, false, false, true)).setValue((short) 2).build(),
-            new TypesBuilder().setOp(new NumericOperand(false, true, false, false, true)).setValue((short) 3).build());
+            new TypesBuilder().setOp(new NumericOperand(false, false, false, false, true)).setValue(Uint8.valueOf(2))
+                .build(),
+            new TypesBuilder().setOp(new NumericOperand(false, true, false, false, true)).setValue(Uint8.valueOf(3))
+                .build());
         return new IcmpTypeCaseBuilder().setTypes(types).build();
     }
 
@@ -658,14 +668,19 @@ public class FlowspecL3vpnIpv4NlriParserTest {
                                 .withValue(Uint8.valueOf(240)).build()).build())
                         .build()).build()).build()).build());
 
-        final FlowspecBuilder expectedFS = new FlowspecBuilder();
-        expectedFS.setFlowspecType(new ProtocolIpCaseBuilder().setProtocolIps(Lists.newArrayList(
-            new ProtocolIpsBuilder().setValue((short) 100).setOp(new NumericOperand(true, true, false, false, false))
-            .build(),
-            new ProtocolIpsBuilder().setValue((short) 200).setOp(new NumericOperand(true, false, false, false, false))
-            .build(),
-            new ProtocolIpsBuilder().setValue((short) 240).setOp(new NumericOperand(true, true, true, false, false))
-            .build())).build());
+        final FlowspecBuilder expectedFS = new FlowspecBuilder()
+                .setFlowspecType(new ProtocolIpCaseBuilder()
+                    .setProtocolIps(Lists.newArrayList(new ProtocolIpsBuilder()
+                        .setValue(Uint8.valueOf(100))
+                        .setOp(new NumericOperand(true, true, false, false, false))
+                        .build(), new ProtocolIpsBuilder()
+                        .setValue(Uint8.valueOf(200))
+                        .setOp(new NumericOperand(true, false, false, false, false))
+                        .build(), new ProtocolIpsBuilder()
+                        .setValue(Uint8.valueOf(240))
+                        .setOp(new NumericOperand(true, true, true, false, false))
+                        .build()))
+                    .build());
         final List<Flowspec> expected = new ArrayList<>();
         expected.add(expectedFS.build());
         assertEquals(expected, this.fsParser.extractFlowspec(entry.build()));
@@ -692,9 +707,13 @@ public class FlowspecL3vpnIpv4NlriParserTest {
                                 .withValue(Uint16.valueOf(100)).build()).build())
                         .build()).build()).build()).build());
 
-        final FlowspecBuilder expectedFS = new FlowspecBuilder();
-        expectedFS.setFlowspecType(new PortCaseBuilder().setPorts(Lists.newArrayList(new PortsBuilder().setValue(100)
-            .setOp(new NumericOperand(true, true, false, false, true)).build())).build());
+        final FlowspecBuilder expectedFS = new FlowspecBuilder()
+                .setFlowspecType(new PortCaseBuilder()
+                    .setPorts(Lists.newArrayList(new PortsBuilder()
+                        .setValue(Uint16.valueOf(100))
+                        .setOp(new NumericOperand(true, true, false, false, true))
+                        .build()))
+                    .build());
         final List<Flowspec> expected = new ArrayList<>();
         expected.add(expectedFS.build());
         assertEquals(expected, this.fsParser.extractFlowspec(entry.build()));
@@ -722,9 +741,12 @@ public class FlowspecL3vpnIpv4NlriParserTest {
                                 .withValue(Uint16.valueOf(1024)).build()).build())
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
-        expectedFS.setFlowspecType(new DestinationPortCaseBuilder().setDestinationPorts(Lists.newArrayList(
-            new DestinationPortsBuilder().setValue(1024).setOp(new NumericOperand(false, true, true, false, false))
-            .build())).build());
+        expectedFS.setFlowspecType(new DestinationPortCaseBuilder()
+            .setDestinationPorts(Lists.newArrayList(new DestinationPortsBuilder()
+                .setValue(Uint16.valueOf(1024))
+                .setOp(new NumericOperand(false, true, true, false, false))
+                .build()))
+            .build());
         final List<Flowspec> expected = new ArrayList<>();
         expected.add(expectedFS.build());
         assertEquals(expected, this.fsParser.extractFlowspec(entry.build()));
@@ -754,8 +776,11 @@ public class FlowspecL3vpnIpv4NlriParserTest {
                                 .withValue(Uint16.valueOf(8080)).build()).build())
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
-        expectedFS.setFlowspecType(new SourcePortCaseBuilder().setSourcePorts(Lists.newArrayList(
-            new SourcePortsBuilder().setValue(8080).setOp(new NumericOperand(true, true, true, true, true)).build()))
+        expectedFS.setFlowspecType(new SourcePortCaseBuilder()
+            .setSourcePorts(Lists.newArrayList(new SourcePortsBuilder()
+                .setValue(Uint16.valueOf(8080))
+                .setOp(new NumericOperand(true, true, true, true, true))
+                .build()))
             .build());
         final List<Flowspec> expected = new ArrayList<>();
         expected.add(expectedFS.build());
@@ -786,8 +811,11 @@ public class FlowspecL3vpnIpv4NlriParserTest {
                                 .withValue(Uint8.valueOf(22)).build()).build())
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
-        expectedFS.setFlowspecType(new IcmpTypeCaseBuilder().setTypes(Lists.newArrayList(
-            new TypesBuilder().setValue((short) 22).setOp(new NumericOperand(true, true, true, true, true)).build()))
+        expectedFS.setFlowspecType(new IcmpTypeCaseBuilder()
+            .setTypes(Lists.newArrayList(new TypesBuilder()
+                .setValue(Uint8.valueOf(22))
+                .setOp(new NumericOperand(true, true, true, true, true))
+                .build()))
             .build());
         final List<Flowspec> expected = new ArrayList<>();
         expected.add(expectedFS.build());
@@ -815,8 +843,12 @@ public class FlowspecL3vpnIpv4NlriParserTest {
                                 .withValue(Uint8.valueOf(23)).build()).build())
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
-        expectedFS.setFlowspecType(new IcmpCodeCaseBuilder().setCodes(Lists.newArrayList(new CodesBuilder()
-            .setValue((short) 23).setOp(new NumericOperand(false, false, false, false, false)).build())).build());
+        expectedFS.setFlowspecType(new IcmpCodeCaseBuilder()
+            .setCodes(Lists.newArrayList(new CodesBuilder()
+                .setValue(Uint8.valueOf(23))
+                .setOp(new NumericOperand(false, false, false, false, false))
+                .build()))
+            .build());
         final List<Flowspec> expected = new ArrayList<>();
         expected.add(expectedFS.build());
         assertEquals(expected, this.fsParser.extractFlowspec(entry.build()));
@@ -845,7 +877,7 @@ public class FlowspecL3vpnIpv4NlriParserTest {
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
         expectedFS.setFlowspecType(new TcpFlagsCaseBuilder().setTcpFlags(Lists.newArrayList(new TcpFlagsBuilder()
-            .setValue(99).setOp(new BitmaskOperand(true, true, false, false)).build())).build());
+            .setValue(Uint16.valueOf(99)).setOp(new BitmaskOperand(true, true, false, false)).build())).build());
         final List<Flowspec> expected = new ArrayList<>();
         expected.add(expectedFS.build());
         assertEquals(expected, this.fsParser.extractFlowspec(entry.build()));
@@ -874,7 +906,7 @@ public class FlowspecL3vpnIpv4NlriParserTest {
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
         expectedFS.setFlowspecType(new PacketLengthCaseBuilder().setPacketLengths(Lists.newArrayList(
-            new PacketLengthsBuilder().setValue(101).setOp(
+            new PacketLengthsBuilder().setValue(Uint16.valueOf(101)).setOp(
                 new NumericOperand(true, false, false, true, false)).build())).build());
         final List<Flowspec> expected = new ArrayList<>();
         expected.add(expectedFS.build());
@@ -904,7 +936,7 @@ public class FlowspecL3vpnIpv4NlriParserTest {
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
         expectedFS.setFlowspecType(new DscpCaseBuilder().setDscps(Lists.newArrayList(new DscpsBuilder().setValue(
-            new Dscp((short) 15)).setOp(new NumericOperand(true, true, false, true, false)).build())).build());
+            new Dscp(Uint8.valueOf(15))).setOp(new NumericOperand(true, true, false, true, false)).build())).build());
         final List<Flowspec> expected = new ArrayList<>();
         expected.add(expectedFS.build());
         assertEquals(expected, this.fsParser.extractFlowspec(entry.build()));
index c1881ab873d398a126dda48ea82561c95c4b8cba..a31ffca91fda59e26680121124ef76800c4e3439 100644 (file)
@@ -45,6 +45,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.RouteDistinguisher;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode;
@@ -55,7 +56,7 @@ public class FlowspecL3vpnIpv4RIBSupportTest extends AbstractRIBSupportTest<Flow
 
     private static final FlowspecL3vpnRoute ROUTE;
     private static final FlowspecL3vpnRouteKey ROUTE_KEY;
-    private static final PathId PATH_ID = new PathId(1L);
+    private static final PathId PATH_ID = new PathId(Uint32.ONE);
     private static final RouteDistinguisher RD = new RouteDistinguisher(new RdTwoOctetAs("0:5:3"));
     private static final DestinationPrefixCase DEST_PREFIX = new DestinationPrefixCaseBuilder()
             .setDestinationPrefix(new Ipv4Prefix("172.17.1.0/24")).build();
index 6ef79172349bb8a9d8e7b2334b1101362a4069fa..dd5d51ae381305b3cbbd2316aa11aaee4703e8b8 100644 (file)
@@ -146,7 +146,7 @@ public class FlowspecL3vpnIpv6NlriParserTest {
         fs.add(builder.build());
 
         final List<NextHeaders> nextheaders = Lists.newArrayList(new NextHeadersBuilder()
-            .setOp(new NumericOperand(false, true, true, false, false)).setValue((short) 6).build());
+            .setOp(new NumericOperand(false, true, true, false, false)).setValue(Uint8.valueOf(6)).build());
         final NextHeaderCase headersCase = new NextHeaderCaseBuilder().setNextHeaders(nextheaders).build();
         builder.setFlowspecType(headersCase);
         fs.add(builder.build());
@@ -210,7 +210,7 @@ public class FlowspecL3vpnIpv6NlriParserTest {
         fs.add(builder.build());
 
         final List<NextHeaders> nextheaders = Lists.newArrayList(new NextHeadersBuilder()
-            .setOp(new NumericOperand(false, true, true, false, false)).setValue((short) 6).build());
+            .setOp(new NumericOperand(false, true, true, false, false)).setValue(Uint8.valueOf(6)).build());
         final NextHeaderCase headersCase = new NextHeaderCaseBuilder().setNextHeaders(nextheaders).build();
         builder.setFlowspecType(headersCase);
         fs.add(builder.build());
@@ -319,9 +319,9 @@ public class FlowspecL3vpnIpv6NlriParserTest {
     private static FlowspecType createLabel() {
         final List<FlowLabel> labels = new ArrayList<>(2);
         labels.add(new FlowLabelBuilder().setOp(new NumericOperand(false, false, true, false, false))
-            .setValue(16777222L).build());
+            .setValue(Uint32.valueOf(16777222)).build());
         labels.add(new FlowLabelBuilder().setOp(new NumericOperand(false, true, true, false, false))
-            .setValue(258L).build());
+            .setValue(Uint32.valueOf(258)).build());
         return new FlowLabelCaseBuilder().setFlowLabel(labels).build();
     }
 
@@ -445,14 +445,16 @@ public class FlowspecL3vpnIpv6NlriParserTest {
                                 .withValue(Uint8.valueOf(210)).build()).build())
                         .build()).build()).build()).build());
 
-        final FlowspecBuilder expectedFS = new FlowspecBuilder();
-        expectedFS.setFlowspecType(new NextHeaderCaseBuilder().setNextHeaders(Lists.newArrayList(
-            new NextHeadersBuilder().setValue((short) 100).setOp(new NumericOperand(true, true, false, false, false))
-            .build(),
-            new NextHeadersBuilder().setValue((short) 200).setOp(new NumericOperand(true, false, false, false, false))
-            .build(),
-            new NextHeadersBuilder().setValue((short) 210).setOp(new NumericOperand(true, true, true, false, false))
-            .build())).build());
+        final FlowspecBuilder expectedFS = new FlowspecBuilder()
+                .setFlowspecType(new NextHeaderCaseBuilder()
+                    .setNextHeaders(Lists.newArrayList(
+                        new NextHeadersBuilder().setValue(Uint8.valueOf(100))
+                        .setOp(new NumericOperand(true, true, false, false, false)).build(),
+                        new NextHeadersBuilder().setValue(Uint8.valueOf(200))
+                        .setOp(new NumericOperand(true, false, false, false, false)).build(),
+                        new NextHeadersBuilder().setValue(Uint8.valueOf(210))
+                        .setOp(new NumericOperand(true, true, true, false, false)).build()))
+                    .build());
         final List<Flowspec> expectedValue = new ArrayList<>();
         expectedValue.add(expectedFS.build());
         assertEquals(expectedValue, this.fsParser.extractFlowspec(entry.build()));
@@ -485,8 +487,10 @@ public class FlowspecL3vpnIpv6NlriParserTest {
 
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
         expectedFS.setFlowspecType(new FlowLabelCaseBuilder().setFlowLabel(Lists.newArrayList(
-            new FlowLabelBuilder().setValue(100L).setOp(new NumericOperand(true, true, false, false, false)).build(),
-            new FlowLabelBuilder().setValue(200L).setOp(new NumericOperand(true, false, false, false, false)).build()))
+            new FlowLabelBuilder().setValue(Uint32.valueOf(100))
+                .setOp(new NumericOperand(true, true, false, false, false)).build(),
+            new FlowLabelBuilder().setValue(Uint32.valueOf(200))
+                .setOp(new NumericOperand(true, false, false, false, false)).build()))
             .build());
         final List<Flowspec> expectedValue = new ArrayList<>();
         expectedValue.add(expectedFS.build());
index 38432bb928481ba7fb1512b8f24ed94590e0acf9..a919d91b0649c91e207c1dc0bf7f2f7c49223890 100644 (file)
@@ -45,6 +45,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.RouteDistinguisher;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidates;
@@ -54,7 +55,7 @@ public class FlowspecL3vpnIpv6RIBSupportTest extends AbstractRIBSupportTest<Flow
 
     private static final FlowspecL3vpnRoute ROUTE;
     private static final FlowspecL3vpnRouteKey ROUTE_KEY;
-    private static final PathId PATH_ID = new PathId(1L);
+    private static final PathId PATH_ID = new PathId(Uint32.ONE);
     private static final RouteDistinguisher RD = new RouteDistinguisher(new RdTwoOctetAs("0:5:3"));
     private static final DestinationIpv6PrefixCase DEST_PREFIX = new DestinationIpv6PrefixCaseBuilder()
             .setDestinationPrefix(new Ipv6Prefix("2001:db8:1:2::/64")).build();
index 29db804ecbe6497b7f100a48da8248c0b8832840..1e8b7aa35f3cdabdac6d1ce7228b51824347e072 100644 (file)
@@ -93,6 +93,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mult
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.update.attributes.mp.unreach.nlri.WithdrawnRoutesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.Ipv4AddressFamily;
 import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.common.Uint8;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
@@ -104,7 +105,7 @@ public class SimpleFlowspecIpv4NlriParserTest {
 
     private static final NodeIdentifier PROTOCOL_IP_NID = new NodeIdentifier(ProtocolIps.QNAME);
 
-    static final PathId PATH_ID = new PathId(1L);
+    static final PathId PATH_ID = new PathId(Uint32.ONE);
     @Mock
     private PeerSpecificParserConstraint constraint;
     @Mock
@@ -247,21 +248,21 @@ public class SimpleFlowspecIpv4NlriParserTest {
 
     private static FlowspecType createSps() {
         final List<SourcePorts> sports = Lists.newArrayList(new SourcePortsBuilder().setOp(
-            new NumericOperand(false, true, true, false, false)).setValue(8080).build());
+            new NumericOperand(false, true, true, false, false)).setValue(Uint16.valueOf(8080)).build());
         return new SourcePortCaseBuilder().setSourcePorts(sports).build();
     }
 
     private static FlowspecType createProts() {
         final List<ProtocolIps> protocols = Lists.newArrayList(new ProtocolIpsBuilder().setOp(
-            new NumericOperand(false, true, true, false, false)).setValue((short) 6).build());
+            new NumericOperand(false, true, true, false, false)).setValue(Uint8.valueOf(6)).build());
         return new ProtocolIpCaseBuilder().setProtocolIps(protocols).build();
     }
 
     private static FlowspecType createDps() {
         final List<DestinationPorts> destports = Lists.newArrayList(new DestinationPortsBuilder().setOp(
-            new NumericOperand(false, false, false, true, false)).setValue(4089).build(),
-            new DestinationPortsBuilder().setOp(new NumericOperand(false, true, true, false, false)).setValue(179)
-            .build());
+            new NumericOperand(false, false, false, true, false)).setValue(Uint16.valueOf(4089)).build(),
+            new DestinationPortsBuilder().setOp(new NumericOperand(false, true, true, false, false))
+                .setValue(Uint16.valueOf(179)).build());
         return new DestinationPortCaseBuilder().setDestinationPorts(destports).build();
     }
 
@@ -336,9 +337,12 @@ public class SimpleFlowspecIpv4NlriParserTest {
 
     private static PortCase createPorts() {
         final List<Ports> ports = Lists.newArrayList(
-            new PortsBuilder().setOp(new NumericOperand(false, false, true, true, false)).setValue(137).build(),
-            new PortsBuilder().setOp(new NumericOperand(true, false, true, false, true)).setValue(139).build(),
-            new PortsBuilder().setOp(new NumericOperand(false, true, true, false, false)).setValue(8080).build());
+            new PortsBuilder().setOp(new NumericOperand(false, false, true, true, false)).setValue(Uint16.valueOf(137))
+                .build(),
+            new PortsBuilder().setOp(new NumericOperand(true, false, true, false, true)).setValue(Uint16.valueOf(139))
+                .build(),
+            new PortsBuilder().setOp(new NumericOperand(false, true, true, false, false)).setValue(Uint16.valueOf(8080))
+                .build());
 
         return new PortCaseBuilder().setPorts(ports).build();
     }
@@ -424,35 +428,42 @@ public class SimpleFlowspecIpv4NlriParserTest {
     private static FlowspecType createDscp() {
         final List<Dscps> dscps = Lists.newArrayList(new DscpsBuilder()
             .setOp(new NumericOperand(false, true, false, true, false))
-            .setValue(new Dscp((short) 42)).build());
+            .setValue(new Dscp(Uint8.valueOf(42))).build());
         return new DscpCaseBuilder().setDscps(dscps).build();
     }
 
     private static PacketLengthCase createPackets() {
         final List<PacketLengths> packets = Lists.newArrayList(new PacketLengthsBuilder()
             .setOp(new NumericOperand(false, true, false, false, true))
-            .setValue(57005).build());
+            .setValue(Uint16.valueOf(57005)).build());
         return new PacketLengthCaseBuilder().setPacketLengths(packets).build();
     }
 
     private static TcpFlagsCase createTcp() {
-        final List<TcpFlags> flags = Lists.newArrayList(
-            new TcpFlagsBuilder().setOp(new BitmaskOperand(false, false, false, true)).setValue(1025).build(),
-            new TcpFlagsBuilder().setOp(new BitmaskOperand(false, true, true, false)).setValue(22193).build());
+        final List<TcpFlags> flags = Lists.newArrayList(new TcpFlagsBuilder()
+            .setOp(new BitmaskOperand(false, false, false, true)).setValue(Uint16.valueOf(1025))
+            .build(), new TcpFlagsBuilder()
+            .setOp(new BitmaskOperand(false, true, true, false))
+            .setValue(Uint16.valueOf(22193)).build());
         return new TcpFlagsCaseBuilder().setTcpFlags(flags).build();
     }
 
     private static FlowspecType createIcmpCode() {
-        final List<Codes> codes = Lists.newArrayList(
-            new CodesBuilder().setOp(new NumericOperand(false, false, false, false, true)).setValue((short) 4).build(),
-            new CodesBuilder().setOp(new NumericOperand(false, true, false, false, false)).setValue((short) 5).build());
+        final List<Codes> codes = Lists.newArrayList(new CodesBuilder()
+            .setOp(new NumericOperand(false, false, false, false, true))
+            .setValue(Uint8.valueOf(4))
+            .build(), new CodesBuilder()
+            .setOp(new NumericOperand(false, true, false, false, false))
+            .setValue(Uint8.valueOf(5)).build());
         return new IcmpCodeCaseBuilder().setCodes(codes).build();
     }
 
     private static FlowspecType createIcmpType() {
         final List<Types> types = Lists.newArrayList(
-            new TypesBuilder().setOp(new NumericOperand(false, false, false, false, true)).setValue((short) 2).build(),
-            new TypesBuilder().setOp(new NumericOperand(false, true, false, false, true)).setValue((short) 3).build());
+            new TypesBuilder().setOp(new NumericOperand(false, false, false, false, true)).setValue(Uint8.valueOf(2))
+                .build(),
+            new TypesBuilder().setOp(new NumericOperand(false, true, false, false, true)).setValue(Uint8.valueOf(3))
+                .build());
         return new IcmpTypeCaseBuilder().setTypes(types).build();
     }
 
@@ -620,11 +631,11 @@ public class SimpleFlowspecIpv4NlriParserTest {
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
         expectedFS.setFlowspecType(new ProtocolIpCaseBuilder().setProtocolIps(
             Lists.newArrayList(
-                new ProtocolIpsBuilder().setValue((short) 100).setOp(
+                new ProtocolIpsBuilder().setValue(Uint8.valueOf(100)).setOp(
                     new NumericOperand(true, true, false, false, false)).build(),
-                new ProtocolIpsBuilder().setValue((short) 200).setOp(
+                new ProtocolIpsBuilder().setValue(Uint8.valueOf(200)).setOp(
                     new NumericOperand(true, false, false, false, false)).build(),
-                new ProtocolIpsBuilder().setValue((short) 240).setOp(
+                new ProtocolIpsBuilder().setValue(Uint8.valueOf(240)).setOp(
                     new NumericOperand(true, true, true, false, false)).build())).build());
         final List<Flowspec> expected = new ArrayList<>();
         expected.add(expectedFS.build());
@@ -652,9 +663,13 @@ public class SimpleFlowspecIpv4NlriParserTest {
                                 .withValue(Uint16.valueOf(100)).build()).build())
                         .build()).build()).build()).build());
 
-        final FlowspecBuilder expectedFS = new FlowspecBuilder();
-        expectedFS.setFlowspecType(new PortCaseBuilder().setPorts(Lists.newArrayList(new PortsBuilder()
-            .setValue(100).setOp(new NumericOperand(true, true, false, false, true)).build())).build());
+        final FlowspecBuilder expectedFS = new FlowspecBuilder()
+                .setFlowspecType(new PortCaseBuilder()
+                    .setPorts(Lists.newArrayList(new PortsBuilder()
+                        .setValue(Uint16.valueOf(100))
+                        .setOp(new NumericOperand(true, true, false, false, true))
+                        .build()))
+                    .build());
         final List<Flowspec> expected = new ArrayList<>();
         expected.add(expectedFS.build());
         assertEquals(expected, this.fsParser.extractFlowspec(entry.build()));
@@ -682,9 +697,12 @@ public class SimpleFlowspecIpv4NlriParserTest {
                                 .withValue(Uint16.valueOf(1024)).build()).build())
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
-        expectedFS.setFlowspecType(new DestinationPortCaseBuilder().setDestinationPorts(Lists.newArrayList(
-            new DestinationPortsBuilder().setValue(1024).setOp(new NumericOperand(false, true, true, false, false))
-            .build())).build());
+        expectedFS.setFlowspecType(new DestinationPortCaseBuilder()
+            .setDestinationPorts(Lists.newArrayList(new DestinationPortsBuilder()
+                .setValue(Uint16.valueOf(1024))
+                .setOp(new NumericOperand(false, true, true, false, false))
+                .build()))
+            .build());
         final List<Flowspec> expected = new ArrayList<>();
         expected.add(expectedFS.build());
         assertEquals(expected, this.fsParser.extractFlowspec(entry.build()));
@@ -714,8 +732,11 @@ public class SimpleFlowspecIpv4NlriParserTest {
                                 .withValue(Uint16.valueOf(8080)).build()).build())
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
-        expectedFS.setFlowspecType(new SourcePortCaseBuilder().setSourcePorts(Lists.newArrayList(
-            new SourcePortsBuilder().setValue(8080).setOp(new NumericOperand(true, true, true, true, true)).build()))
+        expectedFS.setFlowspecType(new SourcePortCaseBuilder()
+            .setSourcePorts(Lists.newArrayList(new SourcePortsBuilder()
+                .setValue(Uint16.valueOf(8080))
+                .setOp(new NumericOperand(true, true, true, true, true))
+                .build()))
             .build());
         final List<Flowspec> expected = new ArrayList<>();
         expected.add(expectedFS.build());
@@ -747,7 +768,7 @@ public class SimpleFlowspecIpv4NlriParserTest {
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
         expectedFS.setFlowspecType(new IcmpTypeCaseBuilder().setTypes(Lists.newArrayList(new TypesBuilder()
-            .setValue((short) 22).setOp(new NumericOperand(true, true, true, true, true)).build())).build());
+            .setValue(Uint8.valueOf(22)).setOp(new NumericOperand(true, true, true, true, true)).build())).build());
         final List<Flowspec> expected = new ArrayList<>();
         expected.add(expectedFS.build());
         assertEquals(expected, this.fsParser.extractFlowspec(entry.build()));
@@ -775,7 +796,8 @@ public class SimpleFlowspecIpv4NlriParserTest {
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
         expectedFS.setFlowspecType(new IcmpCodeCaseBuilder().setCodes(Lists.newArrayList(new CodesBuilder()
-            .setValue((short) 23).setOp(new NumericOperand(false, false, false, false, false)).build())).build());
+            .setValue(Uint8.valueOf(23)).setOp(new NumericOperand(false, false, false, false, false)).build()))
+            .build());
         final List<Flowspec> expected = new ArrayList<>();
         expected.add(expectedFS.build());
         assertEquals(expected, this.fsParser.extractFlowspec(entry.build()));
@@ -803,8 +825,12 @@ public class SimpleFlowspecIpv4NlriParserTest {
                                 .withValue(Uint16.valueOf(99)).build()).build())
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
-        expectedFS.setFlowspecType(new TcpFlagsCaseBuilder().setTcpFlags(Lists.newArrayList(new TcpFlagsBuilder()
-            .setValue(99).setOp(new BitmaskOperand(true, true, false, false)).build())).build());
+        expectedFS.setFlowspecType(new TcpFlagsCaseBuilder()
+            .setTcpFlags(Lists.newArrayList(new TcpFlagsBuilder()
+                .setValue(Uint16.valueOf(99))
+                .setOp(new BitmaskOperand(true, true, false, false))
+                .build()))
+            .build());
         final List<Flowspec> expected = new ArrayList<>();
         expected.add(expectedFS.build());
         assertEquals(expected, this.fsParser.extractFlowspec(entry.build()));
@@ -832,9 +858,12 @@ public class SimpleFlowspecIpv4NlriParserTest {
                                 .withValue(Uint16.valueOf(101)).build()).build())
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
-        expectedFS.setFlowspecType(new PacketLengthCaseBuilder().setPacketLengths(Lists.newArrayList(
-            new PacketLengthsBuilder().setValue(101).setOp(new NumericOperand(true, false, false, true, false))
-            .build())).build());
+        expectedFS.setFlowspecType(new PacketLengthCaseBuilder()
+            .setPacketLengths(Lists.newArrayList(new PacketLengthsBuilder()
+                .setValue(Uint16.valueOf(101))
+                .setOp(new NumericOperand(true, false, false, true, false))
+                .build()))
+            .build());
         final List<Flowspec> expected = new ArrayList<>();
         expected.add(expectedFS.build());
         assertEquals(expected, this.fsParser.extractFlowspec(entry.build()));
@@ -863,7 +892,7 @@ public class SimpleFlowspecIpv4NlriParserTest {
                         .build()).build()).build()).build());
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
         expectedFS.setFlowspecType(new DscpCaseBuilder().setDscps(Lists.newArrayList(new DscpsBuilder()
-            .setValue(new Dscp((short) 15)).setOp(new NumericOperand(true, true, false, true, false)).build()))
+            .setValue(new Dscp(Uint8.valueOf(15))).setOp(new NumericOperand(true, true, false, true, false)).build()))
             .build());
         final List<Flowspec> expected = new ArrayList<>();
         expected.add(expectedFS.build());
index effcfdd59ac515524877e0fea59cb6dce7b674aa..66291b71162749895d4b4a59f0a6e1674b39f59f 100644 (file)
@@ -138,7 +138,7 @@ public class SimpleFlowspecIpv6NlriParserTest {
         fs.add(builder.build());
 
         final List<NextHeaders> nextheaders = Lists.newArrayList(new NextHeadersBuilder().setOp(
-            new NumericOperand(false, true, true, false, false)).setValue((short) 6).build());
+            new NumericOperand(false, true, true, false, false)).setValue(Uint8.valueOf(6)).build());
         final NextHeaderCase headersCase = new NextHeaderCaseBuilder().setNextHeaders(nextheaders).build();
         builder.setFlowspecType(headersCase);
         fs.add(builder.build());
@@ -197,7 +197,7 @@ public class SimpleFlowspecIpv6NlriParserTest {
         fs.add(builder.build());
 
         final List<NextHeaders> nextheaders = Lists.newArrayList(new NextHeadersBuilder().setOp(
-            new NumericOperand(false, true, true, false, false)).setValue((short) 6).build());
+            new NumericOperand(false, true, true, false, false)).setValue(Uint8.valueOf(6)).build());
         final NextHeaderCase headersCase = new NextHeaderCaseBuilder().setNextHeaders(nextheaders).build();
         builder.setFlowspecType(headersCase);
         fs.add(builder.build());
@@ -297,9 +297,9 @@ public class SimpleFlowspecIpv6NlriParserTest {
     private static FlowspecType createLabel() {
         final List<FlowLabel> labels = new ArrayList<>(2);
         labels.add(new FlowLabelBuilder().setOp(new NumericOperand(false, false, true, false, false))
-            .setValue(16777222L).build());
+            .setValue(Uint32.valueOf(16777222)).build());
         labels.add(new FlowLabelBuilder().setOp(new NumericOperand(false, true, true, false, false))
-            .setValue(258L).build());
+            .setValue(Uint32.valueOf(258)).build());
         return new FlowLabelCaseBuilder().setFlowLabel(labels).build();
     }
 
@@ -420,12 +420,13 @@ public class SimpleFlowspecIpv6NlriParserTest {
 
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
         expectedFS.setFlowspecType(new NextHeaderCaseBuilder().setNextHeaders(Lists.newArrayList(
-            new NextHeadersBuilder().setValue((short) 100).setOp(new NumericOperand(true, true, false, false, false))
-            .build(),
-            new NextHeadersBuilder().setValue((short) 200).setOp(new NumericOperand(true, false, false, false, false))
-            .build(),
-            new NextHeadersBuilder().setValue((short) 210).setOp(new NumericOperand(true, true, true, false, false))
-            .build())).build());
+            new NextHeadersBuilder().setValue(Uint8.valueOf(100))
+                .setOp(new NumericOperand(true, true, false, false, false)).build(),
+            new NextHeadersBuilder().setValue(Uint8.valueOf(200))
+                .setOp(new NumericOperand(true, false, false, false, false)).build(),
+            new NextHeadersBuilder().setValue(Uint8.valueOf(210))
+                .setOp(new NumericOperand(true, true, true, false, false)).build()))
+            .build());
         final List<Flowspec> expectedValue = new ArrayList<>();
         expectedValue.add(expectedFS.build());
         assertEquals(expectedValue, this.fsParser.extractFlowspec(entry.build()));
@@ -458,8 +459,10 @@ public class SimpleFlowspecIpv6NlriParserTest {
 
         final FlowspecBuilder expectedFS = new FlowspecBuilder();
         expectedFS.setFlowspecType(new FlowLabelCaseBuilder().setFlowLabel(Lists.newArrayList(
-            new FlowLabelBuilder().setValue(100L).setOp(new NumericOperand(true, true, false, false, false)).build(),
-            new FlowLabelBuilder().setValue(200L).setOp(new NumericOperand(true, false, false, false, false)).build()))
+            new FlowLabelBuilder().setValue(Uint32.valueOf(100))
+                .setOp(new NumericOperand(true, true, false, false, false)).build(),
+            new FlowLabelBuilder().setValue(Uint32.valueOf(200))
+                .setOp(new NumericOperand(true, false, false, false, false)).build()))
             .build());
         final List<Flowspec> expectedValue = new ArrayList<>();
         expectedValue.add(expectedFS.build());
index 9e3899165b86e0e3ce991505640b7fb3df478c27..2d3229b24b86768a4325dfe70695a27eaad1f305 100644 (file)
@@ -55,6 +55,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mess
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.attributes.ExtendedCommunitiesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.ShortAsNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125.Bandwidth;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 public class FSExtendedCommunitiesTest {
 
@@ -101,7 +104,7 @@ public class FSExtendedCommunitiesTest {
     public void testTrafficRateParser() throws BGPDocumentedException, BGPParsingException {
         final TrafficRateExtendedCommunityCase trafficRate = new TrafficRateExtendedCommunityCaseBuilder()
                 .setTrafficRateExtendedCommunity(new TrafficRateExtendedCommunityBuilder()
-                    .setInformativeAs(new ShortAsNumber(72L))
+                    .setInformativeAs(new ShortAsNumber(Uint32.valueOf(72)))
                     .setLocalAdministrator(new Bandwidth(new byte[] { 0, 1, 2, 3 })).build()).build();
         final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(trafficRate)
                 .setTransitive(true).build();
@@ -117,7 +120,7 @@ public class FSExtendedCommunitiesTest {
                 new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib
                     .route.attributes.extended.communities.extended.community.TrafficRateExtendedCommunityCaseBuilder()
                     .setTrafficRateExtendedCommunity(new TrafficRateExtendedCommunityBuilder()
-                        .setInformativeAs(new ShortAsNumber(72L))
+                        .setInformativeAs(new ShortAsNumber(Uint32.valueOf(72)))
                         .setLocalAdministrator(new Bandwidth(new byte[] { 0, 1, 2, 3 })).build()).build();
         final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(trafficRate)
                 .setTransitive(true).build();
@@ -160,7 +163,7 @@ public class FSExtendedCommunitiesTest {
     public void testTrafficMarkingParser() throws BGPDocumentedException, BGPParsingException {
         final TrafficMarkingExtendedCommunityCase trafficMarking = new TrafficMarkingExtendedCommunityCaseBuilder()
                 .setTrafficMarkingExtendedCommunity(new TrafficMarkingExtendedCommunityBuilder()
-                    .setGlobalAdministrator(new Dscp((short) 63)).build()).build();
+                    .setGlobalAdministrator(new Dscp(Uint8.valueOf(63))).build()).build();
         final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(trafficMarking)
                 .setTransitive(true).build();
 
@@ -176,7 +179,7 @@ public class FSExtendedCommunitiesTest {
                     .route.attributes.extended.communities.extended.community
                     .TrafficMarkingExtendedCommunityCaseBuilder().setTrafficMarkingExtendedCommunity(
                         new TrafficMarkingExtendedCommunityBuilder()
-                        .setGlobalAdministrator(new Dscp((short) 63)).build()).build();
+                        .setGlobalAdministrator(new Dscp(Uint8.valueOf(63))).build()).build();
         final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(trafficMarking)
                 .setTransitive(true).build();
 
@@ -189,7 +192,7 @@ public class FSExtendedCommunitiesTest {
     public void testRedirect2bParser() throws BGPDocumentedException, BGPParsingException {
         final RedirectExtendedCommunityCase redirect = new RedirectExtendedCommunityCaseBuilder()
                 .setRedirectExtendedCommunity(new RedirectExtendedCommunityBuilder()
-                    .setGlobalAdministrator(new ShortAsNumber(35L))
+                    .setGlobalAdministrator(new ShortAsNumber(Uint32.valueOf(35)))
                     .setLocalAdministrator(new byte[] { 4, 2, 8, 7 }).build()).build();
         final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect)
                 .setTransitive(true).build();
@@ -206,7 +209,7 @@ public class FSExtendedCommunitiesTest {
                 new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib
                     .route.attributes.extended.communities.extended.community.RedirectExtendedCommunityCaseBuilder()
                     .setRedirectExtendedCommunity(new RedirectExtendedCommunityBuilder()
-                        .setGlobalAdministrator(new ShortAsNumber(35L))
+                        .setGlobalAdministrator(new ShortAsNumber(Uint32.valueOf(35)))
                         .setLocalAdministrator(new byte[] { 4, 2, 8, 7 }).build()).build();
         final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect)
                 .setTransitive(true).build();
@@ -221,7 +224,7 @@ public class FSExtendedCommunitiesTest {
         final RedirectIpv6ExtendedCommunityCase redirect = new RedirectIpv6ExtendedCommunityCaseBuilder()
                 .setRedirectIpv6(new RedirectIpv6Builder()
                         .setGlobalAdministrator(new Ipv6Address("102:304:506:708:90a:b0c:d0e:f10"))
-                        .setLocalAdministrator(258).build()).build();
+                        .setLocalAdministrator(Uint16.valueOf(258)).build()).build();
         final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect)
                 .setTransitive(true).build();
 
@@ -237,7 +240,7 @@ public class FSExtendedCommunitiesTest {
                     .route.attributes.extended.communities.extended.community.RedirectIpv6ExtendedCommunityCaseBuilder()
                     .setRedirectIpv6(new RedirectIpv6Builder()
                         .setGlobalAdministrator(new Ipv6Address("102:304:506:708:90a:b0c:d0e:f10"))
-                        .setLocalAdministrator(258).build()).build();
+                        .setLocalAdministrator(Uint16.valueOf(258)).build()).build();
         final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect)
                 .setTransitive(true).build();
 
@@ -248,8 +251,11 @@ public class FSExtendedCommunitiesTest {
 
     @Test
     public void testRedirect4bParser() throws BGPDocumentedException, BGPParsingException {
-        final RedirectAs4ExtendedCommunityCase redirect = new RedirectAs4ExtendedCommunityCaseBuilder().setRedirectAs4(
-                new RedirectAs4Builder().setGlobalAdministrator(new AsNumber(6548L)).setLocalAdministrator(126).build())
+        final RedirectAs4ExtendedCommunityCase redirect = new RedirectAs4ExtendedCommunityCaseBuilder()
+                .setRedirectAs4(new RedirectAs4Builder()
+                    .setGlobalAdministrator(new AsNumber(Uint32.valueOf(6548)))
+                    .setLocalAdministrator(Uint16.valueOf(126))
+                    .build())
                 .build();
 
         final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect)
@@ -266,8 +272,8 @@ public class FSExtendedCommunitiesTest {
             .attributes.extended.communities.extended.community.RedirectAs4ExtendedCommunityCase redirect =
                 new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib
                     .route.attributes.extended.communities.extended.community.RedirectAs4ExtendedCommunityCaseBuilder()
-                    .setRedirectAs4(new RedirectAs4Builder().setGlobalAdministrator(new AsNumber(6548L))
-                        .setLocalAdministrator(126).build()).build();
+                    .setRedirectAs4(new RedirectAs4Builder().setGlobalAdministrator(new AsNumber(Uint32.valueOf(6548)))
+                        .setLocalAdministrator(Uint16.valueOf(126)).build()).build();
 
         final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect)
                 .setTransitive(true).build();
@@ -281,7 +287,7 @@ public class FSExtendedCommunitiesTest {
     public void testRedirectIpv4Parser() throws BGPDocumentedException, BGPParsingException {
         final RedirectIpv4ExtendedCommunityCase redirect = new RedirectIpv4ExtendedCommunityCaseBuilder()
                 .setRedirectIpv4(new RedirectIpv4Builder().setGlobalAdministrator(new Ipv4Address("127.0.0.1"))
-                    .setLocalAdministrator(126).build()).build();
+                    .setLocalAdministrator(Uint16.valueOf(126)).build()).build();
 
         final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect)
                 .setTransitive(true).build();
@@ -297,7 +303,7 @@ public class FSExtendedCommunitiesTest {
                 new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.bgp.rib
                     .route.attributes.extended.communities.extended.community.RedirectIpv4ExtendedCommunityCaseBuilder()
                         .setRedirectIpv4(new RedirectIpv4Builder().setGlobalAdministrator(new Ipv4Address("127.0.0.1"))
-                            .setLocalAdministrator(126).build()).build();
+                            .setLocalAdministrator(Uint16.valueOf(126)).build()).build();
 
         final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setExtendedCommunity(redirect)
                 .setTransitive(true).build();
index d98b610bb21917b74732d4f9dc9c66b4caeb2c86..7b9415819cb603537239d774e916c14e3704ed06 100644 (file)
@@ -20,6 +20,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flow
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.flowspec.destination.flowspec.flowspec.type.icmp.code._case.CodesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.flowspec.destination.flowspec.flowspec.type.port._case.Ports;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.flowspec.destination.flowspec.flowspec.type.port._case.PortsBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 public class NumericOperandParserTest {
     private static final byte[] ONE_BYTE_CODE_LIST = new byte[]{
@@ -34,11 +36,10 @@ public class NumericOperandParserTest {
         final List<Ports> ports = new ArrayList<>();
         // create 3 ports without end-of-list bit set
         for (int i = 0; i < 3; i++) {
-            ports.add(
-                    new PortsBuilder()
-                            .setOp(new NumericOperand(false, false, true, false, false))
-                            .setValue(100 + i)
-                            .build()
+            ports.add(new PortsBuilder()
+                .setOp(new NumericOperand(false, false, true, false, false))
+                .setValue(Uint16.valueOf(100 + i))
+                .build()
             );
         }
         NumericTwoByteOperandParser.INSTANCE.serialize(ports, nlriByteBuf);
@@ -54,7 +55,7 @@ public class NumericOperandParserTest {
             codes.add(
                     new CodesBuilder()
                             .setOp(new NumericOperand(false, false, true, false, false))
-                            .setValue((short) (100 + i))
+                            .setValue(Uint8.valueOf(100 + i))
                             .build()
             );
         }
index d2f99aca81ce910b38b374a680cf8c9ce10d500d..822da625648c3ea12409dbb75cde28b1096f5fa7 100644 (file)
@@ -40,6 +40,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mult
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.tables.Routes;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode;
@@ -48,7 +49,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidates;
 public final class IPv4RIBSupportTest extends AbstractRIBSupportTest<Ipv4RoutesCase, Ipv4Routes, Ipv4Route,
         Ipv4RouteKey> {
     private IPv4RIBSupport ribSupport;
-    private static final PathId PATH_ID = new PathId(1L);
+    private static final PathId PATH_ID = new PathId(Uint32.ONE);
     private static final Ipv4Prefix PREFIX = new Ipv4Prefix("1.2.3.4/32");
     private static final Ipv4RouteKey ROUTE_KEY = new Ipv4RouteKey(PATH_ID, PREFIX.getValue());
     private static final Ipv4Prefixes IPV4_PREFIXES = new Ipv4PrefixesBuilder().setPathId(PATH_ID)
@@ -128,7 +129,7 @@ public final class IPv4RIBSupportTest extends AbstractRIBSupportTest<Ipv4RoutesC
 
     @Test
     public void testRouteIdAddPath() {
-        final Ipv4RouteKey expected = new Ipv4RouteKey(new PathId(1L), PREFIX.getValue());
+        final Ipv4RouteKey expected = new Ipv4RouteKey(new PathId(Uint32.ONE), PREFIX.getValue());
         assertEquals(expected, this.ribSupport.createRouteListKey(expected.getPathId(), PREFIX.getValue()));
     }
 
index 322bef429780b2bede7ab3d4a161c4160b8bb7f6..827c872fe62231f074b656cf2069e5bb39b36e41 100644 (file)
@@ -39,6 +39,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mult
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.tables.Routes;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode;
@@ -47,7 +48,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidates;
 public final class IPv6RIBSupportTest extends AbstractRIBSupportTest<Ipv6RoutesCase, Ipv6Routes, Ipv6Route,
         Ipv6RouteKey> {
     private IPv6RIBSupport ribSupport;
-    private static final PathId PATH_ID = new PathId(1L);
+    private static final PathId PATH_ID = new PathId(Uint32.ONE);
     private static final Ipv6Prefix PREFIX = new Ipv6Prefix("2001:db8:1:2::/64");
     private static final Ipv6RouteKey ROUTE_KEY = new Ipv6RouteKey(PATH_ID, PREFIX.getValue());
     private static final Ipv6Prefixes IPV6_PREFIXES = new Ipv6PrefixesBuilder().setPathId(PATH_ID)
@@ -129,7 +130,7 @@ public final class IPv6RIBSupportTest extends AbstractRIBSupportTest<Ipv6RoutesC
 
     @Test
     public void testRouteIdAddPath() {
-        final Ipv6RouteKey expected = new Ipv6RouteKey(new PathId(1L), PREFIX.getValue());
+        final Ipv6RouteKey expected = new Ipv6RouteKey(new PathId(Uint32.ONE), PREFIX.getValue());
         assertEquals(expected, this.ribSupport.createRouteListKey(expected.getPathId(), PREFIX.getValue()));
     }
 
index 062773b2c9446a64554a16ab1be228b81724f9d7..2bddc37642478258b7106df42fbe9bdaf9bae262 100644 (file)
@@ -63,6 +63,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.next.hop.c.next.hop.Ipv6NextHopCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.next.hop.c.next.hop.Ipv6NextHopCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.next.hop.c.next.hop.ipv6.next.hop._case.Ipv6NextHopBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class BGPParserTest {
 
@@ -170,7 +171,7 @@ public class BGPParserTest {
 
         // attributes
         final List<AsNumber> asNumbers = new ArrayList<>();
-        asNumbers.add(new AsNumber(65001L));
+        asNumbers.add(new AsNumber(Uint32.valueOf(65001)));
         final List<Segments> asPath = new ArrayList<>();
         asPath.add(new SegmentsBuilder().setAsSequence(asNumbers).build());
 
@@ -193,7 +194,7 @@ public class BGPParserTest {
         paBuilder.setAsPath(new AsPathBuilder().setSegments(asPath).build());
         assertEquals(paBuilder.getAsPath(), attrs.getAsPath());
 
-        paBuilder.setMultiExitDisc(new MultiExitDiscBuilder().setMed((long) 0).build());
+        paBuilder.setMultiExitDisc(new MultiExitDiscBuilder().setMed(Uint32.ZERO).build());
         assertEquals(paBuilder.getMultiExitDisc(), attrs.getMultiExitDisc());
 
         paBuilder.setOriginatorId(new OriginatorIdBuilder().setOriginator(new Ipv4Address("127.0.0.1")).build());
index ac41ef254c798815b9eff05def61939b7942e0f5..e9e128aeed88c761a3739f0d551f6d6aec78613a 100644 (file)
@@ -49,6 +49,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mult
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.update.attributes.mp.unreach.nlri.WithdrawnRoutesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.Ipv4AddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.UnicastSubsequentAddressFamily;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class Ipv4NlriParserTest {
     private static final byte[] MP_NLRI_BYTES = new byte[]{
@@ -78,7 +79,7 @@ public class Ipv4NlriParserTest {
     private MultiPathSupport muliPathSupport;
 
     private static Ipv4Prefixes createIpv4Prefix(final long pathId, final Ipv4Prefix prefix) {
-        return new Ipv4PrefixesBuilder().setPathId(new PathId(pathId)).setPrefix(prefix).build();
+        return new Ipv4PrefixesBuilder().setPathId(new PathId(Uint32.valueOf(pathId))).setPrefix(prefix).build();
     }
 
     @Before
index 5ac60253794e30881f1de823f181e7ea710c7952..af661d79325dd0ecf5ab389b2702a20aafe8700d 100644 (file)
@@ -141,9 +141,8 @@ abstract class AbstractL3vpnMcastIpRIBSupport<
                         keys.add(routeKey);
                     }
                     return keys;
-                } else {
-                    LOG.warn("Routes {} are not a map", routes);
                 }
+                LOG.warn("Routes {} are not a map", routes);
             }
         }
         return Collections.emptyList();
index b99436e0c21cf09fc76d5ef258a9d3b46293e267..6668000f4116e34a8765bcb1caa7dae1258a5132 100644 (file)
@@ -138,9 +138,8 @@ public abstract class AbstractVpnRIBSupport<C extends Routes & DataObject, S ext
                         keys.add(key);
                     }
                     return keys;
-                } else {
-                    LOG.warn("Routes {} are not a map", routes);
                 }
+                LOG.warn("Routes {} are not a map", routes);
             }
         } else {
             LOG.debug("Destination is null.");
index 77dfc3a337080021195232e3be59e6999486460e..b889bd250fd6c21819e9e09c29d9be1863d85aec 100644 (file)
@@ -44,6 +44,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.RdIpv4;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.RouteDistinguisher;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
@@ -52,7 +53,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidates;
 
 public class L3vpnMcastIpv4RIBSupportTest extends AbstractRIBSupportTest<L3vpnMcastRoutesIpv4Case ,L3vpnMcastRoutesIpv4,
         L3vpnMcastRoute, L3vpnMcastRouteKey> {
-    private static final PathId PATH_ID = new PathId(0L);
+    private static final PathId PATH_ID = new PathId(Uint32.ZERO);
     private static final IpPrefix IPV4_PREFIX = new IpPrefix(new Ipv4Prefix("34.1.22.0/24"));
     private static final RouteDistinguisher RD = new RouteDistinguisher(new RdIpv4("1.2.3.4:258"));
     private static final L3vpnMcastRouteKey ROUTE_KEY
index 85517d6722b23413301a5191abf0c7da1407f148..9dd6a9aacccb1e48d398ddc5824f6e77d93d909f 100644 (file)
@@ -44,6 +44,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.RdIpv4;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.RouteDistinguisher;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
@@ -52,7 +53,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidates;
 
 public class L3vpnMcastIpv6RIBSupportTest extends AbstractRIBSupportTest<L3vpnMcastRoutesIpv6Case, L3vpnMcastRoutesIpv6,
         L3vpnMcastRoute, L3vpnMcastRouteKey> {
-    private static final PathId PATH_ID = new PathId(0L);
+    private static final PathId PATH_ID = new PathId(Uint32.ZERO);
     private static final IpPrefix IPV6_PREFIX = new IpPrefix(new Ipv6Prefix("2001:db8:1:1::/64"));
     private static final RouteDistinguisher RD = new RouteDistinguisher(new RdIpv4("1.2.3.4:258"));
     private static final L3vpnMcastRouteKey ROUTE_KEY
index 66230cd51b0693786d5c3a56495b899bf4ee3b5f..5b8ed86fa05aabb1abb99368e4148b8ff166b15a 100755 (executable)
@@ -42,6 +42,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.rev180329.l3vpn.ip.destination.type.VpnDestination;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.rev180329.l3vpn.ip.destination.type.VpnDestinationBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125.MplsLabel;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class VpnIpv4NlriParserTest {
 
@@ -84,7 +85,7 @@ public class VpnIpv4NlriParserTest {
 
     static final IpPrefix IPV4_PREFIX = new IpPrefix(new Ipv4Prefix("34.1.22.0/24"));
     static final List<LabelStack> LABEL_STACK = Lists.newArrayList(
-        new LabelStackBuilder().setLabelValue(new MplsLabel(355L)).build());
+        new LabelStackBuilder().setLabelValue(new MplsLabel(Uint32.valueOf(355))).build());
     static final RouteDistinguisher DISTINGUISHER = RouteDistinguisherBuilder
             .getDefaultInstance("1.2.3.4:258");
     static final VpnDestination IPV4_VPN = new VpnDestinationBuilder().setRouteDistinguisher(DISTINGUISHER)
index 101a80c5d0cb96b8ae24cedc4c0089ce21366ca8..318761ac6a9767ab25dd4f648443de1e3fda4238 100644 (file)
@@ -41,6 +41,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.rev180329.l3vpn.ip.route.VpnRouteKey;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode;
@@ -59,7 +60,7 @@ public class VpnIpv4RIBSupportTest extends AbstractRIBSupportTest<VpnIpv4RoutesC
                     .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationVpnIpv4CaseBuilder()
                     .setVpnIpv4Destination(new VpnIpv4DestinationBuilder()
                             .setVpnDestination(Collections.singletonList(IPV4_VPN)).build()).build();
-    private static final VpnRouteKey ROUTE_KEY = new VpnRouteKey(new PathId(0L), "WAABAQIDBAECIgEW");
+    private static final VpnRouteKey ROUTE_KEY = new VpnRouteKey(new PathId(Uint32.ZERO), "WAABAQIDBAECIgEW");
 
     private static final VpnRoute ROUTE = new VpnRouteBuilder().setPathId(NON_PATH_ID)
             .setAttributes(ATTRIBUTES).setPrefix(IPV4_PREFIX)
index d7c451d0d63f07b696138191fb7e6c23ab75ac84..9fcd755f916cd769ff4cb3fdf5376f1d3fcc4845 100755 (executable)
@@ -42,6 +42,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.rev180329.l3vpn.ip.destination.type.VpnDestination;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.rev180329.l3vpn.ip.destination.type.VpnDestinationBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125.MplsLabel;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class VpnIpv6NlriParserTest {
 
@@ -84,7 +85,7 @@ public class VpnIpv6NlriParserTest {
 
     static final IpPrefix IPV6PREFIX = new IpPrefix(new Ipv6Prefix("2001:2345:5689::/48"));
     static final List<LabelStack> LABEL_STACK = Lists.newArrayList(
-        new LabelStackBuilder().setLabelValue(new MplsLabel(355L)).build());
+        new LabelStackBuilder().setLabelValue(new MplsLabel(Uint32.valueOf(355))).build());
     static final RouteDistinguisher DISTINGUISHER = RouteDistinguisherBuilder
             .getDefaultInstance("1.2.3.4:258");
     static final VpnDestination IPV6_VPN = new VpnDestinationBuilder().setRouteDistinguisher(DISTINGUISHER)
index 395ea3016396882c8cac644092951eeb78c2670d..293f6ab77a15a3218267022be73a1a58b84e6de3 100644 (file)
@@ -41,6 +41,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.rev180329.l3vpn.ip.route.VpnRouteKey;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode;
@@ -60,7 +61,7 @@ public class VpnIpv6RIBSupportTest extends AbstractRIBSupportTest<VpnIpv6RoutesC
                     .attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationVpnIpv6CaseBuilder()
                     .setVpnIpv6Destination(new VpnIpv6DestinationBuilder()
                             .setVpnDestination(Collections.singletonList(IPV6_VPN)).build()).build();
-    private static final VpnRouteKey ROUTE_KEY = new VpnRouteKey(new PathId(0L), "cAABAQIDBAECIAEjRVaJ");
+    private static final VpnRouteKey ROUTE_KEY = new VpnRouteKey(new PathId(Uint32.ZERO), "cAABAQIDBAECIAEjRVaJ");
     private static final VpnRoute ROUTE = new VpnRouteBuilder().setPathId(NON_PATH_ID)
             .setAttributes(ATTRIBUTES).setPrefix(IPV6PREFIX)
             .setLabelStack(LABEL_STACK).setRouteDistinguisher(DISTINGUISHER).withKey(ROUTE_KEY).build();
index dd35af3bb3638644438c01ec017c7e9d9afaf16d..31cefda907438e5b98d4f8c6fb021bf559428513 100644 (file)
@@ -110,9 +110,8 @@ abstract class AbstractLabeledUnicastRIBSupport<
                         keys.add(routeKey);
                     }
                     return keys;
-                } else {
-                    LOG.warn("Routes {} are not a map", routes);
                 }
+                LOG.warn("Routes {} are not a map", routes);
             }
         }
         return Collections.emptyList();
index a0c8f35f5d6362b95abf5f63364d6a7a21d68c90..a23e64aa14b40543c3b7163ce07811dcafc6c59f 100644 (file)
@@ -22,13 +22,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labe
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev180329.update.attributes.bgp.prefix.sid.bgp.prefix.sid.tlvs.bgp.prefix.sid.tlv.LuLabelIndexTlvBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev180329.update.attributes.bgp.prefix.sid.bgp.prefix.sid.tlvs.bgp.prefix.sid.tlv.LuOriginatorSrgbTlv;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev180329.update.attributes.bgp.prefix.sid.bgp.prefix.sid.tlvs.bgp.prefix.sid.tlv.LuOriginatorSrgbTlvBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public final class BgpPrefixSidTlvsTest {
 
     @Test
     public void testLabelIndexParser() {
         final LabelIndexTlvParser parser = new LabelIndexTlvParser();
-        final LuLabelIndexTlv tlv = new LuLabelIndexTlvBuilder().setLabelIndexTlv(333L).build();
+        final LuLabelIndexTlv tlv = new LuLabelIndexTlvBuilder().setLabelIndexTlv(Uint32.valueOf(333)).build();
         final ByteBuf serialized = Unpooled.buffer(7);
         final byte[] expected = new byte[] {0, 0, 0, 0, 0, 1, (byte)0x4d};
         parser.serializeBgpPrefixSidTlv(tlv, serialized);
@@ -44,8 +45,8 @@ public final class BgpPrefixSidTlvsTest {
         final OriginatorSrgbTlvParser parser = new OriginatorSrgbTlvParser();
         final List<SrgbValue> list = new ArrayList<>();
 
-        final Srgb srgb1 = new Srgb(1L);
-        final Srgb srgb2 = new Srgb(2L);
+        final Srgb srgb1 = new Srgb(Uint32.ONE);
+        final Srgb srgb2 = new Srgb(Uint32.valueOf(2));
         list.add(new SrgbValueBuilder().setBase(srgb1).setRange(srgb2).build());
         list.add(new SrgbValueBuilder().setBase(srgb2).setRange(srgb1).build());
 
index c8d9c287daa08ec20c50bc0521e1729393361e87..f4013e2c21a8a90e1174e6fe6727a67c2941843d 100755 (executable)
@@ -51,6 +51,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mult
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.Ipv4AddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.Ipv6AddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125.MplsLabel;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class LUNlriParserTest {
 
@@ -213,20 +214,19 @@ public class LUNlriParserTest {
     };
 
     private static final List<LabelStack> LABEL_STACK = Lists.newArrayList(
-        new LabelStackBuilder().setLabelValue(new MplsLabel(355L)).build(),
-        new LabelStackBuilder().setLabelValue(new MplsLabel(356L)).build(),
-        new LabelStackBuilder().setLabelValue(new MplsLabel(357L)).build());
+        new LabelStackBuilder().setLabelValue(new MplsLabel(Uint32.valueOf(355))).build(),
+        new LabelStackBuilder().setLabelValue(new MplsLabel(Uint32.valueOf(356))).build(),
+        new LabelStackBuilder().setLabelValue(new MplsLabel(Uint32.valueOf(357))).build());
 
     private static final IpPrefix IPV4_PREFIX = new IpPrefix(new Ipv4Prefix("34.1.22.0/24"));
     private static final IpPrefix IPV6_PREFIX = new IpPrefix(new Ipv6Prefix("2001:db8:1:2::/128"));
-    private static final PathId PATH_ID = new PathId(1L);
+    private static final PathId PATH_ID = new PathId(Uint32.ONE);
 
     @Mock
     private PeerSpecificParserConstraint constraint;
     @Mock
     private MultiPathSupport muliPathSupport;
 
-
     @Before
     public void setUp() {
         MockitoAnnotations.initMocks(this);
index 41349fa3f6523c7c62a94fe99de214ac8b6442c1..a61c2f0d1faf307ff73903df1d87c985c76f9a67 100644 (file)
@@ -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.labeled.unicast;
 
 import static org.junit.Assert.assertEquals;
@@ -49,6 +48,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125.MplsLabel;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode;
@@ -62,9 +62,9 @@ public class LabeledUnicastIpv4RIBSupportTest extends AbstractRIBSupportTest<Lab
     private static final LabeledUnicastRoutes ROUTES;
     private static final LabeledUnicastRouteKey ROUTE_KEY;
     private static final String LABEL_KEY;
-    private static final PathId PATH_ID = new PathId(1L);
+    private static final PathId PATH_ID = new PathId(Uint32.ONE);
     private static final List<LabelStack> LABEL_STACK = Lists.newArrayList(new LabelStackBuilder()
-            .setLabelValue(new MplsLabel(355L)).build());
+            .setLabelValue(new MplsLabel(Uint32.valueOf(355))).build());
     private static final List<CLabeledUnicastDestination> LABELED_DESTINATION_LIST
             = Collections.singletonList(new CLabeledUnicastDestinationBuilder()
             .setPathId(PATH_ID).setLabelStack(LABEL_STACK).setPrefix(IPV4_PREFIX).build());
index 57b5a70da3a615b561e3a559978689b5fe3fbb0e..c539af1b493571d9f8d69dac038257d51ee62db4 100644 (file)
@@ -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.labeled.unicast;
 
 import static org.junit.Assert.assertEquals;
@@ -49,6 +48,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125.MplsLabel;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode;
@@ -62,9 +62,9 @@ public class LabeledUnicastIpv6RIBSupportTest extends AbstractRIBSupportTest<Lab
     private static final LabeledUnicastIpv6Routes ROUTES;
     private static final LabeledUnicastRouteKey ROUTE_KEY;
     private static final String LABEL_KEY;
-    private static final PathId PATH_ID = new PathId(1L);
+    private static final PathId PATH_ID = new PathId(Uint32.ONE);
     private static final List<LabelStack> LABEL_STACK = Lists.newArrayList(new LabelStackBuilder()
-            .setLabelValue(new MplsLabel(355L)).build());
+            .setLabelValue(new MplsLabel(Uint32.valueOf(355))).build());
     private static final List<CLabeledUnicastDestination> LABELED_DESTINATION_LIST
             = Collections.singletonList(new CLabeledUnicastDestinationBuilder()
             .setPathId(PATH_ID).setLabelStack(LABEL_STACK).setPrefix(IPV6_PREFIX).build());
index d3f9bb2ee9ad60f776878c304744403ab477f452..429aa5b4b6b5b37ee2324da7ae429566bd4df9e5 100644 (file)
@@ -123,9 +123,8 @@ public final class LinkstateRIBSupport
                     keys.add(routeKey);
                 }
                 return keys;
-            } else {
-                LOG.warn("Routes {} are not a map", routes);
             }
+            LOG.warn("Routes {} are not a map", routes);
         }
         return Collections.emptyList();
     }
index 90206d128a037f8824cffdcbe2351e9b77d2d5c2..9d7c3b065d622a34a55657cf9b3bbad829e9b373 100644 (file)
@@ -187,10 +187,10 @@ public class LinkstateNlriParserTest {
         final NodeCase nCase = (NodeCase) this.dest.getObjectType();
 
         final NodeDescriptors nodeD = nCase.getNodeDescriptors();
-        assertEquals(new AsNumber(72L), nodeD.getAsNumber());
-        assertEquals(new DomainIdentifier(0x28282828L), nodeD.getDomainId());
+        assertEquals(new AsNumber(Uint32.valueOf(72)), nodeD.getAsNumber());
+        assertEquals(new DomainIdentifier(Uint32.valueOf(0x28282828L)), nodeD.getDomainId());
         assertEquals(new IsisPseudonodeCaseBuilder().setIsisPseudonode(
-            new IsisPseudonodeBuilder().setPsn((short) 5).setIsIsRouterIdentifier(
+            new IsisPseudonodeBuilder().setPsn(Uint8.valueOf(5)).setIsIsRouterIdentifier(
                new IsIsRouterIdentifierBuilder().setIsoSystemId(
                    new IsoSystemIdentifier(new byte[] { 0, 0, 0, 0, 0, (byte) 0x39 })).build()).build()).build(),
             nodeD.getCRouterIdentifier());
@@ -274,23 +274,23 @@ public class LinkstateNlriParserTest {
         final LinkCase lCase = (LinkCase) this.dest.getObjectType();
 
         final LocalNodeDescriptors local = lCase.getLocalNodeDescriptors();
-        assertEquals(new AsNumber(72L), local.getAsNumber());
-        assertEquals(new DomainIdentifier(0x28282828L), local.getDomainId());
+        assertEquals(new AsNumber(Uint32.valueOf(72)), local.getAsNumber());
+        assertEquals(new DomainIdentifier(Uint32.valueOf(0x28282828L)), local.getDomainId());
         assertEquals(
             new IsisNodeCaseBuilder().setIsisNode(
                 new IsisNodeBuilder().setIsoSystemId(new IsoSystemIdentifier(new byte[] {
                     (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x42 })).build()).build(),
             local.getCRouterIdentifier());
         assertEquals("1.1.1.1", local.getBgpRouterId().getValue());
-        assertEquals(new AsNumber(258L), local.getMemberAsn());
+        assertEquals(new AsNumber(Uint32.valueOf(258)), local.getMemberAsn());
 
         final RemoteNodeDescriptors remote = lCase.getRemoteNodeDescriptors();
-        assertEquals(new AsNumber(72L), remote.getAsNumber());
-        assertEquals(new DomainIdentifier(0x28282828L), remote.getDomainId());
-        assertEquals(new OspfNodeCaseBuilder().setOspfNode(new OspfNodeBuilder().setOspfRouterId(0x00000040L).build())
-            .build(),
-            remote.getCRouterIdentifier());
-        assertEquals(new AsNumber(259L), remote.getMemberAsn());
+        assertEquals(new AsNumber(Uint32.valueOf(72)), remote.getAsNumber());
+        assertEquals(new DomainIdentifier(Uint32.valueOf(0x28282828L)), remote.getDomainId());
+        assertEquals(new OspfNodeCaseBuilder().setOspfNode(new OspfNodeBuilder()
+            .setOspfRouterId(Uint32.valueOf(0x00000040L)).build())
+            .build(), remote.getCRouterIdentifier());
+        assertEquals(new AsNumber(Uint32.valueOf(259)), remote.getMemberAsn());
         assertEquals("1.1.1.2", remote.getBgpRouterId().getValue());
 
         final LinkDescriptors ld = lCase.getLinkDescriptors();
@@ -438,8 +438,8 @@ public class LinkstateNlriParserTest {
         final PrefixCase pCase = (PrefixCase) this.dest.getObjectType();
 
         final AdvertisingNodeDescriptors local = pCase.getAdvertisingNodeDescriptors();
-        assertEquals(new AsNumber(72L), local.getAsNumber());
-        assertEquals(new DomainIdentifier(0x28282828L), local.getDomainId());
+        assertEquals(new AsNumber(Uint32.valueOf(72)), local.getAsNumber());
+        assertEquals(new DomainIdentifier(Uint32.valueOf(0x28282828L)), local.getDomainId());
         assertEquals(
             new IsisNodeCaseBuilder().setIsisNode(new IsisNodeBuilder().setIsoSystemId(
                 new IsoSystemIdentifier(new byte[] { (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
@@ -447,7 +447,7 @@ public class LinkstateNlriParserTest {
 
         final PrefixDescriptors pd = pCase.getPrefixDescriptors();
         assertEquals(OspfRouteType.External1, pd.getOspfRouteType());
-        assertEquals(new TopologyIdentifier(15), pd.getMultiTopologyId());
+        assertEquals(new TopologyIdentifier(Uint16.valueOf(15)), pd.getMultiTopologyId());
         assertEquals(new Ipv4Prefix("255.255.0.0/16"), pd.getIpReachabilityInformation().getIpv4Prefix());
 
         final ByteBuf buffer = Unpooled.buffer();
@@ -542,8 +542,8 @@ public class LinkstateNlriParserTest {
         assertEquals(Uint64.ONE, this.dest.getIdentifier().getValue());
         final TeLspCase teCase = (TeLspCase) this.dest.getObjectType();
 
-        assertEquals(new LspId(1L), teCase.getLspId());
-        assertEquals(new TunnelId(1), teCase.getTunnelId());
+        assertEquals(new LspId(Uint32.ONE), teCase.getLspId());
+        assertEquals(new TunnelId(Uint16.ONE), teCase.getTunnelId());
         assertEquals(new Ipv4Address("1.2.3.4"), ((Ipv4Case) teCase.getAddressFamily()).getIpv4TunnelSenderAddress());
         assertEquals(new Ipv4Address("4.3.2.1"), ((Ipv4Case) teCase.getAddressFamily()).getIpv4TunnelEndpointAddress());
 
index 32c67df2f320c053b10328a09c1d157af9048607..7704d7f0912df1216288ba94ddc3b1eb41bebbf1 100644 (file)
@@ -13,7 +13,6 @@ import static org.junit.Assert.assertNull;
 import com.google.common.collect.ImmutableSet;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-import java.math.BigInteger;
 import java.util.Collection;
 import java.util.Collections;
 import org.junit.Assert;
@@ -61,6 +60,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125.IsoSystemIdentifier;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint64;
+import org.opendaylight.yangtools.yang.common.Uint8;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode;
@@ -73,19 +75,19 @@ public final class LinkstateRIBSupportTest extends AbstractRIBSupportTest<Linkst
     private static final LinkstateRoute ROUTE;
     private static final LinkstateRoutes ROUTES;
     private static final LinkstateRouteKey ROUTE_KEY;
-    private static final PathId PATH_ID = new PathId(0L);
-
+    private static final PathId PATH_ID = new PathId(Uint32.ZERO);
 
     private static final NodeCase OBJECT_TYPE2 = new NodeCaseBuilder().setNodeDescriptors(new NodeDescriptorsBuilder()
-        .setAreaId(new AreaIdentifier(2697513L)).setAsNumber(new AsNumber(72L)).setCRouterIdentifier(
-            new IsisPseudonodeCaseBuilder()
+        .setAreaId(new AreaIdentifier(Uint32.valueOf(2697513)))
+        .setAsNumber(new AsNumber(Uint32.valueOf(72)))
+        .setCRouterIdentifier(new IsisPseudonodeCaseBuilder()
             .setIsisPseudonode(new IsisPseudonodeBuilder().setIsIsRouterIdentifier(new IsIsRouterIdentifierBuilder()
                 .setIsoSystemId(new IsoSystemIdentifier(new byte[]{0, 0, 0, 0, 0, (byte) 0x39})).build())
-                .setPsn((short) 5).build()).build())
-        .setDomainId(new DomainIdentifier(28282828L)).build()).build();
+                .setPsn(Uint8.valueOf(5)).build()).build())
+        .setDomainId(new DomainIdentifier(Uint32.valueOf(28282828))).build()).build();
 
     private static final RouteDistinguisher RD = new RouteDistinguisher(new RdTwoOctetAs("0:5:3"));
-    private static final Identifier ID = new Identifier(BigInteger.ONE);
+    private static final Identifier ID = new Identifier(Uint64.ONE);
     private static final CLinkstateDestination LINKSTATE_DESTINATION = new CLinkstateDestinationBuilder()
         .setRouteDistinguisher(RD)
         .setIdentifier(ID)
index c90c638fd0f7af1310df90756d60983a33fc4e0b..05d2720795ce99f54a8f970f32b7b6aae3654911 100644 (file)
@@ -18,7 +18,6 @@ import io.netty.buffer.Unpooled;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashSet;
@@ -91,6 +90,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.next.hop.c.next.hop.ipv4.next.hop._case.Ipv4NextHopBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125.Metric;
 import org.opendaylight.yangtools.yang.binding.Notification;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint64;
 
 public class ParserTest {
 
@@ -337,15 +338,15 @@ public class ParserTest {
             new Ipv4NextHopBuilder().setGlobal(new Ipv4Address("25.25.25.1")).build()).build();
 
         final LocalNodeDescriptorsBuilder ndBuilder = new LocalNodeDescriptorsBuilder()
-            .setAsNumber(new AsNumber((long) 100)).setDomainId(
-            new DomainIdentifier(0x19191901L)).setAreaId(new AreaIdentifier(0L));
+            .setAsNumber(new AsNumber(Uint32.valueOf(100))).setDomainId(
+            new DomainIdentifier(Uint32.valueOf(0x19191901L))).setAreaId(new AreaIdentifier(Uint32.ZERO));
 
         final RemoteNodeDescriptorsBuilder rdBuilder = new RemoteNodeDescriptorsBuilder()
-            .setAsNumber(new AsNumber((long) 100)).setDomainId(
-            new DomainIdentifier(0x19191901L)).setAreaId(new AreaIdentifier(0L));
+            .setAsNumber(new AsNumber(Uint32.valueOf(100))).setDomainId(
+            new DomainIdentifier(Uint32.valueOf(0x19191901L))).setAreaId(new AreaIdentifier(Uint32.ZERO));
 
         final CLinkstateDestinationBuilder clBuilder = new CLinkstateDestinationBuilder();
-        clBuilder.setIdentifier(new Identifier(BigInteger.ONE));
+        clBuilder.setIdentifier(new Identifier(Uint64.ONE));
         clBuilder.setProtocolId(ProtocolId.Ospf);
 
         final Attributes1Builder lsBuilder = new Attributes1Builder();
@@ -355,31 +356,33 @@ public class ParserTest {
         mpBuilder.setCNextHop(nextHop);
 
         final List<CLinkstateDestination> linkstates = new ArrayList<>();
-        final LinkCaseBuilder lCase = new LinkCaseBuilder().setLocalNodeDescriptors(ndBuilder.setCRouterIdentifier(
-            new OspfPseudonodeCaseBuilder().setOspfPseudonode(
-                new OspfPseudonodeBuilder().setOspfRouterId(0x03030304L)
-                    .setLanInterface(new OspfInterfaceIdentifier(0x0b0b0b03L)).build()).build()).build());
+        final LinkCaseBuilder lCase = new LinkCaseBuilder()
+                .setLocalNodeDescriptors(ndBuilder.setCRouterIdentifier(new OspfPseudonodeCaseBuilder()
+                    .setOspfPseudonode(new OspfPseudonodeBuilder()
+                        .setOspfRouterId(Uint32.valueOf(0x03030304L))
+                        .setLanInterface(new OspfInterfaceIdentifier(Uint32.valueOf(0x0b0b0b03L)))
+                        .build()).build()).build());
         lCase.setRemoteNodeDescriptors(rdBuilder.setCRouterIdentifier(
             new OspfNodeCaseBuilder().setOspfNode(new OspfNodeBuilder()
-                .setOspfRouterId(0x03030304L).build()).build()).build());
+                .setOspfRouterId(Uint32.valueOf(0x03030304L)).build()).build()).build());
         lCase.setLinkDescriptors(new LinkDescriptorsBuilder().setIpv4InterfaceAddress(
             new Ipv4InterfaceIdentifier(new Ipv4Address("11.11.11.3"))).build());
         linkstates.add(clBuilder.setObjectType(lCase.build()).build());
 
         lCase.setRemoteNodeDescriptors(rdBuilder.setCRouterIdentifier(
             new OspfNodeCaseBuilder().setOspfNode(new OspfNodeBuilder()
-                .setOspfRouterId(0x01010102L).build()).build()).build());
+                .setOspfRouterId(Uint32.valueOf(0x01010102L)).build()).build()).build());
         lCase.setLinkDescriptors(new LinkDescriptorsBuilder().setIpv4InterfaceAddress(
             new Ipv4InterfaceIdentifier(new Ipv4Address("11.11.11.1"))).build());
         linkstates.add(clBuilder.setObjectType(lCase.build()).build());
 
         lCase.setLocalNodeDescriptors(ndBuilder.setCRouterIdentifier(
             new OspfNodeCaseBuilder().setOspfNode(new OspfNodeBuilder()
-                .setOspfRouterId(0x01010102L).build()).build()).build());
+                .setOspfRouterId(Uint32.valueOf(0x01010102L)).build()).build()).build());
         lCase.setRemoteNodeDescriptors(rdBuilder.setCRouterIdentifier(
             new OspfPseudonodeCaseBuilder().setOspfPseudonode(new OspfPseudonodeBuilder()
-                .setOspfRouterId(0x03030304L)
-                .setLanInterface(new OspfInterfaceIdentifier(0x0b0b0b03L)).build()).build()).build());
+                .setOspfRouterId(Uint32.valueOf(0x03030304L))
+                .setLanInterface(new OspfInterfaceIdentifier(Uint32.valueOf(0x0b0b0b03L))).build()).build()).build());
         linkstates.add(clBuilder.setObjectType(lCase.build()).build());
 
         lsBuilder.setMpReachNlri(mpBuilder.build());
@@ -395,7 +398,7 @@ public class ParserTest {
         paBuilder.setAsPath(new AsPathBuilder().setSegments(Collections.emptyList()).build());
         assertEquals(paBuilder.getAsPath(), attrs.getAsPath());
 
-        paBuilder.setLocalPref(new LocalPrefBuilder().setPref(100L).build());
+        paBuilder.setLocalPref(new LocalPrefBuilder().setPref(Uint32.valueOf(100)).build());
         assertEquals(paBuilder.getLocalPref(), attrs.getLocalPref());
 
         final MpReachNlri mp = attrs.augmentation(Attributes1.class).getMpReachNlri();
@@ -418,7 +421,7 @@ public class ParserTest {
 
         lsAttrBuilder.setLinkStateAttribute(
             new LinkAttributesCaseBuilder().setLinkAttributes(new LinkAttributesBuilder()
-                .setMetric(new Metric(1L)).build()).build());
+                .setMetric(new Metric(Uint32.ONE)).build()).build());
         paBuilder.addAugmentation(
             org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev180329.Attributes1.class,
             lsAttrBuilder.build());
@@ -547,29 +550,32 @@ public class ParserTest {
             new Ipv4NextHopBuilder().setGlobal(new Ipv4Address("25.25.25.1")).build()).build();
 
         final CLinkstateDestinationBuilder clBuilder = new CLinkstateDestinationBuilder();
-        clBuilder.setIdentifier(new Identifier(BigInteger.ONE));
+        clBuilder.setIdentifier(new Identifier(Uint64.ONE));
         clBuilder.setProtocolId(ProtocolId.Ospf);
 
-        final NodeDescriptorsBuilder n = new NodeDescriptorsBuilder();
-        n.setAsNumber(new AsNumber((long) 100)).setDomainId(new DomainIdentifier(0x19191901L))
-            .setAreaId(new AreaIdentifier(0L));
+        final NodeDescriptorsBuilder n = new NodeDescriptorsBuilder()
+                .setAsNumber(new AsNumber(Uint32.valueOf(100)))
+                .setDomainId(new DomainIdentifier(Uint32.valueOf(0x19191901L)))
+                .setAreaId(new AreaIdentifier(Uint32.ZERO));
 
         final List<CLinkstateDestination> linkstates = new ArrayList<>();
-        final NodeCaseBuilder nCase = new NodeCaseBuilder();
-        nCase.setNodeDescriptors(n.setCRouterIdentifier(
-            new OspfPseudonodeCaseBuilder().setOspfPseudonode(
-                new OspfPseudonodeBuilder().setOspfRouterId(0x03030304L)
-                    .setLanInterface(new OspfInterfaceIdentifier(0x0b0b0b03L)).build()).build()).build());
+        final NodeCaseBuilder nCase = new NodeCaseBuilder()
+                .setNodeDescriptors(n.setCRouterIdentifier(new OspfPseudonodeCaseBuilder()
+                    .setOspfPseudonode(new OspfPseudonodeBuilder()
+                        .setOspfRouterId(Uint32.valueOf(0x03030304L))
+                        .setLanInterface(new OspfInterfaceIdentifier(Uint32.valueOf(0x0b0b0b03L)))
+                        .build())
+                    .build()).build());
         linkstates.add(clBuilder.setObjectType(nCase.build()).build());
 
         nCase.setNodeDescriptors(n.setCRouterIdentifier(
             new OspfNodeCaseBuilder().setOspfNode(new OspfNodeBuilder()
-                .setOspfRouterId(0x03030304L).build()).build()).build());
+                .setOspfRouterId(Uint32.valueOf(0x03030304L)).build()).build()).build());
         linkstates.add(clBuilder.setObjectType(nCase.build()).build());
 
         nCase.setNodeDescriptors(n.setCRouterIdentifier(
             new OspfNodeCaseBuilder().setOspfNode(new OspfNodeBuilder()
-                .setOspfRouterId(0x01010102L).build()).build()).build());
+                .setOspfRouterId(Uint32.valueOf(0x01010102L)).build()).build()).build());
         linkstates.add(clBuilder.setObjectType(nCase.build()).build());
 
         final Attributes1Builder lsBuilder = new Attributes1Builder();
@@ -596,7 +602,7 @@ public class ParserTest {
         paBuilder.setAsPath(new AsPathBuilder().setSegments(Collections.emptyList()).build());
         assertEquals(paBuilder.getAsPath(), attrs.getAsPath());
 
-        paBuilder.setLocalPref(new LocalPrefBuilder().setPref(100L).build());
+        paBuilder.setLocalPref(new LocalPrefBuilder().setPref(Uint32.valueOf(100)).build());
         assertEquals(paBuilder.getLocalPref(), attrs.getLocalPref());
 
         paBuilder.addAugmentation(Attributes1.class, lsBuilder.build());
index 79b22963dae6ca531899977f08bfb5d2e3d38f5e..ffc067c857afc3580816150c7cf6aa34b82131ca 100644 (file)
@@ -81,6 +81,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.segm
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125.IsoSystemIdentifier;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125.MplsLabel;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125.TeMetric;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 public class SrAttributeParserTest {
 
@@ -143,11 +146,12 @@ public class SrAttributeParserTest {
         final byte[] bytesIsis = { (byte)0xC0, 0, 0, 0, 10, 4, (byte)0x89, 0, 4, 1, 2, 3, 4 };
         final byte[] bytesOspf = { 0, 0, 0, 0, 10, 4, (byte)0x89, 0, 4, 1, 2, 3, 4 };
         final SrCapabilities capsIsis = new SrCapabilitiesBuilder().setMplsIpv4(Boolean.TRUE).setMplsIpv6(Boolean.TRUE)
-                .setSrIpv6(Boolean.FALSE).setSidLabelIndex(new SidCaseBuilder().setSid(16909060L).build())
-                .setRangeSize((long) 10).build();
+                .setSrIpv6(Boolean.FALSE)
+                .setSidLabelIndex(new SidCaseBuilder().setSid(Uint32.valueOf(16909060L)).build())
+                .setRangeSize(Uint32.valueOf(10)).build();
         final SrCapabilities capsOspf = new SrCapabilitiesBuilder().setMplsIpv4(Boolean.FALSE)
                 .setMplsIpv6(Boolean.FALSE).setSrIpv6(Boolean.FALSE).setSidLabelIndex(new SidCaseBuilder()
-                    .setSid(16909060L).build()).setRangeSize((long) 10).build();
+                    .setSid(Uint32.valueOf(16909060L)).build()).setRangeSize(Uint32.valueOf(10)).build();
         assertEquals(capsIsis,
             SrNodeAttributesParser.parseSrCapabilities(Unpooled.wrappedBuffer(bytesIsis), ProtocolId.IsisLevel1));
         assertEquals(capsOspf,
@@ -167,11 +171,13 @@ public class SrAttributeParserTest {
         final byte[] bytesOspf = { (byte)0x20, 0, 0, 0, 1, 2, 3, 4 };
         final SrPrefix prefixIsis = new SrPrefixBuilder()
             .setFlags(ISIS_PREFIX_FLAGS)
-            .setAlgorithm(Algorithm.ShortestPathFirst).setSidLabelIndex(new SidCaseBuilder().setSid(16909060L).build())
+            .setAlgorithm(Algorithm.ShortestPathFirst)
+            .setSidLabelIndex(new SidCaseBuilder().setSid(Uint32.valueOf(16909060L)).build())
             .build();
         final SrPrefix prefixOspf = new SrPrefixBuilder()
             .setFlags(OSPF_PREFIX_FLAGS)
-            .setAlgorithm(Algorithm.ShortestPathFirst).setSidLabelIndex(new SidCaseBuilder().setSid(16909060L).build())
+            .setAlgorithm(Algorithm.ShortestPathFirst)
+            .setSidLabelIndex(new SidCaseBuilder().setSid(Uint32.valueOf(16909060L)).build())
             .build();
         assertEquals(prefixIsis,
             SrPrefixAttributesParser.parseSrPrefix(Unpooled.wrappedBuffer(bytes), ProtocolId.IsisLevel1));
@@ -217,7 +223,7 @@ public class SrAttributeParserTest {
 
         final List<SubTlvs> rangeSubTlvs = new ArrayList<>();
         addSubTlvs(rangeSubTlvs);
-        final SrRange expected = new SrRangeBuilder().setInterArea(Boolean.FALSE).setRangeSize(5)
+        final SrRange expected = new SrRangeBuilder().setInterArea(Boolean.FALSE).setRangeSize(Uint16.valueOf(5))
                 .setSubTlvs(rangeSubTlvs).build();
 
         assertEquals(expected, parsedRange);
@@ -230,18 +236,21 @@ public class SrAttributeParserTest {
     private static void addSubTlvs(final List<SubTlvs> rangeSubTlvs) {
         rangeSubTlvs.add(new SubTlvsBuilder().setRangeSubTlv(
             new SidLabelTlvCaseBuilder()
-                .setSidLabelIndex(new SidCaseBuilder().setSid(16909060L).build()).build()).build());
+                .setSidLabelIndex(new SidCaseBuilder().setSid(Uint32.valueOf(16909060L)).build()).build()).build());
         rangeSubTlvs.add(new SubTlvsBuilder().setRangeSubTlv(
             new PrefixSidTlvCaseBuilder()
                 .setFlags(ISIS_PREFIX_FLAGS)
                 .setAlgorithm(Algorithm.StrictShortestPathFirst)
-                .setSidLabelIndex(new LocalLabelCaseBuilder().setLocalLabel(new MplsLabel(66048L)).build()).build())
+                .setSidLabelIndex(new LocalLabelCaseBuilder()
+                    .setLocalLabel(new MplsLabel(Uint32.valueOf(66048)))
+                    .build())
+                .build())
             .build());
         final List<BindingSubTlvs> bindingSubTlvs = new ArrayList<>();
         addBindingSubTlvs(bindingSubTlvs);
         rangeSubTlvs.add(new SubTlvsBuilder().setRangeSubTlv(
             new BindingSidTlvCaseBuilder()
-                .setWeight(new Weight((short) 5))
+                .setWeight(new Weight(Uint8.valueOf(5)))
                 .setFlags(BINDING_FLAGS)
                 .setBindingSubTlvs(bindingSubTlvs).build()).build());
     }
@@ -251,24 +260,34 @@ public class SrAttributeParserTest {
             new PrefixSidCaseBuilder()
                 .setFlags(ISIS_PREFIX_FLAGS)
                 .setAlgorithm(Algorithm.StrictShortestPathFirst)
-                .setSidLabelIndex(new SidCaseBuilder().setSid(16909060L).build())
+                .setSidLabelIndex(new SidCaseBuilder().setSid(Uint32.valueOf(16909060L)).build())
                 .build()).build());
-        bindingSubTlvs.add(new BindingSubTlvsBuilder().setBindingSubTlv(
-            new SidLabelCaseBuilder().setSidLabelIndex(new SidCaseBuilder().setSid(16909060L).build()).build())
+        bindingSubTlvs.add(new BindingSubTlvsBuilder()
+            .setBindingSubTlv(new SidLabelCaseBuilder()
+                .setSidLabelIndex(new SidCaseBuilder().setSid(Uint32.valueOf(16909060L)).build())
+                .build())
             .build());
         bindingSubTlvs.add(new BindingSubTlvsBuilder().setBindingSubTlv(
-            new EroMetricCaseBuilder().setEroMetric(new TeMetric(6L)).build()).build());
+            new EroMetricCaseBuilder().setEroMetric(new TeMetric(Uint32.valueOf(6))).build()).build());
         bindingSubTlvs.add(new BindingSubTlvsBuilder().setBindingSubTlv(
             new Ipv4EroCaseBuilder().setLoose(Boolean.FALSE).setAddress(new Ipv4Address("9.8.7.6")).build()).build());
-        bindingSubTlvs.add(new BindingSubTlvsBuilder().setBindingSubTlv(
-            new UnnumberedInterfaceIdEroCaseBuilder().setLoose(Boolean.FALSE).setRouterId(16843009L)
-            .setInterfaceId(33686018L).build()).build());
+        bindingSubTlvs.add(new BindingSubTlvsBuilder()
+            .setBindingSubTlv(new UnnumberedInterfaceIdEroCaseBuilder()
+                .setLoose(Boolean.FALSE)
+                .setRouterId(Uint32.valueOf(16843009L))
+                .setInterfaceId(Uint32.valueOf(33686018L))
+                .build())
+            .build());
         bindingSubTlvs.add(new BindingSubTlvsBuilder().setBindingSubTlv(
             new Ipv4EroBackupCaseBuilder().setLoose(Boolean.FALSE).setAddress(new Ipv4Address("3.4.5.6")).build())
             .build());
-        bindingSubTlvs.add(new BindingSubTlvsBuilder().setBindingSubTlv(
-            new UnnumberedInterfaceIdBackupEroCaseBuilder().setLoose(Boolean.FALSE).setRouterId(50529027L)
-            .setInterfaceId(67372036L).build()).build());
+        bindingSubTlvs.add(new BindingSubTlvsBuilder()
+            .setBindingSubTlv(new UnnumberedInterfaceIdBackupEroCaseBuilder()
+                .setLoose(Boolean.FALSE)
+                .setRouterId(Uint32.valueOf(50529027L))
+                .setInterfaceId(Uint32.valueOf(67372036L))
+                .build())
+            .build());
     }
 
     @Test
@@ -292,10 +311,10 @@ public class SrAttributeParserTest {
             .build());
         rangeSubTlvs.add(new SubTlvsBuilder().setRangeSubTlv(
             new BindingSidTlvCaseBuilder()
-                .setWeight(new Weight((short) 5))
+                .setWeight(new Weight(Uint8.valueOf(5)))
                 .setFlags(BINDING_FLAGS)
                 .setBindingSubTlvs(bindingSubTlvs).build()).build());
-        final SrRange expected = new SrRangeBuilder().setInterArea(Boolean.FALSE).setRangeSize(5)
+        final SrRange expected = new SrRangeBuilder().setInterArea(Boolean.FALSE).setRangeSize(Uint16.valueOf(5))
                 .setSubTlvs(rangeSubTlvs).build();
 
         assertEquals(expected, parsedRange);
@@ -313,12 +332,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((short) 10))
+            .setWeight(new Weight(Uint8.valueOf(10)))
             .setSidLabelIndex(new Ipv6AddressCaseBuilder().setIpv6Address(
                 Ipv6Util.addressForByteBuf(Unpooled.copiedBuffer(sidLabel))).build()).build();
         final SrAdjIds ospfAdj = new SrAdjIdsBuilder()
             .setFlags(OSPF_ADJ_FLAGS)
-            .setWeight(new Weight((short) 10))
+            .setWeight(new Weight(Uint8.valueOf(10)))
             .setSidLabelIndex(new Ipv6AddressCaseBuilder().setIpv6Address(
                 Ipv6Util.addressForByteBuf(Unpooled.copiedBuffer(sidLabel))).build()).build();
 
@@ -337,9 +356,12 @@ 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((short)10))
+            .setWeight(new Weight(Uint8.valueOf(10)))
             .setNeighborId(new Ipv4Address("1.2.3.4"))
-            .setSidLabelIndex(new LocalLabelCaseBuilder().setLocalLabel(new MplsLabel(24000L)).build()).build();
+            .setSidLabelIndex(new LocalLabelCaseBuilder()
+                .setLocalLabel(new MplsLabel(Uint32.valueOf(24000L)))
+                .build())
+            .build();
         assertEquals(srLanAdjId, SrLinkAttributesParser.parseLanAdjacencySegmentIdentifier(
             Unpooled.wrappedBuffer(tested), ProtocolId.Ospf));
         final ByteBuf serializedData = SrLinkAttributesParser.serializeLanAdjacencySegmentIdentifier(srLanAdjId);
@@ -354,7 +376,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((short)10))
+            .setWeight(new Weight(Uint8.valueOf(10)))
             .setIsoSystemId(new IsoSystemIdentifier(systemId))
             .setSidLabelIndex(new Ipv6AddressCaseBuilder().setIpv6Address(Ipv6Util.addressForByteBuf(
                 Unpooled.copiedBuffer(sidLabel))).build()).build();
index 1a99ff594d497c5d4dfe307426007a67160902f7..3fbf422ed47173184ada3a4cbef55ed4ba76efa2 100644 (file)
@@ -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;
 
 import com.google.common.collect.ImmutableCollection;
@@ -131,9 +130,8 @@ abstract class AbstractMvpnRIBSupport<C extends Routes & DataObject & ChoiceIn<T
                         keys.add(routeKey);
                     }
                     return keys;
-                } else {
-                    LOG.warn("Routes {} are not a map", routes);
                 }
+                LOG.warn("Routes {} are not a map", routes);
             }
         }
         return Collections.emptyList();
index c6d0f172674e9df6310b2dcad8363503e042c7b9..0aa87fc65ec4c41c59d27210dac418d64227a889 100644 (file)
@@ -46,6 +46,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.RdIpv4;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.RouteDistinguisher;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
@@ -54,10 +55,10 @@ import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidates;
 
 public class MvpnIpv4RIBSupportTest extends AbstractRIBSupportTest<MvpnRoutesIpv4Case, MvpnRoutesIpv4, MvpnRoute,
         MvpnRouteKey> {
-    private static final PathId PATH_ID = new PathId(0L);
+    private static final PathId PATH_ID = new PathId(Uint32.ZERO);
     private static final MvpnChoice MVPN = new InterAsIPmsiADCaseBuilder().setInterAsIPmsiAD(
             new InterAsIPmsiADBuilder()
-                    .setSourceAs(new AsNumber(1L))
+                    .setSourceAs(new AsNumber(Uint32.ONE))
                     .setRouteDistinguisher(new RouteDistinguisher(new RdIpv4("1.2.3.4:258")))
                     .build()).build();
     private static final MvpnRouteKey ROUTE_KEY = new MvpnRouteKey(PATH_ID, "AgwAAQECAwQBAgAAAAE=");
index 54f4be690f7a0f6e7fa5570b48ea9634707e14ae..a70ab7b4760afa2d47807c5979f72e0c0e04eec8 100644 (file)
@@ -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;
 
 import static org.junit.Assert.assertEquals;
@@ -47,6 +46,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.RdIpv4;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.RouteDistinguisher;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
@@ -57,10 +57,10 @@ import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidates;
 
 public final class MvpnIpv6RIBSupportTest extends AbstractRIBSupportTest<MvpnRoutesIpv6Case, MvpnRoutesIpv6, MvpnRoute,
         MvpnRouteKey> {
-    private static final PathId PATH_ID = new PathId(0L);
+    private static final PathId PATH_ID = new PathId(Uint32.ZERO);
     private static final MvpnChoice MVPN = new InterAsIPmsiADCaseBuilder().setInterAsIPmsiAD(
             new InterAsIPmsiADBuilder()
-                    .setSourceAs(new AsNumber(1L))
+                    .setSourceAs(new AsNumber(Uint32.ONE))
                     .setRouteDistinguisher(new RouteDistinguisher(new RdIpv4("1.2.3.4:258")))
                     .build()).build();
     private static final MvpnRouteKey ROUTE_KEY = new MvpnRouteKey(PATH_ID, "AgwAAQECAwQBAgAAAAE=");
index da5309e7f50b96f777de7bae4fda95bcdd01cf5f..12377cd3e0cd4273f7297777fb097c45ddae51b4 100644 (file)
@@ -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;
 
 import static org.junit.Assert.assertArrayEquals;
@@ -33,6 +32,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.pe.distinguisher.labels.attribute.pe.distinguisher.labels.attribute.PeDistinguisherLabelAttribute;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.pe.distinguisher.labels.attribute.pe.distinguisher.labels.attribute.PeDistinguisherLabelAttributeBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125.MplsLabel;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public final class PEDistinguisherLabelsAttributeHandlerTest {
     /**
@@ -77,11 +77,11 @@ public final class PEDistinguisherLabelsAttributeHandlerTest {
 
         peAtt.add(new PeDistinguisherLabelAttributeBuilder()
                 .setPeAddress(new IpAddress(new Ipv4Address("127.0.0.1")))
-                .setMplsLabel(new MplsLabel(1L))
+                .setMplsLabel(new MplsLabel(Uint32.ONE))
                 .build());
         peAtt.add(new PeDistinguisherLabelAttributeBuilder()
                 .setPeAddress(new IpAddress(new Ipv4Address("127.0.0.2")))
-                .setMplsLabel(new MplsLabel(2L))
+                .setMplsLabel(new MplsLabel(Uint32.valueOf(2)))
                 .build());
         return new AttributesBuilder()
                 .setUnrecognizedAttributes(Collections.emptyList())
index 82c44ae51bf91be7204cc27f39352ed6043960d9..f4cfdffbf267e5e80a35d82c6895fc3682fed809 100644 (file)
@@ -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;
 
 import static java.util.Collections.singletonList;
@@ -37,9 +36,12 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tun
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev180329.pmsi.tunnel.pmsi.tunnel.tunnel.identifier.RsvpTeP2mpLspBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev180329.pmsi.tunnel.pmsi.tunnel.tunnel.identifier.mldp.p2mp.lsp.mldp.p2mp.lsp.OpaqueValue;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev180329.pmsi.tunnel.pmsi.tunnel.tunnel.identifier.mldp.p2mp.lsp.mldp.p2mp.lsp.OpaqueValueBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 final class PMSITunnelAttributeHandlerTestUtil {
-    private static final MplsLabel MPLS_LABEL = new MplsLabel(24001L);
+    private static final MplsLabel MPLS_LABEL = new MplsLabel(Uint32.valueOf(24001L));
     /**
      * ATT - TYPE - ATT LENGTH.
      * PMSI FLAG - PMSI TYPE 0- MPLS LABEL
@@ -253,13 +255,13 @@ final class PMSITunnelAttributeHandlerTestUtil {
     };
     private static final IpAddress P_MULTICAST = new IpAddress(new Ipv4Address("23.1.1.1"));
     private static final IpAddress IP_ADDRESS = new IpAddress(new Ipv4Address("1.1.1.1"));
-    private static final Short NO_SUPPORTED_OPAQUE = 200;
-    private static final short GENERIC_LSP_IDENTIFIER = 1;
+    private static final Uint8 NO_SUPPORTED_OPAQUE = Uint8.valueOf(200);
+    private static final Uint8 GENERIC_LSP_IDENTIFIER = Uint8.ONE;
     private static final HexString OPAQUE_TEST = new HexString("07:00:0b:00:00:01:00:00:00:01:00:00:00:00");
     private static final HexString OPAQUE_TEST2
             = new HexString("07:00:0b:00:00:01:00:00:00:01:00:00:00:00:01:02");
     private static final IpAddress IPV6 = new IpAddress(new Ipv6Address("2001::1"));
-    private static final short EXTENDED_TYPE = 255;
+    private static final Uint8 EXTENDED_TYPE = Uint8.MAX_VALUE;
 
     private PMSITunnelAttributeHandlerTestUtil() {
         throw new UnsupportedOperationException();
@@ -360,7 +362,8 @@ final class PMSITunnelAttributeHandlerTestUtil {
         pmsiTunnelBuilder.setTunnelIdentifier(new RsvpTeP2mpLspBuilder()
                 .setRsvpTeP2mpLsp(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel
                         .rev180329.pmsi.tunnel.pmsi.tunnel.tunnel.identifier.rsvp.te.p2mp.lsp.RsvpTeP2mpLspBuilder()
-                        .setP2mpId(3458L).setTunnelId(15).setExtendedTunnelId(IP_ADDRESS).build()).build());
+                        .setP2mpId(Uint32.valueOf(3458)).setTunnelId(Uint16.valueOf(15))
+                        .setExtendedTunnelId(IP_ADDRESS).build()).build());
         return buildAttribute(pmsiTunnelBuilder);
     }
 
@@ -387,7 +390,7 @@ final class PMSITunnelAttributeHandlerTestUtil {
         pmsiTunnelBuilder.setTunnelIdentifier(new MldpMp2mpLspBuilder().setMldpMp2mpLsp(new org.opendaylight.yang.gen
                 .v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev180329.pmsi.tunnel.pmsi.tunnel.tunnel
                 .identifier.mldp.mp2mp.lsp.MldpMp2mpLspBuilder().setOpaque(OPAQUE_TEST)
-                .setOpaqueType(GENERIC_LSP_IDENTIFIER).build()).build());
+                .setOpaqueType(Uint8.ONE).build()).build());
         return buildAttribute(pmsiTunnelBuilder);
     }
 
@@ -396,8 +399,8 @@ final class PMSITunnelAttributeHandlerTestUtil {
         opaqueValues.add(new OpaqueValueBuilder().setOpaque(OPAQUE_TEST)
                 .setOpaqueType(GENERIC_LSP_IDENTIFIER).build());
         opaqueValues.add(new OpaqueValueBuilder().setOpaque(OPAQUE_TEST2)
-                .setOpaqueType((short) 2).setOpaqueType(EXTENDED_TYPE)
-                .setOpaqueExtendedType(4).build());
+                .setOpaqueType(Uint8.valueOf(2)).setOpaqueType(EXTENDED_TYPE)
+                .setOpaqueExtendedType(Uint16.valueOf(4)).build());
         return opaqueValues;
     }
 
index 57dce106366cc99f691488c7f66a2eca82175031..81c5c9fc5987848cc12ef7a0e5ac1bb7bb3abbb6 100644 (file)
@@ -23,6 +23,8 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev180329.Opaque;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev180329.pmsi.tunnel.pmsi.tunnel.tunnel.identifier.mldp.p2mp.lsp.mldp.p2mp.lsp.OpaqueValue;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev180329.pmsi.tunnel.pmsi.tunnel.tunnel.identifier.mldp.p2mp.lsp.mldp.p2mp.lsp.OpaqueValueBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 public final class OpaqueUtilTest {
     private static final byte[] OPAQUE_WRONG = {
@@ -67,9 +69,10 @@ public final class OpaqueUtilTest {
     private static final HexString OPAQUE_TEST2
             = new HexString("07:00:0b:00:00:01:00:00:00:01:00:00:00:00:01:02");
     private static final Opaque OPAQUE = new OpaqueValueBuilder().setOpaque(OPAQUE_TEST)
-            .setOpaqueType(OpaqueUtil.GENERIC_LSP_IDENTIFIER).build();
+            .setOpaqueType(Uint8.ONE).build();
     private static final Opaque OPAQUE_EXTENDED = new OpaqueValueBuilder().setOpaque(OPAQUE_TEST2)
-            .setOpaqueType((short) 2).setOpaqueType(OpaqueUtil.EXTENDED_TYPE).setOpaqueExtendedType(4).build();
+            .setOpaqueType(Uint8.valueOf(2)).setOpaqueType(Uint8.MAX_VALUE).setOpaqueExtendedType(Uint16.valueOf(4))
+            .build();
     private static final List<OpaqueValue> OPAQUE_VALUE_LIST = Arrays.asList((OpaqueValue) OPAQUE,
             (OpaqueValue) OPAQUE_EXTENDED);
 
@@ -84,7 +87,7 @@ public final class OpaqueUtilTest {
         assertArrayEquals(OPAQUE_EXT_EXPECTED, ByteArray.readAllBytes(actualOpaqueExt));
 
         final ByteBuf empty = Unpooled.buffer();
-        OpaqueUtil.serializeOpaque(new OpaqueValueBuilder().setOpaqueType((short) 5).build(), actualOpaqueExt);
+        OpaqueUtil.serializeOpaque(new OpaqueValueBuilder().setOpaqueType(Uint8.valueOf(5)).build(), actualOpaqueExt);
         assertArrayEquals(new byte[0], ByteArray.readAllBytes(empty));
 
         final Opaque opaque = OpaqueUtil.parseOpaque(Unpooled.wrappedBuffer(OPAQUE_EXPECTED));
index 1a8ce927943d354e72820f396963e7c1042b0719..bc2dc17f53b0198a69cf1e02e222bfe9a015fbe3 100644 (file)
@@ -20,6 +20,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.mvpn.mvpn.choice.InterAsIPmsiADCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.RdIpv4;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.RouteDistinguisher;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public final class InterASIPmsiADHandlerTest {
 
@@ -37,7 +38,7 @@ public final class InterASIPmsiADHandlerTest {
 
     private final InterAsIPmsiADCase expected = new InterAsIPmsiADCaseBuilder()
             .setInterAsIPmsiAD(new InterAsIPmsiADBuilder()
-                    .setSourceAs(new AsNumber(1L))
+                    .setSourceAs(new AsNumber(Uint32.ONE))
                     .setRouteDistinguisher(new RouteDistinguisher(new RdIpv4("1.2.3.4:258")))
                     .build()
             ).build();
index f2ef83c19952fef6bbc829236fcb11a16b14bd64..d36aff1dce1f2ada10cf6dfe19448c5de1724f70 100644 (file)
@@ -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;
@@ -28,6 +27,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.mvpn.mvpn.choice.LeafADCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.RdIpv4;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.RouteDistinguisher;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class LeafADHandlerTest {
     private static final byte[] LEAF_AD = new byte[]{
@@ -50,7 +50,7 @@ public class LeafADHandlerTest {
             .setLeafADRouteKey(
                     new InterAsIPmsiADCaseBuilder().setInterAsIPmsiAD(
                             new InterAsIPmsiADBuilder()
-                                    .setSourceAs(new AsNumber(1L))
+                                    .setSourceAs(new AsNumber(Uint32.ONE))
                                     .setRouteDistinguisher(new RouteDistinguisher(new RdIpv4("1.2.3.4:258")))
                                     .build()
                     ).build())
index 20232ddce8495a0395f4217a20230d47e5cb69db..75a6f0ae5b00234fe500d1c3727c24520e3260ea 100644 (file)
@@ -25,6 +25,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.mvpn.mvpn.choice.shared.tree.join._case.SharedTreeJoinBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.RdIpv4;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.RouteDistinguisher;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public final class SharedTreeJoinHandlerTest {
     private static final byte[] SHARED_TREE = new byte[]{
@@ -45,7 +46,7 @@ public final class SharedTreeJoinHandlerTest {
             .setSharedTreeJoin(new SharedTreeJoinBuilder()
                     .setCMulticast(new CMulticastBuilder()
                             .setRouteDistinguisher(new RouteDistinguisher(new RdIpv4("1.2.3.4:258")))
-                            .setSourceAs(new AsNumber(10L))
+                            .setSourceAs(new AsNumber(Uint32.valueOf(10)))
                             .setMulticastSource(new IpAddress(new Ipv4Address("1.0.0.1")))
                             .setMulticastGroup(new CGAddressCaseBuilder()
                                     .setCGAddress(new IpAddress(new Ipv4Address("2.0.0.2"))).build()).build())
index 38f301efdddf3740420c24f553dd10fa32bdb1f9..9e95d614a608431e728555b5e947421f651cef0d 100644 (file)
@@ -25,6 +25,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.mvpn.mvpn.choice.source.tree.join._case.SourceTreeJoinBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.RdIpv4;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.RouteDistinguisher;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public final class SourceTreeJoinHandlerTest {
     private static final byte[] SHARED_TREE = new byte[]{
@@ -45,7 +46,7 @@ public final class SourceTreeJoinHandlerTest {
             .setSourceTreeJoin(new SourceTreeJoinBuilder()
                     .setCMulticast(new CMulticastBuilder()
                             .setRouteDistinguisher(new RouteDistinguisher(new RdIpv4("1.2.3.4:258")))
-                            .setSourceAs(new AsNumber(10L))
+                            .setSourceAs(new AsNumber(Uint32.valueOf(10)))
                             .setMulticastSource(new IpAddress(new Ipv4Address("1.0.0.1")))
                             .setMulticastGroup(new CGAddressCaseBuilder().setCGAddress(
                                     new IpAddress(new Ipv4Address("2.0.0.2"))).build()).build())
index 749ee44523b2132d977e5d64248862b994576826..ee966f1dbe772d6de981ee47a532d96a012dbda2 100644 (file)
@@ -173,9 +173,8 @@ public final class RouteTargetConstrainRIBSupport
                         keys.add(routeKey);
                     }
                     return keys;
-                } else {
-                    LOG.warn("Routes {} are not a map", routes);
                 }
+                LOG.warn("Routes {} are not a map", routes);
             }
         }
         return Collections.emptyList();
index f38ac50265a5dadb550b09994f86a0acb979f216..4ae79f0c5c033f26211a4416c3eea3ec5b569a82 100644 (file)
@@ -48,6 +48,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.as._4.spec.common.As4SpecificCommon;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.as._4.spec.common.As4SpecificCommonBuilder;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
@@ -57,11 +59,11 @@ import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidates;
 
 public class RouteTargetConstrainRIBSupportTest extends AbstractRIBSupportTest<RouteTargetConstrainRoutesCase,
         RouteTargetConstrainRoutes, RouteTargetConstrainRoute, RouteTargetConstrainRouteKey> {
-    private static final AsNumber ORIGIN_AS = new AsNumber(72L);
-    private static final PathId PATH_ID = new PathId(0L);
+    private static final AsNumber ORIGIN_AS = new AsNumber(Uint32.valueOf(72));
+    private static final PathId PATH_ID = new PathId(Uint32.ZERO);
     private static final As4SpecificCommon AS_COMMON = new As4SpecificCommonBuilder()
-            .setAsNumber(new AsNumber(20L))
-            .setLocalAdministrator(100)
+            .setAsNumber(new AsNumber(Uint32.valueOf(20)))
+            .setLocalAdministrator(Uint16.valueOf(100))
             .build();
     private static final RouteTargetConstrainChoice RT = new RouteTargetConstrainAs4ExtendedCommunityCaseBuilder()
             .setAs4RouteTargetExtendedCommunity(new As4RouteTargetExtendedCommunityBuilder()
index 8356955eee20830b2e0d7215468ff3bc5e486dd0..c46f6d67c5c435f6cea98229c7e3c4cafa6a1def 100644 (file)
@@ -35,12 +35,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.route.target.constrain._default.route.grouping.RouteTargetConstrainDefaultRouteBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.route.target.extended.community.grouping.RouteTargetExtendedCommunityBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.route.target.ipv4.grouping.RouteTargetIpv4Builder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 @RunWith(Parameterized.class)
 public class SimpleRouteTargetConstrainNlriRegistryTest {
     private static final As4SpecificCommon AS_COMMON = new As4SpecificCommonBuilder()
-            .setAsNumber(new AsNumber(20L))
-            .setLocalAdministrator(100).build();
+            .setAsNumber(new AsNumber(Uint32.valueOf(20)))
+            .setLocalAdministrator(Uint16.valueOf(100)).build();
 
     private static final byte[] RT_DEFAULT_BUFF = new byte[0];
     private static final Integer RT_2_OCT_TYPE = 0;
@@ -69,13 +71,13 @@ public class SimpleRouteTargetConstrainNlriRegistryTest {
                     .build()).build();
     private static RouteTargetConstrainChoice RT_AS_2_OCT = new RouteTargetConstrainRouteCaseBuilder()
             .setRouteTargetExtendedCommunity(new RouteTargetExtendedCommunityBuilder()
-                    .setGlobalAdministrator(new ShortAsNumber(35L))
+                    .setGlobalAdministrator(new ShortAsNumber(Uint32.valueOf(35)))
                     .setLocalAdministrator(new byte[]{4, 2, 8, 7})
                     .build()).build();
     private static RouteTargetConstrainChoice RT_IPV4 = new RouteTargetConstrainIpv4RouteCaseBuilder()
             .setRouteTargetIpv4(new RouteTargetIpv4Builder()
                     .setGlobalAdministrator(new Ipv4Address("12.51.2.5"))
-                    .setLocalAdministrator(5421)
+                    .setLocalAdministrator(Uint16.valueOf(5421))
                     .build()).build();
     private static RouteTargetConstrainChoice RT_AS_4_OCT = new RouteTargetConstrainAs4ExtendedCommunityCaseBuilder()
             .setAs4RouteTargetExtendedCommunity(new As4RouteTargetExtendedCommunityBuilder()
@@ -86,7 +88,7 @@ public class SimpleRouteTargetConstrainNlriRegistryTest {
     private final Integer type;
     private final byte[] expectedBuffer;
     private final byte[] expectedBufferWithType;
-    private RouteTargetConstrainChoice expected;
+    private final RouteTargetConstrainChoice expected;
 
     public SimpleRouteTargetConstrainNlriRegistryTest(
             final RouteTargetConstrainChoice routeTargetConstrainChoice,
index 83ea2f000eb9b32337a403c058f8a94a5bf86a6a..f95520f8dd864aebf8687781d7c567cf2bf5b12e 100644 (file)
@@ -28,6 +28,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mess
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.BgpOrigin;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.next.hop.c.next.hop.Ipv4NextHopCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.next.hop.c.next.hop.ipv4.next.hop._case.Ipv4NextHopBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class AppendActionTest extends AbstractStatementRegistryTest {
     @Mock
@@ -64,8 +65,8 @@ public class AppendActionTest extends AbstractStatementRegistryTest {
                 .setOrigin(new OriginBuilder().setValue(BgpOrigin.Igp).build())
                 .setCNextHop(new Ipv4NextHopCaseBuilder().setIpv4NextHop(new Ipv4NextHopBuilder()
                         .setGlobal(new Ipv4Address("4.5.6.7")).build()).build())
-                .setLocalPref(new LocalPrefBuilder().setPref(100L).build())
-                .setMultiExitDisc(new MultiExitDiscBuilder().setMed(15L).build())
+                .setLocalPref(new LocalPrefBuilder().setPref(Uint32.valueOf(100)).build())
+                .setMultiExitDisc(new MultiExitDiscBuilder().setMed(Uint32.valueOf(15)).build())
                 .build();
         assertEquals(expected, result.getAttributes());
     }
index 871613056e9036858c2b672e50c9fba8498bc787..8b460483ef28ef283d1bf3dccf123188a13fbbac 100644 (file)
@@ -32,6 +32,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.next.hop.c.next.hop.Ipv6NextHopCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.next.hop.c.next.hop.ipv4.next.hop._case.Ipv4NextHopBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.next.hop.c.next.hop.ipv6.next.hop._case.Ipv6NextHopBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class AttributesEqualTests extends AbstractStatementRegistryTest {
     @Mock
@@ -55,7 +56,7 @@ public class AttributesEqualTests extends AbstractStatementRegistryTest {
         Statement statement = this.basicStatements.stream()
                 .filter(st -> st.getName().equals("med-eq-test")).findFirst().get();
         RouteAttributeContainer attributeContainer = routeAttributeContainerFalse(new AttributesBuilder()
-                .setMultiExitDisc(new MultiExitDiscBuilder().setMed(200L).build())
+                .setMultiExitDisc(new MultiExitDiscBuilder().setMed(Uint32.valueOf(200)).build())
                 .build());
 
         RouteAttributeContainer result = this.statementRegistry.applyExportStatement(
@@ -68,7 +69,7 @@ public class AttributesEqualTests extends AbstractStatementRegistryTest {
 
 
         attributeContainer = routeAttributeContainerFalse(new AttributesBuilder()
-                .setMultiExitDisc(new MultiExitDiscBuilder().setMed(100L).build())
+                .setMultiExitDisc(new MultiExitDiscBuilder().setMed(Uint32.valueOf(100)).build())
                 .build());
         result = this.statementRegistry.applyExportStatement(
                 this.baseAttributes,
@@ -144,7 +145,7 @@ public class AttributesEqualTests extends AbstractStatementRegistryTest {
         Statement statement = this.basicStatements.stream()
                 .filter(st -> st.getName().equals("local-pref-eq-test")).findFirst().get();
         RouteAttributeContainer attributeContainer = routeAttributeContainerFalse(new AttributesBuilder()
-                .setLocalPref(new LocalPrefBuilder().setPref(350L).build())
+                .setLocalPref(new LocalPrefBuilder().setPref(Uint32.valueOf(350)).build())
                 .build());
 
         RouteAttributeContainer result = this.statementRegistry.applyExportStatement(
@@ -157,7 +158,7 @@ public class AttributesEqualTests extends AbstractStatementRegistryTest {
 
 
         attributeContainer = routeAttributeContainerFalse(new AttributesBuilder()
-                .setLocalPref(new LocalPrefBuilder().setPref(100L).build())
+                .setLocalPref(new LocalPrefBuilder().setPref(Uint32.valueOf(100)).build())
                 .build());
         result = this.statementRegistry.applyExportStatement(
                 this.baseAttributes,
@@ -173,7 +174,7 @@ public class AttributesEqualTests extends AbstractStatementRegistryTest {
         Statement statement = this.basicStatements.stream()
                 .filter(st -> st.getName().equals("afi-safi-in-test")).findFirst().get();
         RouteAttributeContainer attributeContainer = routeAttributeContainerFalse(new AttributesBuilder()
-                .setLocalPref(new LocalPrefBuilder().setPref(350L).build())
+                .setLocalPref(new LocalPrefBuilder().setPref(Uint32.valueOf(350)).build())
                 .build());
 
         RouteAttributeContainer result = this.statementRegistry.applyExportStatement(
@@ -186,7 +187,7 @@ public class AttributesEqualTests extends AbstractStatementRegistryTest {
 
 
         attributeContainer = routeAttributeContainerFalse(new AttributesBuilder()
-                .setLocalPref(new LocalPrefBuilder().setPref(100L).build())
+                .setLocalPref(new LocalPrefBuilder().setPref(Uint32.valueOf(100)).build())
                 .build());
         result = this.statementRegistry.applyExportStatement(
                 this.baseAttributes,
index cdcba9acd35780c93368c36851fa334bf4d24048..c1662a6f1c28dbcf7e5258bfd9d6810c5e74191f 100644 (file)
@@ -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.openconfig.routing.policy.statement.actions;
 
 import java.util.ArrayList;
@@ -18,9 +17,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mess
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.attributes.as.path.Segments;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.attributes.as.path.SegmentsBuilder;
 
-class AbstractPrependAsPath {
+abstract class AbstractPrependAsPath {
 
-    final Attributes prependAS(final Attributes attributes, final AsNumber as) {
+    static final Attributes prependAS(final Attributes attributes, final AsNumber as) {
         final List<Segments> oldSegments = attributes.getAsPath().getSegments();
         /*
          * We need to check the first segment.
index b1ae66248d65cb92c37aff172a856b710bc52a39..05106c41fc940a1247556999087d9320187282a3 100644 (file)
@@ -44,12 +44,12 @@ public final class NonTransitiveAttributesFilterHandler implements BgpActionAugP
         return filterAttributes(attributes);
     }
 
-    private Attributes filterAttributes(final Attributes attributes) {
-        final AttributesBuilder builder = new AttributesBuilder();
-        builder.setCNextHop(attributes.getCNextHop());
-        builder.setOrigin(attributes.getOrigin());
-        builder.setAsPath(attributes.getAsPath());
-        builder.setCommunities(attributes.getCommunities());
+    private static Attributes filterAttributes(final Attributes attributes) {
+        final AttributesBuilder builder = new AttributesBuilder()
+                .setCNextHop(attributes.getCNextHop())
+                .setOrigin(attributes.getOrigin())
+                .setAsPath(attributes.getAsPath())
+                .setCommunities(attributes.getCommunities());
 
         final List<UnrecognizedAttributes> oldAtt = attributes.getUnrecognizedAttributes();
         if (oldAtt != null) {
index 519fe88d91441ce42c0ad21df8bf290c76ff18b5..ffaf590c724679af0604117ea99ccbe3571dc654 100644 (file)
@@ -44,7 +44,7 @@ public final class SetClusterIdPrependHandler implements BgpActionAugPolicy<SetC
         return prependClusterId(attributes, clusterIdLocal);
     }
 
-    private Attributes prependClusterId(final Attributes attributes, final ClusterIdentifier clusterId) {
+    private static Attributes prependClusterId(final Attributes attributes, final ClusterIdentifier clusterId) {
         final AttributesBuilder newAtt = new AttributesBuilder(attributes);
         final List<ClusterIdentifier> newClusterList = new ArrayList<>();
         newClusterList.add(clusterId);
index ee8ab3efdb963505455a12be88158314a320557a..121a71dd6970b6bda1b47c51d17bb878978e1419 100644 (file)
@@ -75,7 +75,7 @@ public final class SetCommunityHandler extends AbstractCommunityHandler implemen
         return inlineSetComm(attributes, this.communitySets.getUnchecked(setKey), options);
     }
 
-    private Attributes inlineSetComm(
+    private static Attributes inlineSetComm(
             final Attributes attributes,
             final List<Communities> actionCommunities,
             final BgpSetCommunityOptionType options) {
index c4d57ba9a53d05f438d675aefbb75eb43ee90bb7..04ee764a78cf255a88cb4946708e512c4b913b1e 100644 (file)
@@ -68,7 +68,7 @@ public final class SetExtCommunityHandler extends AbstractExtCommunityHandler
         return referenceSetExtComm(attributes, ((Reference) setExtCommunityMethod).getExtCommunitySetRef(), options);
     }
 
-    private Attributes inlineSetExtComm(
+    private static Attributes inlineSetExtComm(
             final Attributes attributes,
             final List<ExtendedCommunities> actionExtCommunities,
             final BgpSetCommunityOptionType options) {
index 7a4d70aba7d16d0e1668c7d143ca757c24bdd40b..8dcc73356c6e6f452d44ca9bb4e99e7833c1847f 100644 (file)
@@ -44,7 +44,7 @@ public final class SetOriginatorIdPrependHandler implements BgpActionAugPolicy<S
                 ? routeEntryInfo.getOriginatorId() : defOri);
     }
 
-    private Attributes prependOriginatorId(final Attributes attributes, final Ipv4Address originatorId) {
+    private static Attributes prependOriginatorId(final Attributes attributes, final Ipv4Address originatorId) {
         if (attributes.getOriginatorId() != null) {
             return attributes;
         }
index 11c5d39214cd894a8d18c812a48e02aab7515f31..e962becda203f9f3ab02eaf643729abf65ebc010 100644 (file)
@@ -22,10 +22,11 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mess
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.attributes.as.path.Segments;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.attributes.as.path.SegmentsBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.ClusterIdentifier;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public final class ExportAttributeTestUtil {
-    public static final long REMOTE_AS = 8;
-    public static final AsNumber LOCAL_AS = new AsNumber(65L);
+    public static final Uint32 REMOTE_AS = Uint32.valueOf(8);
+    public static final AsNumber LOCAL_AS = new AsNumber(Uint32.valueOf(65));
     public static final Ipv4Address IPV4 = new Ipv4Address("1.2.3.4");
     public static final ClusterIdentifier CLUSTER = new ClusterIdentifier(IPV4);
 
index b4d2058fe8528078dcb74851a879c6aa13e7dac0..1907c033e75090aca2718372dfce1fbff592a091 100644 (file)
@@ -25,9 +25,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.next.hop.c.next.hop.Ipv4NextHopCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.next.hop.c.next.hop.Ipv4NextHopCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.next.hop.c.next.hop.ipv4.next.hop._case.Ipv4NextHopBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public final class ImportAttributeTestUtil {
-    static final AsNumber AS = new AsNumber(65L);
+    static final AsNumber AS = new AsNumber(Uint32.valueOf(65));
 
     private ImportAttributeTestUtil() {
         throw new UnsupportedOperationException();
@@ -36,7 +37,7 @@ public final class ImportAttributeTestUtil {
     public static Attributes createInput() {
         final AttributesBuilder attBuilder = new AttributesBuilder();
         // local pref
-        attBuilder.setLocalPref(new LocalPrefBuilder().setPref(100L).build());
+        attBuilder.setLocalPref(new LocalPrefBuilder().setPref(Uint32.valueOf(100)).build());
 
         // cluster pref
         attBuilder.setClusterId(new ClusterIdBuilder()
@@ -56,7 +57,7 @@ public final class ImportAttributeTestUtil {
         attBuilder.setAsPath(new AsPathBuilder().build());
 
         // multi-exit-disc pref
-        attBuilder.setMultiExitDisc(new MultiExitDiscBuilder().setMed(0L).build());
+        attBuilder.setMultiExitDisc(new MultiExitDiscBuilder().setMed(Uint32.ZERO).build());
         return attBuilder.build();
     }
 
index 05c43f48d444df57b029a4abfeb47909851e2beb..d2c8549dfe196d0d2c403105a3adb5266b8373e6 100644 (file)
@@ -29,6 +29,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mess
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.as._4.spec.common.As4SpecificCommonBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.As4RouteOriginExtendedCommunityCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.as._4.route.origin.extended.community._case.As4RouteOriginExtendedCommunityBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
 
 public class MatchAfiSafiNotInTest extends AbstractStatementRegistryConsumerTest {
     @Mock
@@ -65,7 +66,7 @@ public class MatchAfiSafiNotInTest extends AbstractStatementRegistryConsumerTest
                                 .setAs4RouteOriginExtendedCommunity(new As4RouteOriginExtendedCommunityBuilder()
                                         .setAs4SpecificCommon(new As4SpecificCommonBuilder()
                                                 .setAsNumber(AsNumber.getDefaultInstance("65000"))
-                                                .setLocalAdministrator(123)
+                                                .setLocalAdministrator(Uint16.valueOf(123))
                                                 .build()).build()).build()).build())).build());
 
         result = this.statementRegistry.applyExportStatement(
index b624dd9c59ce24fcbdf7f527756f1d1e9a5dfb73..e982bc4a232b4e6e4484bfb486a21a6bcc7ce966 100644 (file)
@@ -25,6 +25,7 @@ import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.routing.policy.rev1
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.AttributesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.attributes.CommunitiesBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
 
 public class MatchCommunityTest extends AbstractStatementRegistryConsumerTest {
     @Mock
@@ -57,7 +58,7 @@ public class MatchCommunityTest extends AbstractStatementRegistryConsumerTest {
         attributeContainer = routeAttributeContainerFalse(new AttributesBuilder().setCommunities(
                 Collections.singletonList(new CommunitiesBuilder()
                         .setAsNumber(AsNumber.getDefaultInstance("65"))
-                        .setSemantics(10)
+                        .setSemantics(Uint16.valueOf(10))
                         .build())).build());
 
         result = this.statementRegistry.applyExportStatement(
@@ -86,7 +87,7 @@ public class MatchCommunityTest extends AbstractStatementRegistryConsumerTest {
         attributeContainer = routeAttributeContainerFalse(new AttributesBuilder().setCommunities(
                 Collections.singletonList(new CommunitiesBuilder()
                         .setAsNumber(AsNumber.getDefaultInstance("65"))
-                        .setSemantics(10)
+                        .setSemantics(Uint16.valueOf(10))
                         .build())).build());
 
         result = this.statementRegistry.applyExportStatement(
@@ -114,9 +115,9 @@ public class MatchCommunityTest extends AbstractStatementRegistryConsumerTest {
 
         attributeContainer = routeAttributeContainerFalse(new AttributesBuilder().setCommunities(Arrays.asList(
                 new CommunitiesBuilder().setAsNumber(AsNumber.getDefaultInstance("65"))
-                        .setSemantics(10).build(),
+                        .setSemantics(Uint16.valueOf(10)).build(),
                 new CommunitiesBuilder().setAsNumber(AsNumber.getDefaultInstance("66"))
-                        .setSemantics(11).build())).build());
+                        .setSemantics(Uint16.valueOf(11)).build())).build());
 
         result = this.statementRegistry.applyExportStatement(
                 this.baseAttributes,
index 15418dab9d78db2d595ee6633fa09f78e680a2e5..a281d8aa6b4c6755c2c9d9a03dd6c9cbd6594729 100644 (file)
@@ -32,6 +32,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.EncapsulationCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.as._4.route.origin.extended.community._case.As4RouteOriginExtendedCommunityBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.encapsulation._case.EncapsulationExtendedCommunityBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
 
 public class MatchExtComTest extends AbstractStatementRegistryConsumerTest {
     @Mock
@@ -68,7 +69,7 @@ public class MatchExtComTest extends AbstractStatementRegistryConsumerTest {
                                 .setAs4RouteOriginExtendedCommunity(new As4RouteOriginExtendedCommunityBuilder()
                                         .setAs4SpecificCommon(new As4SpecificCommonBuilder()
                                                 .setAsNumber(AsNumber.getDefaultInstance("65000"))
-                                                .setLocalAdministrator(123)
+                                                .setLocalAdministrator(Uint16.valueOf(123))
                                                 .build()).build()).build()).build())).build());
 
         result = this.statementRegistry.applyExportStatement(
@@ -101,7 +102,7 @@ public class MatchExtComTest extends AbstractStatementRegistryConsumerTest {
                                 new As4RouteOriginExtendedCommunityBuilder()
                                         .setAs4SpecificCommon(new As4SpecificCommonBuilder()
                                                 .setAsNumber(AsNumber.getDefaultInstance("65000"))
-                                                .setLocalAdministrator(123)
+                                                .setLocalAdministrator(Uint16.valueOf(123))
                                                 .build()).build()).build()).build(),
                 new ExtendedCommunitiesBuilder().setExtendedCommunity(new EncapsulationCaseBuilder()
                         .setEncapsulationExtendedCommunity(new EncapsulationExtendedCommunityBuilder()
@@ -136,7 +137,7 @@ public class MatchExtComTest extends AbstractStatementRegistryConsumerTest {
                                 .setAs4RouteOriginExtendedCommunity(new As4RouteOriginExtendedCommunityBuilder()
                                         .setAs4SpecificCommon(new As4SpecificCommonBuilder()
                                                 .setAsNumber(AsNumber.getDefaultInstance("65000"))
-                                                .setLocalAdministrator(123)
+                                                .setLocalAdministrator(Uint16.valueOf(123))
                                                 .build()).build()).build()).build())).build());
 
         result = this.statementRegistry.applyExportStatement(
index e3d0fd1aa6e82ecf3d2ab291aa308a5314c12566..056c5520d74d7821d6720d3ba9f07a6d3d0e890f 100644 (file)
@@ -28,11 +28,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mess
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.AttributesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.attributes.CommunitiesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.PeerRole;
+import org.opendaylight.yangtools.yang.common.Uint16;
 
 public class SetCommunityTest extends AbstractStatementRegistryConsumerTest {
     private final Attributes multipleCom = new AttributesBuilder().setCommunities(Arrays.asList(
-            new CommunitiesBuilder().setAsNumber(AsNumber.getDefaultInstance("65")).setSemantics(10).build(),
-            new CommunitiesBuilder().setAsNumber(AsNumber.getDefaultInstance("66")).setSemantics(11).build()
+            new CommunitiesBuilder().setAsNumber(AsNumber.getDefaultInstance("65")).setSemantics(Uint16.valueOf(10))
+                .build(),
+            new CommunitiesBuilder().setAsNumber(AsNumber.getDefaultInstance("66")).setSemantics(Uint16.valueOf(11))
+                .build()
     )).build();
     private final Attributes emptyCom = new AttributesBuilder().setCommunities(Collections.emptyList()).build();
     @Mock
index b51d1fc2f19acf2f5f458345b151f168e7fc736d..d6232ebc98ddf39ee9ee758c11bbc33175ce56d6 100644 (file)
@@ -33,6 +33,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.EncapsulationCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.as._4.route.origin.extended.community._case.As4RouteOriginExtendedCommunityBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.encapsulation._case.EncapsulationExtendedCommunityBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class SetExtCommunityTest extends AbstractStatementRegistryConsumerTest {
     private final Attributes multipleExtCom = new AttributesBuilder().setExtendedCommunities(Arrays.asList(
@@ -42,8 +44,8 @@ public class SetExtCommunityTest extends AbstractStatementRegistryConsumerTest {
             new ExtendedCommunitiesBuilder().setExtendedCommunity(new As4RouteOriginExtendedCommunityCaseBuilder()
                     .setAs4RouteOriginExtendedCommunity(new As4RouteOriginExtendedCommunityBuilder()
                             .setAs4SpecificCommon(new As4SpecificCommonBuilder()
-                                    .setLocalAdministrator(123)
-                                    .setAsNumber(new AsNumber(65000L)).build())
+                                    .setLocalAdministrator(Uint16.valueOf(123))
+                                    .setAsNumber(new AsNumber(Uint32.valueOf(65000))).build())
                             .build()).build()).build())).build();
     private final Attributes emptyExtCom = new AttributesBuilder()
             .setExtendedCommunities(Collections.emptyList()).build();
index a2495f311d838775d8e30b9f7891d720ffc5d723..ad33a3f2625dad33d27cb21d02e6300e58b3454c 100644 (file)
@@ -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.openconfig.routing.policy.statement;
 
 import static org.junit.Assert.assertNotNull;
@@ -31,10 +30,12 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.as._4.spec.common.As4SpecificCommon;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.as._4.spec.common.As4SpecificCommonBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.As4RouteTargetExtendedCommunityCaseBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class VpnNonMemberHandlerTest extends AbstractStatementRegistryConsumerTest {
     private static final As4SpecificCommon AS_COMMON = new As4SpecificCommonBuilder()
-            .setAsNumber(new AsNumber(20L)).setLocalAdministrator(100).build();
+            .setAsNumber(new AsNumber(Uint32.valueOf(20))).setLocalAdministrator(Uint16.valueOf(100)).build();
 
     private static final As4RouteTargetExtendedCommunity RT = new As4RouteTargetExtendedCommunityBuilder()
             .setAs4SpecificCommon(AS_COMMON).build();
index 985e40cfedd35465f0a6a578f8c8ff6b752fd0e8..12357969b01e0f651266795299c36b35de7ee201 100644 (file)
@@ -168,7 +168,7 @@ public final class NeighborUtil {
         final long uptimeTicks = neighbor.getUpTime() / 10 % TIMETICK_ROLLOVER_VALUE;
         final NeighborTimersStateAugmentation timerState = new NeighborTimersStateAugmentationBuilder()
                 .setNegotiatedHoldTime(BigDecimal.valueOf(neighbor.getNegotiatedHoldTime()))
-                .setUptime(new Timeticks(uptimeTicks)).build();
+                .setUptime(new Timeticks(Uint32.valueOf(uptimeTicks))).build();
 
         return new TimersBuilder().setState(new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp
                 .neighbor.group.timers.StateBuilder()
index 928822c28a8125b6f7421b14d19e975447e85f8f..9b48b86c89fae77d108a9d06fdf3b22d66b65986 100644 (file)
@@ -45,6 +45,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.open
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.NeighborStateAugmentationBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.NeighborTimersStateAugmentation;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.NeighborTimersStateAugmentationBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class NeighborUtilTest {
     @Mock
@@ -103,7 +104,7 @@ public class NeighborUtilTest {
         doReturn(5000L).when(timerState).getUpTime();
 
         final NeighborTimersStateAugmentation timerStateAug = new NeighborTimersStateAugmentationBuilder()
-                .setNegotiatedHoldTime(BigDecimal.valueOf(90L)).setUptime(new Timeticks(500L)).build();
+                .setNegotiatedHoldTime(BigDecimal.valueOf(90L)).setUptime(new Timeticks(Uint32.valueOf(500))).build();
         final Timers expectedTimers = new TimersBuilder().setState(
                 new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group.timers
                 .StateBuilder().addAugmentation(NeighborTimersStateAugmentation.class, timerStateAug).build())
@@ -118,7 +119,7 @@ public class NeighborUtilTest {
         doReturn(42949673015L).when(timerState).getUpTime();
 
         final NeighborTimersStateAugmentation timerStateAug = new NeighborTimersStateAugmentationBuilder()
-                .setNegotiatedHoldTime(BigDecimal.valueOf(90L)).setUptime(new Timeticks(5L)).build();
+                .setNegotiatedHoldTime(BigDecimal.valueOf(90L)).setUptime(new Timeticks(Uint32.valueOf(5))).build();
         final Timers expectedTimers = new TimersBuilder().setState(
                 new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group.timers
                 .StateBuilder().addAugmentation(NeighborTimersStateAugmentation.class, timerStateAug).build())
@@ -148,7 +149,7 @@ public class NeighborUtilTest {
                                 .setReceived(false)
                                 .setLlReceived(false)
                                 .setLlAdvertised(false)
-                                .setLlStaleTimer(0L)
+                                .setLlStaleTimer(Uint32.ZERO)
                                 .build()).build()).build();
 
         final org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi
index b0ad8e5eaeac8828d7e480c578e71f9bae17107b..f169234cb4877a6309b52c148bc4f93e396a0462 100644 (file)
@@ -29,7 +29,6 @@ import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListeningExecutorService;
 import com.google.common.util.concurrent.MoreExecutors;
 import java.math.BigDecimal;
-import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
@@ -147,21 +146,24 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint64;
 import org.slf4j.LoggerFactory;
 
 public class StateProviderImplTest extends AbstractDataBrokerTest {
     private final LongAdder totalPathsCounter = new LongAdder();
     private final LongAdder totalPrefixesCounter = new LongAdder();
-    private final PortNumber localPort = new PortNumber(1790);
-    private final PortNumber remotePort = new PortNumber(179);
-    private final int restartTime = 15;
+    private final PortNumber localPort = new PortNumber(Uint16.valueOf(1790));
+    private final PortNumber remotePort = new PortNumber(Uint16.valueOf(179));
+    private final Uint16 restartTime = Uint16.valueOf(15);
     private final String ribId = "identifier-test";
     private final InstanceIdentifier<Bgp> bgpInstanceIdentifier = InstanceIdentifier.create(NetworkInstances.class)
         .child(NetworkInstance.class, new NetworkInstanceKey("global-bgp")).child(Protocols.class)
         .child(Protocol.class, new ProtocolKey(BGP.class, this.ribId)).augmentation(NetworkInstanceProtocol.class)
             .child(Bgp.class);
     static final TablesKey TABLES_KEY = new TablesKey(Ipv4AddressFamily.class, UnicastSubsequentAddressFamily.class);
-    private final AsNumber as = new AsNumber(72L);
+    private final AsNumber as = new AsNumber(Uint32.valueOf(72));
     private final BgpId bgpId = new BgpId("127.0.0.1");
     private final IpAddress neighborAddress = new IpAddress(new Ipv4Address("127.0.0.2"));
     private final List<Class<? extends BgpCapability>> supportedCap = Arrays.asList(ASN32.class, ROUTEREFRESH.class,
@@ -261,7 +263,7 @@ public class StateProviderImplTest extends AbstractDataBrokerTest {
         doReturn(true).when(this.bgpGracelfulRestartState).isGracefulRestartReceived(any());
         doReturn(true).when(this.bgpGracelfulRestartState).isLocalRestarting();
         doReturn(true).when(this.bgpGracelfulRestartState).isPeerRestarting();
-        doReturn(this.restartTime).when(this.bgpGracelfulRestartState).getPeerRestartTime();
+        doReturn(this.restartTime.toJava()).when(this.bgpGracelfulRestartState).getPeerRestartTime();
         doReturn(BgpAfiSafiGracefulRestartState.Mode.BILATERAL).when(this.bgpGracelfulRestartState).getMode();
 
         doReturn(this.bgpAfiSafiState).when(this.bgpPeerState).getBGPAfiSafiState();
@@ -473,16 +475,21 @@ public class StateProviderImplTest extends AbstractDataBrokerTest {
     private static BgpNeighborStateAugmentation buildBgpNeighborStateAugmentation() {
         final BgpNeighborStateAugmentation augmentation = new BgpNeighborStateAugmentationBuilder()
                 .setMessages(new MessagesBuilder().setReceived(new ReceivedBuilder()
-                        .setNOTIFICATION(BigInteger.ONE).setUPDATE(BigInteger.ONE).build())
-                        .setSent(new SentBuilder().setNOTIFICATION(BigInteger.ONE).setUPDATE(BigInteger.ONE).build())
+                        .setNOTIFICATION(Uint64.ONE).setUPDATE(Uint64.ONE).build())
+                        .setSent(new SentBuilder().setNOTIFICATION(Uint64.ONE).setUPDATE(Uint64.ONE).build())
                         .build()).build();
         return augmentation;
     }
 
     private static AfiSafis buildAfiSafis() {
         final NeighborAfiSafiStateAugmentationBuilder neighborAfiSafiStateAugmentation =
-                new NeighborAfiSafiStateAugmentationBuilder().setActive(true).setPrefixes(
-                        new PrefixesBuilder().setSent(1L).setReceived(2L).setInstalled(1L).build());
+                new NeighborAfiSafiStateAugmentationBuilder()
+                .setActive(true)
+                .setPrefixes(new PrefixesBuilder()
+                    .setSent(Uint32.ONE)
+                    .setReceived(Uint32.valueOf(2))
+                    .setInstalled(Uint32.ONE)
+                    .build());
         final AfiSafi afiSafi = new AfiSafiBuilder()
                 .setAfiSafiName(IPV4UNICAST.class)
                 .setGracefulRestart(new GracefulRestartBuilder().setState(new StateBuilder().setEnabled(false)
@@ -490,7 +497,7 @@ public class StateProviderImplTest extends AbstractDataBrokerTest {
                                 new NeighborAfiSafiGracefulRestartStateAugmentationBuilder()
                                         .setAdvertised(true)
                                         .setReceived(true)
-                                        .setLlStaleTimer(60L)
+                                        .setLlStaleTimer(Uint32.valueOf(60))
                                         .setLlAdvertised(true)
                                         .setLlReceived(true)
                                         .build())
@@ -510,7 +517,7 @@ public class StateProviderImplTest extends AbstractDataBrokerTest {
                         .handling.StateBuilder().setTreatAsWithdraw(false)
                         .addAugmentation(NeighborErrorHandlingStateAugmentation.class,
                                 new NeighborErrorHandlingStateAugmentationBuilder()
-                                        .setErroneousUpdateMessages(1L).build()).build()).build();
+                                        .setErroneousUpdateMessages(Uint32.ONE).build()).build()).build();
         return errorHandling;
     }
 
@@ -522,7 +529,7 @@ public class StateProviderImplTest extends AbstractDataBrokerTest {
                 .setKeepaliveInterval(BigDecimal.valueOf(30))
                 .setMinimumAdvertisementInterval(BigDecimal.valueOf(30))
                 .addAugmentation(NeighborTimersStateAugmentation.class, new NeighborTimersStateAugmentationBuilder()
-                        .setNegotiatedHoldTime(BigDecimal.TEN).setUptime(new Timeticks(1L)).build())
+                        .setNegotiatedHoldTime(BigDecimal.TEN).setUptime(new Timeticks(Uint32.ONE)).build())
                 .build()).build();
         return timers;
     }
@@ -542,11 +549,11 @@ public class StateProviderImplTest extends AbstractDataBrokerTest {
 
     private GracefulRestart buildGracefulRestart() {
         final NeighborGracefulRestartStateAugmentationBuilder gracefulAugmentation
-                = new NeighborGracefulRestartStateAugmentationBuilder();
-        gracefulAugmentation.setPeerRestarting(false);
-        gracefulAugmentation.setLocalRestarting(false);
-        gracefulAugmentation.setPeerRestartTime(0);
-        gracefulAugmentation.setLocalRestarting(true)
+                = new NeighborGracefulRestartStateAugmentationBuilder()
+                .setPeerRestarting(false)
+                .setLocalRestarting(false)
+                .setPeerRestartTime(Uint16.ZERO)
+                .setLocalRestarting(true)
                 .setPeerRestarting(true)
                 .setPeerRestartTime(this.restartTime)
                 .setMode(BgpAfiSafiGracefulRestartState.Mode.BILATERAL);
@@ -561,18 +568,28 @@ public class StateProviderImplTest extends AbstractDataBrokerTest {
     private Global buildGlobalExpected(final long prefixesAndPaths) {
         return new GlobalBuilder()
                 .setState(new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.global.base
-                        .StateBuilder().setRouterId(new Ipv4Address(this.bgpId.getValue()))
-                        .setTotalPrefixes(prefixesAndPaths).setTotalPaths(prefixesAndPaths).setAs(this.as).build())
+                        .StateBuilder()
+                            .setRouterId(new Ipv4Address(this.bgpId.getValue()))
+                            .setTotalPrefixes(Uint32.valueOf(prefixesAndPaths))
+                            .setTotalPaths(Uint32.valueOf(prefixesAndPaths))
+                            .setAs(this.as)
+                            .build())
                 .setAfiSafis(new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.global.base
-                        .AfiSafisBuilder().setAfiSafi(Collections.singletonList(new AfiSafiBuilder()
-                        .setAfiSafiName(IPV4UNICAST.class).setState(new org.opendaylight.yang.gen.v1.http.openconfig
-                                .net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.afi.safi.StateBuilder()
-                                .setEnabled(false)
-                                .addAugmentation(GlobalAfiSafiStateAugmentation.class,
-                                        new GlobalAfiSafiStateAugmentationBuilder()
-                                                .setTotalPaths(prefixesAndPaths).setTotalPrefixes(prefixesAndPaths)
-                                                .build()).build()).build()))
-                        .build()).build();
+                        .AfiSafisBuilder()
+                            .setAfiSafi(Collections.singletonList(new AfiSafiBuilder()
+                                .setAfiSafiName(IPV4UNICAST.class)
+                                .setState(new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol
+                                    .rev151009.bgp.common.afi.safi.list.afi.safi.StateBuilder()
+                                        .setEnabled(false)
+                                        .addAugmentation(GlobalAfiSafiStateAugmentation.class,
+                                            new GlobalAfiSafiStateAugmentationBuilder()
+                                                .setTotalPaths(Uint32.valueOf(prefixesAndPaths))
+                                                .setTotalPrefixes(Uint32.valueOf(prefixesAndPaths))
+                                                .build())
+                                        .build())
+                                .build()))
+                        .build())
+                .build();
     }
 
     private static PeerGroup buildGroupExpected() {
@@ -580,9 +597,10 @@ public class StateProviderImplTest extends AbstractDataBrokerTest {
             .openconfig.net.yang.bgp.rev151009.bgp.neighbor.group.StateBuilder()
             .setSendCommunity(CommunityType.NONE)
             .setRouteFlapDamping(false)
-            .addAugmentation(PeerGroupStateAugmentation.class,
-                new PeerGroupStateAugmentationBuilder().setTotalPaths(1L).setTotalPrefixes(1L)
-                    .build()).build())
+            .addAugmentation(PeerGroupStateAugmentation.class, new PeerGroupStateAugmentationBuilder()
+                .setTotalPaths(Uint32.ONE)
+                .setTotalPrefixes(Uint32.ONE)
+                .build()).build())
             .build();
     }
 }
index 151277e6a36c2215f7ee3b8f905212c3e6a9cd9d..4f53fab5d946238a1fbf87c4c0c8f8592aea9c74 100644 (file)
@@ -26,6 +26,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mess
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.CParameters1;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.CParameters1Builder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.mp.capabilities.MultiprotocolCapabilityBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.common.Uint8;
 
 public class APITest {
@@ -64,12 +66,12 @@ public class APITest {
                         new MultiprotocolCapabilityBuilder().build()).build()).build()).build());
         capas.add(new OptionalCapabilitiesBuilder().setCParameters(
                 new CParametersBuilder().setAs4BytesCapability(new As4BytesCapabilityBuilder().setAsNumber(
-                        new AsNumber(35L)).build()).build()).build());
+                        new AsNumber(Uint32.valueOf(35))).build()).build()).build());
         params.add(new BgpParametersBuilder().setOptionalCapabilities(capas).build());
         final Open open1 = new OpenBuilder().setBgpParameters(params).build();
         assertEquals(35L, AsNumberUtil.advertizedAsNumber(open1).getValue().longValue());
 
-        final Open open2 = new OpenBuilder().setMyAsNumber(10).build();
+        final Open open2 = new OpenBuilder().setMyAsNumber(Uint16.valueOf(10)).build();
         assertEquals(10, AsNumberUtil.advertizedAsNumber(open2).getValue().intValue());
     }
 
index b3590d49211a1b308a980f3aa8aedf63745f9872..8f1d77ae09b3d562053d111d0878f988c2ba4ee4 100644 (file)
@@ -75,6 +75,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.next.hop.c.next.hop.Ipv4NextHopCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.next.hop.c.next.hop.ipv4.next.hop._case.Ipv4NextHopBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.route.target.ipv4.grouping.RouteTargetIpv4Builder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class BGPParserTest {
     private static final List<byte[]> INPUT_BYTES = new ArrayList<>();
@@ -188,7 +190,7 @@ public class BGPParserTest {
 
         // attributes
         final List<AsNumber> asNumbers = new ArrayList<>();
-        asNumbers.add(new AsNumber(65002L));
+        asNumbers.add(new AsNumber(Uint32.valueOf(65002)));
         final List<Segments> asPath = new ArrayList<>();
         asPath.add(new SegmentsBuilder().setAsSequence(asNumbers).build());
 
@@ -229,7 +231,7 @@ public class BGPParserTest {
         paBuilder.setCNextHop(nextHop);
         assertEquals(paBuilder.getCNextHop(), attrs.getCNextHop());
 
-        paBuilder.setMultiExitDisc(new MultiExitDiscBuilder().setMed((long) 0).build());
+        paBuilder.setMultiExitDisc(new MultiExitDiscBuilder().setMed(Uint32.ZERO).build());
         assertEquals(paBuilder.getMultiExitDisc(), attrs.getMultiExitDisc());
 
         paBuilder.setAtomicAggregate(new AtomicAggregateBuilder().build());
@@ -309,14 +311,15 @@ public class BGPParserTest {
 
         // attributes
         final List<AsNumber> asNumbers = new ArrayList<>();
-        asNumbers.add(new AsNumber(30L));
+        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(10L), new AsNumber(20L));
+        final List<AsNumber> asSet = Lists.newArrayList(new AsNumber(Uint32.valueOf(10)),
+            new AsNumber(Uint32.valueOf(20)));
         asPath.add(new SegmentsBuilder().setAsSet(asSet).build());
 
-        final Aggregator aggregator = new AggregatorBuilder().setAsNumber(new AsNumber((long) 30)).setNetworkAddress(
-                new Ipv4Address("10.0.0.9")).build();
+        final Aggregator aggregator = new AggregatorBuilder().setAsNumber(new AsNumber(Uint32.valueOf(30)))
+                .setNetworkAddress(new Ipv4Address("10.0.0.9")).build();
         final Ipv4NextHopCase nextHop = new Ipv4NextHopCaseBuilder().setIpv4NextHop(
                 new Ipv4NextHopBuilder().setGlobal(new Ipv4Address("10.0.0.9")).build()).build();
 
@@ -334,7 +337,7 @@ public class BGPParserTest {
         paBuilder.setCNextHop(nextHop);
         assertEquals(paBuilder.getCNextHop(), attrs.getCNextHop());
 
-        paBuilder.setMultiExitDisc(new MultiExitDiscBuilder().setMed((long) 0).build());
+        paBuilder.setMultiExitDisc(new MultiExitDiscBuilder().setMed(Uint32.ZERO).build());
         assertEquals(paBuilder.getMultiExitDisc(), attrs.getMultiExitDisc());
 
         paBuilder.setAggregator(aggregator);
@@ -416,11 +419,15 @@ public class BGPParserTest {
                 new Ipv4NextHopBuilder().setGlobal(new Ipv4Address("3.3.3.3")).build()).build();
 
         final List<ExtendedCommunities> comms = new ArrayList<>();
-        comms.add(new ExtendedCommunitiesBuilder().setTransitive(true).setExtendedCommunity(
-                new RouteTargetIpv4CaseBuilder().setRouteTargetIpv4(
-                        new RouteTargetIpv4Builder().setGlobalAdministrator(
-                                new Ipv4Address("192.168.1.0")).setLocalAdministrator(4660)
-                                .build()).build()).build());
+        comms.add(new ExtendedCommunitiesBuilder()
+            .setTransitive(true)
+            .setExtendedCommunity(new RouteTargetIpv4CaseBuilder()
+                .setRouteTargetIpv4(new RouteTargetIpv4Builder()
+                    .setGlobalAdministrator(new Ipv4Address("192.168.1.0"))
+                    .setLocalAdministrator(Uint16.valueOf(4660))
+                    .build())
+                .build())
+            .build());
 
         // check path attributes
         final Attributes attrs = message.getAttributes();
@@ -436,10 +443,10 @@ public class BGPParserTest {
         paBuilder.setCNextHop(nextHop);
         assertEquals(paBuilder.getCNextHop(), attrs.getCNextHop());
 
-        paBuilder.setMultiExitDisc(new MultiExitDiscBuilder().setMed((long) 0).build());
+        paBuilder.setMultiExitDisc(new MultiExitDiscBuilder().setMed(Uint32.ZERO).build());
         assertEquals(paBuilder.getMultiExitDisc(), attrs.getMultiExitDisc());
 
-        paBuilder.setLocalPref(new LocalPrefBuilder().setPref(100L).build());
+        paBuilder.setLocalPref(new LocalPrefBuilder().setPref(Uint32.valueOf(100)).build());
         assertEquals(paBuilder.getLocalPref(), attrs.getLocalPref());
 
         paBuilder.setExtendedCommunities(comms);
@@ -640,7 +647,7 @@ public class BGPParserTest {
 
         // attributes
         final List<AsNumber> asNumbers = new ArrayList<>();
-        asNumbers.add(new AsNumber(65002L));
+        asNumbers.add(new AsNumber(Uint32.valueOf(65002)));
         final List<Segments> asPath = new ArrayList<>();
         asPath.add(new SegmentsBuilder().setAsSequence(asNumbers).build());
 
@@ -658,9 +665,12 @@ public class BGPParserTest {
         // check nlri
 
         final List<Nlri> nlris = new ArrayList<>();
-        nlris.add(new NlriBuilder().setPrefix(new Ipv4Prefix("172.17.1.0/24")).setPathId(new PathId(1L)).build());
-        nlris.add(new NlriBuilder().setPrefix(new Ipv4Prefix("172.17.1.0/24")).setPathId(new PathId(2L)).build());
-        nlris.add(new NlriBuilder().setPrefix(new Ipv4Prefix("172.17.0.0/24")).setPathId(new PathId(1L)).build());
+        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)))
+            .build());
+        nlris.add(new NlriBuilder().setPrefix(new Ipv4Prefix("172.17.0.0/24")).setPathId(new PathId(Uint32.ONE))
+            .build());
 
         assertEquals(nlris, message.getNlri());
 
@@ -681,7 +691,7 @@ public class BGPParserTest {
         paBuilder.setCNextHop(nextHop);
         assertEquals(paBuilder.getCNextHop(), attrs.getCNextHop());
 
-        paBuilder.setMultiExitDisc(new MultiExitDiscBuilder().setMed((long) 0).build());
+        paBuilder.setMultiExitDisc(new MultiExitDiscBuilder().setMed(Uint32.ZERO).build());
         assertEquals(paBuilder.getMultiExitDisc(), attrs.getMultiExitDisc());
 
         paBuilder.setAtomicAggregate(new AtomicAggregateBuilder().build());
@@ -726,9 +736,9 @@ public class BGPParserTest {
         // attributes
         final List<WithdrawnRoutes> withdrawnRoutes = new ArrayList<>();
         withdrawnRoutes.add(new WithdrawnRoutesBuilder().setPrefix(new Ipv4Prefix("172.16.0.4/30"))
-            .setPathId(new PathId(1L)).build());
+            .setPathId(new PathId(Uint32.ONE)).build());
         withdrawnRoutes.add(new WithdrawnRoutesBuilder().setPrefix(new Ipv4Prefix("172.16.0.4/30"))
-            .setPathId(new PathId(2L)).build());
+            .setPathId(new PathId(Uint32.valueOf(2))).build());
 
         // check API message
         final Update expectedMessage = new UpdateBuilder().setWithdrawnRoutes(withdrawnRoutes).build();
index db9ee76998837b43c2adbcd96b2a00f3e654a5ce..f0314b285ccdcb09128471925556949c4ad97298 100644 (file)
@@ -34,6 +34,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.Ipv4AddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.Ipv6AddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.UnicastSubsequentAddressFamily;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class ComplementaryTest {
 
@@ -56,10 +58,10 @@ public class ComplementaryTest {
             .build());
 
         final GracefulRestartCapability tlv3 = new GracefulRestartCapabilityBuilder().setRestartFlags(
-            new RestartFlags(Boolean.FALSE)).setRestartTime(0).setTables(tt).build();
+            new RestartFlags(Boolean.FALSE)).setRestartTime(Uint16.ZERO).setTables(tt).build();
 
         final CParameters tlv4 = new CParametersBuilder().setAs4BytesCapability(
-            new As4BytesCapabilityBuilder().setAsNumber(new AsNumber((long) 40)).build()).build();
+            new As4BytesCapabilityBuilder().setAsNumber(new AsNumber(Uint32.valueOf(40))).build()).build();
 
         assertFalse(tlv3.getRestartFlags().isRestartState());
 
@@ -80,15 +82,19 @@ public class ComplementaryTest {
         assertEquals(40, tlv4.getAs4BytesCapability().getAsNumber().getValue().longValue());
 
         assertEquals(new CParametersBuilder().setAs4BytesCapability(new As4BytesCapabilityBuilder().setAsNumber(
-            new AsNumber((long) 40)).build()).build(), tlv4);
+            new AsNumber(Uint32.valueOf(40))).build()).build(), tlv4);
     }
 
     @Test
     public void testBGPAggregatorImpl() {
-        final BgpAggregator ipv4 = new AggregatorBuilder().setAsNumber(new AsNumber((long) 5524)).setNetworkAddress(
-                new Ipv4Address("124.55.42.1")).build();
-        final BgpAggregator ipv4i = new AggregatorBuilder().setAsNumber(new AsNumber((long) 5525)).setNetworkAddress(
-                new Ipv4Address("124.55.42.1")).build();
+        final BgpAggregator ipv4 = new AggregatorBuilder()
+                .setAsNumber(new AsNumber(Uint32.valueOf(5524)))
+                .setNetworkAddress(new Ipv4Address("124.55.42.1"))
+                .build();
+        final BgpAggregator ipv4i = new AggregatorBuilder()
+                .setAsNumber(new AsNumber(Uint32.valueOf(5525)))
+                .setNetworkAddress(new Ipv4Address("124.55.42.1"))
+                .build();
 
         assertNotSame(ipv4.hashCode(), ipv4i.hashCode());
 
index 84007879154ddd85fec91795820f953cf4bdf253..652caa124e8a3f0fa1ebc601349b2f993d01a67b 100644 (file)
@@ -52,13 +52,13 @@ public class GracefulCapabilityHandlerTest {
             (byte) 0x00, (byte) 0x01, (byte) 0x01, (byte) 0x80
         };
 
-        final GracefulRestartCapabilityBuilder capaBuilder = new GracefulRestartCapabilityBuilder();
-        capaBuilder.setRestartFlags(new RestartFlags(true));
-        capaBuilder.setRestartTime(500);
-        final TablesBuilder tablesBuilder = new TablesBuilder();
-        tablesBuilder.setAfiFlags(new AfiFlags(true));
-        tablesBuilder.setAfi(Ipv4AddressFamily.class);
-        tablesBuilder.setSafi(UnicastSubsequentAddressFamily.class);
+        final GracefulRestartCapabilityBuilder capaBuilder = new GracefulRestartCapabilityBuilder()
+                .setRestartFlags(new RestartFlags(true))
+                .setRestartTime(Uint16.valueOf(500));
+        final TablesBuilder tablesBuilder = new TablesBuilder()
+                .setAfiFlags(new AfiFlags(true))
+                .setAfi(Ipv4AddressFamily.class)
+                .setSafi(UnicastSubsequentAddressFamily.class);
         capaBuilder.setTables(Lists.newArrayList(tablesBuilder.build()));
 
         final ByteBuf buffer = Unpooled.buffer(capaBytes.length);
@@ -75,7 +75,7 @@ public class GracefulCapabilityHandlerTest {
             (byte) 0x00, (byte) 0x01, (byte) 0x01, (byte) 0x00
         };
         capaBuilder.setRestartFlags(new RestartFlags(false));
-        capaBuilder.setRestartTime(0);
+        capaBuilder.setRestartTime(Uint16.ZERO);
         tablesBuilder.setAfiFlags(new AfiFlags(false));
         capaBuilder.setTables(Lists.newArrayList(tablesBuilder.build()));
         buffer.clear();
@@ -100,7 +100,7 @@ public class GracefulCapabilityHandlerTest {
             (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00
         };
         capaBuilder.setRestartFlags(new RestartFlags(false));
-        capaBuilder.setRestartTime(0);
+        capaBuilder.setRestartTime(Uint16.ZERO);
         capaBuilder.setTables(Collections.emptyList());
         Assert.assertEquals(new CParametersBuilder().addAugmentation(CParameters1.class,
             new CParameters1Builder().setGracefulRestartCapability(capaBuilder.build()).build()).build(),
@@ -125,7 +125,7 @@ public class GracefulCapabilityHandlerTest {
         Assert.assertEquals(new CParametersBuilder().addAugmentation(CParameters1.class, new CParameters1Builder()
             .setGracefulRestartCapability(new GracefulRestartCapabilityBuilder()
                 .setRestartFlags(new RestartFlags(Boolean.FALSE))
-                .setRestartTime(0).setTables(Collections.emptyList()).build()).build()).build(),
+                .setRestartTime(Uint16.ZERO).setTables(Collections.emptyList()).build()).build()).build(),
             handler.parseCapability(Unpooled.wrappedBuffer(capaBytes5).slice(2, capaBytes5.length - 2)));
     }
 
@@ -136,7 +136,7 @@ public class GracefulCapabilityHandlerTest {
 
         final GracefulRestartCapabilityBuilder capaBuilder = new GracefulRestartCapabilityBuilder();
         capaBuilder.setRestartFlags(new RestartFlags(true));
-        capaBuilder.setRestartTime(50);
+        capaBuilder.setRestartTime(Uint16.valueOf(50));
         final TablesBuilder tablesBuilder = new TablesBuilder();
         tablesBuilder.setAfiFlags(new AfiFlags(true));
 
@@ -156,7 +156,7 @@ public class GracefulCapabilityHandlerTest {
 
         final GracefulRestartCapabilityBuilder capaBuilder = new GracefulRestartCapabilityBuilder();
         capaBuilder.setRestartFlags(new RestartFlags(true));
-        capaBuilder.setRestartTime(50);
+        capaBuilder.setRestartTime(Uint16.valueOf(50));
         final TablesBuilder tablesBuilder = new TablesBuilder();
         tablesBuilder.setAfiFlags(new AfiFlags(true));
         tablesBuilder.setAfi(Ipv4AddressFamily.class);
@@ -173,18 +173,19 @@ public class GracefulCapabilityHandlerTest {
         final GracefulCapabilityHandler handler = new GracefulCapabilityHandler(this.ctx.getAddressFamilyRegistry(),
             this.ctx.getSubsequentAddressFamilyRegistry());
 
-        final GracefulRestartCapabilityBuilder capaBuilder = new GracefulRestartCapabilityBuilder();
-        capaBuilder.setRestartFlags(new RestartFlags(true));
-        capaBuilder.setRestartTime(-1);
-        final TablesBuilder tablesBuilder = new TablesBuilder();
-        tablesBuilder.setAfiFlags(new AfiFlags(true));
-        tablesBuilder.setAfi(Ipv4AddressFamily.class);
-        tablesBuilder.setSafi(UnicastSubsequentAddressFamily.class);
-        capaBuilder.setTables(Lists.newArrayList(tablesBuilder.build()));
+        final GracefulRestartCapabilityBuilder capaBuilder = new GracefulRestartCapabilityBuilder()
+                .setRestartFlags(new RestartFlags(true))
+                .setRestartTime(-1);
+        capaBuilder.setTables(Lists.newArrayList(new TablesBuilder()
+            .setAfiFlags(new AfiFlags(true))
+            .setAfi(Ipv4AddressFamily.class)
+            .setSafi(UnicastSubsequentAddressFamily.class)
+            .build()));
 
         final ByteBuf buffer = Unpooled.buffer();
-        handler.serializeCapability(new CParametersBuilder().addAugmentation(CParameters1.class,
-            new CParameters1Builder().setGracefulRestartCapability(capaBuilder.build()).build()).build(), buffer);
+        handler.serializeCapability(new CParametersBuilder()
+            .addAugmentation(CParameters1.class, new CParameters1Builder()
+                .setGracefulRestartCapability(capaBuilder.build()).build()).build(), buffer);
     }
 
     @Test(expected = IllegalArgumentException.class)
@@ -192,17 +193,19 @@ public class GracefulCapabilityHandlerTest {
         final GracefulCapabilityHandler handler = new GracefulCapabilityHandler(this.ctx.getAddressFamilyRegistry(),
             this.ctx.getSubsequentAddressFamilyRegistry());
 
-        final GracefulRestartCapabilityBuilder capaBuilder = new GracefulRestartCapabilityBuilder();
-        capaBuilder.setRestartFlags(new RestartFlags(true));
-        capaBuilder.setRestartTime(50 * 1000);
-        final TablesBuilder tablesBuilder = new TablesBuilder();
-        tablesBuilder.setAfiFlags(new AfiFlags(true));
-        tablesBuilder.setAfi(Ipv4AddressFamily.class);
-        tablesBuilder.setSafi(UnicastSubsequentAddressFamily.class);
-        capaBuilder.setTables(Lists.newArrayList(tablesBuilder.build()));
+        final GracefulRestartCapabilityBuilder capaBuilder = new GracefulRestartCapabilityBuilder()
+                .setRestartFlags(new RestartFlags(true))
+                .setRestartTime(Uint16.valueOf(50000));
+
+        capaBuilder.setTables(Lists.newArrayList(new TablesBuilder()
+            .setAfiFlags(new AfiFlags(true))
+            .setAfi(Ipv4AddressFamily.class)
+            .setSafi(UnicastSubsequentAddressFamily.class)
+            .build()));
 
         final ByteBuf buffer = Unpooled.buffer();
-        handler.serializeCapability(new CParametersBuilder().addAugmentation(CParameters1.class,
-            new CParameters1Builder().setGracefulRestartCapability(capaBuilder.build()).build()).build(), buffer);
+        handler.serializeCapability(new CParametersBuilder()
+            .addAugmentation(CParameters1.class, new CParameters1Builder()
+                .setGracefulRestartCapability(capaBuilder.build()).build()).build(), buffer);
     }
 }
index d633bd7f344a99de8c2cf373d2d735ad1e326540..ab9655890b75b14c2e434c175ea4d98a9e6efb53 100644 (file)
@@ -33,26 +33,32 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mult
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.CParameters1Builder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.mp.capabilities.GracefulRestartCapability;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.mp.capabilities.GracefulRestartCapabilityBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 public class OpenTest {
 
     @Test
     public void testSerializeOpen() throws BGPDocumentedException {
-        final Open open = new OpenBuilder().setBgpIdentifier(new Ipv4Address("127.0.0.1")).setMyAsNumber(30)
-                .setHoldTimer(3).setVersion(new ProtocolVersion((short) 4)).setBgpParameters(ImmutableList.of(
-                    new BgpParametersBuilder()
-                        .setOptionalCapabilities(ImmutableList.of(new OptionalCapabilitiesBuilder()
-                            .setCParameters(new CParametersBuilder()
-                                .setAs4BytesCapability(new As4BytesCapabilityBuilder()
-                                    .setAsNumber(new AsNumber(1000L)).build())
-                                .addAugmentation(CParameters1.class, new CParameters1Builder()
-                                    .setGracefulRestartCapability(new GracefulRestartCapabilityBuilder()
-                                        .setRestartFlags(new GracefulRestartCapability.RestartFlags(false))
-                                        .setRestartTime(0)
-                                        .setTables(ImmutableList.of()).build())
-                                    .build())
+        final Open open = new OpenBuilder()
+                .setBgpIdentifier(new Ipv4Address("127.0.0.1"))
+                .setMyAsNumber(Uint16.valueOf(30))
+                .setHoldTimer(Uint16.valueOf(3))
+                .setVersion(new ProtocolVersion(Uint8.valueOf(4)))
+                .setBgpParameters(ImmutableList.of(new BgpParametersBuilder()
+                    .setOptionalCapabilities(ImmutableList.of(new OptionalCapabilitiesBuilder()
+                        .setCParameters(new CParametersBuilder()
+                            .setAs4BytesCapability(new As4BytesCapabilityBuilder()
+                                .setAsNumber(new AsNumber(Uint32.valueOf(1000))).build())
+                            .addAugmentation(CParameters1.class, new CParameters1Builder()
+                                .setGracefulRestartCapability(new GracefulRestartCapabilityBuilder()
+                                    .setRestartFlags(new GracefulRestartCapability.RestartFlags(false))
+                                    .setRestartTime(Uint16.ZERO)
+                                    .setTables(ImmutableList.of()).build())
                                 .build())
-                            .build())).build()))
+                            .build())
+                        .build())).build()))
                 .build();
         final ByteBuf msg = Unpooled.buffer();
         new BGPOpenMessageParser(ServiceLoaderBGPExtensionProviderContext.getSingletonInstance().getParameterRegistry())
@@ -87,13 +93,17 @@ public class OpenTest {
             capabilities.add(new OptionalCapabilitiesBuilder()
                 .setCParameters(new CParametersBuilder()
                     .setAs4BytesCapability(new As4BytesCapabilityBuilder()
-                        .setAsNumber(new AsNumber(1000L)).build())
+                        .setAsNumber(new AsNumber(Uint32.valueOf(1000))).build())
                     .build())
                 .build());
         }
 
-        final Open open = new OpenBuilder().setBgpIdentifier(new Ipv4Address("127.0.0.1")).setMyAsNumber(30)
-                .setHoldTimer(3).setVersion(new ProtocolVersion((short) 4)).setBgpParameters(ImmutableList.of(
+        final Open open = new OpenBuilder()
+                .setBgpIdentifier(new Ipv4Address("127.0.0.1"))
+                .setMyAsNumber(Uint16.valueOf(30))
+                .setHoldTimer(Uint16.valueOf(3))
+                .setVersion(new ProtocolVersion(Uint8.valueOf(4)))
+                .setBgpParameters(ImmutableList.of(
                     new BgpParametersBuilder().setOptionalCapabilities(capabilities).build()))
                 .build();
 
index 0102abb607c97c1db3927793101f5b4382879cd9..4a41ac204a94a424d3e1649ac213bc2a2630965f 100644 (file)
@@ -42,6 +42,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mult
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.Ipv4AddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.UnicastSubsequentAddressFamily;
 import org.opendaylight.yangtools.yang.binding.Notification;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 public class ParserTest {
     private static final byte[] OPEN_BMSG = new byte[] {
@@ -195,20 +197,24 @@ public class ParserTest {
 
     @Test
     public void testOpenMessage() throws UnknownHostException, BGPParsingException, BGPDocumentedException {
-        final Notification open = new OpenBuilder().setMyAsNumber(100).setHoldTimer(180)
-            .setBgpIdentifier(new Ipv4Address("20.20.20.20")).setVersion(
-            new ProtocolVersion((short) 4)).build();
+        final Notification open = new OpenBuilder()
+                .setMyAsNumber(Uint16.valueOf(100))
+                .setHoldTimer(Uint16.valueOf(180))
+                .setBgpIdentifier(new Ipv4Address("20.20.20.20"))
+                .setVersion(new ProtocolVersion(Uint8.valueOf(4)))
+                .build();
         final ByteBuf bytes = Unpooled.buffer();
         ParserTest.reg.serializeMessage(open, bytes);
         assertArrayEquals(OPEN_BMSG, ByteArray.getAllBytes(bytes));
 
         final Notification m = ParserTest.reg.parseMessage(Unpooled.copiedBuffer(bytes), null);
-
         assertTrue(m instanceof Open);
-        assertEquals(100, ((Open) m).getMyAsNumber().intValue());
-        assertEquals(180, ((Open) m).getHoldTimer().intValue());
-        assertEquals(new Ipv4Address("20.20.20.20"), ((Open) m).getBgpIdentifier());
-        assertTrue(((Open) m).getBgpParameters().isEmpty());
+
+        final Open mo = (Open) m;
+        assertEquals(100, mo.getMyAsNumber().intValue());
+        assertEquals(180, mo.getHoldTimer().intValue());
+        assertEquals(new Ipv4Address("20.20.20.20"), mo.getBgpIdentifier());
+        assertTrue(mo.getBgpParameters().isEmpty());
     }
 
     @Test
index ec81374d6af69020d879d6ed442a5d63b05cc89f..b6e001405ab0d9bdf7608106d2564ed2bca2094e 100644 (file)
@@ -30,6 +30,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.RouteOriginExtendedCommunityCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.RouteOriginExtendedCommunityCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.route.origin.extended.community._case.RouteOriginExtendedCommunityBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class ExtendedCommunitiesAttributeParserTest {
 
@@ -54,7 +55,7 @@ public class ExtendedCommunitiesAttributeParserTest {
     public void testExtendedCommunityAttributeParser() throws BGPDocumentedException, BGPParsingException {
         final RouteOriginExtendedCommunityCase routeOrigin = new RouteOriginExtendedCommunityCaseBuilder()
                 .setRouteOriginExtendedCommunity(new RouteOriginExtendedCommunityBuilder()
-                    .setGlobalAdministrator(new ShortAsNumber(54L))
+                    .setGlobalAdministrator(new ShortAsNumber(Uint32.valueOf(54)))
                     .setLocalAdministrator(new byte[] { 0, 0, 1, 76 }).build())
                 .build();
         final ExtendedCommunities expected = new ExtendedCommunitiesBuilder().setTransitive(false)
index 4f4c272cbaac21679f6a1be0a7656def4656e3fe..c9806f2323b9a30a2d49bf3ea0131473f864d03d 100644 (file)
@@ -20,6 +20,7 @@ import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.Attributes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.AttributesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.attributes.LocalPrefBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class LocalPreferenceAttributeParserTest {
     private static final byte[] ATTRIBUTE_BYTES = {
@@ -27,9 +28,7 @@ public class LocalPreferenceAttributeParserTest {
     };
 
     private static final Attributes RESULT = new AttributesBuilder()
-            .setLocalPref(new LocalPrefBuilder()
-                    .setPref(1L)
-                    .build())
+            .setLocalPref(new LocalPrefBuilder().setPref(Uint32.ONE).build())
             .build();
 
     @Test
index 27cc429a80abce3a64e09afb07af50a294aad395..967d10b9d316cb31afdc9b6e56f3b7de2f9c1a89 100644 (file)
@@ -20,6 +20,7 @@ import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.Attributes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.AttributesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.attributes.MultiExitDiscBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class MultiExitDiscriminatorAttributeParserTest {
     private static final byte[] ATTRIBUTE_BYTES = {
@@ -27,7 +28,7 @@ public class MultiExitDiscriminatorAttributeParserTest {
     };
 
     private static final Attributes RESULT = new AttributesBuilder()
-            .setMultiExitDisc(new MultiExitDiscBuilder().setMed(1L).build()).build();
+            .setMultiExitDisc(new MultiExitDiscBuilder().setMed(Uint32.ONE).build()).build();
 
     @Test
     public void testAttributeParser() throws BGPParsingException, BGPDocumentedException {
index 27234154678952a84c61cb75d0ff5faea436c72c..d1d5a3a8baa19ec553caefef72a9b00448150280 100755 (executable)
@@ -20,6 +20,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mess
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.AttributesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.attributes.UnrecognizedAttributes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.attributes.UnrecognizedAttributesBuilder;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 public class UnrecognizedAttributesSerializerTest {
 
@@ -38,10 +39,10 @@ public class UnrecognizedAttributesSerializerTest {
         };
         final List<UnrecognizedAttributes> unrecognizedAttrs = new ArrayList<>();
         final UnrecognizedAttributes unrecognizedAttribute1 = new UnrecognizedAttributesBuilder().setPartial(true)
-                .setTransitive(true).setType((short) 101).setValue(unrecognizedValue1).build();
+                .setTransitive(true).setType(Uint8.valueOf(101)).setValue(unrecognizedValue1).build();
         unrecognizedAttrs.add(unrecognizedAttribute1);
         final UnrecognizedAttributes unrecognizedAttribute2 = new UnrecognizedAttributesBuilder().setPartial(true)
-                .setTransitive(true).setType((short) 102).setValue(unrecognizedValue2).build();
+                .setTransitive(true).setType(Uint8.valueOf(102)).setValue(unrecognizedValue2).build();
         unrecognizedAttrs.add(unrecognizedAttribute2);
         final Attributes attrs = new AttributesBuilder().setUnrecognizedAttributes(unrecognizedAttrs).build();
 
index 570f3b40fd081884ad382a3cab67b48066859e68..f0b31160a44d4251989eaf90bbb126d2b9d2d070 100644 (file)
@@ -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.parser.impl.message.update.extended.communities;
 
 import io.netty.buffer.ByteBuf;
@@ -24,14 +23,18 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.As4RouteOriginExtendedCommunityCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.As4RouteOriginExtendedCommunityCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.as._4.route.origin.extended.community._case.As4RouteOriginExtendedCommunityBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public final class RouteOrigin4OctectASEcHandlerTest {
 
     public static final byte[] INPUT = {
         0, 0, 0, 20, 0, 100
     };
-    public static final As4SpecificCommon AS_COMMON = new As4SpecificCommonBuilder().setAsNumber(new AsNumber(20L))
-        .setLocalAdministrator(100).build();
+    public static final As4SpecificCommon AS_COMMON = new As4SpecificCommonBuilder()
+            .setAsNumber(new AsNumber(Uint32.valueOf(20)))
+            .setLocalAdministrator(Uint16.valueOf(100))
+            .build();
 
     private RouteOrigin4OctectASEcHandler handler;
 
index 067b117d9f03d4658463efc4c0389f0c42ba4e42..6d8f8ce165657e3c7606a0396e1c3fab5e259dde 100644 (file)
@@ -18,6 +18,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.RouteOriginExtendedCommunityCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.RouteOriginExtendedCommunityCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.route.origin.extended.community._case.RouteOriginExtendedCommunityBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class RouteOriginAsTwoOctetEcHandlerTest {
     private static final byte[] INPUT = {
@@ -29,7 +30,7 @@ public class RouteOriginAsTwoOctetEcHandlerTest {
         final RouteOriginAsTwoOctetEcHandler handler = new RouteOriginAsTwoOctetEcHandler();
         final RouteOriginExtendedCommunityCase expected = new RouteOriginExtendedCommunityCaseBuilder()
                 .setRouteOriginExtendedCommunity(new RouteOriginExtendedCommunityBuilder()
-                    .setGlobalAdministrator(new ShortAsNumber(24L))
+                    .setGlobalAdministrator(new ShortAsNumber(Uint32.valueOf(24)))
                     .setLocalAdministrator(new byte[] { 4, 2, 8, 7 }).build())
                 .build();
 
index d5fbaded6bb92a3e2526a81e438ba20de575ee38..78310d0191fb8f73b62bb3592c5b146ff9731128 100644 (file)
@@ -19,6 +19,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.RouteOriginIpv4Case;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.RouteOriginIpv4CaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.route.origin.ipv4._case.RouteOriginIpv4Builder;
+import org.opendaylight.yangtools.yang.common.Uint16;
 
 public class RouteOriginIpv4EcHandlerTest {
 
@@ -32,7 +33,7 @@ public class RouteOriginIpv4EcHandlerTest {
         final RouteOriginIpv4Case expected = new RouteOriginIpv4CaseBuilder().setRouteOriginIpv4(
                 new RouteOriginIpv4Builder()
                     .setGlobalAdministrator(new Ipv4Address("12.51.2.5"))
-                    .setLocalAdministrator(5421)
+                    .setLocalAdministrator(Uint16.valueOf(5421))
                     .build()).build();
 
         final ExtendedCommunity exComm = handler.parseExtendedCommunity(Unpooled.copiedBuffer(INPUT));
index f42d81b1d99dea13002950431913313d717986ed..eeb3a15966cbaf35d9854f84431e4819d5845a80 100644 (file)
@@ -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.parser.impl.message.update.extended.communities;
 
 import static org.junit.Assert.assertEquals;
@@ -21,17 +20,17 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.SourceAs4ExtendedCommunityCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.SourceAs4ExtendedCommunityCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.source.as._4.extended.community._case.SourceAs4ExtendedCommunityBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class SourceAS4OctectASHandlerTest {
     private static final byte[] INPUT = {0, 0, 0, 20, 0, 0};
     private final SourceAS4OctectHandler handler = new SourceAS4OctectHandler();
 
-
     @Test
     public void testHandler() {
         final SourceAs4ExtendedCommunityCase expected = new SourceAs4ExtendedCommunityCaseBuilder()
                 .setSourceAs4ExtendedCommunity(new SourceAs4ExtendedCommunityBuilder()
-                        .setGlobalAdministrator(new AsNumber(20L)).build()).build();
+                        .setGlobalAdministrator(new AsNumber(Uint32.valueOf(20))).build()).build();
 
         final ExtendedCommunity exComm = this.handler.parseExtendedCommunity(Unpooled.copiedBuffer(INPUT));
         assertEquals(expected, exComm);
index c64846e623d3d95f61b8f166d104274c8d58d353..605c207542459ced1709bf87ae89aa400f8a43d1 100644 (file)
@@ -20,6 +20,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.SourceAsExtendedCommunityCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.SourceAsExtendedCommunityCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.source.as.extended.community._case.SourceAsExtendedCommunityBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class SourceASHandlerTest {
     private static final byte[] INPUT = {0, 1, 0, 0, 0, 0};
@@ -30,7 +31,7 @@ public class SourceASHandlerTest {
     public void testHandler() {
         final SourceAsExtendedCommunityCase expected = new SourceAsExtendedCommunityCaseBuilder()
                 .setSourceAsExtendedCommunity(new SourceAsExtendedCommunityBuilder()
-                        .setGlobalAdministrator(new ShortAsNumber(1L))
+                        .setGlobalAdministrator(new ShortAsNumber(Uint32.ONE))
                         .build()).build();
 
         final ExtendedCommunity exComm = this.handler.parseExtendedCommunity(Unpooled.copiedBuffer(INPUT));
index 29e307a05dfa9d5fca90357b738145de13f283e2..919c5daec503ad4f4984de8964227bde237c17c8 100644 (file)
@@ -19,6 +19,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.RouteTargetExtendedCommunityCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.RouteTargetExtendedCommunityCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.route.target.extended.community.grouping.RouteTargetExtendedCommunityBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class RouteTargetAsTwoOctetEcHandlerTest {
 
@@ -31,7 +32,7 @@ public class RouteTargetAsTwoOctetEcHandlerTest {
         final RouteTargetAsTwoOctetEcHandler handler = new RouteTargetAsTwoOctetEcHandler();
         final RouteTargetExtendedCommunityCase expected = new RouteTargetExtendedCommunityCaseBuilder()
                 .setRouteTargetExtendedCommunity(new RouteTargetExtendedCommunityBuilder()
-                        .setGlobalAdministrator(new ShortAsNumber(35L))
+                        .setGlobalAdministrator(new ShortAsNumber(Uint32.valueOf(35)))
                         .setLocalAdministrator(new byte[]{4, 2, 8, 7})
                         .build()).build();
 
index 4caf30358b0a53b4218590b561f348b88054c4ef..00852c00a190ef63785d165209e0f90a1538f17b 100644 (file)
@@ -19,6 +19,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.RouteTargetIpv4Case;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.RouteTargetIpv4CaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.route.target.ipv4.grouping.RouteTargetIpv4Builder;
+import org.opendaylight.yangtools.yang.common.Uint16;
 
 public class RouteTargetIpv4EcHandlerTest {
 
@@ -32,7 +33,7 @@ public class RouteTargetIpv4EcHandlerTest {
         final RouteTargetIpv4Case expected = new RouteTargetIpv4CaseBuilder().setRouteTargetIpv4(
                 new RouteTargetIpv4Builder()
                         .setGlobalAdministrator(new Ipv4Address("12.51.2.5"))
-                        .setLocalAdministrator(5421)
+                        .setLocalAdministrator(Uint16.valueOf(5421))
                         .build()).build();
 
         final ExtendedCommunity exComm = handler.parseExtendedCommunity(Unpooled.copiedBuffer(INPUT));
index a141cc672947cac6b873251620f75c1afe49a72a..6c3ee68ab5aca67f51c77115f5dc8524bf5aa0d3 100644 (file)
             <groupId>io.netty</groupId>
             <artifactId>netty-buffer</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>yang-common</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.opendaylight.mdsal</groupId>
             <artifactId>yang-binding</artifactId>
index a9aeaaab58abb6913a29a27e1dfe59d8d6218cd4..bcff065f65021b7cb3c6dd1f5dd22585be975a1c 100644 (file)
@@ -65,6 +65,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.next.hop.c.next.hop.Ipv6NextHopCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.next.hop.c.next.hop.ipv6.next.hop._case.Ipv6NextHopBuilder;
 import org.opendaylight.yangtools.yang.binding.Notification;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 public class BGPMessageParserMockTest {
 
@@ -142,7 +145,7 @@ public class BGPMessageParserMockTest {
         final UpdateBuilder builder = new UpdateBuilder();
 
         final List<Segments> asPath = new ArrayList<>();
-        asPath.add(new SegmentsBuilder().setAsSequence(Lists.newArrayList(new AsNumber(asn))).build());
+        asPath.add(new SegmentsBuilder().setAsSequence(Lists.newArrayList(new AsNumber(Uint32.valueOf(asn)))).build());
         final CNextHop nextHop = new Ipv6NextHopCaseBuilder().setIpv6NextHop(
                 new Ipv6NextHopBuilder().setGlobal(new Ipv6Address("2001:db8::1"))
                         .setLinkLocal(new Ipv6Address("fe80::c001:bff:fe7e:0")).build()).build();
@@ -191,8 +194,12 @@ public class BGPMessageParserMockTest {
 
         final byte[] input = new byte[]{5, 8, 13, 21};
 
-        openMap.put(Unpooled.copiedBuffer(input), new OpenBuilder().setMyAsNumber(30).setHoldTimer(30)
-                .setBgpParameters(params).setVersion(new ProtocolVersion((short) 4)).build());
+        openMap.put(Unpooled.copiedBuffer(input), new OpenBuilder()
+            .setMyAsNumber(Uint16.valueOf(30))
+            .setHoldTimer(Uint16.valueOf(30))
+            .setBgpParameters(params)
+            .setVersion(new ProtocolVersion(Uint8.valueOf(4)))
+            .build());
 
         final BGPMessageParserMock mockParser = new BGPMessageParserMock(openMap);
 
index 9c9981a26a8bcf6c2c43d4c62c7599928d1a39ba..2f1090f22d56c73afc21fe87ccb1e7500774a7bb 100644 (file)
@@ -46,7 +46,7 @@ public class PathIdUtilTest {
 
     @Test
     public void testWritePathId() {
-        PathIdUtil.writePathId(new PathId(10L), this.buffer);
+        PathIdUtil.writePathId(new PathId(Uint32.valueOf(10)), this.buffer);
         Assert.assertEquals(Integer.BYTES, this.buffer.readableBytes());
     }
 
index 853c45883db3ac7cebe30dba53a0f6783a0baedd..b65528002c00aec64af7c8b296e5758925637407 100644 (file)
@@ -26,13 +26,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mess
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.attributes.as.path.SegmentsBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.PeerId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.BgpOrigin;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class BasePathSelectorTest {
-    private static final List<AsNumber> SEQ_SEGMENT
-            = Arrays.asList(new AsNumber(1L), new AsNumber(2L), new AsNumber(3L));
+    private static final List<AsNumber> SEQ_SEGMENT = Arrays.asList(
+        new AsNumber(Uint32.ONE), new AsNumber(Uint32.valueOf(2)), 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(20L), new AsNumber(2L), new AsNumber(3L));
+    private static final List<AsNumber> SEQ_SEGMENT2 = Arrays.asList(
+        new AsNumber(Uint32.valueOf(20)), new AsNumber(Uint32.valueOf(2)), 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);
@@ -57,19 +58,19 @@ public class BasePathSelectorTest {
     }
 
     private static void addLowerLocalRef(final AttributesBuilder dataContBuilder) {
-        dataContBuilder.setLocalPref(new LocalPrefBuilder().setPref(123L).build());
+        dataContBuilder.setLocalPref(new LocalPrefBuilder().setPref(Uint32.valueOf(123)).build());
     }
 
     private static void addHigherLocalRef(final AttributesBuilder dataContBuilder) {
-        dataContBuilder.setLocalPref(new LocalPrefBuilder().setPref(321L).build());
+        dataContBuilder.setLocalPref(new LocalPrefBuilder().setPref(Uint32.valueOf(321)).build());
     }
 
     private static void addLowerMultiExitDisc(final AttributesBuilder dataContBuilder) {
-        dataContBuilder.setMultiExitDisc(new MultiExitDiscBuilder().setMed(1234L).build());
+        dataContBuilder.setMultiExitDisc(new MultiExitDiscBuilder().setMed(Uint32.valueOf(1234)).build());
     }
 
     private static void addHigherMultiExitDisc(final AttributesBuilder dataContBuilder) {
-        dataContBuilder.setMultiExitDisc(new MultiExitDiscBuilder().setMed(4321L).build());
+        dataContBuilder.setMultiExitDisc(new MultiExitDiscBuilder().setMed(Uint32.valueOf(4321)).build());
     }
 
     private static void addIgpOrigin(final AttributesBuilder dataContBuilder) {
index b21e80015b4e02f6d2174961e19e697857dab662..f353405f5a91421e1b79b8c4243c0fbd401de7c0 100644 (file)
@@ -22,7 +22,7 @@ import org.opendaylight.protocol.util.InetSocketAddressUtil;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
-
+import org.opendaylight.yangtools.yang.common.Uint16;
 
 public class BGPPeerAcceptorImplTest extends AbstractBGPDispatcherTest {
     @Test
@@ -30,7 +30,8 @@ public class BGPPeerAcceptorImplTest extends AbstractBGPDispatcherTest {
         final InetSocketAddress inetServerAddress = InetSocketAddressUtil.getRandomLoopbackInetSocketAddress();
         final IpAddress serverIpAddress = new IpAddress(new Ipv4Address(InetSocketAddressUtil
                 .toHostAndPort(inetServerAddress).getHost()));
-        final PortNumber portNumber = new PortNumber(InetSocketAddressUtil.toHostAndPort(inetServerAddress).getPort());
+        final PortNumber portNumber = new PortNumber(Uint16.valueOf(
+            InetSocketAddressUtil.toHostAndPort(inetServerAddress).getPort()));
         this.registry.addPeer(serverIpAddress, this.serverListener, createPreferences(inetServerAddress));
 
         final BGPPeerAcceptorImpl bgpPeerAcceptor = new BGPPeerAcceptorImpl(serverIpAddress, portNumber,
index 9717cf0d1b9f5ca9909166ddf3486e8cb7e7a8dc..dc721a99c53e6f054e5f52d62a0d72dda3ed1f25 100644 (file)
@@ -90,6 +90,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.next.hop.c.next.hop.ipv4.next.hop._case.Ipv4NextHopBuilder;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.Notification;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public abstract class AbstractAddPathTest extends DefaultRibPoliciesMockTest {
     private static final int RETRY_TIMER = 10;
@@ -101,16 +103,16 @@ public abstract class AbstractAddPathTest extends DefaultRibPoliciesMockTest {
     static final Ipv4Address PEER4 = new Ipv4Address("127.0.0.5");
     static final Ipv4Address PEER5 = new Ipv4Address("127.0.0.6");
     static final Ipv4Address PEER6 = new Ipv4Address("127.0.0.7");
-    static final AsNumber AS_NUMBER = new AsNumber(AS);
-    static final int PORT = InetSocketAddressUtil.getRandomPort();
+    static final AsNumber AS_NUMBER = new AsNumber(Uint32.valueOf(AS));
+    static final Uint16 PORT = Uint16.valueOf(InetSocketAddressUtil.getRandomPort());
     static final Ipv4Prefix PREFIX1 = new Ipv4Prefix("1.1.1.1/32");
     private static final ClusterIdentifier CLUSTER_ID = new ClusterIdentifier(RIB_ID);
     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(1L), CLUSTER_ID, 100);
-    static final Update UPD_50 = createSimpleUpdate(PREFIX1, new PathId(2L), CLUSTER_ID, 50);
-    static final Update UPD_200 = createSimpleUpdate(PREFIX1, new PathId(3L), CLUSTER_ID, 200);
-    static final Update UPD_20 = createSimpleUpdate(PREFIX1, new PathId(1L), CLUSTER_ID, 20);
+    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_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);
     static final Update UPD_NA_100_EBGP = createSimpleUpdateEbgp(PREFIX1);
     static final Update UPD_NA_200 = createSimpleUpdate(PREFIX1, null, CLUSTER_ID, 200);
@@ -202,7 +204,7 @@ public abstract class AbstractAddPathTest extends DefaultRibPoliciesMockTest {
 
     void causeBGPError(final BGPSessionImpl session) {
         final Open openObj = new OpenBuilder().setBgpIdentifier(new Ipv4Address("1.1.1.1"))
-            .setHoldTimer(50).setMyAsNumber(72).build();
+            .setHoldTimer(Uint16.valueOf(50)).setMyAsNumber(Uint16.valueOf(72)).build();
         waitFutureSuccess(session.writeAndFlush(openObj));
     }
 
@@ -293,8 +295,8 @@ public abstract class AbstractAddPathTest extends DefaultRibPoliciesMockTest {
     private static BGPSessionImpl connectPeer(final Ipv4Address localAddress, final BGPDispatcherImpl dispatcherImpl)
             throws InterruptedException {
         final Future<BGPSessionImpl> future = dispatcherImpl
-                .createClient(new InetSocketAddress(localAddress.getValue(), PORT),
-                        new InetSocketAddress(RIB_ID, PORT), RETRY_TIMER, true);
+                .createClient(new InetSocketAddress(localAddress.getValue(), PORT.toJava()),
+                        new InetSocketAddress(RIB_ID, PORT.toJava()), RETRY_TIMER, true);
         Thread.sleep(200);
         waitFutureSuccess(future);
         Thread.sleep(100);
@@ -324,10 +326,10 @@ public abstract class AbstractAddPathTest extends DefaultRibPoliciesMockTest {
     private static Update createSimpleUpdate(final Ipv4Prefix prefix, final PathId pathId,
             final ClusterIdentifier clusterId, final long localPreference) {
         final AttributesBuilder attBuilder = new AttributesBuilder();
-        attBuilder.setLocalPref(new LocalPrefBuilder().setPref(localPreference).build());
+        attBuilder.setLocalPref(new LocalPrefBuilder().setPref(Uint32.valueOf(localPreference)).build());
         attBuilder.setOrigin(new OriginBuilder().setValue(BgpOrigin.Igp).build());
         attBuilder.setAsPath(new AsPathBuilder().setSegments(Collections.emptyList()).build());
-        attBuilder.setMultiExitDisc(new MultiExitDiscBuilder().setMed(0L).build());
+        attBuilder.setMultiExitDisc(new MultiExitDiscBuilder().setMed(Uint32.ZERO).build());
         if (clusterId != null) {
             attBuilder.setClusterId(new ClusterIdBuilder().setCluster(Collections.singletonList(clusterId)).build());
             attBuilder.setOriginatorId(new OriginatorIdBuilder().setOriginator(new Ipv4Address(clusterId)).build());
@@ -367,7 +369,7 @@ public abstract class AbstractAddPathTest extends DefaultRibPoliciesMockTest {
 
     private static Update createSimpleWithdrawalUpdate(final Ipv4Prefix prefix, final long localPreference) {
         final AttributesBuilder attBuilder = new AttributesBuilder();
-        attBuilder.setLocalPref(new LocalPrefBuilder().setPref(localPreference).build());
+        attBuilder.setLocalPref(new LocalPrefBuilder().setPref(Uint32.valueOf(localPreference)).build());
         attBuilder.setOrigin(new OriginBuilder().setValue(BgpOrigin.Igp).build());
         attBuilder.setAsPath(new AsPathBuilder().setSegments(Collections.emptyList()).build());
         attBuilder.setUnrecognizedAttributes(Collections.emptyList());
index 50260a499645dfae457eff033752c1828e67e411..e447ea66edcf621317598aeafca14f6fe5cde63d 100644 (file)
@@ -44,10 +44,11 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mult
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.BgpId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.Ipv4AddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.UnicastSubsequentAddressFamily;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.slf4j.LoggerFactory;
 
 public class AbstractBGPDispatcherTest {
-    protected static final AsNumber AS_NUMBER = new AsNumber(30L);
+    protected static final AsNumber AS_NUMBER = new AsNumber(Uint32.valueOf(30));
     static final int RETRY_TIMER = 1;
     protected static final BgpTableType IPV_4_TT = new BgpTableTypeImpl(Ipv4AddressFamily.class,
         UnicastSubsequentAddressFamily.class);
@@ -92,12 +93,19 @@ public class AbstractBGPDispatcherTest {
     protected BGPSessionPreferences createPreferences(final InetSocketAddress socketAddress) {
         final List<BgpParameters> tlvs = new ArrayList<>();
         final List<OptionalCapabilities> capas = new ArrayList<>();
-        capas.add(new OptionalCapabilitiesBuilder().setCParameters(new CParametersBuilder().addAugmentation(
-                CParameters1.class, new CParameters1Builder()
+        capas.add(new OptionalCapabilitiesBuilder()
+            .setCParameters(new CParametersBuilder()
+                .addAugmentation(CParameters1.class, new CParameters1Builder()
                         .setMultiprotocolCapability(new MultiprotocolCapabilityBuilder()
-                                .setAfi(IPV_4_TT.getAfi()).setSafi(IPV_4_TT.getSafi()).build()).build())
-                .setAs4BytesCapability(new As4BytesCapabilityBuilder().setAsNumber(new AsNumber(30L)).build())
-                .build()).build());
+                                .setAfi(IPV_4_TT.getAfi())
+                                .setSafi(IPV_4_TT.getSafi())
+                                .build())
+                        .build())
+                .setAs4BytesCapability(new As4BytesCapabilityBuilder()
+                    .setAsNumber(new AsNumber(Uint32.valueOf(30)))
+                    .build())
+                .build())
+            .build());
         capas.add(new OptionalCapabilitiesBuilder()
                 .setCParameters(BgpExtendedMessageUtil.EXTENDED_MESSAGE_CAPABILITY).build());
         tlvs.add(new BgpParametersBuilder().setOptionalCapabilities(capas).build());
index 841aad5664e0d519f98d983500b1886f360389c6..d1e81226c971d02850adf877124b44cd54617cd7 100644 (file)
@@ -73,6 +73,7 @@ import org.opendaylight.yangtools.util.concurrent.FluentFutures;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
@@ -158,7 +159,7 @@ public class AbstractRIBTestSetup extends DefaultRibPoliciesMockTest {
         mockedMethods();
         doReturn(mock(ClusterSingletonServiceRegistration.class)).when(this.clusterSingletonServiceProvider)
                 .registerClusterSingletonService(any(ClusterSingletonService.class));
-        this.rib = new RIBImpl(this.tableRegistry, new RibId("test"), new AsNumber(5L), RIB_ID, context,
+        this.rib = new RIBImpl(this.tableRegistry, new RibId("test"), new AsNumber(Uint32.valueOf(5)), RIB_ID, context,
                 this.dispatcher, codecsRegistry, this.dom, getDataBroker(), this.policies,
                 localTables, Collections.singletonMap(KEY,
                 BasePathSelectionModeFactory.createBestPathSelectionStrategy()));
index 2bd8517c48d468fc53aac69722556c8ddd8d81ce..fbda246aa9ea918086513229bc3754a9d36a8244 100644 (file)
@@ -61,7 +61,8 @@ public class AddPathAllPathsTest extends AbstractAddPathTest {
 
         this.ribImpl.instantiateServiceInstance();
         this.ribImpl.onGlobalContextUpdated(this.schemaService.getGlobalContext());
-        final ChannelFuture channelFuture = this.serverDispatcher.createServer(new InetSocketAddress(RIB_ID, PORT));
+        final ChannelFuture channelFuture = this.serverDispatcher.createServer(
+            new InetSocketAddress(RIB_ID, PORT.toJava()));
         waitFutureSuccess(channelFuture);
         this.serverChannel = channelFuture.channel();
     }
index 2965f63dcae39638a17f151445c6370c4a1ebbd5..e1525ced504c8cb3509490d5c5b2c43edb77380f 100644 (file)
@@ -47,7 +47,8 @@ public class AddPathBasePathsTest extends AbstractAddPathTest {
                 TABLES_TYPE, pathTables);
         this.ribImpl.instantiateServiceInstance();
         this.ribImpl.onGlobalContextUpdated(this.schemaService.getGlobalContext());
-        final ChannelFuture channelFuture = this.serverDispatcher.createServer(new InetSocketAddress(RIB_ID, PORT));
+        final ChannelFuture channelFuture = this.serverDispatcher.createServer(
+            new InetSocketAddress(RIB_ID, PORT.toJava()));
         waitFutureSuccess(channelFuture);
         this.serverChannel = channelFuture.channel();
     }
index 8fe255174cc46b209fb82f398ef166d27e33db48..a83a6399fabbfbd234a1a8d2590d316d47207b0f 100644 (file)
@@ -48,7 +48,8 @@ public class AddPathNPathsTest extends AbstractAddPathTest {
 
         this.ribImpl.instantiateServiceInstance();
         this.ribImpl.onGlobalContextUpdated(this.schemaService.getGlobalContext());
-        final ChannelFuture channelFuture = this.serverDispatcher.createServer(new InetSocketAddress(RIB_ID, PORT));
+        final ChannelFuture channelFuture = this.serverDispatcher.createServer(
+            new InetSocketAddress(RIB_ID, PORT.toJava()));
         waitFutureSuccess(channelFuture);
         this.serverChannel = channelFuture.channel();
     }
index a9b56c1237724c8e8e6b5656b4bf617cfa840bc0..7139e77aeba5ed0c63ef6672fe9f24ae457463c2 100644 (file)
@@ -71,10 +71,13 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mult
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.Ipv4AddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.UnicastSubsequentAddressFamily;
 import org.opendaylight.yangtools.yang.binding.Notification;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 public class BGPSessionImplTest {
-    private static final int HOLD_TIMER = 3;
-    private static final AsNumber AS_NUMBER = new AsNumber(30L);
+    private static final Uint16 HOLD_TIMER = Uint16.valueOf(3);
+    private static final AsNumber AS_NUMBER = new AsNumber(Uint32.valueOf(30));
     private static final Ipv4Address BGP_ID = new Ipv4Address("1.1.1.2");
     private static final String LOCAL_IP = "1.1.1.4";
     private static final int LOCAL_PORT = 12345;
@@ -104,8 +107,13 @@ public class BGPSessionImplTest {
         new EmbeddedChannel();
         MockitoAnnotations.initMocks(this);
         final List<BgpParameters> tlvs = new ArrayList<>();
-        this.classicOpen = new OpenBuilder().setMyAsNumber(AS_NUMBER.getValue().intValue()).setHoldTimer(HOLD_TIMER)
-                .setVersion(new ProtocolVersion((short) 4)).setBgpParameters(tlvs).setBgpIdentifier(BGP_ID).build();
+        this.classicOpen = new OpenBuilder()
+                .setMyAsNumber(Uint16.valueOf(AS_NUMBER.getValue()))
+                .setHoldTimer(HOLD_TIMER)
+                .setVersion(new ProtocolVersion(Uint8.valueOf(4)))
+                .setBgpParameters(tlvs)
+                .setBgpIdentifier(BGP_ID)
+                .build();
 
         final List<OptionalCapabilities> capa = new ArrayList<>();
         capa.add(new OptionalCapabilitiesBuilder().setCParameters(new CParametersBuilder()
index f022a4889b4862fc9132de322c6d28631a4eb230..cd3dc99aecdd5fef56a09faa675a5ca38354750a 100644 (file)
@@ -42,6 +42,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.SubsequentAddressFamily;
 import org.opendaylight.yangtools.yang.binding.Notification;
 import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 @RunWith(MockitoJUnitRunner.StrictStubs.class)
 public final class BgpPeerRpcTest {
@@ -109,7 +110,7 @@ public final class BgpPeerRpcTest {
         doReturn(new SimpleSessionListener().restartGracefully(referraltimerSeconds))
                 .when(this.peerRpcs).restartGracefully(referraltimerSeconds);
         final RestartGracefullyInput input = new RestartGracefullyInputBuilder()
-                .setSelectionDeferralTime(referraltimerSeconds)
+                .setSelectionDeferralTime(Uint32.valueOf(referraltimerSeconds))
                 .build();
         final ListenableFuture<RpcResult<RestartGracefullyOutput>> result = this.rpc.restartGracefully(input);
         assertTrue(!result.get().getErrors().isEmpty());
index 7fad72a19619d2c473a2b5b4e549812146f3da21..6df8934341ed594bedc7318aee92ee433e97bdb7 100644 (file)
@@ -14,6 +14,7 @@ import java.util.function.Function;
 import org.junit.Assert;
 import org.opendaylight.protocol.bgp.rib.spi.State;
 import org.opendaylight.protocol.bgp.rib.spi.state.BGPGracelfulRestartState;
+import org.opendaylight.protocol.bgp.rib.spi.state.BGPSessionState;
 
 public final class CheckUtil {
 
@@ -31,11 +32,8 @@ public final class CheckUtil {
     public static void checkIdleState(final BGPPeer bgpPeer) {
         checkInLoop(State.IDLE, bgpPeer, peer -> {
             synchronized (bgpPeer) {
-                if (peer.getBGPSessionState() == null) {
-                    return State.IDLE;
-                } else {
-                    return peer.getBGPSessionState().getSessionState();
-                }
+                final BGPSessionState state = peer.getBGPSessionState();
+                return state == null ? State.IDLE : state.getSessionState();
             }
         }, SLEEP_FOR_MILLIS, TIMEOUT_SECONDS);
     }
@@ -47,11 +45,8 @@ public final class CheckUtil {
     public static void checkUpState(final BGPPeer bgpPeer) {
         checkInLoop(State.UP, bgpPeer, peer -> {
             synchronized (bgpPeer) {
-                if (peer.getBGPSessionState() == null) {
-                    return State.IDLE;
-                } else {
-                    return peer.getBGPSessionState().getSessionState();
-                }
+                final BGPSessionState state = peer.getBGPSessionState();
+                return state == null ? State.IDLE : state.getSessionState();
             }
         }, SLEEP_FOR_MILLIS, TIMEOUT_SECONDS);
     }
index 50722c0d4b71e08df649a2d424c98140eb367a76..30ef4fb7653552a9c5c7798471ded87b6abe5fd8 100644 (file)
@@ -65,6 +65,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.Ipv4AddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.UnicastSubsequentAddressFamily;
 import org.opendaylight.yangtools.yang.binding.Notification;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 public class FSMTest {
     @Mock
@@ -104,8 +107,13 @@ public class FSMTest {
                         new CParameters1Builder().setMultiprotocolCapability(new MultiprotocolCapabilityBuilder()
                                 .setAfi(this.linkstatett.getAfi()).setSafi(this.linkstatett.getSafi())
                                 .build()).build()).build()).build());
-        capas.add(new OptionalCapabilitiesBuilder().setCParameters(new CParametersBuilder().setAs4BytesCapability(
-                new As4BytesCapabilityBuilder().setAsNumber(new AsNumber(30L)).build()).build()).build());
+        capas.add(new OptionalCapabilitiesBuilder()
+            .setCParameters(new CParametersBuilder()
+                .setAs4BytesCapability(new As4BytesCapabilityBuilder()
+                    .setAsNumber(new AsNumber(Uint32.valueOf(30)))
+                    .build())
+                .build())
+            .build());
         capas.add(new OptionalCapabilitiesBuilder()
                 .setCParameters(BgpExtendedMessageUtil.EXTENDED_MESSAGE_CAPABILITY).build());
         capas.add(new OptionalCapabilitiesBuilder()
@@ -115,8 +123,8 @@ public class FSMTest {
 
 
         tlvs.add(new BgpParametersBuilder().setOptionalCapabilities(capas).build());
-        final BGPSessionPreferences prefs = new BGPSessionPreferences(new AsNumber(30L), (short) 3,
-                new BgpId("1.1.1.1"), new AsNumber(30L), tlvs);
+        final BGPSessionPreferences prefs = new BGPSessionPreferences(new AsNumber(Uint32.valueOf(30)), (short) 3,
+                new BgpId("1.1.1.1"), new AsNumber(Uint32.valueOf(30)), tlvs);
 
         final ChannelFuture f = mock(ChannelFuture.class);
         doReturn(null).when(f).addListener(any(GenericFutureListener.class));
@@ -148,9 +156,13 @@ public class FSMTest {
         this.clientSession = new BGPClientSessionNegotiator(new DefaultPromise<>(GlobalEventExecutor.INSTANCE),
                 this.speakerListener, peerRegistry);
 
-        this.classicOpen = new OpenBuilder().setMyAsNumber(30).setHoldTimer(3)
-                .setVersion(new ProtocolVersion((short) 4)).setBgpParameters(
-            tlvs).setBgpIdentifier(new Ipv4Address("1.1.1.2")).build();
+        this.classicOpen = new OpenBuilder()
+                .setMyAsNumber(Uint16.valueOf(30))
+                .setHoldTimer(Uint16.valueOf(3))
+                .setVersion(new ProtocolVersion(Uint8.valueOf(4)))
+                .setBgpParameters(tlvs)
+                .setBgpIdentifier(new Ipv4Address("1.1.1.2"))
+                .build();
     }
 
     @Test
@@ -179,9 +191,12 @@ public class FSMTest {
         this.clientSession.channelActive(null);
         assertEquals(1, this.receivedMsgs.size());
         assertTrue(this.receivedMsgs.get(0) instanceof Open);
-        this.clientSession.handleMessage(new OpenBuilder().setMyAsNumber(30)
-                .setHoldTimer(1)
-                .setBgpIdentifier(new Ipv4Address("127.0.0.1")).setVersion(new ProtocolVersion((short) 4)).build());
+        this.clientSession.handleMessage(new OpenBuilder()
+            .setMyAsNumber(Uint16.valueOf(30))
+            .setHoldTimer(Uint16.ONE)
+            .setBgpIdentifier(new Ipv4Address("127.0.0.1"))
+            .setVersion(new ProtocolVersion(Uint8.valueOf(4)))
+            .build());
         assertEquals(2, this.receivedMsgs.size());
         assertTrue(this.receivedMsgs.get(1) instanceof Notify);
         final Notification m = this.receivedMsgs.get(this.receivedMsgs.size() - 1);
@@ -206,9 +221,13 @@ public class FSMTest {
                 .setCParameters(BgpExtendedMessageUtil.EXTENDED_MESSAGE_CAPABILITY).build());
         tlvs.add(new BgpParametersBuilder().setOptionalCapabilities(capas).build());
         // Open Message without advertised four-octet AS Number capability
-        this.clientSession.handleMessage(new OpenBuilder().setMyAsNumber(30).setHoldTimer(1).setVersion(
-                new ProtocolVersion((short) 4)).setBgpParameters(tlvs)
-                .setBgpIdentifier(new Ipv4Address("1.1.1.2")).build());
+        this.clientSession.handleMessage(new OpenBuilder()
+            .setMyAsNumber(Uint16.valueOf(30))
+            .setHoldTimer(Uint16.ONE)
+            .setVersion(new ProtocolVersion(Uint8.valueOf(4)))
+            .setBgpParameters(tlvs)
+            .setBgpIdentifier(new Ipv4Address("1.1.1.2"))
+            .build());
         assertEquals(2, this.receivedMsgs.size());
         assertTrue(this.receivedMsgs.get(1) instanceof Notify);
         final Notification m = this.receivedMsgs.get(this.receivedMsgs.size() - 1);
@@ -226,16 +245,30 @@ public class FSMTest {
         final List<BgpParameters> tlvs = new ArrayList<>();
         final List<OptionalCapabilities> capas = new ArrayList<>();
         capas.add(new OptionalCapabilitiesBuilder()
-                .setCParameters(new CParametersBuilder().addAugmentation(CParameters1.class,
-                        new CParameters1Builder().setMultiprotocolCapability(new MultiprotocolCapabilityBuilder()
-                                .setAfi(this.ipv4tt.getAfi()).setSafi(this.ipv4tt.getSafi()).build()).build())
-                        .build()).build());
-        capas.add(new OptionalCapabilitiesBuilder().setCParameters(new CParametersBuilder().setAs4BytesCapability(
-                new As4BytesCapabilityBuilder().setAsNumber(new AsNumber(30L)).build()).build()).build());
+            .setCParameters(new CParametersBuilder()
+                .addAugmentation(CParameters1.class, new CParameters1Builder()
+                    .setMultiprotocolCapability(new MultiprotocolCapabilityBuilder()
+                        .setAfi(this.ipv4tt.getAfi())
+                        .setSafi(this.ipv4tt.getSafi())
+                        .build())
+                    .build())
+                .build())
+            .build());
+        capas.add(new OptionalCapabilitiesBuilder()
+            .setCParameters(new CParametersBuilder()
+                .setAs4BytesCapability(new As4BytesCapabilityBuilder()
+                    .setAsNumber(new AsNumber(Uint32.valueOf(30)))
+                    .build())
+                .build())
+            .build());
         tlvs.add(new BgpParametersBuilder().setOptionalCapabilities(capas).build());
-        this.clientSession.handleMessage(new OpenBuilder().setMyAsNumber(30).setHoldTimer(1).setVersion(
-                new ProtocolVersion((short) 4)).setBgpParameters(tlvs)
-                .setBgpIdentifier(new Ipv4Address("1.1.1.2")).build());
+        this.clientSession.handleMessage(new OpenBuilder()
+            .setMyAsNumber(Uint16.valueOf(30))
+            .setHoldTimer(Uint16.ONE)
+            .setVersion(new ProtocolVersion(Uint8.valueOf(4)))
+            .setBgpParameters(tlvs)
+            .setBgpIdentifier(new Ipv4Address("1.1.1.2"))
+            .build());
         assertEquals(2, this.receivedMsgs.size());
         assertTrue(this.receivedMsgs.get(1) instanceof Keepalive);
     }
@@ -246,8 +279,11 @@ public class FSMTest {
         this.clientSession.handleMessage(this.classicOpen);
         this.clientSession.handleMessage(new KeepaliveBuilder().build());
         assertEquals(this.clientSession.getState(), BGPClientSessionNegotiator.State.FINISHED);
-        this.clientSession.handleMessage(new OpenBuilder().setMyAsNumber(30)
-                .setHoldTimer(3).setVersion(new ProtocolVersion((short) 4)).build());
+        this.clientSession.handleMessage(new OpenBuilder()
+            .setMyAsNumber(Uint16.valueOf(30))
+            .setHoldTimer(Uint16.valueOf(3))
+            .setVersion(new ProtocolVersion(Uint8.valueOf(4)))
+            .build());
         assertEquals(3, this.receivedMsgs.size());
         assertTrue(this.receivedMsgs.get(2) instanceof Notify);
         final Notification m = this.receivedMsgs.get(2);
index 008fccdfb2cf4f41f57355557aff80b6f130a52e..f2f5b7005b6b1107d123ff7e821dc80329c12731 100644 (file)
@@ -68,6 +68,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.UnicastSubsequentAddressFamily;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.Notification;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 public class GracefulRestartTest extends AbstractAddPathTest {
 
@@ -112,7 +114,8 @@ public class GracefulRestartTest extends AbstractAddPathTest {
 
         this.ribImpl.instantiateServiceInstance();
         this.ribImpl.onGlobalContextUpdated(this.schemaService.getGlobalContext());
-        final ChannelFuture channelFuture = this.serverDispatcher.createServer(new InetSocketAddress(RIB_ID, PORT));
+        final ChannelFuture channelFuture = this.serverDispatcher.createServer(
+            new InetSocketAddress(RIB_ID, PORT.toJava()));
         waitFutureSuccess(channelFuture);
         this.serverChannel = channelFuture.channel();
 
@@ -421,9 +424,9 @@ public class GracefulRestartTest extends AbstractAddPathTest {
             graceful.put(new TablesKey(Ipv4AddressFamily.class, UnicastSubsequentAddressFamily.class), true);
         }
         return new OpenBuilder()
-                .setMyAsNumber((int) AS)
-                .setHoldTimer(HOLDTIMER)
-                .setVersion(new ProtocolVersion((short) 4))
+                .setMyAsNumber(Uint16.valueOf(AS))
+                .setHoldTimer(Uint16.valueOf(HOLDTIMER))
+                .setVersion(new ProtocolVersion(Uint8.valueOf(4)))
                 .setBgpParameters(Collections.singletonList(createParameter(false, true, graceful)))
                 .setBgpIdentifier(PEER1)
                 .build();
index aa43d365f5723806e7c34f693455387b5f7ea0a4..750e22c6f69458c6de0a505d4bbdf882ebac4284 100644 (file)
@@ -79,6 +79,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.next.hop.c.next.hop.Ipv4NextHopCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.next.hop.c.next.hop.ipv4.next.hop._case.Ipv4NextHopBuilder;
 import org.opendaylight.yangtools.yang.binding.Notification;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.ModificationType;
@@ -173,7 +175,7 @@ public class PeerTest extends AbstractRIBTestSetup {
         }
         assertEquals(0, this.routes.size());
 
-        final LocalPref localPref = new LocalPrefBuilder().setPref((long) 100).build();
+        final LocalPref localPref = new LocalPrefBuilder().setPref(Uint32.valueOf(100)).build();
         ub.setAttributes(ab.setLocalPref(localPref).build());
         this.classic.onMessage(this.session, ub.build());
         assertEquals(3, this.routes.size());
@@ -237,8 +239,8 @@ public class PeerTest extends AbstractRIBTestSetup {
                                                 .build()).build()).build()).build())).build());
         final Open openObj = new OpenBuilder()
                 .setBgpIdentifier(new Ipv4Address("1.1.1.1"))
-                .setHoldTimer(50)
-                .setMyAsNumber(72)
+                .setHoldTimer(Uint16.valueOf(50))
+                .setMyAsNumber(Uint16.valueOf(72))
                 .setBgpParameters(params).build();
         this.session = new BGPSessionImpl(this.classic, channel, openObj, 30, null);
         this.session.setChannelExtMsgCoder(openObj);
index fb94eb4b649bf370d3d0d23e715c33b37d140866..71e471421f774404cac27ee7efc6878ce5d4c85d 100644 (file)
@@ -36,11 +36,12 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mess
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.open.message.bgp.parameters.optional.capabilities.c.parameters.As4BytesCapabilityBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.BgpId;
 import org.opendaylight.yangtools.concepts.Registration;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class StrictBGPPeerRegistryTest {
 
-    private static final AsNumber LOCAL_AS = new AsNumber(1234L);
-    private static final AsNumber REMOTE_AS = new AsNumber(1235L);
+    private static final AsNumber LOCAL_AS = new AsNumber(Uint32.valueOf(1234));
+    private static final AsNumber REMOTE_AS = new AsNumber(Uint32.valueOf(1235));
     private static final Ipv4Address FROM = new Ipv4Address("0.0.0.1");
     private static final IpAddress REMOTE_IP = new IpAddress(FROM);
     private static final Ipv4Address TO = new Ipv4Address("255.255.255.255");
@@ -183,7 +184,7 @@ public class StrictBGPPeerRegistryTest {
 
     @Test
     public void testDuplicatePeersLowerAs() throws Exception {
-        final AsNumber as2 = new AsNumber(3L);
+        final AsNumber as2 = new AsNumber(Uint32.valueOf(3));
 
         this.peerRegistry.addPeer(REMOTE_IP, this.peer1, this.mockPreferences);
 
@@ -199,7 +200,7 @@ public class StrictBGPPeerRegistryTest {
 
     @Test
     public void testAsMismatch() {
-        final AsNumber as2 = new AsNumber(3L);
+        final AsNumber as2 = new AsNumber(Uint32.valueOf(3));
 
         this.peerRegistry.addPeer(REMOTE_IP, this.peer1, this.mockPreferences);
         try {
index e4a704854dc429454e344bf60afedc615b141eca..a5d45c681eb6c02637834593fe5336c9faf1c02e 100644 (file)
@@ -99,13 +99,16 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.next.hop.c.next.hop.ipv4.next.hop._case.Ipv4NextHopBuilder;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint8;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
 
 public class SynchronizationAndExceptionTest extends AbstractAddPathTest {
     private static final int HOLD_TIMER = 3;
-    private static final AsNumber AS_NUMBER = new AsNumber(30L);
+    private static final AsNumber AS_NUMBER = new AsNumber(Uint32.valueOf(30));
     private static final Ipv4Address BGP_ID = new Ipv4Address("1.1.1.2");
     private static final String LOCAL_IP = "1.1.1.4";
     private static final int LOCAL_PORT = 12345;
@@ -141,15 +144,20 @@ public class SynchronizationAndExceptionTest extends AbstractAddPathTest {
         super.setUp();
         new EmbeddedChannel();
         final List<BgpParameters> tlvs = new ArrayList<>();
-        this.classicOpen = new OpenBuilder().setMyAsNumber(AS_NUMBER.getValue().intValue()).setHoldTimer(HOLD_TIMER)
-                .setVersion(new ProtocolVersion((short) 4)).setBgpParameters(tlvs).setBgpIdentifier(BGP_ID).build();
+        this.classicOpen = new OpenBuilder()
+                .setMyAsNumber(Uint16.valueOf(AS_NUMBER.getValue()))
+                .setHoldTimer(Uint16.valueOf(HOLD_TIMER))
+                .setVersion(new ProtocolVersion(Uint8.valueOf(4)))
+                .setBgpParameters(tlvs)
+                .setBgpIdentifier(BGP_ID)
+                .build();
 
         final List<OptionalCapabilities> capa = new ArrayList<>();
         capa.add(new OptionalCapabilitiesBuilder().setCParameters(new CParametersBuilder()
                 .addAugmentation(CParameters1.class, new CParameters1Builder()
                         .setMultiprotocolCapability(new MultiprotocolCapabilityBuilder()
                                 .setAfi(this.ipv4tt.getAfi()).setSafi(this.ipv4tt.getSafi()).build())
-                        .setGracefulRestartCapability(new GracefulRestartCapabilityBuilder().setRestartTime(0)
+                        .setGracefulRestartCapability(new GracefulRestartCapabilityBuilder().setRestartTime(Uint16.ZERO)
                                 .build()).build())
                 .setAs4BytesCapability(new As4BytesCapabilityBuilder().setAsNumber(AS_NUMBER).build()).build())
                 .build());
@@ -236,7 +244,7 @@ public class SynchronizationAndExceptionTest extends AbstractAddPathTest {
         wrongMessage.setAttributes(ab.setOrigin(origin).setAsPath(asPath).setCNextHop(nextHop).build());
 
         final UpdateBuilder correct = new UpdateBuilder(wrongMessage.build());
-        correct.setAttributes(ab.setLocalPref(new LocalPrefBuilder().setPref((long) 100).build()).build());
+        correct.setAttributes(ab.setLocalPref(new LocalPrefBuilder().setPref(Uint32.valueOf(100)).build()).build());
 
         bgpSession.handleMessage(correct.build());
         verify(this.tx, times(2)).merge(eq(LogicalDatastoreType.OPERATIONAL),
@@ -285,7 +293,7 @@ public class SynchronizationAndExceptionTest extends AbstractAddPathTest {
         wrongMessage.setAttributes(ab.setOrigin(origin).setAsPath(asPath).setCNextHop(nextHop).build());
 
         final UpdateBuilder correct = new UpdateBuilder(wrongMessage.build());
-        correct.setAttributes(ab.setLocalPref(new LocalPrefBuilder().setPref((long) 100).build()).build());
+        correct.setAttributes(ab.setLocalPref(new LocalPrefBuilder().setPref(Uint32.valueOf(100)).build()).build());
 
         bgpSession.handleMessage(correct.build());
         verify(this.tx, times(2)).merge(eq(LogicalDatastoreType.OPERATIONAL),
index 80ed7355d2a6e8eeb719e888c6cd14547405b30c..f3d37cd62ba42e9a4cd21c8926109827faebcd81 100644 (file)
@@ -51,14 +51,15 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.UnicastSubsequentAddressFamily;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.osgi.framework.ServiceRegistration;
 
 class AbstractConfig extends DefaultRibPoliciesMockTest {
-    protected static final AsNumber AS = new AsNumber(72L);
-    protected static final AsNumber LOCAL_AS = new AsNumber(73L);
+    protected static final AsNumber AS = new AsNumber(Uint32.valueOf(72));
+    protected static final AsNumber LOCAL_AS = new AsNumber(Uint32.valueOf(73));
     protected static final RibId RIB_ID = new RibId("test");
     static final TablesKey TABLES_KEY = new TablesKey(Ipv4AddressFamily.class, UnicastSubsequentAddressFamily.class);
     @Mock
index ba8232379bc822c70cd5886a8b493cbc3bbafb3c..aa658e008ddee6e81f8c1230de1ad71854d88743 100644 (file)
@@ -53,15 +53,17 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.open
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.NeighborAddPathsConfigBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.NeighborTransportConfig;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.NeighborTransportConfigBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 public class BgpPeerTest extends AbstractConfig {
-    static final short SHORT = 0;
+    static final Uint8 SHORT = Uint8.ZERO;
     static final IpAddress NEIGHBOR_ADDRESS = new IpAddress(new Ipv4Address("127.0.0.1"));
     static final String MD5_PASSWORD = "123";
-    static final PortNumber PORT = new PortNumber(179);
+    static final PortNumber PORT = new PortNumber(Uint16.valueOf(179));
     static final AfiSafi AFI_SAFI_IPV4 = new AfiSafiBuilder().setAfiSafiName(IPV4UNICAST.class)
             .addAugmentation(NeighborAddPathsConfig.class, new NeighborAddPathsConfigBuilder()
-                       .setReceive(true).setSendMax(SHORT).build()).build();
+                       .setReceive(true).setSendMax(Uint8.ZERO).build()).build();
     static final List<AfiSafi> AFI_SAFI = Collections.singletonList(AFI_SAFI_IPV4);
     private static final BigDecimal DEFAULT_TIMERS = BigDecimal.valueOf(30);
     private BgpPeer bgpPeer;
index e9e081b05338a42154fb969bb3dc536b96cf8d0d..008f84176774c26fd86ccafbef75099311a30b6c 100644 (file)
@@ -51,6 +51,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.Ipv4AddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.Ipv6AddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.UnicastSubsequentAddressFamily;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class GracefulRestartUtilTest {
 
@@ -192,7 +193,7 @@ public class GracefulRestartUtilTest {
                         .setLlGracefulRestart(new LlGracefulRestartBuilder()
                             .setConfig(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.ll
                                 .graceful.restart.rev181112.afi.safi.ll.graceful.restart.ll.graceful.restart
-                                .ConfigBuilder().setLongLivedStaleTime((long) STALE_TIME).build())
+                                .ConfigBuilder().setLongLivedStaleTime(Uint32.valueOf(STALE_TIME)).build())
                             .build())
                         .build())
                     .build())
index ac7875e73454a9efd97cb7bafccb90fe69ee34a7..4065ea3cc3ecd60663d9cd8cca9f3666fb7bad28 100644 (file)
@@ -103,6 +103,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.MplsLabeledVpnSubsequentAddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.UnicastSubsequentAddressFamily;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 public class OpenConfigMappingUtilTest {
     private static final Neighbor NEIGHBOR = createNeighborExpected(NEIGHBOR_ADDRESS);
@@ -116,17 +119,18 @@ public class OpenConfigMappingUtilTest {
     private static final Ipv4Address CLUSTER_ID = new Ipv4Address("4.3.2.1");
     private static final Ipv4Address LOCAL_HOST = new Ipv4Address("127.0.0.1");
 
-    private static final Short ALL_PATHS = 0;
-    private static final Short N_PATHS = 2;
-    private static final PathSelectionMode ADD_PATH_BEST_N_PATH_SELECTION = new AddPathBestNPathSelection(N_PATHS);
+    private static final Uint8 ALL_PATHS = Uint8.ZERO;
+    private static final Uint8 N_PATHS = Uint8.valueOf(2);
+    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 BgpTableType BGP_TABLE_TYPE_IPV4 = new BgpTableTypeImpl(Ipv4AddressFamily.class,
             UnicastSubsequentAddressFamily.class);
     private static final BgpTableType BGP_TABLE_TYPE_IPV6
             = new BgpTableTypeImpl(Ipv6AddressFamily.class, UnicastSubsequentAddressFamily.class);
 
-    private static final AsNumber AS = new AsNumber(72L);
-    private static final AsNumber GLOBAL_AS = new AsNumber(73L);
+    private static final AsNumber AS = new AsNumber(Uint32.valueOf(72));
+    private static final AsNumber GLOBAL_AS = new AsNumber(Uint32.valueOf(73));
     private static final List<AddressFamilies> FAMILIES;
     private static final List<BgpTableType> TABLE_TYPES;
     private static final List<AfiSafi> AFISAFIS = new ArrayList<>();
@@ -286,7 +290,7 @@ public class OpenConfigMappingUtilTest {
         assertEquals(PORT, OpenConfigMappingUtil.getPort(new NeighborBuilder().setTransport(
                 transport.setConfig(new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor
                         .group.transport.ConfigBuilder().build()).build()).build(), null));
-        final PortNumber newPort = new PortNumber(111);
+        final PortNumber newPort = new PortNumber(Uint16.valueOf(111));
         final Config portConfig = new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor
                 .group.transport.ConfigBuilder().addAugmentation(NeighborTransportConfig.class,
                 new NeighborTransportConfigBuilder().setRemotePort(newPort).build()).build();
@@ -482,8 +486,8 @@ public class OpenConfigMappingUtilTest {
         assertEquals(HOLDTIMER, timer);
     }
 
-    private org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.graceful.restart.graceful.restart
-            .Config createGracefulConfig(final Integer restartTimer) {
+    private static org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.graceful.restart.graceful
+            .restart.Config createGracefulConfig(final Integer restartTimer) {
         return new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.graceful.restart.graceful
                 .restart.ConfigBuilder().setRestartTime(restartTimer).build();
     }
index 4b9306c57e4fadb20e991efe04bced61dc0460f0..051dbe225210dbe778d52a1a2c72e5373a88f397 100644 (file)
@@ -16,7 +16,6 @@ import static org.opendaylight.protocol.bgp.rib.impl.config.BgpPeerTest.createNe
 import static org.opendaylight.protocol.bgp.rib.impl.config.BgpPeerTest.createTimers;
 import static org.opendaylight.protocol.bgp.rib.impl.config.BgpPeerTest.createTransport;
 
-import com.google.common.primitives.Shorts;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
@@ -37,23 +36,23 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.GlobalAddPathsConfig;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.GlobalAddPathsConfigBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.BgpId;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 final class RIBTestsUtil {
     private static final Ipv4Address BGP_ID = new BgpId(new Ipv4Address("127.0.0.1"));
     private static final List<AfiSafi> AFISAFIS_IPV4 = new ArrayList<>();
     private static final List<AfiSafi> AFISAFIS_IPV6 = new ArrayList<>();
-    private static final Long ALL_PATHS = 0L;
 
     static {
         AFISAFIS_IPV4.add(new AfiSafiBuilder().setAfiSafiName(IPV4UNICAST.class)
                 .addAugmentation(GlobalAddPathsConfig.class, new GlobalAddPathsConfigBuilder().setReceive(true)
-                        .setSendMax(Shorts.checkedCast(ALL_PATHS)).build()).build());
+                        .setSendMax(Uint8.ZERO).build()).build());
     }
 
     static {
         AFISAFIS_IPV6.add(new AfiSafiBuilder().setAfiSafiName(IPV6UNICAST.class)
                 .addAugmentation(GlobalAddPathsConfig.class, new GlobalAddPathsConfigBuilder().setReceive(true)
-                        .setSendMax(Shorts.checkedCast(ALL_PATHS)).build()).build());
+                        .setSendMax(Uint8.ZERO).build()).build());
     }
 
     private RIBTestsUtil() {
index 4cb7b9789608ebbe3cf39a4ed88352bbe02e512f..2b4c51bd41076b7d5c61bee83aea3c6479455a3e 100644 (file)
@@ -17,7 +17,6 @@ import static org.mockito.Mockito.verify;
 
 import com.google.common.collect.ImmutableClassToInstanceMap;
 import com.google.common.collect.ImmutableSet;
-import com.google.common.primitives.Shorts;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
@@ -50,6 +49,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.UnicastSubsequentAddressFamily;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.Uint8;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
@@ -57,7 +57,6 @@ import org.osgi.framework.ServiceRegistration;
 
 public class RibImplTest extends AbstractConfig {
     private static final List<AfiSafi> AFISAFIS = new ArrayList<>();
-    private static final Long ALL_PATHS = 0L;
     private static final BgpTableType TABLE_TYPE = new BgpTableTypeImpl(Ipv4AddressFamily.class,
             UnicastSubsequentAddressFamily.class);
     private static final Ipv4Address BGP_ID = new BgpId(new Ipv4Address("127.0.0.1"));
@@ -65,7 +64,7 @@ public class RibImplTest extends AbstractConfig {
     static {
         AFISAFIS.add(new AfiSafiBuilder().setAfiSafiName(IPV4UNICAST.class)
                 .addAugmentation(GlobalAddPathsConfig.class, new GlobalAddPathsConfigBuilder().setReceive(true)
-                        .setSendMax(Shorts.checkedCast(ALL_PATHS)).build()).build());
+                        .setSendMax(Uint8.ZERO).build()).build());
     }
 
     @Mock
index 1dde3852f46015fd4b916dd6df812b4759cbaec8..93479bde3470a6de87b3f4af9a96b24da4451c8e 100644 (file)
@@ -56,6 +56,7 @@ import org.opendaylight.yangtools.yang.binding.Identifiable;
 import org.opendaylight.yangtools.yang.binding.Identifier;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
@@ -69,7 +70,7 @@ public abstract class AbstractRIBSupportTest<C extends Routes & DataObject & Cho
         S extends ChildOf<? super C>,
         R extends Route & ChildOf<? super S> & Identifiable<I>,
         I extends Identifier<R>> extends AbstractConcurrentDataBrokerTest {
-    protected static final PathId PATH_ID = new PathId(1L);
+    protected static final PathId PATH_ID = new PathId(Uint32.ONE);
     protected static final Attributes ATTRIBUTES = new AttributesBuilder().build();
     private static final InstanceIdentifier<LocRib> RIB = InstanceIdentifier.builder(BgpRib.class)
             .child(Rib.class, new RibKey(new RibId("rib"))).child(LocRib.class).build();
index 96e46efc63345100381d8e6b9851c581e26bc95c..e6a6c0801c812e6c81a2f59e7083a5fb574e0fe7 100644 (file)
@@ -49,6 +49,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.explicit.route.subobjects.subobject.type.path.key._case.PathKeyBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.label.subobject.label.type.GeneralizedLabelCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.label.subobject.label.type.generalized.label._case.GeneralizedLabelBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class EROSubobjectParserTest {
     private static final byte[] IP_4_PREFIX_BYTES = {(byte) 0x81, (byte) 0x08, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
@@ -144,10 +146,10 @@ public class EROSubobjectParserTest {
     @Test
     public void testEROAsNumberSubobject() throws RSVPParsingException {
         final EROAsNumberSubobjectParser parser = new EROAsNumberSubobjectParser();
-        final SubobjectContainerBuilder subs = new SubobjectContainerBuilder();
-        subs.setLoose(true);
-        subs.setSubobjectType(new AsNumberCaseBuilder().setAsNumber(new AsNumberBuilder().setAsNumber(
-            new AsNumber(0x64L)).build()).build());
+        final SubobjectContainerBuilder subs = new SubobjectContainerBuilder()
+                .setLoose(true)
+                .setSubobjectType(new AsNumberCaseBuilder().setAsNumber(new AsNumberBuilder().setAsNumber(
+                    new AsNumber(Uint32.valueOf(0x64))).build()).build());
         assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(
             ByteArray.cutBytes(AS_NUMBER_BYTES, 2)), true));
         final ByteBuf buff = Unpooled.buffer();
@@ -171,10 +173,14 @@ public class EROSubobjectParserTest {
     @Test
     public void testEROUnnumberedSubobject() throws RSVPParsingException {
         final EROUnnumberedInterfaceSubobjectParser parser = new EROUnnumberedInterfaceSubobjectParser();
-        final SubobjectContainerBuilder subs = new SubobjectContainerBuilder();
-        subs.setLoose(true);
-        subs.setSubobjectType(new UnnumberedCaseBuilder().setUnnumbered(
-            new UnnumberedBuilder().setRouterId(0x12345000L).setInterfaceId(0xffffffffL).build()).build());
+        final SubobjectContainerBuilder subs = new SubobjectContainerBuilder()
+                .setLoose(true)
+                .setSubobjectType(new UnnumberedCaseBuilder()
+                    .setUnnumbered(new UnnumberedBuilder()
+                        .setRouterId(Uint32.valueOf(0x12345000L))
+                        .setInterfaceId(Uint32.valueOf(0xffffffffL))
+                        .build())
+                    .build());
         assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(UNNUMBERED_BYTES,
             2)), true));
         final ByteBuf buff = Unpooled.buffer();
@@ -202,7 +208,7 @@ public class EROSubobjectParserTest {
         subs.setLoose(true);
         final PathKeyBuilder pBuilder = new PathKeyBuilder();
         pBuilder.setPceId(new PceId(new byte[]{(byte) 0x12, (byte) 0x34, (byte) 0x50, (byte) 0x00}));
-        pBuilder.setPathKey(new PathKey(4660));
+        pBuilder.setPathKey(new PathKey(Uint16.valueOf(4660)));
         subs.setSubobjectType(new PathKeyCaseBuilder().setPathKey(pBuilder.build()).build());
         assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(PATH_KEY_32_BYTES,
             2)), true));
@@ -234,7 +240,7 @@ public class EROSubobjectParserTest {
         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(4660));
+        pBuilder.setPathKey(new PathKey(Uint16.valueOf(4660)));
         subs.setSubobjectType(new PathKeyCaseBuilder().setPathKey(pBuilder.build()).build());
         assertEquals(subs.build(), parser128.parseSubobject(Unpooled.wrappedBuffer(
             ByteArray.cutBytes(PATH_KEY_128_BYTES, 2)), true));
@@ -302,7 +308,7 @@ public class EROSubobjectParserTest {
             .rev150820.explicit.route.subobjects.subobject.type.exrs._case.exrs.ExrsBuilder();
         builder.setMandatory(true);
         builder.setSubobjectType(new AsNumberCaseBuilder().setAsNumber(new AsNumberBuilder().setAsNumber(
-            new AsNumber(0x64L)).build()).build());
+            new AsNumber(Uint32.valueOf(0x64))).build()).build());
         list.add(builder.build());
         subs.setSubobjectType(new ExrsCaseBuilder().setExrs(new ExrsBuilder().setExrs(list).build()).build());
         assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(
index d23142a93b4eee9fcf7e54258bf4c8e68892c748..1945d0dcfb3eaef106593f666b25f55860353d3b 100644 (file)
@@ -25,6 +25,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.label.subobject.label.type.generalized.label._case.GeneralizedLabelBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.label.subobject.label.type.type1.label._case.Type1LabelBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.label.subobject.label.type.waveband.switching.label._case.WavebandSwitchingLabelBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class LabelSubobjectParserTest {
     private static final byte[] GENERALIZED_LABEL_BYTES = {(byte) 0x80, 0x02, 0x00, 0x04, 0x12, 0x00, 0x25,
@@ -66,10 +67,10 @@ public class LabelSubobjectParserTest {
     @Test
     public void testWavebandLabel() throws RSVPParsingException {
         final WavebandSwitchingLabelParser parser = new WavebandSwitchingLabelParser();
-        final WavebandSwitchingLabelBuilder iBuilder = new WavebandSwitchingLabelBuilder();
-        iBuilder.setWavebandId(0x1234L);
-        iBuilder.setStartLabel(0x9999L);
-        iBuilder.setEndLabel(0x1111L);
+        final WavebandSwitchingLabelBuilder iBuilder = new WavebandSwitchingLabelBuilder()
+                .setWavebandId(Uint32.valueOf(0x1234))
+                .setStartLabel(Uint32.valueOf(0x9999))
+                .setEndLabel(Uint32.valueOf(0x1111));
         final WavebandSwitchingLabelCaseBuilder builder = new WavebandSwitchingLabelCaseBuilder()
             .setWavebandSwitchingLabel(iBuilder.build());
         assertEquals(builder.build(), parser.parseLabel(Unpooled.wrappedBuffer(
@@ -95,9 +96,8 @@ public class LabelSubobjectParserTest {
     @Test
     public void testTypeOneLabel() throws RSVPParsingException {
         final Type1LabelParser parser = new Type1LabelParser();
-        final Type1LabelBuilder iBuilder = new Type1LabelBuilder();
-        iBuilder.setType1Label(0x120025ffL);
-        final Type1LabelCaseBuilder builder = new Type1LabelCaseBuilder().setType1Label(iBuilder.build());
+        final Type1LabelCaseBuilder builder = new Type1LabelCaseBuilder()
+                .setType1Label(new Type1LabelBuilder().setType1Label(Uint32.valueOf(0x120025ffL)).build());
         assertEquals(builder.build(), parser.parseLabel(Unpooled.wrappedBuffer(
             ByteArray.cutBytes(TYPE_ONE_LABEL_BYTES, 2))));
         final ByteBuf buff = Unpooled.buffer();
index de42e88510281067698015071f7ec602cacf8ae1..9b4f75286ea5e0020c7d3752f428822c93329605 100644 (file)
@@ -38,6 +38,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.record.route.subobjects.subobject.type.label._case.LabelBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.record.route.subobjects.subobject.type.path.key._case.PathKeyBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.record.route.subobjects.subobject.type.unnumbered._case.UnnumberedBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class RROSubobjectParserTest {
 
@@ -117,11 +119,15 @@ public class RROSubobjectParserTest {
     @Test
     public void testRROUnnumberedSubobject() throws RSVPParsingException {
         final RROUnnumberedInterfaceSubobjectParser parser = new RROUnnumberedInterfaceSubobjectParser();
-        final SubobjectContainerBuilder subs = new SubobjectContainerBuilder();
-        subs.setProtectionAvailable(false);
-        subs.setProtectionInUse(true);
-        subs.setSubobjectType(new UnnumberedCaseBuilder().setUnnumbered(
-            new UnnumberedBuilder().setRouterId(0x12345000L).setInterfaceId(0xffffffffL).build()).build());
+        final SubobjectContainerBuilder subs = new SubobjectContainerBuilder()
+                .setProtectionAvailable(false)
+                .setProtectionInUse(true)
+                .setSubobjectType(new UnnumberedCaseBuilder()
+                    .setUnnumbered(new UnnumberedBuilder()
+                        .setRouterId(Uint32.valueOf(0x12345000L))
+                        .setInterfaceId(Uint32.valueOf(0xffffffffL))
+                        .build())
+                    .build());
         assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(UNNUMBERED_BYTES,
             2))));
         final ByteBuf buff = Unpooled.buffer();
@@ -148,7 +154,7 @@ public class RROSubobjectParserTest {
         final SubobjectContainerBuilder subs = new SubobjectContainerBuilder();
         final PathKeyBuilder pBuilder = new PathKeyBuilder();
         pBuilder.setPceId(new PceId(new byte[]{(byte) 0x12, (byte) 0x34, (byte) 0x50, (byte) 0x00}));
-        pBuilder.setPathKey(new PathKey(4660));
+        pBuilder.setPathKey(new PathKey(Uint16.valueOf(4660)));
         subs.setSubobjectType(new PathKeyCaseBuilder().setPathKey(pBuilder.build()).build());
         assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(PATH_KEY_32_BYTES, 2)
         )));
@@ -179,7 +185,7 @@ public class RROSubobjectParserTest {
             (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(4660));
+        pBuilder.setPathKey(new PathKey(Uint16.valueOf(4660)));
         subs.setSubobjectType(new PathKeyCaseBuilder().setPathKey(pBuilder.build()).build());
         assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(PATH_KEY_128_BYTES,
             2))));
index a93b5edb7f4e4067e2c4db7f3aa8149607b1e2a3..1642ab7cf81650617e1c1cf409ab25bb2b506916 100644 (file)
@@ -42,6 +42,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.exclude.route.object.exclude.route.object.SubobjectContainerBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.explicit.route.subobjects.subobject.type.PathKeyCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.explicit.route.subobjects.subobject.type.path.key._case.PathKeyBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class XROSubobjectParserTest {
     private static final byte[] IP_4_PREFIX_BYTES = {(byte) 0x01, (byte) 0x08, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
@@ -124,11 +126,12 @@ public class XROSubobjectParserTest {
     @Test
     public void testXROSrlgSubobject() throws RSVPParsingException {
         final XROSrlgSubobjectParser parser = new XROSrlgSubobjectParser();
-        final SubobjectContainerBuilder subs = new SubobjectContainerBuilder();
-        subs.setMandatory(true);
-        subs.setAttribute(ExcludeRouteSubobjects.Attribute.Srlg);
-        subs.setSubobjectType(new SrlgCaseBuilder().setSrlg(new SrlgBuilder().setSrlgId(new SrlgId(0x12345678L))
-            .build()).build());
+        final SubobjectContainerBuilder subs = new SubobjectContainerBuilder()
+                .setMandatory(true)
+                .setAttribute(ExcludeRouteSubobjects.Attribute.Srlg)
+                .setSubobjectType(new SrlgCaseBuilder()
+                    .setSrlg(new SrlgBuilder().setSrlgId(new SrlgId(Uint32.valueOf(0x12345678L))).build())
+                    .build());
         assertEquals(subs.build(), parser.parseSubobject(
             Unpooled.wrappedBuffer(ByteArray.cutBytes(SRLG_BYTES, 2)), true));
         final ByteBuf buff = Unpooled.buffer();
@@ -152,11 +155,15 @@ public class XROSubobjectParserTest {
     @Test
     public void testXROUnnumberedSubobject() throws RSVPParsingException {
         final XROUnnumberedInterfaceSubobjectParser parser = new XROUnnumberedInterfaceSubobjectParser();
-        final SubobjectContainerBuilder subs = new SubobjectContainerBuilder();
-        subs.setMandatory(true);
-        subs.setAttribute(ExcludeRouteSubobjects.Attribute.Node);
-        subs.setSubobjectType(new UnnumberedCaseBuilder().setUnnumbered(
-            new UnnumberedBuilder().setRouterId(0x12345000L).setInterfaceId(0xffffffffL).build()).build());
+        final SubobjectContainerBuilder subs = new SubobjectContainerBuilder()
+                .setMandatory(true)
+                .setAttribute(ExcludeRouteSubobjects.Attribute.Node)
+                .setSubobjectType(new UnnumberedCaseBuilder()
+                    .setUnnumbered(new UnnumberedBuilder()
+                        .setRouterId(Uint32.valueOf(0x12345000L))
+                        .setInterfaceId(Uint32.valueOf(0xffffffffL))
+                        .build())
+                    .build());
         assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(UNNUMBERED_BYTES,
             2)), true));
         final ByteBuf buff = Unpooled.buffer();
@@ -180,10 +187,13 @@ public class XROSubobjectParserTest {
     @Test
     public void testXROAsNumberSubobject() throws RSVPParsingException {
         final XROAsNumberSubobjectParser parser = new XROAsNumberSubobjectParser();
-        final SubobjectContainerBuilder subs = new SubobjectContainerBuilder();
-        subs.setMandatory(true);
-        subs.setSubobjectType(new AsNumberCaseBuilder().setAsNumber(new AsNumberBuilder().setAsNumber(
-            new AsNumber(0x64L)).build()).build());
+        final SubobjectContainerBuilder subs = new SubobjectContainerBuilder()
+                .setMandatory(true)
+                .setSubobjectType(new AsNumberCaseBuilder()
+                    .setAsNumber(new AsNumberBuilder()
+                        .setAsNumber(new AsNumber(Uint32.valueOf(0x64)))
+                        .build())
+                    .build());
         assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(
             ByteArray.cutBytes(AS_NUMBER_BYTES, 2)), true));
         final ByteBuf buff = Unpooled.buffer();
@@ -211,7 +221,7 @@ public class XROSubobjectParserTest {
         subs.setMandatory(true);
         final PathKeyBuilder pBuilder = new PathKeyBuilder();
         pBuilder.setPceId(new PceId(new byte[]{(byte) 0x12, (byte) 0x34, (byte) 0x50, (byte) 0x00}));
-        pBuilder.setPathKey(new PathKey(4660));
+        pBuilder.setPathKey(new PathKey(Uint16.valueOf(4660)));
         subs.setSubobjectType(new PathKeyCaseBuilder().setPathKey(pBuilder.build()).build());
         assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(PATH_KEY_32_BYTES, 2)
         ), true));
@@ -244,7 +254,7 @@ public class XROSubobjectParserTest {
             (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(4660));
+        pBuilder.setPathKey(new PathKey(Uint16.valueOf(4660)));
         subs.setSubobjectType(new PathKeyCaseBuilder().setPathKey(pBuilder.build()).build());
         assertEquals(subs.build(), parser128.parseSubobject(Unpooled.wrappedBuffer(
             ByteArray.cutBytes(PATH_KEY_128_BYTES, 2)), true));
index d1566332442f3d45b714eb5b1aa283c23cb2c4c8..f7cc950b033ad819bd9777692b53428f479191e7 100644 (file)
@@ -18,6 +18,7 @@ import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.PceId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.explicit.route.subobjects.subobject.type.path.key._case.PathKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.explicit.route.subobjects.subobject.type.path.key._case.PathKeyBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
 
 public class CommonPathKeyParserTest {
     private final byte[] bytes = new byte[]{0, 1, 2, 3, 4, 5};
@@ -29,10 +30,10 @@ public class CommonPathKeyParserTest {
     public void setUp() {
         this.key1 = new PathKeyBuilder().build();
         this.key2 = new PathKeyBuilder().setPathKey(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns
-            .yang.rsvp.rev150820.PathKey(1))
+            .yang.rsvp.rev150820.PathKey(Uint16.ONE))
             .build();
         this.key3 = new PathKeyBuilder().setPathKey(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns
-            .yang.rsvp.rev150820.PathKey(1))
+            .yang.rsvp.rev150820.PathKey(Uint16.ONE))
             .setPceId(new PceId(new byte[]{2, 3, 4, 5}))
             .build();
     }
index 9933bc46552205c5467a23148fc8c844067fa4af..28f7d3df3ba8a77a4a688c6f4f5a4f4827122e13 100644 (file)
@@ -24,6 +24,7 @@ import org.opendaylight.protocol.rsvp.parser.spi.RSVPParsingException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.AttributeFilter;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.RsvpTeObject;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.explicit.route.subobjects.list.SubobjectContainer;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 public class EROSubobjectListParserTest {
 
@@ -85,7 +86,7 @@ public class EROSubobjectListParserTest {
 
         final ByteBuf body = Unpooled.buffer(4);
         output = new byte[]{0, 0, 0, 1};
-        final AttributeFilter filter = new AttributeFilter(1L);
+        final AttributeFilter filter = new AttributeFilter(Uint32.ONE);
         EroListParser.writeAttributeFilter(filter, body);
         assertArrayEquals(output, body.array());