use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.ArpShaCaseValue in project openflowplugin by opendaylight.
the class ArpShaConvertorTest method testConvertFromOFJava.
@Test
public void testConvertFromOFJava() throws Exception {
final ArpShaValuesBuilder arpShaValuesBuilder = new ArpShaValuesBuilder().setMacAddress(MAC_ADDRESS);
final ArpShaCaseValueBuilder arpShaCaseValueBuilder = new ArpShaCaseValueBuilder().setArpShaValues(arpShaValuesBuilder.build());
final ArpShaCaseValue arpShaCaseValue = arpShaCaseValueBuilder.build();
when(matchEntry.getMatchEntryValue()).thenReturn(arpShaCaseValue);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = arpShaConvertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
Assert.assertEquals(arpShaCaseValue.getArpShaValues().getMacAddress(), ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxArpSha().getMacAddress());
Assert.assertEquals(extensionAugment.getKey(), NxmNxArpShaKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = arpShaConvertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
Assert.assertEquals(arpShaCaseValue.getArpShaValues().getMacAddress(), ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmNxArpSha().getMacAddress());
Assert.assertEquals(extensionAugment.getKey(), NxmNxArpShaKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = arpShaConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
Assert.assertEquals(arpShaCaseValue.getArpShaValues().getMacAddress(), ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmNxArpSha().getMacAddress());
Assert.assertEquals(extensionAugment.getKey(), NxmNxArpShaKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = arpShaConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
Assert.assertEquals(arpShaCaseValue.getArpShaValues().getMacAddress(), ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxArpSha().getMacAddress());
Assert.assertEquals(extensionAugment.getKey(), NxmNxArpShaKey.class);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.ArpShaCaseValue in project openflowplugin by opendaylight.
the class ArpShaCodecTest method deserializeTest.
@Test
public void deserializeTest() {
createBuffer(buffer);
input = arpShaCodec.deserialize(buffer);
final ArpShaCaseValue result = (ArpShaCaseValue) input.getMatchEntryValue();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmNxArpSha.class, input.getOxmMatchField());
assertEquals(false, input.isHasMask());
assertEquals(RESULT_ADDRESS, result.getArpShaValues().getMacAddress());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.ArpShaCaseValue in project openflowplugin by opendaylight.
the class ArpShaCodec method serialize.
@Override
public void serialize(MatchEntry input, ByteBuf outBuffer) {
serializeHeader(input, outBuffer);
ArpShaCaseValue value = ((ArpShaCaseValue) input.getMatchEntryValue());
outBuffer.writeBytes(ByteBufUtils.macAddressToBytes(value.getArpShaValues().getMacAddress().getValue()));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.ArpShaCaseValue in project openflowplugin by opendaylight.
the class ArpShaConvertorTest method testConvertToOFJava.
@Test
public void testConvertToOFJava() throws Exception {
final MatchEntry converted = arpShaConvertor.convert(extension);
Assert.assertEquals(MAC_ADDRESS.getValue(), ((ArpShaCaseValue) converted.getMatchEntryValue()).getArpShaValues().getMacAddress().getValue());
}
Aggregations