Search in sources :

Example 36 with MatchEntry

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry in project openflowplugin by opendaylight.

the class EthTypeConvertorTest method testConvert.

@Test
public void testConvert() throws Exception {
    final MatchEntry converted = ethTypeConvertor.convert(extension);
    Assert.assertEquals(1, ((EthTypeCaseValue) converted.getMatchEntryValue()).getEthTypeValues().getValue().intValue());
}
Also used : MatchEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry) Test(org.junit.Test)

Example 37 with MatchEntry

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry in project openflowplugin by opendaylight.

the class EthTypeConvertorTest method testConvert1.

@Test
public void testConvert1() throws Exception {
    final EthTypeValuesBuilder ethTypeValuesBuilder = new EthTypeValuesBuilder().setValue(Integer.valueOf(1));
    final EthTypeCaseValueBuilder ethTypeCaseValueBuilder = new EthTypeCaseValueBuilder().setEthTypeValues(ethTypeValuesBuilder.build());
    final EthTypeCaseValue ethTypeCaseValue = ethTypeCaseValueBuilder.build();
    when(matchEntry.getMatchEntryValue()).thenReturn(ethTypeCaseValue);
    final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = ethTypeConvertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
    Assert.assertEquals(1, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmOfEthType().getValue().intValue());
    Assert.assertEquals(extensionAugment.getKey(), NxmOfEthTypeKey.class);
    final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = ethTypeConvertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
    Assert.assertEquals(1, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmOfEthType().getValue().intValue());
    Assert.assertEquals(extensionAugment.getKey(), NxmOfEthTypeKey.class);
    final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = ethTypeConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
    Assert.assertEquals(1, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmOfEthType().getValue().intValue());
    Assert.assertEquals(extensionAugment.getKey(), NxmOfEthTypeKey.class);
    final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = ethTypeConvertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
    Assert.assertEquals(1, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmOfEthType().getValue().intValue());
    Assert.assertEquals(extensionAugment.getKey(), NxmOfEthTypeKey.class);
}
Also used : EthTypeCaseValue(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.EthTypeCaseValue) Extension(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.Extension) EthTypeValuesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.of.match.eth.type.grouping.EthTypeValuesBuilder) EthTypeCaseValueBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.EthTypeCaseValueBuilder) Test(org.junit.Test)

Example 38 with MatchEntry

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry in project openflowplugin by opendaylight.

the class Nshc2ConvertorTest method testConvert1.

@Test
public void testConvert1() throws Exception {
    final Nshc2ValuesBuilder nshc2ValuesBuilder = new Nshc2ValuesBuilder().setNshc(Long.valueOf(1));
    final Nshc2CaseValueBuilder nshc2CaseValueBuilder = new Nshc2CaseValueBuilder().setNshc2Values(nshc2ValuesBuilder.build());
    final Nshc2CaseValue nshc2CaseValue = nshc2CaseValueBuilder.build();
    when(matchEntry.getMatchEntryValue()).thenReturn(nshc2CaseValue);
    final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = nshc2Convertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
    Assert.assertEquals(1, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxNshc2().getValue().intValue());
    Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc2Key.class);
    final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = nshc2Convertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
    Assert.assertEquals(1, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmNxNshc2().getValue().intValue());
    Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc2Key.class);
    final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = nshc2Convertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
    Assert.assertEquals(1, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmNxNshc2().getValue().intValue());
    Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc2Key.class);
    final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = nshc2Convertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
    Assert.assertEquals(1, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxNshc2().getValue().intValue());
    Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc2Key.class);
}
Also used : Nshc2CaseValueBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.Nshc2CaseValueBuilder) Extension(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.Extension) Nshc2CaseValue(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.Nshc2CaseValue) Nshc2ValuesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.nshc._2.grouping.Nshc2ValuesBuilder) Test(org.junit.Test)

Example 39 with MatchEntry

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry 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);
}
Also used : Extension(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.Extension) Nshc4CaseValueBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.Nshc4CaseValueBuilder) Nshc4ValuesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.nshc._4.grouping.Nshc4ValuesBuilder) Nshc4CaseValue(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.Nshc4CaseValue) Test(org.junit.Test)

Example 40 with MatchEntry

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry 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());
}
Also used : MatchEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry) Test(org.junit.Test)

Aggregations

MatchEntryBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder)207 MatchEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry)127 Test (org.junit.Test)112 ArrayList (java.util.ArrayList)70 MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder)33 CodecPreconditionException (org.opendaylight.openflowplugin.extension.vendor.nicira.convertor.CodecPreconditionException)32 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)30 BigInteger (java.math.BigInteger)29 ByteBuf (io.netty.buffer.ByteBuf)26 Extension (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.Extension)26 Ipv4Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address)24 ActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.ActionBuilder)21 List (java.util.List)20 VersionDatapathIdConvertorData (org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.VersionDatapathIdConvertorData)20 SetFieldActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.set.field._case.SetFieldActionBuilder)19 Match (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.Match)19 MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder)17 SetFieldCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.action.grouping.action.choice.SetFieldCaseBuilder)16 Ipv6Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address)15 IpMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.IpMatchBuilder)15