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();
}
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");
}
}
Aggregations