use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.intext.ip.map.ip.mapping.IpMapBuilder in project netvirt by opendaylight.
the class NaptManagerTest method testRegisterMappingIpSubnet.
@Ignore
@Test
// TODO Clean up the exception handling
@SuppressWarnings("checkstyle:IllegalCatch")
public void testRegisterMappingIpSubnet() {
// TODO : This needs to be modified to make it work
ipmapId = InstanceIdentifier.builder(IntextIpMap.class).child(IpMapping.class, new IpMappingKey(5L)).child(IpMap.class, new IpMapKey("10.0.0.1")).build();
ipmap = new IpMapBuilder().setKey(new IpMapKey("10.0.0.1")).setInternalIp("10.0.0.1").setExternalIp("192.17.13.1/24").build();
try {
PowerMockito.doNothing().when(MDSALUtil.class, "syncWrite", dataBroker, LogicalDatastoreType.OPERATIONAL, ipmapId, ipmap);
} catch (Exception e) {
// Test failed anyways
assertEquals("true", "false");
}
IPAddress internal = new IPAddress("10.0.0.1", 0);
IPAddress external = new IPAddress("192.17.13.1", 24);
naptManager.registerMapping(5, internal, external);
PowerMockito.verifyStatic();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.intext.ip.map.ip.mapping.IpMapBuilder in project netvirt by opendaylight.
the class NaptManagerTest method testRegisterMappingSubnetIp.
@Ignore
@Test
// TODO Clean up the exception handling
@SuppressWarnings("checkstyle:IllegalCatch")
public void testRegisterMappingSubnetIp() {
// TODO : This needs to be modified to make it work
ipmapId = InstanceIdentifier.builder(IntextIpMap.class).child(IpMapping.class, new IpMappingKey(6L)).child(IpMap.class, new IpMapKey("10.0.2.1/16")).build();
ipmap = new IpMapBuilder().setKey(new IpMapKey("10.0.0.1")).setInternalIp("10.0.0.1").setExternalIp("192.19.15.3").build();
try {
PowerMockito.doNothing().when(MDSALUtil.class, "syncWrite", dataBroker, LogicalDatastoreType.OPERATIONAL, ipmapId, ipmap);
} catch (Exception e) {
// Test failed anyways
assertEquals("true", "false");
}
IPAddress internal = new IPAddress("10.0.2.1", 16);
IPAddress external = new IPAddress("192.19.15.3", 0);
naptManager.registerMapping(6, internal, external);
PowerMockito.verifyStatic();
}
Aggregations