*/
public static EthernetMatch createEthernetMatch(MacAddress destinationMacAddress) {
return new EthernetMatchBuilder().setEthernetType(
- new EthernetTypeBuilder().setType(new EtherType(Long.valueOf(EtherTypes.ARP.intValue()))).build())
+ new EthernetTypeBuilder().setType(new EtherType((long) EtherTypes.ARP.intValue())).build())
.setEthernetDestination(new EthernetDestinationBuilder().setAddress(destinationMacAddress).build())
.build();
}
@Test
public void testProgramDefaultPipelineRule() {
when(southbound.getBridgeName(any(Node.class))).thenReturn(Constants.INTEGRATION_BRIDGE);
- when(southbound.getDataPathId(any(Node.class))).thenReturn(Long.valueOf(261));
+ when(southbound.getDataPathId(any(Node.class))).thenReturn(261L);
when(orchestrator.getNextServiceInPipeline(any(Service.class))).thenReturn(Service.ARP_RESPONDER);
*/
@Test
public void testEgressACLDefaultTcpDrop() throws Exception {
- egressAclService.egressACLDefaultTcpDrop(Long.valueOf(123), "2", MAC_ADDRESS, 1, true);
+ egressAclService.egressACLDefaultTcpDrop(123L, "2", MAC_ADDRESS, 1, true);
verify(writeTransaction, times(2)).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class), anyBoolean());
verify(writeTransaction, times(1)).submit();
verify(commitFuture, times(1)).get();
- egressAclService.egressACLDefaultTcpDrop(Long.valueOf(123), "2", MAC_ADDRESS, 1, false);
+ egressAclService.egressACLDefaultTcpDrop(123L, "2", MAC_ADDRESS, 1, false);
verify(writeTransaction, times(1)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
verify(writeTransaction, times(2)).submit();
verify(commitFuture, times(2)).get(); // 1 + 1 above
*/
@Test
public void testEgressACLTcpPortWithPrefix() throws Exception {
- egressAclService.egressACLTcpPortWithPrefix(Long.valueOf(123), "2", MAC_ADDRESS, true, 1, HOST_ADDRESS, 1);
+ egressAclService.egressACLTcpPortWithPrefix(123L, "2", MAC_ADDRESS, true, 1, HOST_ADDRESS, 1);
verify(writeTransaction, times(2)).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class), anyBoolean());
verify(writeTransaction, times(1)).submit();
verify(commitFuture, times(1)).get();
- egressAclService.egressACLTcpPortWithPrefix(Long.valueOf(123), "2", MAC_ADDRESS, false, 1, HOST_ADDRESS, 1);
+ egressAclService.egressACLTcpPortWithPrefix(123L, "2", MAC_ADDRESS, false, 1, HOST_ADDRESS, 1);
verify(writeTransaction, times(1)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
verify(writeTransaction, times(2)).submit();
verify(commitFuture, times(2)).get(); // 1 + 1 above
*/
@Test
public void testEgressAllowProto() throws Exception {
- egressAclService.egressAllowProto(Long.valueOf(123), "2", MAC_ADDRESS, true, HOST_ADDRESS, 1);
+ egressAclService.egressAllowProto(123L, "2", MAC_ADDRESS, true, HOST_ADDRESS, 1);
verify(writeTransaction, times(2)).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class), anyBoolean());
verify(writeTransaction, times(1)).submit();
verify(commitFuture, times(1)).get();
- egressAclService.egressAllowProto(Long.valueOf(123), "2", MAC_ADDRESS, false, HOST_ADDRESS, 1);
+ egressAclService.egressAllowProto(123L, "2", MAC_ADDRESS, false, HOST_ADDRESS, 1);
verify(writeTransaction, times(1)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
verify(writeTransaction, times(2)).submit();
verify(commitFuture, times(2)).get(); // 1 + 1 above
*/
@Test
public void testEgressACLPermitAllProto() throws Exception {
- egressAclService.egressACLPermitAllProto(Long.valueOf(123), "2", MAC_ADDRESS, true, HOST_ADDRESS, 1);
+ egressAclService.egressACLPermitAllProto(123L, "2", MAC_ADDRESS, true, HOST_ADDRESS, 1);
verify(writeTransaction, times(2)).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class), anyBoolean());
verify(writeTransaction, times(1)).submit();
verify(commitFuture, times(1)).get();
- egressAclService.egressACLPermitAllProto(Long.valueOf(123), "2", MAC_ADDRESS, false, HOST_ADDRESS, 1);
+ egressAclService.egressACLPermitAllProto(123L, "2", MAC_ADDRESS, false, HOST_ADDRESS, 1);
verify(writeTransaction, times(1)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
verify(writeTransaction, times(2)).submit();
verify(commitFuture, times(2)).get(); // 1 + 1 above
*/
@Test
public void testEgressACLTcpSyn() throws Exception {
- egressAclService.egressACLTcpSyn(Long.valueOf(123), "2", MAC_ADDRESS, true, 1, 1);
+ egressAclService.egressACLTcpSyn(123L, "2", MAC_ADDRESS, true, 1, 1);
verify(writeTransaction, times(2)).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class), anyBoolean());
verify(writeTransaction, times(1)).submit();
verify(commitFuture, times(1)).get();
- egressAclService.egressACLTcpSyn(Long.valueOf(123), "2", MAC_ADDRESS, false, 1, 1);
+ egressAclService.egressACLTcpSyn(123L, "2", MAC_ADDRESS, false, 1, 1);
verify(writeTransaction, times(1)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
verify(writeTransaction, times(2)).submit();
verify(commitFuture, times(2)).get(); // 1 + 1 above
*/
@Test
public void testIgressACLDefaultTcpDrop() throws Exception {
- ingressAclService.ingressACLDefaultTcpDrop(Long.valueOf(123), SEGMENTATION_ID, MAC_ADDRESS, PRIORITY, true);
+ ingressAclService.ingressACLDefaultTcpDrop(123L, SEGMENTATION_ID, MAC_ADDRESS, PRIORITY, true);
verify(writeTransaction, times(2)).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class), anyBoolean());
verify(writeTransaction, times(1)).submit();
verify(commitFuture, times(1)).get();
- ingressAclService.ingressACLDefaultTcpDrop(Long.valueOf(123), SEGMENTATION_ID, MAC_ADDRESS, PRIORITY, false);
+ ingressAclService.ingressACLDefaultTcpDrop(123L, SEGMENTATION_ID, MAC_ADDRESS, PRIORITY, false);
verify(writeTransaction, times(1)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
verify(writeTransaction, times(2)).submit();
verify(commitFuture, times(2)).get(); // 1 + 1 above
*/
@Test
public void testIngressACLTcpPortWithPrefix() throws Exception {
- ingressAclService.ingressACLTcpPortWithPrefix(Long.valueOf(123), SEGMENTATION_ID, MAC_ADDRESS, true, 1, HOST_ADDRESS, PRIORITY);
+ ingressAclService.ingressACLTcpPortWithPrefix(123L, SEGMENTATION_ID, MAC_ADDRESS, true, 1, HOST_ADDRESS, PRIORITY);
verify(writeTransaction, times(2)).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class), anyBoolean());
verify(writeTransaction, times(1)).submit();
verify(commitFuture, times(1)).get();
- ingressAclService.ingressACLTcpPortWithPrefix(Long.valueOf(123), SEGMENTATION_ID, MAC_ADDRESS, false, 1, HOST_ADDRESS, PRIORITY);
+ ingressAclService.ingressACLTcpPortWithPrefix(123L, SEGMENTATION_ID, MAC_ADDRESS, false, 1, HOST_ADDRESS, PRIORITY);
verify(writeTransaction, times(1)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
verify(writeTransaction, times(2)).submit();
verify(commitFuture, times(2)).get(); // 1 + 1 above
*/
@Test
public void testIngressAllowProto() throws Exception {
- ingressAclService.handleIngressAllowProto(Long.valueOf(123), SEGMENTATION_ID, MAC_ADDRESS, true, HOST_ADDRESS, PRIORITY);
+ ingressAclService.handleIngressAllowProto(123L, SEGMENTATION_ID, MAC_ADDRESS, true, HOST_ADDRESS, PRIORITY);
verify(writeTransaction, times(2)).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class), anyBoolean());
verify(writeTransaction, times(1)).submit();
verify(commitFuture, times(1)).get();
- ingressAclService.handleIngressAllowProto(Long.valueOf(123), SEGMENTATION_ID, MAC_ADDRESS, false, HOST_ADDRESS, PRIORITY);
+ ingressAclService.handleIngressAllowProto(123L, SEGMENTATION_ID, MAC_ADDRESS, false, HOST_ADDRESS, PRIORITY);
verify(writeTransaction, times(1)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
verify(writeTransaction, times(2)).submit();
verify(commitFuture, times(2)).get(); // 1 + 1 above
*/
@Test
public void testIngressACLPermitAllProto() throws Exception {
- ingressAclService.ingressACLPermitAllProto(Long.valueOf(123), SEGMENTATION_ID, MAC_ADDRESS, true, HOST_ADDRESS, PRIORITY);
+ ingressAclService.ingressACLPermitAllProto(123L, SEGMENTATION_ID, MAC_ADDRESS, true, HOST_ADDRESS, PRIORITY);
verify(writeTransaction, times(2)).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class), anyBoolean());
verify(writeTransaction, times(1)).submit();
verify(commitFuture, times(1)).get();
- ingressAclService.ingressACLPermitAllProto(Long.valueOf(123), SEGMENTATION_ID, MAC_ADDRESS, false, HOST_ADDRESS, PRIORITY);
+ ingressAclService.ingressACLPermitAllProto(123L, SEGMENTATION_ID, MAC_ADDRESS, false, HOST_ADDRESS, PRIORITY);
verify(writeTransaction, times(1)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
verify(writeTransaction, times(2)).submit();
verify(commitFuture, times(2)).get(); // 1 + 1 above
*/
@Test
public void testIngressACLTcpSyn() throws Exception {
- ingressAclService.ingressACLTcpSyn(Long.valueOf(123), SEGMENTATION_ID, MAC_ADDRESS, true, 1, PRIORITY);
+ ingressAclService.ingressACLTcpSyn(123L, SEGMENTATION_ID, MAC_ADDRESS, true, 1, PRIORITY);
verify(writeTransaction, times(2)).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class), anyBoolean());
verify(writeTransaction, times(1)).submit();
verify(commitFuture, times(1)).get();
- ingressAclService.ingressACLTcpSyn(Long.valueOf(123), SEGMENTATION_ID, MAC_ADDRESS, false, 1, PRIORITY);
+ ingressAclService.ingressACLTcpSyn(123L, SEGMENTATION_ID, MAC_ADDRESS, false, 1, PRIORITY);
verify(writeTransaction, times(1)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
verify(writeTransaction, times(2)).submit();
verify(commitFuture, times(2)).get(); // 1 + 1 above
private static final String SEGMENTATION_ID = "2";
private static final String MAC_ADDRESS = "87:1D:5E:02:40:B8";
- private static final Long DPID = Long.valueOf(122);
- private static final Long LOCAL_PORT = Long.valueOf(451);
- private static final Long ETH_PORT = Long.valueOf(564);
- private static final Long OF_PORT_OUT = Long.valueOf(5698);
+ private static final Long DPID = 122L;
+ private static final Long LOCAL_PORT = 451L;
+ private static final Long ETH_PORT = 564L;
+ private static final Long OF_PORT_OUT = 5698L;
@Before
public void setUp() throws Exception {
when(member.getMAC()).thenReturn(MAC_ADDRESS);
Southbound southbound = mock(Southbound.class);
- when(southbound.getDataPathId(any(Node.class))).thenReturn(Long.valueOf(123));
+ when(southbound.getDataPathId(any(Node.class))).thenReturn(123L);
MemberModifier.field(LoadBalancerService.class, "southbound").set(loadBalancerService, southbound);
}
/**
@Override
public void syncSecurityGroup(NeutronPort port, List<NeutronSecurityGroup> securityGroupList, boolean write) {
- LOG.trace("syncSecurityGroup:" + securityGroupList + " Write:" + Boolean.valueOf(write));
+ LOG.trace("syncSecurityGroup:" + securityGroupList + " Write:" + write);
if (null != port && null != port.getSecurityGroups()) {
Node node = getNode(port);
NeutronNetwork neutronNetwork = neutronNetworkCache.getNetwork(port.getNetworkUUID());
@Override
public void syncSecurityRule(NeutronPort port, NeutronSecurityRule securityRule,Neutron_IPs vmIp, boolean write) {
- LOG.trace("syncSecurityGroup:" + securityRule + " Write:" + Boolean.valueOf(write));
+ LOG.trace("syncSecurityGroup:" + securityRule + " Write:" + write);
if (null != port && null != port.getSecurityGroups()) {
Node node = getNode(port);
NeutronNetwork neutronNetwork = neutronNetworkCache.getNetwork(port.getNetworkUUID());
NETWORK_MAP.inverse();
segmentsBuilder.setNetworkType((Class<? extends NetworkTypeBase>) mapper.get(segment.getProviderNetworkType()));
}
- segmentsBuilder.setSegmentationIndex(Long.valueOf(count));
+ segmentsBuilder.setSegmentationIndex(count);
segments.add(segmentsBuilder.build());
}
providerExtensionBuilder.setSegments(segments);
private static final ImmutableBiMap<Class<? extends IpVersionBase>,Integer> IPV_MAP
= new ImmutableBiMap.Builder<Class<? extends IpVersionBase>,Integer>()
- .put(IpVersionV4.class,Integer.valueOf(4))
- .put(IpVersionV6.class,Integer.valueOf(6))
+ .put(IpVersionV4.class, 4)
+ .put(IpVersionV6.class, 6)
.build();
private static final ImmutableBiMap<Class<? extends Dhcpv6Base>,String> DHCPV6_MAP
private static final ImmutableBiMap<Class<? extends IpVersionBase>,Integer> IPV_MAP
= new ImmutableBiMap.Builder<Class<? extends IpVersionBase>,Integer>()
- .put(IpVersionV4.class,Integer.valueOf(4))
- .put(IpVersionV6.class,Integer.valueOf(6))
+ .put(IpVersionV4.class, 4)
+ .put(IpVersionV6.class, 6)
.build();
private static final ImmutableBiMap<Class<? extends Dhcpv6Base>,String> DHCPV6_MAP
{"10.10.1.343", "10.10.1.391", "10.10.1.31"},
{"D5:6B:59:E8:F4:84", "D5:4B:60:E8:F5:84", "D5:4B:60:E8:F6:84"},
{"tcp", "tcp", "http"},
- {Integer.valueOf(125304), Integer.valueOf(125304), Integer.valueOf(1204)}};
+ {125304, 125304, 1204}};
@Before
public void setUp() throws Exception {
INeutronPortCRUD neutronPortCache = mock(INeutronPortCRUD.class);
when(neutronPortCache.getPort(anyString())).thenReturn(neutronPort);
PowerMockito.doReturn(neutronPort).when(neutronL3Adapter, "findNeutronPortForFloatingIp", anyString());
- PowerMockito.doReturn(Long.valueOf(15)).when(neutronL3Adapter, "findOFPortForExtPatch", anyLong());
+ PowerMockito.doReturn(15L).when(neutronL3Adapter, "findOFPortForExtPatch", anyLong());
MemberModifier.field(NeutronL3Adapter.class, "floatIpDataMapCache").set(neutronL3Adapter , floatIpDataMapCache);
MemberModifier.field(NeutronL3Adapter.class, "neutronPortToDpIdCache").set(neutronL3Adapter , neutronPortToDpIdCache);
MemberModifier.field(NeutronL3Adapter.class, "neutronPortCache").set(neutronL3Adapter , neutronPortCache);
MemberModifier.suppress(MemberMatcher.method(NeutronL3Adapter.class, "handleInterfaceEventAdd", String.class, Long.class, Uuid.class));
MemberModifier.suppress(MemberMatcher.method(NeutronL3Adapter.class, "handleInterfaceEventDelete", OvsdbTerminationPointAugmentation.class, Long.class));
- PowerMockito.when(neutronL3Adapter, "getDpidForIntegrationBridge", any(Node.class)).thenReturn(Long.valueOf(45));
+ PowerMockito.when(neutronL3Adapter, "getDpidForIntegrationBridge", any(Node.class)).thenReturn(45L);
Mockito.doNothing().when(neutronL3Adapter).handleNeutronPortEvent(any(NeutronPort.class), any(Action.class));
neutronL3Adapter.handleInterfaceEvent(node, intf, mock(NeutronNetwork.class), Action.ADD);
when(neutronNetwork.getProviderSegmentationID()).thenReturn(ID);
List<Node> nodes = new ArrayList<>();
nodes.add(mock(Node.class));
- PowerMockito.doReturn(Long.valueOf(15)).when(neutronL3Adapter, "getDpidForIntegrationBridge", any(Node.class));
+ PowerMockito.doReturn(15L).when(neutronL3Adapter, "getDpidForIntegrationBridge", any(Node.class));
// init instance variables
networkIdToRouterMacCache .put(UUID, MAC_ADDRESS);
MemberModifier.field(NeutronL3Adapter.class, "neutronSubnetCache").set(neutronL3Adapter , neutronSubnetCache);
MemberModifier.field(NeutronL3Adapter.class, "neutronNetworkCache").set(neutronL3Adapter , neutronNetworkCache);
MemberModifier.field(NeutronL3Adapter.class, "nodeCacheManager").set(neutronL3Adapter , nodeCacheManager);
- PowerMockito.when(neutronL3Adapter, "getDpidForIntegrationBridge", any(Node.class)).thenReturn(Long.valueOf(45));
+ PowerMockito.when(neutronL3Adapter, "getDpidForIntegrationBridge", any(Node.class)).thenReturn(45L);
int networkIdToRouterMacCacheSize, networkIdToRouterIpListCacheSize, subnetIdToRouterInterfaceCacheSize;
networkIdToRouterMacCacheSize = networkIdToRouterMacCache.size();
PowerMockito.when(southbound.getBridge(any(Node.class), anyString())).thenReturn(mock(OvsdbBridgeAugmentation.class));
PowerMockito.when(configurationService.getIntegrationBridgeName()).thenReturn("");
- PowerMockito.when(southbound.getDataPathId(any(Node.class))).thenReturn(Long.valueOf(45));
+ PowerMockito.when(southbound.getDataPathId(any(Node.class))).thenReturn(45L);
- assertEquals("Error, did not return the correct Dpid", Long.valueOf(45), Whitebox.invokeMethod(neutronL3Adapter, "getDpidForIntegrationBridge", mock(Node.class)));
+ assertEquals("Error, did not return the correct Dpid", 45L, Whitebox.invokeMethod(neutronL3Adapter, "getDpidForIntegrationBridge", mock(Node.class)));
}
@Test
public void testencodeExcplicitOFPort() throws Exception {
- assertEquals("Error, did not correctly encode the port", OFPort, NeutronL3Adapter.encodeExcplicitOFPort(Long.valueOf(45)));
+ assertEquals("Error, did not correctly encode the port", OFPort, NeutronL3Adapter.encodeExcplicitOFPort(45L));
}
@Test
Class clazz = Whitebox.getInnerClassType(NeutronL3Adapter.class, "FloatIpData");
Constructor [] constructors = clazz.getConstructors();
Constructor c = constructors[0];
- return c.newInstance(new NeutronL3Adapter(), Long.valueOf(415), Long.valueOf(415), "a", "b", "c", "d", "e");
+ return c.newInstance(new NeutronL3Adapter(), 415L, 415L, "a", "b", "c", "d", "e");
}
}
@Test
public void testCacheListenerAddedAndRemoved() {
ServiceReference ref = mock(ServiceReference.class);
- when(ref.getProperty(org.osgi.framework.Constants.SERVICE_ID)).thenReturn(Long.valueOf(1));
+ when(ref.getProperty(org.osgi.framework.Constants.SERVICE_ID)).thenReturn(1L);
// add
nodeCacheManagerImpl.cacheListenerAdded(ref, mock(NodeCacheListener.class));
Map<?, ?> map = (HashMap<?, ?>) getField("providers");
ServiceReference<?> ref = mock(ServiceReference.class);
- when(ref.getProperty(org.osgi.framework.Constants.SERVICE_ID)).thenReturn(Long.valueOf(1));
+ when(ref.getProperty(org.osgi.framework.Constants.SERVICE_ID)).thenReturn(1L);
providerNetworkManagerImpl.providerAdded(ref, mock(NetworkingProvider.class));
NxRegLoad r = new NxRegLoadBuilder()
.setDst(new DstBuilder()
.setDstChoice(dstChoice)
- .setStart(Integer.valueOf(0))
- .setEnd(Integer.valueOf(endOffset))
+ .setStart(0)
+ .setEnd(endOffset)
.build())
.setValue(value)
.build();
NxRegMove r = new NxRegMoveBuilder()
.setSrc(new SrcBuilder()
.setSrcChoice(srcChoice)
- .setStart(Integer.valueOf(0))
- .setEnd(Integer.valueOf(endOffset))
+ .setStart(0)
+ .setEnd(endOffset)
.build())
.setDst(new org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.nx.reg.move.DstBuilder()
.setDstChoice(dstChoice)
- .setStart(Integer.valueOf(0))
- .setEnd(Integer.valueOf(endOffset))
+ .setStart(0)
+ .setEnd(endOffset)
.build())
.build();
if (groupBucket) {
NxOutputReg r = new NxOutputRegBuilder()
.setSrc(new org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.output.reg.grouping.nx.output.reg.SrcBuilder()
.setSrcChoice(srcChoice)
- .setOfsNbits(Integer.valueOf(31))
+ .setOfsNbits(31)
.build())
- .setMaxLen(Integer.valueOf(0xffff))
+ .setMaxLen(0xffff)
.build();
return new NxActionOutputRegNodesNodeTableFlowApplyActionsCaseBuilder()
.setNxOutputReg(r).build();