use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetAsyncInputBuilder in project openflowplugin by opendaylight.
the class SalAsyncConfigServiceImplTest method testGetAsyncTest.
@Test
public void testGetAsyncTest() throws Exception {
final GetAsyncOutput getAsyncOutput = new GetAsyncOutputBuilder().build();
final RpcResult<GetAsyncOutput> replyRpcResult = RpcResultBuilder.success(getAsyncOutput).build();
final ListenableFuture<RpcResult<GetAsyncOutput>> replyFuture = Futures.immediateFuture(replyRpcResult);
Mockito.when(mockedRequestContext.getFuture()).thenReturn(replyFuture);
final Future<RpcResult<GetAsyncOutput>> getAsyncResult = salAsyncConfigService.getAsync(new GetAsyncInputBuilder().build());
Assert.assertNotNull(getAsyncResult);
Assert.assertTrue(getAsyncResult.isDone());
Assert.assertTrue(getAsyncResult.get().isSuccessful());
verify(mockedRequestContextStack).createRequestContext();
verify(mockedOutboundQueue).commitEntry(Matchers.eq(ServiceMocking.DUMMY_XID_VALUE), Matchers.<OfHeader>any(), Matchers.<FutureCallback<OfHeader>>any());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetAsyncInputBuilder in project openflowplugin by opendaylight.
the class GetAsyncRequestMessageFactory method deserialize.
@Override
public GetAsyncInput deserialize(ByteBuf rawMessage) {
GetAsyncInputBuilder builder = new GetAsyncInputBuilder();
builder.setVersion((short) EncodeConstants.OF13_VERSION_ID);
builder.setXid(rawMessage.readUnsignedInt());
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetAsyncInputBuilder in project openflowplugin by opendaylight.
the class GetaAsyncRequestMessageFactoryTest method testGetAsyncReques.
/**
* Testing of {@link GetAsyncRequestMessageFactory} for correct translation from POJO.
*/
@Test
public void testGetAsyncReques() throws Exception {
GetAsyncInputBuilder builder = new GetAsyncInputBuilder();
BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
GetAsyncInput message = builder.build();
ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
getAsyncFactory.serialize(message, out);
BufferHelper.checkHeaderV13(out, MESSAGE_TYPE, MESSAGE_LENGTH);
}
Aggregations