use of org.opendaylight.openflowplugin.impl.rpc.AbstractRequestContext in project openflowplugin by opendaylight.
the class AbstractCompatibleStatServiceTest method setUp.
@Override
public void setUp() {
rqContext = new AbstractRequestContext<Object>(42L) {
@Override
public void close() {
// NOOP
}
};
final Answer closeRequestFutureAnswer = invocation -> {
rqContext.setResult(rpcResult);
rqContext.close();
return null;
};
Mockito.when(featuresOutput.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
Mockito.when(rqContextStack.<Object>createRequestContext()).thenReturn(rqContext);
Mockito.when(deviceContext.getDeviceState()).thenReturn(deviceState);
Mockito.when(deviceContext.getDeviceInfo()).thenReturn(deviceInfo);
Mockito.when(deviceInfo.getNodeId()).thenReturn(NODE_ID);
Mockito.when(deviceInfo.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
Mockito.doAnswer(closeRequestFutureAnswer).when(multiMsgCollector).endCollecting(null);
Mockito.doAnswer(closeRequestFutureAnswer).when(multiMsgCollector).endCollecting(Matchers.any(EventIdentifier.class));
Mockito.doAnswer(answerVoidToCallback).when(outboundQueueProvider).commitEntry(Matchers.eq(42L), requestInput.capture(), Matchers.any(FutureCallback.class));
Mockito.when(translatorLibrary.lookupTranslator(Matchers.any(TranslatorKey.class))).thenReturn(translator);
service = AggregateFlowsInTableService.createWithOook(rqContextStack, deviceContext, new AtomicLong(20L));
}
use of org.opendaylight.openflowplugin.impl.rpc.AbstractRequestContext in project openflowplugin by opendaylight.
the class AbstractRequestCallbackTest method initialization.
@Before
public void initialization() {
dummyRequestContext = new AbstractRequestContext(DUMMY_XID) {
@Override
public void close() {
}
};
abstractRequestCallback = new AbstractRequestCallback(dummyRequestContext, DUMMY_REQUEST_TYPE, new MessageIntelligenceAgencyImpl(), DUMMY_EVENT_IDENTIFIER) {
@Override
public void onSuccess(Object object) {
}
};
}
use of org.opendaylight.openflowplugin.impl.rpc.AbstractRequestContext in project openflowplugin by opendaylight.
the class AbstractSingleStatsServiceTest method init.
@Override
public void init() throws Exception {
super.init();
rqContext = new AbstractRequestContext<Object>(42L) {
@Override
public void close() {
// NOOP
}
};
final Answer closeRequestFutureAnswer = invocation -> {
rqContext.setResult(rpcResult);
rqContext.close();
return null;
};
Mockito.when(rqContextStack.<Object>createRequestContext()).thenReturn(rqContext);
Mockito.doAnswer(closeRequestFutureAnswer).when(multiMsgCollector).endCollecting(null);
Mockito.doAnswer(closeRequestFutureAnswer).when(multiMsgCollector).endCollecting(Matchers.any(EventIdentifier.class));
}
use of org.opendaylight.openflowplugin.impl.rpc.AbstractRequestContext in project openflowplugin by opendaylight.
the class OpendaylightFlowStatisticsServiceImpl1Test method setUp.
public void setUp() {
final ConvertorManager convertorManager = ConvertorManagerFactory.createDefaultManager();
flowStatisticsService = OpendaylightFlowStatisticsServiceImpl.createWithOook(rqContextStack, deviceContext, convertorManager);
AbstractRequestContext<Object> rqContext = new AbstractRequestContext<Object>(42L) {
@Override
public void close() {
// NOOP
}
};
Mockito.when(rqContextStack.<Object>createRequestContext()).thenReturn(rqContext);
}
Aggregations