2 * Copyright (c) 2016 Pantheon Technologies s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
10 import static org.junit.Assert.assertEquals;
12 import io.netty.buffer.ByteBuf;
13 import io.netty.buffer.UnpooledByteBufAllocator;
14 import org.junit.Test;
15 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatch;
18 public class UdpDestinationPortEntryDeserializerTest extends AbstractMatchEntryDeserializerTest {
20 public void deserializeEntry() {
21 final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
24 writeHeader(in, false);
27 assertEquals(port, ((UdpMatch) deserialize(in).getLayer4Match()).getUdpDestinationPort().getValue()
29 assertEquals(0, in.readableBytes());
33 protected int getOxmClassCode() {
34 return OxmMatchConstants.OPENFLOW_BASIC_CLASS;
38 protected int getOxmFieldCode() {
39 return OxmMatchConstants.UDP_DST;
43 protected int getValueLength() {