@Test
public void testMapBatchesToRanges() {
final List<Batch> inputBatchBag = Lists.newArrayList(
- new BatchBuilder().setBatchOrder(0).build(),
- new BatchBuilder().setBatchOrder(5).build(),
- new BatchBuilder().setBatchOrder(9).build(),
- new BatchBuilder().setBatchOrder(15).build()
+ new BatchBuilder().setBatchOrder(Uint16.ZERO).build(),
+ new BatchBuilder().setBatchOrder(Uint16.valueOf(5)).build(),
+ new BatchBuilder().setBatchOrder(Uint16.valueOf(9)).build(),
+ new BatchBuilder().setBatchOrder(Uint16.valueOf(15)).build()
);
final Map<Range<Uint16>, Batch> rangeBatchMap =
SyncPlanPushStrategyFlatBatchImpl.mapBatchesToRanges(inputBatchBag, 42);
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmOfArpSpaKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.of.arp.spa.grouping.NxmOfArpSpaBuilder;
import org.opendaylight.yangtools.yang.binding.Augmentation;
+import org.opendaylight.yangtools.yang.common.Uint32;
/**
* Test for {@link ArpSpaConvertor}.
@Test
public void testConvertFromOFJava() {
final ArpSpaValuesBuilder arpSpaValuesBuilder = new ArpSpaValuesBuilder()
- .setValue(IpConverter.ipv4AddressToLong(IPV4_ADDRESS));
+ .setValue(Uint32.valueOf(IpConverter.ipv4AddressToLong(IPV4_ADDRESS)));
final ArpSpaCaseValueBuilder arpSpaCaseValueBuilder = new ArpSpaCaseValueBuilder()
.setArpSpaValues(arpSpaValuesBuilder.build());
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmOfArpTpaKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.of.arp.tpa.grouping.NxmOfArpTpaBuilder;
import org.opendaylight.yangtools.yang.binding.Augmentation;
+import org.opendaylight.yangtools.yang.common.Uint32;
/**
* Test for {@link ArpTpaConvertor}.
@Test
public void testConvertToOFJava() {
final ArpTpaValuesBuilder arpTpaValuesBuilder = new ArpTpaValuesBuilder()
- .setValue(IpConverter.ipv4AddressToLong(IPV4_ADDRESS));
+ .setValue(Uint32.valueOf(IpConverter.ipv4AddressToLong(IPV4_ADDRESS)));
final ArpTpaCaseValueBuilder arpTpaCaseValueBuilder = new ArpTpaCaseValueBuilder()
.setArpTpaValues(arpTpaValuesBuilder.build());
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxTunIpv4DstKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.tun.ipv4.dst.grouping.NxmNxTunIpv4DstBuilder;
import org.opendaylight.yangtools.yang.binding.Augmentation;
+import org.opendaylight.yangtools.yang.common.Uint32;
/**
* Test for {@link TunIPv4DstConvertor}.
@Test
public void testConvert1() {
final TunIpv4DstValuesBuilder tunIpv4DstValuesBuilder = new TunIpv4DstValuesBuilder()
- .setValue(IpConverter.ipv4AddressToLong(IPV4_ADDRESS));
+ .setValue(Uint32.valueOf(IpConverter.ipv4AddressToLong(IPV4_ADDRESS)));
final TunIpv4DstCaseValueBuilder tunIpv4DstCaseValueBuilder = new TunIpv4DstCaseValueBuilder()
.setTunIpv4DstValues(tunIpv4DstValuesBuilder.build());
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxTunIpv4SrcKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.tun.ipv4.src.grouping.NxmNxTunIpv4SrcBuilder;
import org.opendaylight.yangtools.yang.binding.Augmentation;
+import org.opendaylight.yangtools.yang.common.Uint32;
/**
* Test for {@link TunIPv4SrcConvertor}.
@Test
public void testConvert1() {
final TunIpv4SrcValuesBuilder tunIpv4SrcValuesBuilder = new TunIpv4SrcValuesBuilder()
- .setValue(IpConverter.ipv4AddressToLong(IPV4_ADDRESS));
+ .setValue(Uint32.valueOf(IpConverter.ipv4AddressToLong(IPV4_ADDRESS)));
final TunIpv4SrcCaseValueBuilder tunIpv4SrcCaseValueBuilder = new TunIpv4SrcCaseValueBuilder()
.setTunIpv4SrcValues(tunIpv4SrcValuesBuilder.build());
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.extension.onf;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.bundle.common.grouping.BundlePropertyBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.bundle.property.grouping.bundle.property.entry.BundlePropertyExperimenterBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.bundle.property.grouping.bundle.property.entry.bundle.property.experimenter.BundlePropertyExperimenterData;
+import org.opendaylight.yangtools.yang.common.Uint32;
/**
* Abstract class for common Converter util methods.
return new BundlePropertyBuilder()
.setType(BundlePropertyType.ONFETBPTEXPERIMENTER)
.setBundlePropertyEntry(new BundlePropertyExperimenterBuilder()
- .setExperimenter(new ExperimenterId(1L))
- .setExpType(2L)
+ .setExperimenter(new ExperimenterId(Uint32.ONE))
+ .setExpType(Uint32.TWO)
.setBundlePropertyExperimenterData(data)
.build())
.build();
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.system.rev130927.SystemNotificationsListener;
import org.opendaylight.yangtools.yang.common.RpcError;
import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint8;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
*
* @author michal.polkorab
*/
-
public class MockPlugin implements OpenflowProtocolListener, SwitchConnectionHandler,
SystemNotificationsListener, ConnectionReadyListener {
protected volatile ConnectionAdapter adapter;
private final SettableFuture<Void> finishedFuture;
private int idleCounter = 0;
- private ExecutorService executorService;
+ private final ExecutorService executorService;
public MockPlugin(ExecutorService executorService) {
LOGGER.trace("Creating MockPlugin");
new Thread(() -> {
LOGGER.debug("MockPlugin.onEchoRequestMessage().run() started adapter: {}", adapter);
EchoReplyInputBuilder replyBuilder = new EchoReplyInputBuilder();
- replyBuilder.setVersion((short) 4);
+ replyBuilder.setVersion(Uint8.valueOf(4));
replyBuilder.setXid(notification.getXid());
EchoReplyInput echoReplyInput = replyBuilder.build();
adapter.echoReply(echoReplyInput);
new Thread(() -> {
LOGGER.debug("MockPlugin.onHelloMessage().run() Hello message received");
HelloInputBuilder hib = new HelloInputBuilder();
- hib.setVersion((short) 4);
- hib.setXid(2L);
+ hib.setVersion(Uint8.valueOf(4));
+ hib.setXid(Uint32.TWO);
HelloInput hi = hib.build();
adapter.hello(hi);
LOGGER.debug("hello msg sent");
protected void getSwitchFeatures() {
GetFeaturesInputBuilder featuresBuilder = new GetFeaturesInputBuilder();
- featuresBuilder.setVersion((short) 4);
- featuresBuilder.setXid(3L);
+ featuresBuilder.setVersion(Uint8.valueOf(4));
+ featuresBuilder.setXid(Uint32.valueOf(3));
GetFeaturesInput featuresInput = featuresBuilder.build();
try {
LOGGER.debug("Requesting features ");