use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.NspCaseValue in project openflowplugin by opendaylight.
the class NspConvertorTest method testConvert.
@Test
public void testConvert() throws Exception {
final MatchEntry converted = nspConvertor.convert(extension);
Assert.assertEquals(1, ((NspCaseValue) converted.getMatchEntryValue()).getNspValues().getNsp().intValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.NspCaseValue in project openflowplugin by opendaylight.
the class NspCodec method serialize.
@Override
public void serialize(MatchEntry input, ByteBuf outBuffer) {
serializeHeader(input, outBuffer);
NspCaseValue nspCaseValue = ((NspCaseValue) input.getMatchEntryValue());
outBuffer.writeInt(nspCaseValue.getNspValues().getNsp().intValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.NspCaseValue in project openflowplugin by opendaylight.
the class NspCodecTest method deserializeTest.
@Test
public void deserializeTest() {
createBuffer(buffer);
input = nspCodec.deserialize(buffer);
final NspCaseValue result = (NspCaseValue) input.getMatchEntryValue();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmNxNsp.class, input.getOxmMatchField());
assertEquals(false, input.isHasMask());
assertEquals(2, result.getNspValues().getNsp().intValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.NspCaseValue in project openflowplugin by opendaylight.
the class NspConvertorTest method testConvert1.
@Test
public void testConvert1() throws Exception {
final NspValuesBuilder nspValuesBuilder = new NspValuesBuilder().setNsp(Long.valueOf(2L));
final NspCaseValueBuilder nspCaseValueBuilder = new NspCaseValueBuilder().setNspValues(nspValuesBuilder.build());
final NspCaseValue nspCaseValue = nspCaseValueBuilder.build();
when(matchEntry.getMatchEntryValue()).thenReturn(nspCaseValue);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = nspConvertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
Assert.assertEquals(2, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxNsp().getValue().longValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNspKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = nspConvertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
Assert.assertEquals(2, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmNxNsp().getValue().longValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNspKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = nspConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
Assert.assertEquals(2, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmNxNsp().getValue().longValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNspKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = nspConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
Assert.assertEquals(2, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxNsp().getValue().longValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNspKey.class);
}
Aggregations