use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.Nshc4CaseValue in project openflowplugin by opendaylight.
the class Nshc4ConvertorTest method testConvert1.
@Test
public void testConvert1() throws Exception {
final Nshc4ValuesBuilder nshc4ValuesBuilder = new Nshc4ValuesBuilder().setNshc(Long.valueOf(1));
final Nshc4CaseValueBuilder nshc4CaseValueBuilder = new Nshc4CaseValueBuilder().setNshc4Values(nshc4ValuesBuilder.build());
final Nshc4CaseValue nshc4CaseValue = nshc4CaseValueBuilder.build();
when(matchEntry.getMatchEntryValue()).thenReturn(nshc4CaseValue);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = nshc4Convertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
Assert.assertEquals(1, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxNshc4().getValue().intValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc4Key.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = nshc4Convertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
Assert.assertEquals(1, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmNxNshc4().getValue().intValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc4Key.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = nshc4Convertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
Assert.assertEquals(1, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmNxNshc4().getValue().intValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc4Key.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = nshc4Convertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
Assert.assertEquals(1, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxNshc4().getValue().intValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc4Key.class);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.Nshc4CaseValue in project openflowplugin by opendaylight.
the class Nshc4CodecTest method deserializeTest.
@Test
public void deserializeTest() {
createBuffer(buffer);
input = nshc4Codec.deserialize(buffer);
final Nshc4CaseValue result = (Nshc4CaseValue) input.getMatchEntryValue();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmNxNshc4.class, input.getOxmMatchField());
assertEquals(false, input.isHasMask());
assertEquals(2, result.getNshc4Values().getNshc().intValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.Nshc4CaseValue in project openflowplugin by opendaylight.
the class Nshc4Codec method serialize.
@Override
public void serialize(MatchEntry input, ByteBuf outBuffer) {
serializeHeader(input, outBuffer);
Nshc4CaseValue csc1CaseValue = ((Nshc4CaseValue) input.getMatchEntryValue());
outBuffer.writeInt(csc1CaseValue.getNshc4Values().getNshc().intValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.Nshc4CaseValue in project openflowplugin by opendaylight.
the class Nshc4ConvertorTest method testConvert.
@Test
public void testConvert() throws Exception {
final MatchEntry converted = nshc4Convertor.convert(extension);
Assert.assertEquals(1, ((Nshc4CaseValue) converted.getMatchEntryValue()).getNshc4Values().getNshc().intValue());
}
Aggregations