use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.NsiCaseValue in project openflowplugin by opendaylight.
the class NsiConvertorTest method testConvert1.
@Test
public void testConvert1() throws Exception {
final NsiValuesBuilder nsiValuesBuilder = new NsiValuesBuilder().setNsi(Short.valueOf((short) 1));
final NsiCaseValueBuilder nsiCaseValueBuilder = new NsiCaseValueBuilder().setNsiValues(nsiValuesBuilder.build());
final NsiCaseValue nsiCaseValue = nsiCaseValueBuilder.build();
when(matchEntry.getMatchEntryValue()).thenReturn(nsiCaseValue);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = nsiConvertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
Assert.assertEquals(1, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxNsi().getNsi().intValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNsiKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = nsiConvertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
Assert.assertEquals(1, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmNxNsi().getNsi().intValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNsiKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = nsiConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
Assert.assertEquals(1, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmNxNsi().getNsi().intValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNsiKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = nsiConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
Assert.assertEquals(1, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxNsi().getNsi().intValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNsiKey.class);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.NsiCaseValue in project openflowplugin by opendaylight.
the class NsiCodec method serialize.
@Override
public void serialize(MatchEntry input, ByteBuf outBuffer) {
serializeHeader(input, outBuffer);
NsiCaseValue nsiCaseValue = ((NsiCaseValue) input.getMatchEntryValue());
outBuffer.writeByte(nsiCaseValue.getNsiValues().getNsi());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.NsiCaseValue in project openflowplugin by opendaylight.
the class NsiConvertorTest method testConvert.
@Test
public void testConvert() throws Exception {
final MatchEntry converted = nsiConvertor.convert(extension);
Assert.assertEquals(1, ((NsiCaseValue) converted.getMatchEntryValue()).getNsiValues().getNsi().intValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.NsiCaseValue in project openflowplugin by opendaylight.
the class NsiCodecTest method deserializeTest.
@Test
public void deserializeTest() {
createBuffer(buffer);
input = nsiCodec.deserialize(buffer);
final NsiCaseValue result = (NsiCaseValue) input.getMatchEntryValue();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmNxNsi.class, input.getOxmMatchField());
assertEquals(false, input.isHasMask());
assertEquals(2, result.getNsiValues().getNsi().shortValue());
}
Aggregations