Search in sources :

Example 1 with TunIdCaseValue

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());
}
Also used : MatchEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry) TunIdCaseValue(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.TunIdCaseValue) Test(org.junit.Test)

Example 2 with TunIdCaseValue

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());
}
Also used : TunIdCaseValue(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.TunIdCaseValue) Test(org.junit.Test)

Example 3 with TunIdCaseValue

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);
}
Also used : Extension(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.Extension) NxAugMatchNotifSwitchFlowRemoved(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNotifSwitchFlowRemoved) NxAugMatchNodesNodeTableFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlow) TunIdCaseValueBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.TunIdCaseValueBuilder) TunIdValuesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.tun.id.grouping.TunIdValuesBuilder) NxAugMatchRpcGetFlowStats(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchRpcGetFlowStats) TunIdCaseValue(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.TunIdCaseValue) NxAugMatchNotifPacketIn(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNotifPacketIn) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 TunIdCaseValue (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.TunIdCaseValue)3 MatchEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry)1 TunIdValuesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.tun.id.grouping.TunIdValuesBuilder)1 TunIdCaseValueBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.TunIdCaseValueBuilder)1 Extension (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.Extension)1 NxAugMatchNodesNodeTableFlow (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlow)1 NxAugMatchNotifPacketIn (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNotifPacketIn)1 NxAugMatchNotifSwitchFlowRemoved (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNotifSwitchFlowRemoved)1 NxAugMatchRpcGetFlowStats (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchRpcGetFlowStats)1