use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.EthSrcCaseValue in project openflowplugin by opendaylight.
the class EthSrcConvertorTest method testConvert1.
@Test
public void testConvert1() throws Exception {
final EthSrcValuesBuilder ethSrcValuesBuilder = new EthSrcValuesBuilder().setMacAddress(MAC_ADDRESS);
final EthSrcCaseValueBuilder ethSrcCaseValueBuilder = new EthSrcCaseValueBuilder().setEthSrcValues(ethSrcValuesBuilder.build());
final EthSrcCaseValue ethSrcCaseValue = ethSrcCaseValueBuilder.build();
when(matchEntry.getMatchEntryValue()).thenReturn(ethSrcCaseValue);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = ethSrcConvertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
Assert.assertEquals(MAC_ADDRESS, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmOfEthSrc().getMacAddress());
Assert.assertEquals(extensionAugment.getKey(), NxmOfEthSrcKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = ethSrcConvertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
Assert.assertEquals(MAC_ADDRESS, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmOfEthSrc().getMacAddress());
Assert.assertEquals(extensionAugment.getKey(), NxmOfEthSrcKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = ethSrcConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
Assert.assertEquals(MAC_ADDRESS, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmOfEthSrc().getMacAddress());
Assert.assertEquals(extensionAugment.getKey(), NxmOfEthSrcKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = ethSrcConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
Assert.assertEquals(MAC_ADDRESS, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmOfEthSrc().getMacAddress());
Assert.assertEquals(extensionAugment.getKey(), NxmOfEthSrcKey.class);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.EthSrcCaseValue in project openflowplugin by opendaylight.
the class EthSrcCodecTest method deserializeTest.
@Test
public void deserializeTest() {
createBuffer(buffer);
input = ethSrcCodec.deserialize(buffer);
final EthSrcCaseValue result = (EthSrcCaseValue) input.getMatchEntryValue();
assertEquals(Nxm0Class.class, input.getOxmClass());
assertEquals(NxmOfEthSrc.class, input.getOxmMatchField());
assertEquals(false, input.isHasMask());
assertEquals(TEST_ADDRESS, result.getEthSrcValues().getMacAddress());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.EthSrcCaseValue in project openflowplugin by opendaylight.
the class EthSrcCodec method serialize.
@Override
public void serialize(MatchEntry input, ByteBuf outBuffer) {
serializeHeader(input, outBuffer);
EthSrcCaseValue ethSrcCase = ((EthSrcCaseValue) input.getMatchEntryValue());
outBuffer.writeBytes(ByteBufUtils.macAddressToBytes(ethSrcCase.getEthSrcValues().getMacAddress().getValue()));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.EthSrcCaseValue in project openflowplugin by opendaylight.
the class EthSrcConvertorTest method testConvert.
@Test
public void testConvert() throws Exception {
final MatchEntry converted = ethSrcConvertor.convert(extension);
Assert.assertEquals(MAC_ADDRESS, ((EthSrcCaseValue) converted.getMatchEntryValue()).getEthSrcValues().getMacAddress());
}
Aggregations