Search in sources :

Example 1 with Nshc1CaseValue

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.Nshc1CaseValue in project openflowplugin by opendaylight.

the class Nshc1ConvertorTest method testConvert.

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

Example 2 with Nshc1CaseValue

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.Nshc1CaseValue in project openflowplugin by opendaylight.

the class Nshc1Codec method serialize.

@Override
public void serialize(MatchEntry input, ByteBuf outBuffer) {
    serializeHeader(input, outBuffer);
    Nshc1CaseValue csc1CaseValue = ((Nshc1CaseValue) input.getMatchEntryValue());
    outBuffer.writeInt(csc1CaseValue.getNshc1Values().getNshc().intValue());
}
Also used : Nshc1CaseValue(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.Nshc1CaseValue)

Example 3 with Nshc1CaseValue

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.Nshc1CaseValue in project openflowplugin by opendaylight.

the class Nshc1ConvertorTest method testConvert1.

@Test
public void testConvert1() throws Exception {
    final Nshc1ValuesBuilder nshc1ValuesBuilder = new Nshc1ValuesBuilder().setNshc(Long.valueOf(1));
    final Nshc1CaseValueBuilder nshc1CaseValueBuilder = new Nshc1CaseValueBuilder().setNshc1Values(nshc1ValuesBuilder.build());
    final Nshc1CaseValue nshc1CaseValue = nshc1CaseValueBuilder.build();
    when(matchEntry.getMatchEntryValue()).thenReturn(nshc1CaseValue);
    final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment = nshc1Convertor.convert(matchEntry, MatchPath.PACKET_RECEIVED_MATCH);
    Assert.assertEquals(1, ((NxAugMatchNotifPacketIn) extensionAugment.getAugmentationObject()).getNxmNxNshc1().getValue().intValue());
    Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc1Key.class);
    final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment1 = nshc1Convertor.convert(matchEntry, MatchPath.SWITCH_FLOW_REMOVED_MATCH);
    Assert.assertEquals(1, ((NxAugMatchNotifSwitchFlowRemoved) extensionAugment1.getAugmentationObject()).getNxmNxNshc1().getValue().intValue());
    Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc1Key.class);
    final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment2 = nshc1Convertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_UPDATE_MATCH);
    Assert.assertEquals(1, ((NxAugMatchNodesNodeTableFlow) extensionAugment2.getAugmentationObject()).getNxmNxNshc1().getValue().intValue());
    Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc1Key.class);
    final ExtensionAugment<? extends Augmentation<Extension>> extensionAugment3 = nshc1Convertor.convert(matchEntry, MatchPath.FLOWS_STATISTICS_RPC_MATCH);
    Assert.assertEquals(1, ((NxAugMatchRpcGetFlowStats) extensionAugment3.getAugmentationObject()).getNxmNxNshc1().getValue().intValue());
    Assert.assertEquals(extensionAugment.getKey(), NxmNxNshc1Key.class);
}
Also used : Extension(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.Extension) Nshc1CaseValue(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.Nshc1CaseValue) Nshc1CaseValueBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.Nshc1CaseValueBuilder) Nshc1ValuesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.nshc._1.grouping.Nshc1ValuesBuilder) Test(org.junit.Test)

Example 4 with Nshc1CaseValue

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.Nshc1CaseValue in project openflowplugin by opendaylight.

the class Nshc1CodecTest method deserializeTest.

@Test
public void deserializeTest() {
    createBuffer(buffer);
    input = nshc1Codec.deserialize(buffer);
    final Nshc1CaseValue result = (Nshc1CaseValue) input.getMatchEntryValue();
    assertEquals(Nxm1Class.class, input.getOxmClass());
    assertEquals(NxmNxNshc1.class, input.getOxmMatchField());
    assertEquals(false, input.isHasMask());
    assertEquals(2, result.getNshc1Values().getNshc().intValue());
}
Also used : Nshc1CaseValue(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.Nshc1CaseValue) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 Nshc1CaseValue (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.Nshc1CaseValue)3 MatchEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry)1 Nshc1ValuesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.ofj.nxm.nx.match.nshc._1.grouping.Nshc1ValuesBuilder)1 Nshc1CaseValueBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.Nshc1CaseValueBuilder)1 Extension (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.Extension)1