Search in sources :

Example 1 with SendExperimenterMpRequestInputBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.mp.message.service.rev151020.SendExperimenterMpRequestInputBuilder in project openflowplugin by opendaylight.

the class SalExperimenterMpMessageServiceImplTest method sendExperimenterMpRequest.

@Test
public void sendExperimenterMpRequest() throws Exception {
    final SendExperimenterMpRequestInput data = new SendExperimenterMpRequestInputBuilder().setExperimenterMessageOfChoice(mockExperimenter()).setNode(new NodeRef(mockedDeviceInfo.getNodeInstanceIdentifier())).build();
    salExperimenterMpMessageService.sendExperimenterMpRequest(data);
    verify(mockedRequestContextStack).createRequestContext();
}
Also used : SendExperimenterMpRequestInput(org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.mp.message.service.rev151020.SendExperimenterMpRequestInput) NodeRef(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef) SendExperimenterMpRequestInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.mp.message.service.rev151020.SendExperimenterMpRequestInputBuilder) Test(org.junit.Test)

Example 2 with SendExperimenterMpRequestInputBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.mp.message.service.rev151020.SendExperimenterMpRequestInputBuilder in project openflowplugin by opendaylight.

the class SingleLayerExperimenterMultipartServiceTest method handleAndReply.

@Test
public void handleAndReply() throws Exception {
    mockSuccessfulFuture(Collections.singletonList(new MultipartReplyBuilder().setMultipartReplyBody(new MultipartReplyExperimenterBuilder().setExperimenterMessageOfChoice(mockExperimenter()).build()).build()));
    final SendExperimenterMpRequestInput input = new SendExperimenterMpRequestInputBuilder().setExperimenterMessageOfChoice(mockExperimenter()).build();
    final Future<RpcResult<SendExperimenterMpRequestOutput>> rpcResultFuture = service.handleAndReply(input);
    final RpcResult<SendExperimenterMpRequestOutput> sendExperimenterMpRequestOutputRpcResult = rpcResultFuture.get();
    assertEquals(DummyExperimenter.class, sendExperimenterMpRequestOutputRpcResult.getResult().getExperimenterCoreMessageItem().get(0).getExperimenterMessageOfChoice().getImplementedInterface());
}
Also used : SendExperimenterMpRequestInput(org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.mp.message.service.rev151020.SendExperimenterMpRequestInput) SendExperimenterMpRequestInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.mp.message.service.rev151020.SendExperimenterMpRequestInputBuilder) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) MultipartReplyBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.MultipartReplyBuilder) SendExperimenterMpRequestOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.mp.message.service.rev151020.SendExperimenterMpRequestOutput) MultipartReplyExperimenterBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.experimenter.types.rev151020.multipart.reply.multipart.reply.body.MultipartReplyExperimenterBuilder) Test(org.junit.Test)

Example 3 with SendExperimenterMpRequestInputBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.mp.message.service.rev151020.SendExperimenterMpRequestInputBuilder in project openflowplugin by opendaylight.

the class SingleLayerExperimenterMultipartServiceTest method buildRequest.

@Test
public void buildRequest() throws Exception {
    final SendExperimenterMpRequestInput input = new SendExperimenterMpRequestInputBuilder().setExperimenterMessageOfChoice(mockExperimenter()).build();
    final OfHeader ofHeader = service.buildRequest(DUMMY_XID, input);
    assertEquals(MultipartRequest.class, ofHeader.getImplementedInterface());
    final MultipartRequestExperimenter result = MultipartRequestExperimenter.class.cast(MultipartRequest.class.cast(ofHeader).getMultipartRequestBody());
    assertEquals(DummyExperimenter.class, result.getExperimenterMessageOfChoice().getImplementedInterface());
}
Also used : SendExperimenterMpRequestInput(org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.mp.message.service.rev151020.SendExperimenterMpRequestInput) SendExperimenterMpRequestInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.mp.message.service.rev151020.SendExperimenterMpRequestInputBuilder) MultipartRequestExperimenter(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.experimenter.types.rev151020.multipart.request.multipart.request.body.MultipartRequestExperimenter) OfHeader(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 SendExperimenterMpRequestInput (org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.mp.message.service.rev151020.SendExperimenterMpRequestInput)3 SendExperimenterMpRequestInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.mp.message.service.rev151020.SendExperimenterMpRequestInputBuilder)3 SendExperimenterMpRequestOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.mp.message.service.rev151020.SendExperimenterMpRequestOutput)1 NodeRef (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef)1 MultipartReplyBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.MultipartReplyBuilder)1 OfHeader (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader)1 MultipartReplyExperimenterBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.experimenter.types.rev151020.multipart.reply.multipart.reply.body.MultipartReplyExperimenterBuilder)1 MultipartRequestExperimenter (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.experimenter.types.rev151020.multipart.request.multipart.request.body.MultipartRequestExperimenter)1 RpcResult (org.opendaylight.yangtools.yang.common.RpcResult)1