use of edu.stanford.bmir.protege.web.client.metrics.MetricsPresenter in project webprotege by protegeproject.
the class MetricsPresenterTestCase method setUp.
// @Before
public void setUp() {
doAnswer(new Answer<Void>() {
@Override
public Void answer(InvocationOnMock invocationOnMock) throws Throwable {
DispatchServiceCallback<GetMetricsResult> action = (DispatchServiceCallback<GetMetricsResult>) invocationOnMock.getArguments()[1];
action.onSuccess(result);
return null;
}
}).when(dispatchServiceManager).execute(any(GetMetricsAction.class), any(DispatchServiceCallback.class));
doAnswer(new Answer<Void>() {
@Override
public Void answer(InvocationOnMock invocationOnMock) throws Throwable {
handler = (RequestRefreshEventHandler) invocationOnMock.getArguments()[0];
return null;
}
}).when(view).setRequestRefreshEventHandler(any(RequestRefreshEventHandler.class));
when(result.getMetricValues()).thenReturn(metricValues);
doAnswer(new Answer<Void>() {
@Override
public Void answer(InvocationOnMock invocationOnMock) throws Throwable {
metricsChangedHandler = (MetricsChangedHandler) invocationOnMock.getArguments()[0];
return null;
}
}).when(eventManager).addProjectEventHandler(eq(projectId), any(MetricsChangedEvent.getType().getClass()), any(MetricsChangedHandler.class));
presenter = new MetricsPresenter(projectId, view, dispatchServiceManager);
presenter.start();
}
Aggregations