use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtStateCaseValue in project openflowplugin by opendaylight.
the class CtStateConvertorTest method testConvert.
@Test
public void testConvert() throws Exception {
final MatchEntry converted = ctStateConvertor.convert(extension);
Assert.assertEquals(1L, ((CtStateCaseValue) converted.getMatchEntryValue()).getCtStateValues().getCtState().longValue());
Assert.assertEquals(2L, ((CtStateCaseValue) converted.getMatchEntryValue()).getCtStateValues().getMask().longValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtStateCaseValue in project openflowplugin by opendaylight.
the class CtStateConvertorTest method testConvert1.
@Test
public void testConvert1() throws Exception {
final CtStateValuesBuilder ctStateValuesBuilder = new CtStateValuesBuilder().setCtState(3L).setMask(4L);
final CtStateCaseValueBuilder ctStateCaseValueBuilder = new CtStateCaseValueBuilder().setCtStateValues(ctStateValuesBuilder.build());
final CtStateCaseValue ctStateCaseValue = ctStateCaseValueBuilder.build();
when(matchEntry.getMatchEntryValue()).thenReturn(ctStateCaseValue);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = ctStateConvertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
Assert.assertEquals(3L, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxCtState().getCtState().longValue());
Assert.assertEquals(4L, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxCtState().getMask().longValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxCtStateKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = ctStateConvertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
Assert.assertEquals(3L, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmNxCtState().getCtState().longValue());
Assert.assertEquals(4L, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmNxCtState().getMask().longValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxCtStateKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = ctStateConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
Assert.assertEquals(3L, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmNxCtState().getCtState().longValue());
Assert.assertEquals(4L, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmNxCtState().getMask().longValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxCtStateKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = ctStateConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
Assert.assertEquals(3L, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxCtState().getCtState().longValue());
Assert.assertEquals(4L, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxCtState().getMask().longValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxCtStateKey.class);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtStateCaseValue in project openflowplugin by opendaylight.
the class CtStateConvertor method convert.
@Override
public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
CtStateCaseValue ctStateCaseValue = (CtStateCaseValue) input.getMatchEntryValue();
NxmNxCtStateBuilder ctStateBuilder = new NxmNxCtStateBuilder();
ctStateBuilder.setCtState(ctStateCaseValue.getCtStateValues().getCtState());
ctStateBuilder.setMask(ctStateCaseValue.getCtStateValues().getMask());
return resolveAugmentation(ctStateBuilder.build(), path, NxmNxCtStateKey.class);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtStateCaseValue in project openflowplugin by opendaylight.
the class CtStateCodecTest method deserializeTest.
@Test
public void deserializeTest() {
createBuffer(buffer);
input = ctStateCodec.deserialize(buffer);
final CtStateCaseValue result = (CtStateCaseValue) input.getMatchEntryValue();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmNxCtState.class, input.getOxmMatchField());
assertEquals(true, input.isHasMask());
assertEquals(1, result.getCtStateValues().getCtState().intValue());
assertEquals(2, result.getCtStateValues().getMask().intValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtStateCaseValue in project openflowplugin by opendaylight.
the class CtStateCodec method serialize.
@Override
public void serialize(MatchEntry input, ByteBuf outBuffer) {
serializeHeader(input, outBuffer);
CtStateCaseValue ctStateCase = (CtStateCaseValue) input.getMatchEntryValue();
outBuffer.writeInt(ctStateCase.getCtStateValues().getCtState().intValue());
outBuffer.writeInt(ctStateCase.getCtStateValues().getMask().intValue());
}
Aggregations