use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.KnockKnockOutput in project controller by opendaylight.
the class CrossBrokerRpcTest method knockResult.
private Future<RpcResult<KnockKnockOutput>> knockResult(final boolean success, final String answer) {
KnockKnockOutput output = //
new KnockKnockOutputBuilder().setAnswer(answer).build();
RpcResult<KnockKnockOutput> result = RpcResultBuilder.<KnockKnockOutput>status(success).withResult(output).build();
return Futures.immediateFuture(result);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.of.migration.test.model.rev150210.KnockKnockOutput in project controller by opendaylight.
the class CrossBrokerRpcTest method bindingRpcInvoker_DomRoutedProviderTest.
@Test
public void bindingRpcInvoker_DomRoutedProviderTest() throws Exception {
KnockKnockOutputBuilder builder = new KnockKnockOutputBuilder();
builder.setAnswer("open");
final KnockKnockOutput output = builder.build();
provisionRegistry.registerRpcImplementation((rpc, input) -> {
ContainerNode result = testContext.getCodec().getCodecFactory().toNormalizedNodeRpcData(output);
return Futures.immediateCheckedFuture(new DefaultDOMRpcResult(result));
}, DOMRpcIdentifier.create(KNOCK_KNOCK_PATH, BI_NODE_C_ID));
OpendaylightOfMigrationTestModelService baKnockInvoker = providerRegistry.getRpcService(OpendaylightOfMigrationTestModelService.class);
Future<RpcResult<KnockKnockOutput>> baResult = baKnockInvoker.knockKnock((knockKnock(BA_NODE_C_ID).setQuestion("Who's there?").build()));
assertNotNull(baResult);
assertEquals(output, baResult.get().getResult());
}
Aggregations