Search in sources :

Example 51 with Result

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcrep.message.pcrep.message.replies.Result in project openflowplugin by opendaylight.

the class ResubmitCodecTest method getSubTypeTest2.

/**
 * If table != null or table != OFP_TABLE_ALL
 * SUBTYPE should be set to NXAST_RESUBMIT_TABLE_SUBTYPE.
 */
@Test
public void getSubTypeTest2() {
    Byte table = new Byte((byte) 1);
    action = createAction(null, table);
    ActionResubmit actionResubmit = (ActionResubmit) action.getActionChoice();
    byte result = resubmitCodec.getSubType(actionResubmit);
    assertEquals(NXAST_RESUBMIT_TABLE_SUBTYPE, result);
}
Also used : ActionResubmit(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionResubmit) Test(org.junit.Test)

Example 52 with Result

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcrep.message.pcrep.message.replies.Result in project openflowplugin by opendaylight.

the class ResubmitCodecTest method deserializeTest.

@Test
public void deserializeTest() {
    createBuffer(buffer);
    action = resubmitCodec.deserialize(buffer);
    ActionResubmit result = (ActionResubmit) action.getActionChoice();
    assertEquals(1, result.getNxActionResubmit().getInPort().intValue());
    assertEquals(2, result.getNxActionResubmit().getTable().byteValue());
    assertEquals(0, buffer.readableBytes());
}
Also used : ActionResubmit(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.action.container.action.choice.ActionResubmit) Test(org.junit.Test)

Example 53 with Result

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcrep.message.pcrep.message.replies.Result in project openflowplugin by opendaylight.

the class ArpOpCodecTest method deserializeTest.

@Test
public void deserializeTest() {
    createBuffer(buffer);
    input = arpOpCodec.deserialize(buffer);
    final ArpOpCaseValue result = (ArpOpCaseValue) input.getMatchEntryValue();
    assertEquals(Nxm0Class.class, input.getOxmClass());
    assertEquals(NxmOfArpOp.class, input.getOxmMatchField());
    assertEquals(false, input.isHasMask());
    assertEquals(2, result.getArpOpValues().getValue().shortValue());
}
Also used : ArpOpCaseValue(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.ArpOpCaseValue) Test(org.junit.Test)

Example 54 with Result

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcrep.message.pcrep.message.replies.Result in project openflowplugin by opendaylight.

the class ArpSpaCodecTest method deserializeTest.

@Test
public void deserializeTest() {
    createBuffer(buffer);
    input = arpSpaCodec.deserialize(buffer);
    final ArpSpaCaseValue result = (ArpSpaCaseValue) input.getMatchEntryValue();
    assertEquals(Nxm0Class.class, input.getOxmClass());
    assertEquals(NxmOfArpSpa.class, input.getOxmMatchField());
    assertEquals(false, input.isHasMask());
    assertEquals(2, result.getArpSpaValues().getValue().shortValue());
}
Also used : ArpSpaCaseValue(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.ArpSpaCaseValue) Test(org.junit.Test)

Example 55 with Result

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcrep.message.pcrep.message.replies.Result in project openflowplugin by opendaylight.

the class ArpTpaCodecTest method deserializeTest.

@Test
public void deserializeTest() {
    createBuffer(buffer);
    input = arpTpaCodec.deserialize(buffer);
    final ArpTpaCaseValue result = (ArpTpaCaseValue) input.getMatchEntryValue();
    assertEquals(Nxm0Class.class, input.getOxmClass());
    assertEquals(NxmOfArpTpa.class, input.getOxmMatchField());
    assertEquals(false, input.isHasMask());
    assertEquals(2, result.getArpTpaValues().getValue().intValue());
}
Also used : ArpTpaCaseValue(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.oxm.container.match.entry.value.ArpTpaCaseValue) 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