Search in sources :

Example 56 with Result

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.odl.bgp.app.peer.benchmark.rev200120.output.Result in project openflowplugin by opendaylight.

the class OutputRegCodecTest method deserializeTest.

@Test
public void deserializeTest() {
    createBuffer(buffer);
    action = outRegCodec.deserialize(buffer);
    ActionOutputReg result = (ActionOutputReg) action.getActionChoice();
    assertEquals(1, result.getNxActionOutputReg().getNBits().shortValue());
    assertEquals(2, result.getNxActionOutputReg().getSrc().intValue());
    assertEquals(3, result.getNxActionOutputReg().getMaxLen().shortValue());
    assertEquals(0, buffer.readableBytes());
}
Also used : ActionOutputReg(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionOutputReg) Test(org.junit.Test)

Example 57 with Result

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.odl.bgp.app.peer.benchmark.rev200120.output.Result in project openflowplugin by opendaylight.

the class RegMoveCodecTest method deserializeTest.

@Test
public void deserializeTest() {
    createBuffer(buffer);
    action = regMoveCodec.deserialize(buffer);
    ActionRegMove result = (ActionRegMove) action.getActionChoice();
    assertEquals(1, result.getNxActionRegMove().getNBits().shortValue());
    assertEquals(2, result.getNxActionRegMove().getSrcOfs().shortValue());
    assertEquals(3, result.getNxActionRegMove().getDstOfs().shortValue());
    assertEquals(4, result.getNxActionRegMove().getSrc().intValue());
    assertEquals(5, result.getNxActionRegMove().getDst().intValue());
    assertEquals(0, buffer.readableBytes());
}
Also used : ActionRegMove(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionRegMove) Test(org.junit.Test)

Example 58 with Result

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.odl.bgp.app.peer.benchmark.rev200120.output.Result in project openflowplugin by opendaylight.

the class ArpShaCodecTest method deserializeTest.

@Test
public void deserializeTest() {
    createBuffer(buffer);
    input = arpShaCodec.deserialize(buffer);
    final ArpShaCaseValue result = (ArpShaCaseValue) input.getMatchEntryValue();
    assertEquals(Nxm1Class.class, input.getOxmClass());
    assertEquals(NxmNxArpSha.class, input.getOxmMatchField());
    assertEquals(false, input.isHasMask());
    assertEquals(RESULT_ADDRESS, result.getArpShaValues().getMacAddress());
}
Also used : ArpShaCaseValue(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.ArpShaCaseValue) Test(org.junit.Test)

Example 59 with Result

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.odl.bgp.app.peer.benchmark.rev200120.output.Result in project openflowplugin by opendaylight.

the class CtStateCodecTest method deserializeTest.

@Test
public void deserializeTest() {
    createBuffer(buffer);
    input = ctStateCodec.deserialize(buffer);
    final CtStateCaseValue result = (CtStateCaseValue) input.getMatchEntryValue();
    assertEquals(Nxm1Class.class, input.getOxmClass());
    assertEquals(NxmNxCtState.class, input.getOxmMatchField());
    assertEquals(true, input.isHasMask());
    assertEquals(1, result.getCtStateValues().getCtState().intValue());
    assertEquals(2, result.getCtStateValues().getMask().intValue());
}
Also used : CtStateCaseValue(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.CtStateCaseValue) Test(org.junit.Test)

Example 60 with Result

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.odl.bgp.app.peer.benchmark.rev200120.output.Result in project openflowplugin by opendaylight.

the class EthDstCodecTest method deserializeTest.

@Test
public void deserializeTest() {
    createBuffer(buffer);
    input = ethDstCodec.deserialize(buffer);
    final EthDstCaseValue result = (EthDstCaseValue) input.getMatchEntryValue();
    assertEquals(Nxm0Class.class, input.getOxmClass());
    assertEquals(NxmOfEthDst.class, input.getOxmMatchField());
    assertEquals(false, input.isHasMask());
    assertEquals(TEST_ADDRESS, result.getEthDstValues().getMacAddress());
}
Also used : EthDstCaseValue(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.EthDstCaseValue) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)384 RpcResult (org.opendaylight.yangtools.yang.common.RpcResult)212 ArrayList (java.util.ArrayList)136 ExecutionException (java.util.concurrent.ExecutionException)134 ByteBuf (io.netty.buffer.ByteBuf)115 AttributesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.AttributesBuilder)51 Collections (java.util.Collections)50 ObjectHeaderImpl (org.opendaylight.protocol.pcep.spi.ObjectHeaderImpl)47 List (java.util.List)39 RouteAttributeContainer (org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.RouteAttributeContainer)39 Statement (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.routing.policy.rev151009.routing.policy.top.routing.policy.policy.definitions.policy.definition.statements.Statement)39 Uuid (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid)33 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)31 BigInteger (java.math.BigInteger)28 AllocateIdInput (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.AllocateIdInput)28 AllocateIdInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.AllocateIdInputBuilder)28 AllocateIdOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.AllocateIdOutput)27 InstanceIdentifier (org.opendaylight.yangtools.yang.binding.InstanceIdentifier)26 CommitInfo (org.opendaylight.mdsal.common.api.CommitInfo)25 IPV4UNICAST (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.types.rev151009.IPV4UNICAST)25