* 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.impl.protocol.deserialization.match;
import static org.junit.Assert.assertEquals;
import io.netty.buffer.UnpooledByteBufAllocator;
import java.util.Iterator;
import org.junit.Test;
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.IpConversionUtil;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.match.MatchConvertorUtil;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.ArpMatch;
public class ArpSourceTransportAddressEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
-
@Test
public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
writeHeader(in, false);
Iterator<String> addressParts = IpConversionUtil.splitToParts(arpSourceTransportAddressNoMask);
- in.writeBytes(IetfInetUtil.INSTANCE.ipv4AddressBytes(new Ipv4Address(addressParts.next())));
+ in.writeBytes(IetfInetUtil.ipv4AddressBytes(new Ipv4Address(addressParts.next())));
assertEquals(arpSourceTransportAddressNoMask.getValue(),
((ArpMatch) deserialize(in).getLayer3Match()).getArpSourceTransportAddress().getValue());
writeHeader(in, true);
addressParts = IpConversionUtil.splitToParts(arpSourceTransportAddress);
- in.writeBytes(IetfInetUtil.INSTANCE.ipv4AddressBytes(new Ipv4Address(addressParts.next())));
+ in.writeBytes(IetfInetUtil.ipv4AddressBytes(new Ipv4Address(addressParts.next())));
in.writeBytes(MatchConvertorUtil.extractIpv4Mask(addressParts));
final Ipv4Prefix desAddress =
@Override
protected int getValueLength() {
- return EncodeConstants.SIZE_OF_INT_IN_BYTES;
+ return Integer.BYTES;
}
}