use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtZoneCaseValue in project openflowplugin by opendaylight.
the class CtZoneConvertor method convert.
@Override
public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
CtZoneCaseValue ctZoneCaseValue = (CtZoneCaseValue) input.getMatchEntryValue();
NxmNxCtZoneBuilder ctZoneBuilder = new NxmNxCtZoneBuilder();
ctZoneBuilder.setCtZone(ctZoneCaseValue.getCtZoneValues().getCtZone());
return resolveAugmentation(ctZoneBuilder.build(), path, NxmNxCtZoneKey.class);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtZoneCaseValue in project openflowplugin by opendaylight.
the class CtZoneCodec method serialize.
@Override
public void serialize(MatchEntry input, ByteBuf outBuffer) {
serializeHeader(input, outBuffer);
CtZoneCaseValue ctZoneCase = (CtZoneCaseValue) input.getMatchEntryValue();
outBuffer.writeShort(ctZoneCase.getCtZoneValues().getCtZone());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtZoneCaseValue in project openflowplugin by opendaylight.
the class CtZoneCodecTest method deserializeTest.
@Test
public void deserializeTest() {
createBuffer(buffer);
input = ctZoneCodec.deserialize(buffer);
final CtZoneCaseValue result = (CtZoneCaseValue) input.getMatchEntryValue();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmNxCtZone.class, input.getOxmMatchField());
assertEquals(false, input.isHasMask());
assertEquals(2, result.getCtZoneValues().getCtZone().shortValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtZoneCaseValue in project openflowplugin by opendaylight.
the class CtZoneConvertorTest method testConvert1.
@Test
public void testConvert1() throws Exception {
final CtZoneValuesBuilder ctZoneValuesBuilder = new CtZoneValuesBuilder().setCtZone(2);
final CtZoneCaseValueBuilder ctZoneCaseValueBuilder = new CtZoneCaseValueBuilder().setCtZoneValues(ctZoneValuesBuilder.build());
final CtZoneCaseValue ctZoneCaseValue = ctZoneCaseValueBuilder.build();
when(matchEntry.getMatchEntryValue()).thenReturn(ctZoneCaseValue);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = ctZoneConvertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
Assert.assertEquals(2L, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxCtZone().getCtZone().longValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxCtZoneKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = ctZoneConvertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
Assert.assertEquals(2L, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmNxCtZone().getCtZone().longValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxCtZoneKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = ctZoneConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
Assert.assertEquals(2L, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmNxCtZone().getCtZone().longValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxCtZoneKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = ctZoneConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
Assert.assertEquals(2L, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxCtZone().getCtZone().longValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxCtZoneKey.class);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtZoneCaseValue in project openflowplugin by opendaylight.
the class CtZoneConvertorTest method testConvert.
@Test
public void testConvert() throws Exception {
final MatchEntry converted = ctZoneConvertor.convert(extension);
Assert.assertEquals(1L, ((CtZoneCaseValue) converted.getMatchEntryValue()).getCtZoneValues().getCtZone().longValue());
}
Aggregations