Search in sources :

Example 1 with RegCaseValue

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

the class Reg5CodecTest method deserializeTest.

@Test
public void deserializeTest() {
    createBuffer(buffer);
    input = reg5Codec.deserialize(buffer);
    final RegCaseValue result = (RegCaseValue) input.getMatchEntryValue();
    assertEquals(Nxm1Class.class, input.getOxmClass());
    assertEquals(NxmNxReg5.class, input.getOxmMatchField());
    assertEquals(false, input.isHasMask());
    assertEquals(1, result.getRegValues().getValue().intValue());
}
Also used : RegCaseValue(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.RegCaseValue) Test(org.junit.Test)

Example 2 with RegCaseValue

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

the class RegConvertor method convert.

@SuppressWarnings("unchecked")
@Override
public ExtensionAugment<? extends Augmentation<Extension>> convert(MatchEntry input, MatchPath path) {
    NxmNxRegBuilder nxRegBuilder = new NxmNxRegBuilder();
    if (!org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg.class.isAssignableFrom(input.getOxmMatchField())) {
        String msg = input.getOxmMatchField() + " does not implement " + org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg.class;
        LOG.warn(msg);
        throw new IllegalStateException(msg);
    }
    nxRegBuilder.setReg((Class<? extends org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg>) input.getOxmMatchField());
    RegCaseValue regCaseValue = (RegCaseValue) input.getMatchEntryValue();
    nxRegBuilder.setValue(regCaseValue.getRegValues().getValue());
    if (input.isHasMask()) {
        nxRegBuilder.setMask(regCaseValue.getRegValues().getMask());
    }
    return resolveAugmentation(nxRegBuilder.build(), path, resolveRegKey(input.getOxmMatchField()));
}
Also used : NxmNxReg(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.reg.grouping.NxmNxReg) RegCaseValue(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.RegCaseValue) NxmNxRegBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.reg.grouping.NxmNxRegBuilder)

Example 3 with RegCaseValue

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

the class Reg0CodecTest method deserializeTest.

@Test
public void deserializeTest() {
    createBuffer(buffer);
    input = reg0Codec.deserialize(buffer);
    final RegCaseValue result = (RegCaseValue) input.getMatchEntryValue();
    assertEquals(Nxm1Class.class, input.getOxmClass());
    assertEquals(NxmNxReg0.class, input.getOxmMatchField());
    assertEquals(false, input.isHasMask());
    assertEquals(1, result.getRegValues().getValue().intValue());
}
Also used : RegCaseValue(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.RegCaseValue) Test(org.junit.Test)

Example 4 with RegCaseValue

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

the class Reg6CodecTest method deserializeTest.

@Test
public void deserializeTest() {
    createBuffer(buffer);
    input = reg6Codec.deserialize(buffer);
    final RegCaseValue result = (RegCaseValue) input.getMatchEntryValue();
    assertEquals(Nxm1Class.class, input.getOxmClass());
    assertEquals(NxmNxReg6.class, input.getOxmMatchField());
    assertEquals(false, input.isHasMask());
    assertEquals(1, result.getRegValues().getValue().intValue());
}
Also used : RegCaseValue(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.RegCaseValue) Test(org.junit.Test)

Example 5 with RegCaseValue

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

the class Reg3CodecTest method deserializeTest.

@Test
public void deserializeTest() {
    createBuffer(buffer);
    input = reg3Codec.deserialize(buffer);
    final RegCaseValue result = (RegCaseValue) input.getMatchEntryValue();
    assertEquals(Nxm1Class.class, input.getOxmClass());
    assertEquals(NxmNxReg3.class, input.getOxmMatchField());
    assertEquals(false, input.isHasMask());
    assertEquals(1, result.getRegValues().getValue().intValue());
}
Also used : RegCaseValue(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.RegCaseValue) Test(org.junit.Test)

Aggregations

RegCaseValue (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.RegCaseValue)10 Test (org.junit.Test)8 NxmNxReg (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.reg.grouping.NxmNxReg)1 NxmNxRegBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.nxm.nx.reg.grouping.NxmNxRegBuilder)1