use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.EthDstCaseValue in project openflowplugin by opendaylight.
the class EthDstConvertorTest method testConvert1.
@Test
public void testConvert1() throws Exception {
final EthDstValuesBuilder ethDstValuesBuilder = new EthDstValuesBuilder().setMacAddress(MAC_ADDRESS);
final EthDstCaseValueBuilder ethDstCaseValueBuilder = new EthDstCaseValueBuilder().setEthDstValues(ethDstValuesBuilder.build());
final EthDstCaseValue ethDstCaseValue = ethDstCaseValueBuilder.build();
when(matchEntry.getMatchEntryValue()).thenReturn(ethDstCaseValue);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = ethDstConvertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
Assert.assertEquals(MAC_ADDRESS, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmOfEthDst().getMacAddress());
Assert.assertEquals(extensionAugment.getKey(), NxmOfEthDstKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = ethDstConvertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
Assert.assertEquals(MAC_ADDRESS, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmOfEthDst().getMacAddress());
Assert.assertEquals(extensionAugment.getKey(), NxmOfEthDstKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = ethDstConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
Assert.assertEquals(MAC_ADDRESS, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmOfEthDst().getMacAddress());
Assert.assertEquals(extensionAugment.getKey(), NxmOfEthDstKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = ethDstConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
Assert.assertEquals(MAC_ADDRESS, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmOfEthDst().getMacAddress());
Assert.assertEquals(extensionAugment.getKey(), NxmOfEthDstKey.class);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.EthDstCaseValue in project openflowplugin by opendaylight.
the class EthDstCodecTest method deserializeTest.
@Test
public void deserializeTest() {
createBuffer(buffer);
input = ethDstCodec.deserialize(buffer);
final EthDstCaseValue result = (EthDstCaseValue) input.getMatchEntryValue();
assertEquals(Nxm0Class.class, input.getOxmClass());
assertEquals(NxmOfEthDst.class, input.getOxmMatchField());
assertEquals(false, input.isHasMask());
assertEquals(TEST_ADDRESS, result.getEthDstValues().getMacAddress());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.EthDstCaseValue in project openflowplugin by opendaylight.
the class EthDstCodec method serialize.
@Override
public void serialize(MatchEntry input, ByteBuf outBuffer) {
serializeHeader(input, outBuffer);
EthDstCaseValue ethDstCase = ((EthDstCaseValue) input.getMatchEntryValue());
outBuffer.writeBytes(ByteBufUtils.macAddressToBytes(ethDstCase.getEthDstValues().getMacAddress().getValue()));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.EthDstCaseValue in project openflowplugin by opendaylight.
the class EthDstConvertorTest method testConvert.
@Test
public void testConvert() throws Exception {
final MatchEntry converted = ethDstConvertor.convert(extension);
Assert.assertEquals(MAC_ADDRESS, ((EthDstCaseValue) converted.getMatchEntryValue()).getEthDstValues().getMacAddress());
}
Aggregations