Migrate tests to use proper types, eliminating associated warnings.
Change-Id: Ic50bfdbe31848856f47c12ecb8a51ad8109b19e6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.transport.zone.VtepsKey;
import org.opendaylight.yangtools.util.concurrent.FluentFutures;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.Uint16;
import org.opendaylight.yangtools.yang.common.Uint64;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static final Logger LOG = LoggerFactory.getLogger(TepCommandHelper.class);
- private final int interval = 1000;
+ private final Uint16 interval = Uint16.valueOf(1000);
private final Boolean enabled = false ;
private final Class<? extends TunnelMonitoringTypeBase> monitorProtocol = ITMConstants.DEFAULT_MONITOR_PROTOCOL;
private final String tepIp1 = "192.168.56.30";
private final List<InternalTunnel> internalTunnelList = new ArrayList<>();
private final List<StateTunnelList> stateTunnelList = new ArrayList<>() ;
private final List<String> lowerLayerIfList = new ArrayList<>();
- private final List<InstanceIdentifier> instanceIdentifierList = new ArrayList<>();
+ private final List<InstanceIdentifier<?>> instanceIdentifierList = new ArrayList<>();
private final java.lang.Class<? extends TunnelTypeBase> tunnelType1 = TunnelTypeVxlan.class;
private final java.lang.Class<? extends TunnelTypeBase> tunnelType2 = TunnelTypeGre.class;
mergeParentTransportZoneListGre.add(mergeTransportZoneGre);
mergeParentTransportZonesGre = new TransportZonesBuilder().setTransportZone(mergeParentTransportZoneListGre)
.build();
- tunnelMonitorInterval = new TunnelMonitorIntervalBuilder().setInterval(10000).build();
+ tunnelMonitorInterval = new TunnelMonitorIntervalBuilder().setInterval(Uint16.valueOf(10000)).build();
tunnelMonitorParams = new TunnelMonitorParamsBuilder().setEnabled(true).build();
InternalTunnel internalTunnelTest = new InternalTunnelBuilder().setSourceDPN(dpId1).setDestinationDPN(dpId2)
.setTunnelInterfaceNames(Collections.singletonList(tunnelInterfaceName))
.setIfIndex(100).setLowerLayerIf(lowerLayerIfList).setType(L2vlan.class).build();
interfaceTestNew = ItmUtils.buildTunnelInterface(dpId1, tunnelInterfaceName, destinationDevice, enabled,
TunnelTypeVxlan.class, ipAddress1, ipAddress2, true, enabled,monitorProtocol,
- interval, false, null);
+ interval.toJava(), false, null);
doReturn(mockReadTx).when(dataBroker).newReadOnlyTransaction();
doReturn(mockWriteTx).when(dataBroker).newWriteOnlyTransaction();
lenient().doReturn(FluentFutures.immediateNullFluentFuture()).when(mockWriteTx).commit();
TunnelMonitorInterval tunnelMonitor = new TunnelMonitorIntervalBuilder().setInterval(interval).build();
- tepCommandHelper.configureTunnelMonitorInterval(interval);
+ tepCommandHelper.configureTunnelMonitorInterval(interval.toJava());
verify(mockReadTx).read(LogicalDatastoreType.CONFIGURATION,tunnelMonitorIntervalIdentifier);
verify(mockWriteTx).mergeParentStructureMerge(LogicalDatastoreType.CONFIGURATION,
public void testShowTepsWithTransportZone() {
try {
- tepCommandHelper.showTeps(enabled, interval);
+ tepCommandHelper.showTeps(enabled, interval.toJava());
} catch (TepException e) {
LOG.error(e.getMessage());
}
String output = null;
try {
- tepCommandHelper.showTeps(enabled, interval);
+ tepCommandHelper.showTeps(enabled, interval.toJava());
} catch (TepException e) {
output = e.getMessage();
}
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
import org.opendaylight.yangtools.yang.common.Uint64;
@RunWith(MockitoJUnitRunner.class)
Uint64 dpId1 = Uint64.ONE;
int vlanId = 100 ;
- int interval = 1000;
+ Uint16 interval = Uint16.valueOf(1000);
String portName1 = "phy0";
String tepIp1 = "192.168.56.30";
String tepIp2 = "192.168.56.40";
InstanceIdentifier.create(TunnelMonitorInterval.class);
InstanceIdentifier<ExternalTunnel> externalTunnelIdentifier = null;
InstanceIdentifier<DpnEndpoints> dpnEndpointsIdentifier = InstanceIdentifier.builder(DpnEndpoints.class).build();
- AllocateIdOutput expectedId1 = new AllocateIdOutputBuilder().setIdValue(Long.valueOf("100")).build();
+ AllocateIdOutput expectedId1 = new AllocateIdOutputBuilder().setIdValue(Uint32.valueOf(100)).build();
Future<RpcResult<AllocateIdOutput>> idOutputOptional1 ;
- AllocateIdOutput expectedId2 = new AllocateIdOutputBuilder().setIdValue(Long.valueOf("101")).build();
+ AllocateIdOutput expectedId2 = new AllocateIdOutputBuilder().setIdValue(Uint32.valueOf(101)).build();
Future<RpcResult<AllocateIdOutput>> idOutputOptional2 ;
- AllocateIdOutput expectedId3 = new AllocateIdOutputBuilder().setIdValue(Long.valueOf("102")).build();
+ AllocateIdOutput expectedId3 = new AllocateIdOutputBuilder().setIdValue(Uint32.valueOf(102)).build();
Future<RpcResult<AllocateIdOutput>> idOutputOptional3 ;
- AllocateIdOutput expectedId4 = new AllocateIdOutputBuilder().setIdValue(Long.valueOf("103")).build();
+ AllocateIdOutput expectedId4 = new AllocateIdOutputBuilder().setIdValue(Uint32.valueOf(103)).build();
Future<RpcResult<AllocateIdOutput>> idOutputOptional4 ;
- AllocateIdOutput expectedId5 = new AllocateIdOutputBuilder().setIdValue(Long.valueOf("104")).build();
+ AllocateIdOutput expectedId5 = new AllocateIdOutputBuilder().setIdValue(Uint32.valueOf(104)).build();
Future<RpcResult<AllocateIdOutput>> idOutputOptional5 ;
- AllocateIdOutput expectedId6 = new AllocateIdOutputBuilder().setIdValue(Long.valueOf("105")).build();
+ AllocateIdOutput expectedId6 = new AllocateIdOutputBuilder().setIdValue(Uint32.valueOf(105)).build();
Future<RpcResult<AllocateIdOutput>> idOutputOptional6 ;
Optional<DpnEndpoints> optionalDpnEndPoints ;
Optional<TunnelMonitorParams> tunnelMonitorParamsOptional;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
import org.opendaylight.yangtools.yang.common.Uint64;
@RunWith(MockitoJUnitRunner.class)
List<Vteps> vtepsList = new ArrayList<>();
java.lang.Class<? extends TunnelTypeBase> tunnelType1 = TunnelTypeVxlan.class;
- AllocateIdOutput expectedId1 = new AllocateIdOutputBuilder().setIdValue(Long.valueOf("100")).build();
+ AllocateIdOutput expectedId1 = new AllocateIdOutputBuilder().setIdValue(Uint32.valueOf(100)).build();
Future<RpcResult<AllocateIdOutput>> idOutputOptional1 ;
- AllocateIdOutput expectedId2 = new AllocateIdOutputBuilder().setIdValue(Long.valueOf("101")).build();
+ AllocateIdOutput expectedId2 = new AllocateIdOutputBuilder().setIdValue(Uint32.valueOf(101)).build();
Future<RpcResult<AllocateIdOutput>> idOutputOptional2 ;
- AllocateIdOutput expectedId3 = new AllocateIdOutputBuilder().setIdValue(Long.valueOf("102")).build();
+ AllocateIdOutput expectedId3 = new AllocateIdOutputBuilder().setIdValue(Uint32.valueOf(102)).build();
Future<RpcResult<AllocateIdOutput>> idOutputOptional3 ;
- AllocateIdOutput expectedId4 = new AllocateIdOutputBuilder().setIdValue(Long.valueOf("103")).build();
+ AllocateIdOutput expectedId4 = new AllocateIdOutputBuilder().setIdValue(Uint32.valueOf(103)).build();
Future<RpcResult<AllocateIdOutput>> idOutputOptional4 ;
- AllocateIdOutput expectedId5 = new AllocateIdOutputBuilder().setIdValue(Long.valueOf("104")).build();
+ AllocateIdOutput expectedId5 = new AllocateIdOutputBuilder().setIdValue(Uint32.valueOf(104)).build();
Future<RpcResult<AllocateIdOutput>> idOutputOptional5 ;
- AllocateIdOutput expectedId6 = new AllocateIdOutputBuilder().setIdValue(Long.valueOf("105")).build();
+ AllocateIdOutput expectedId6 = new AllocateIdOutputBuilder().setIdValue(Uint32.valueOf(105)).build();
Future<RpcResult<AllocateIdOutput>> idOutputOptional6 ;
- AllocateIdOutput expectedId7 = new AllocateIdOutputBuilder().setIdValue(Long.valueOf("105")).build();
+ AllocateIdOutput expectedId7 = new AllocateIdOutputBuilder().setIdValue(Uint32.valueOf(105)).build();
Future<RpcResult<AllocateIdOutput>> idOutputOptional7 ;
- AllocateIdOutput expectedId8 = new AllocateIdOutputBuilder().setIdValue(Long.valueOf("106")).build();
+ AllocateIdOutput expectedId8 = new AllocateIdOutputBuilder().setIdValue(Uint32.valueOf(106)).build();
Future<RpcResult<AllocateIdOutput>> idOutputOptional8 ;
InstanceIdentifier<Interface> trunkIdentifier ;
InstanceIdentifier<ExternalTunnel> path ;
import org.opendaylight.yangtools.yang.common.OperationFailedException;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
import org.opendaylight.yangtools.yang.common.Uint64;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
String portName1 = "phy0";
String portName2 = "phy1" ;
int vlanId = 100 ;
- int interval = 1000;
+ Uint16 interval = Uint16.valueOf(1000);
String tepIp1 = "192.168.56.101";
String tepIp2 = "192.168.56.102";
String gwyIp1 = "0.0.0.0";
InstanceIdentifier<InternalTunnel> internalTunnelIdentifierGre2 = InstanceIdentifier.create(
TunnelList.class).child(InternalTunnel.class, new InternalTunnelKey(dpId1, dpId2, tunnelType2));
- AllocateIdOutput expectedId1 = new AllocateIdOutputBuilder().setIdValue(Long.valueOf("100")).build();
- AllocateIdOutput expectedId2 = new AllocateIdOutputBuilder().setIdValue(Long.valueOf("200")).build();
- AllocateIdOutput expectedDstID1 = new AllocateIdOutputBuilder().setIdValue(Long.valueOf("1")).build();
- AllocateIdOutput expectedDstID2 = new AllocateIdOutputBuilder().setIdValue(Long.valueOf("2")).build();
+ AllocateIdOutput expectedId1 = new AllocateIdOutputBuilder().setIdValue(Uint32.valueOf(100)).build();
+ AllocateIdOutput expectedId2 = new AllocateIdOutputBuilder().setIdValue(Uint32.valueOf(200)).build();
+ AllocateIdOutput expectedDstID1 = new AllocateIdOutputBuilder().setIdValue(Uint32.ONE).build();
+ AllocateIdOutput expectedDstID2 = new AllocateIdOutputBuilder().setIdValue(Uint32.TWO).build();
Future<RpcResult<AllocateIdOutput>> idOutputOptional1;
Future<RpcResult<AllocateIdOutput>> idOutputOptional2;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.tunnel.list.InternalTunnelKey;
import org.opendaylight.yangtools.util.concurrent.FluentFutures;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.Uint16;
import org.opendaylight.yangtools.yang.common.Uint64;
@RunWith(MockitoJUnitRunner.class)
Uint64 dpId1 = Uint64.ONE;
Uint64 dpId2 = Uint64.valueOf(2);
int vlanId = 100 ;
- int interval = 1000;
+ Uint16 interval = Uint16.valueOf(1000);
String portName1 = "phy0";
String portName2 = "phy1" ;
String parentInterfaceName = "1:phy0:100" ;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.RemoveTerminatingServiceActionsInputBuilder;
import org.opendaylight.yangtools.util.concurrent.FluentFutures;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.Uint16;
import org.opendaylight.yangtools.yang.common.Uint64;
@RunWith(MockitoJUnitRunner.class)
public class ItmManagerRpcServiceTest {
- int vlanId = 100 ;
+ Uint16 vlanId = Uint16.valueOf(100);
String portName1 = "phy0";
String sourceDevice = "abc";
String destinationDevice = "xyz";
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.Uint16;
public final class OvsdbTestUtil {
private OvsdbTestUtil() {
/* methods */
public static ConnectionInfo getConnectionInfo(int port, String strIpAddress) {
IpAddress ipAddress = IpAddressBuilder.getDefaultInstance(strIpAddress);
- PortNumber portNumber = new PortNumber(port);
+ PortNumber portNumber = new PortNumber(Uint16.valueOf(port));
ConnectionInfo connectionInfo =
new ConnectionInfoBuilder().setRemoteIp(ipAddress).setRemotePort(portNumber).build();