import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator;
-import org.junit.Before;
import org.junit.Test;
import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm1Class;
import org.opendaylight.yangtools.yang.common.Uint32;
public class TunIpv4SrcCodecTest {
+ private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
+ private final TunIpv4SrcCodec tunIpv4SrcCodec = new TunIpv4SrcCodec();
- TunIpv4SrcCodec tunIpv4SrcCodec;
- ByteBuf buffer;
- MatchEntry input;
+ private MatchEntry input;
private static final int VALUE_LENGTH = 4;
private static final int NXM_FIELD_CODE = 31;
- @Before
- public void setUp() {
- tunIpv4SrcCodec = new TunIpv4SrcCodec();
- buffer = ByteBufAllocator.DEFAULT.buffer();
- }
-
@Test
public void serializeTest() {
input = createMatchEntry();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmNxTunIpv4Src.class, input.getOxmMatchField());
- assertEquals(false, input.isHasMask());
+ assertEquals(false, input.getHasMask());
assertEquals(1, result.getTunIpv4SrcValues().getValue().intValue());
}
return matchEntryBuilder.build();
}
- private static void createBuffer(ByteBuf message) {
+ private static void createBuffer(final ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;