use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.ArpThaCaseValue in project openflowplugin by opendaylight.
the class ArpThaConvertorTest method testConvertToOFJava.
@Test
public void testConvertToOFJava() throws Exception {
final MatchEntry converted = arpThaConvertor.convert(extension);
Assert.assertEquals(MAC_ADDRESS.getValue(), ((ArpThaCaseValue) converted.getMatchEntryValue()).getArpThaValues().getMacAddress().getValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.ArpThaCaseValue in project openflowplugin by opendaylight.
the class ArpThaCodec method serialize.
@Override
public void serialize(MatchEntry input, ByteBuf outBuffer) {
serializeHeader(input, outBuffer);
ArpThaCaseValue arpThaCase = ((ArpThaCaseValue) input.getMatchEntryValue());
outBuffer.writeBytes(ByteBufUtils.macAddressToBytes(arpThaCase.getArpThaValues().getMacAddress().getValue()));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.ArpThaCaseValue in project openflowplugin by opendaylight.
the class ArpThaCodecTest method deserializeTest.
@Test
public void deserializeTest() {
createBuffer(buffer);
input = arpThaCodec.deserialize(buffer);
final ArpThaCaseValue result = (ArpThaCaseValue) input.getMatchEntryValue();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmNxArpTha.class, input.getOxmMatchField());
assertEquals(false, input.isHasMask());
assertEquals(TEST_ADDRESS, result.getArpThaValues().getMacAddress());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.ArpThaCaseValue in project openflowplugin by opendaylight.
the class ArpThaConvertorTest method testConvertFromOFJava.
@Test
public void testConvertFromOFJava() throws Exception {
final ArpThaValuesBuilder arpThaValuesBuilder = new ArpThaValuesBuilder().setMacAddress(MAC_ADDRESS);
final ArpThaCaseValueBuilder arpThaCaseValueBuilder = new ArpThaCaseValueBuilder().setArpThaValues(arpThaValuesBuilder.build());
final ArpThaCaseValue arpThaCaseValue = arpThaCaseValueBuilder.build();
when(matchEntry.getMatchEntryValue()).thenReturn(arpThaCaseValue);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = arpThaConvertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
Assert.assertEquals(arpThaCaseValue.getArpThaValues().getMacAddress(), ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxArpTha().getMacAddress());
Assert.assertEquals(extensionAugment.getKey(), NxmNxArpThaKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = arpThaConvertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
Assert.assertEquals(arpThaCaseValue.getArpThaValues().getMacAddress(), ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmNxArpTha().getMacAddress());
Assert.assertEquals(extensionAugment.getKey(), NxmNxArpThaKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = arpThaConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
Assert.assertEquals(arpThaCaseValue.getArpThaValues().getMacAddress(), ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmNxArpTha().getMacAddress());
Assert.assertEquals(extensionAugment.getKey(), NxmNxArpThaKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = arpThaConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
Assert.assertEquals(arpThaCaseValue.getArpThaValues().getMacAddress(), ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxArpTha().getMacAddress());
Assert.assertEquals(extensionAugment.getKey(), NxmNxArpThaKey.class);
}
Aggregations