Search in sources :

Example 6 with BarrierInputBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInputBuilder in project openflowplugin by opendaylight.

the class BarrierInputMessageFactory method deserialize.

@Override
public BarrierInput deserialize(ByteBuf rawMessage) {
    BarrierInputBuilder builder = new BarrierInputBuilder();
    builder.setVersion(getVersion());
    builder.setXid(rawMessage.readUnsignedInt());
    return builder.build();
}
Also used : BarrierInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInputBuilder)

Example 7 with BarrierInputBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInputBuilder in project openflowplugin by opendaylight.

the class ResponseExpectedRpcListenerTest method testCompleted.

/**
 * Test object creation.
 */
@Test
public void testCompleted() {
    RpcResponseKey key = new RpcResponseKey(12345L, BarrierOutput.class.getName());
    ResponseExpectedRpcListener<OfHeader> listener = new ResponseExpectedRpcListener<>("MESSAGE", "Failed to send message", responseCache, key);
    BarrierInputBuilder barrierBuilder = new BarrierInputBuilder();
    BarrierInput barrierInput = barrierBuilder.build();
    listener.completed(barrierInput);
    SettableFuture<RpcResult<?>> result = SettableFuture.create();
    result.set(RpcResultBuilder.success(barrierInput).build());
    try {
        Assert.assertEquals("Wrong result", result.get().getErrors(), listener.getResult().get().getErrors());
        Assert.assertEquals("Wrong result", result.get().getResult(), listener.getResult().get().getResult());
        Assert.assertEquals("Wrong result", result.get().isSuccessful(), listener.getResult().get().isSuccessful());
    } catch (InterruptedException | ExecutionException e) {
        fail("Problem accessing result");
    }
}
Also used : BarrierInput(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInput) OfHeader(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader) BarrierInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInputBuilder) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) ExecutionException(java.util.concurrent.ExecutionException) BarrierOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierOutput) Test(org.junit.Test)

Aggregations

BarrierInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInputBuilder)7 Test (org.junit.Test)4 BarrierInput (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInput)4 ByteBuf (io.netty.buffer.ByteBuf)2 BarrierOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierOutput)2 OfHeader (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader)2 ExecutionException (java.util.concurrent.ExecutionException)1 Nonnull (javax.annotation.Nonnull)1 BarrierOutputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierOutputBuilder)1 RpcResult (org.opendaylight.yangtools.yang.common.RpcResult)1