use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.TunIdCaseValue in project openflowplugin by opendaylight.
the class TunIdConvertorTest method testConvert.
@Test
public void testConvert() throws Exception {
final MatchEntry converted = tunIdConvertor.convert(extension);
Assert.assertEquals(BigInteger.ONE, ((TunIdCaseValue) converted.getMatchEntryValue()).getTunIdValues().getValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.TunIdCaseValue in project openflowplugin by opendaylight.
the class TunIdCodecTest method deserializeTest.
@Test
public void deserializeTest() {
createBuffer(buffer);
input = tunIdCodec.deserialize(buffer);
final TunIdCaseValue result = (TunIdCaseValue) input.getMatchEntryValue();
assertEquals(Nxm1Class.class, input.getOxmClass());
assertEquals(NxmNxTunId.class, input.getOxmMatchField());
assertEquals(false, input.isHasMask());
assertEquals(0, result.getTunIdValues().getValue().longValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.TunIdCaseValue in project openflowplugin by opendaylight.
the class TunIdConvertorTest method testConvert1.
@Test
public void testConvert1() throws Exception {
final TunIdValuesBuilder tunIdValuesBuilder = new TunIdValuesBuilder().setValue(BigInteger.TEN);
final TunIdCaseValueBuilder tunIdCaseValueBuilder = new TunIdCaseValueBuilder().setTunIdValues(tunIdValuesBuilder.build());
final TunIdCaseValue tunIdCaseValue = tunIdCaseValueBuilder.build();
when(matchEntry.getMatchEntryValue()).thenReturn(tunIdCaseValue);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = tunIdConvertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
Assert.assertEquals(BigInteger.TEN, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxTunId().getValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxTunIdKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = tunIdConvertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
Assert.assertEquals(BigInteger.TEN, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmNxTunId().getValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxTunIdKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = tunIdConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
Assert.assertEquals(BigInteger.TEN, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmNxTunId().getValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxTunIdKey.class);
final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = tunIdConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
Assert.assertEquals(BigInteger.TEN, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxTunId().getValue());
Assert.assertEquals(extensionAugment.getKey(), NxmNxTunIdKey.class);
}
Aggregations