* 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;
public class ArpSourceHardwareAddressEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
@Test
- public void deserializeEntry() throws Exception {
+ public void deserializeEntry() {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final MacAddress arpSourceHardwareAddress = new MacAddress("00:01:02:03:04:05");
final MacAddress arpSourceHardwareAddressMask = new MacAddress("00:00:00:00:00:00");
writeHeader(in, false);
- in.writeBytes(IetfYangUtil.INSTANCE.bytesFor(arpSourceHardwareAddress));
+ in.writeBytes(IetfYangUtil.macAddressBytes(arpSourceHardwareAddress));
assertEquals(arpSourceHardwareAddress.getValue(),
- ArpMatch.class.cast(deserialize(in).getLayer3Match()).getArpSourceHardwareAddress().getAddress().getValue());
+ ((ArpMatch) deserialize(in).getLayer3Match()).getArpSourceHardwareAddress().getAddress()
+ .getValue());
assertEquals(0, in.readableBytes());
writeHeader(in, true);
- in.writeBytes(IetfYangUtil.INSTANCE.bytesFor(arpSourceHardwareAddress));
- in.writeBytes(IetfYangUtil.INSTANCE.bytesFor(arpSourceHardwareAddressMask));
+ in.writeBytes(IetfYangUtil.macAddressBytes(arpSourceHardwareAddress));
+ in.writeBytes(IetfYangUtil.macAddressBytes(arpSourceHardwareAddressMask));
final ArpSourceHardwareAddress desAddress =
- ArpMatch.class.cast(deserialize(in).getLayer3Match()).getArpSourceHardwareAddress();
+ ((ArpMatch) deserialize(in).getLayer3Match()).getArpSourceHardwareAddress();
assertEquals(arpSourceHardwareAddress.getValue(), desAddress.getAddress().getValue());
assertEquals(arpSourceHardwareAddressMask.getValue(), desAddress.getMask().getValue());
assertEquals(0, in.readableBytes());