use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.ArpOpCaseValue in project openflowplugin by opendaylight.
the class ArpOpConvertorTest method testConvertToOFJava.
@Test
public void testConvertToOFJava() throws Exception {
final NxmOfArpOpBuilder nxmOfArpOpBuilder = new NxmOfArpOpBuilder().setValue(2);
final NxAugMatchRpcAddFlowBuilder nxAugMatchRpcAddFlowBuilder = new NxAugMatchRpcAddFlowBuilder();
nxAugMatchRpcAddFlowBuilder.setNxmOfArpOp(nxmOfArpOpBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchRpcAddFlowBuilder.build();
when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
final MatchEntry converted = arpOpConvertor.convert(extension);
Assert.assertEquals(nxAugMatchRpcAddFlowBuilder.getNxmOfArpOp().getValue(), ((ArpOpCaseValue) converted.getMatchEntryValue()).getArpOpValues().getValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.ArpOpCaseValue in project openflowplugin by opendaylight.
the class ArpOpCodecTest method deserializeTest.
@Test
public void deserializeTest() {
createBuffer(buffer);
input = arpOpCodec.deserialize(buffer);
final ArpOpCaseValue result = (ArpOpCaseValue) input.getMatchEntryValue();
assertEquals(Nxm0Class.class, input.getOxmClass());
assertEquals(NxmOfArpOp.class, input.getOxmMatchField());
assertEquals(false, input.isHasMask());
assertEquals(2, result.getArpOpValues().getValue().shortValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.ArpOpCaseValue in project openflowplugin by opendaylight.
the class ArpOpCodec method serialize.
@Override
public void serialize(MatchEntry input, ByteBuf outBuffer) {
serializeHeader(input, outBuffer);
ArpOpCaseValue arpOpCase = ((ArpOpCaseValue) input.getMatchEntryValue());
outBuffer.writeShort(arpOpCase.getArpOpValues().getValue());
}
Aggregations