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 Reg7CodecTest {
+ private final ByteBuf buffer = ByteBufAllocator.DEFAULT.buffer();
+ private final Reg7Codec reg7Codec = new Reg7Codec();
- Reg7Codec reg7Codec;
- ByteBuf buffer;
- MatchEntry input;
+ private MatchEntry input;
private static final int NXM_FIELD_CODE = 7;
private static final int VALUE_LENGTH = 4;
- @Before
- public void setUp() {
- reg7Codec = new Reg7Codec();
- buffer = ByteBufAllocator.DEFAULT.buffer();
- }
-
@Test
public void serializeTest() {
input = createMatchEntry();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmNxReg7.class, input.getOxmMatchField());
- assertEquals(false, input.isHasMask());
+ assertEquals(false, input.getHasMask());
assertEquals(1, result.getRegValues().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;