@Before public void init() throws Exception { super.init(); displayerCoordinator = new DisplayerCoordinator(rendererManager); displayerCoordinator.addListener(displayerListener); i18n = mock(DashboardI18n.class, new Answer() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { return invocation.getMethod().getName() + Arrays.deepToString(invocation.getArguments()); } }); when(getView().getI18nService()).thenReturn(i18n); registerDataset(); }
@Before public void init() throws Exception { super.init(); displayerCoordinator = new DisplayerCoordinator(rendererManager); displayerCoordinator.addListener(displayerListener); i18n = mock(DashboardI18n.class, new Answer() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { return invocation.getMethod().getName() + Arrays.deepToString(invocation.getArguments()); } }); when(getView().getI18nService()).thenReturn(i18n); registerDataset(); }
@Before public void init() throws Exception { super.init(); displayerCoordinator = new DisplayerCoordinator(rendererManager); displayerCoordinator.addListener(displayerListener); doAnswer(new Answer() { public Object answer(InvocationOnMock invocationOnMock) throws Throwable { return initDisplayer(new MetricDisplayer(mock(MetricDisplayer.View.class)), null); } }).when(dashboardFactory).createMetricDisplayer(); doAnswer(new Answer() { public Object answer(InvocationOnMock invocationOnMock) throws Throwable { return initDisplayer(new TableDisplayer(mock(TableDisplayer.View.class)), null); } }).when(dashboardFactory).createTableDisplayer(); i18n = mock(DashboardI18n.class, new Answer() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { return invocation.getMethod().getName() + Arrays.deepToString(invocation.getArguments()); } }); when(getView().getI18nService()).thenReturn(i18n); registerDataset(); }
displayerCoordinator.addDisplayers(chartsGroup); displayerCoordinator.addNotificationVeto(metricsGroup); displayerCoordinator.addListener(dashboardListener); displayerCoordinator.drawAll(() -> view.hideLoading(), () -> view.hideLoading());
@Before public void init() throws Exception { super.init(); when(beanManager.lookupBean(SelectorLabelItem.class)).thenReturn(labelItemBean); when(labelItemBean.newInstance()).thenReturn(labelItem); when(beanManager.lookupBean(SelectorDropDownItem.class)).thenReturn(dropDownItemBean); when(dropDownItemBean.newInstance()).thenReturn(dropDownItem); allRowsDisplayer = createNewDisplayer(allRows); dateSliderDisplayer = createSliderDisplayer(dateSlider); numberSliderDisplayer = createSliderDisplayer(numberSlider); yearLabelDisplayer = createLabelSetDisplayer(yearLabels); cityDropDownDisplayer = createDropDownDisplayer(dropDownCity); deptDropDownDisplayer = createDropDownDisplayer(dropDownDept); displayerCoordinator = new DisplayerCoordinator(rendererManager); displayerCoordinator.addDisplayers(allRowsDisplayer, dateSliderDisplayer, numberSliderDisplayer, yearLabelDisplayer, cityDropDownDisplayer, deptDropDownDisplayer); displayerCoordinator.addListener(listener); }
@Before public void init() throws Exception { super.init(); when(beanManager.lookupBean(SelectorLabelItem.class)).thenReturn(labelItemBean); when(labelItemBean.newInstance()).thenReturn(labelItem); when(beanManager.lookupBean(SelectorDropDownItem.class)).thenReturn(dropDownItemBean); when(dropDownItemBean.newInstance()).thenReturn(dropDownItem); allRowsDisplayer = createNewDisplayer(allRows); dateSliderDisplayer = createSliderDisplayer(dateSlider); numberSliderDisplayer = createSliderDisplayer(numberSlider); yearLabelDisplayer = createLabelSetDisplayer(yearLabels); cityDropDownDisplayer = createDropDownDisplayer(dropDownCity); deptDropDownDisplayer = createDropDownDisplayer(dropDownDept); displayerCoordinator = new DisplayerCoordinator(rendererManager); displayerCoordinator.addDisplayers(allRowsDisplayer, dateSliderDisplayer, numberSliderDisplayer, yearLabelDisplayer, cityDropDownDisplayer, deptDropDownDisplayer); displayerCoordinator.addListener(listener); }
displayerCoordinator.addDisplayers(chartsGroup); displayerCoordinator.addNotificationVeto(metricsGroup); displayerCoordinator.addListener(dashboardListener); displayerCoordinator.drawAll(() -> view.hideLoading(), () -> view.hideLoading());
@Before public void init() throws Exception { super.init(); when(project.getRepository()).thenReturn(repository); when(repository.getAlias()).thenReturn("repo"); when(project.getName()).thenReturn("project1"); when(project.getOrganizationalUnit().getName()).thenReturn("org1"); contributorsDataSet = ContributorsData.INSTANCE.toDataSet(); contributorsDataSet.setUUID(ContributorsDataSets.GIT_CONTRIB); clientDataSetManager.registerDataSet(contributorsDataSet); displayerCoordinator = new DisplayerCoordinator(rendererManager); displayerCoordinator.addListener(displayerListener); metricsFactory = new ProjectMetricsFactory(i18n, displayerLocator); presenter = new ProjectMetricsScreen(view, i18n, metricsFactory, displayerCoordinator); presenter.onStartup(new WorkbenchProjectMetricsEvent(project)); }
@Before public void init() throws Exception { super.init(); allRowsTable = createNewDisplayer(allRows); deptPieChart = createNewDisplayer(byDepartment); deptSelector = createNewDisplayer(byDepartmentSelector); yearBarChart = createNewDisplayer(byYear); quarterPieChart = createNewDisplayer(byQuarter); displayerCoordinator = new DisplayerCoordinator(rendererManager); displayerCoordinator.addDisplayers(allRowsTable, deptPieChart, deptSelector, yearBarChart, quarterPieChart); displayerCoordinator.addListener(listener); }
@Before public void init() throws Exception { super.init(); allRowsTable = createNewDisplayer(allRows); deptPieChart = createNewDisplayer(byDepartment); deptSelector = createNewDisplayer(byDepartmentSelector); yearBarChart = createNewDisplayer(byYear); quarterPieChart = createNewDisplayer(byQuarter); displayerCoordinator = new DisplayerCoordinator(rendererManager); displayerCoordinator.addDisplayers(allRowsTable, deptPieChart, deptSelector, yearBarChart, quarterPieChart); displayerCoordinator.addListener(listener); }
/** * Avoid IndexOutOfBoundsException caused when a filter is notified to * a table consuming the whole data set (no data lookup columns set). */ @Test public void testFullTableFilterEvent() { AbstractDisplayer tableNoColumns = createNewDisplayer( DisplayerSettingsFactory.newTableSettings() .dataset(EXPENSES) .filterOn(true, false, true) .buildSettings()); displayerCoordinator = new DisplayerCoordinator(rendererManager); displayerCoordinator.addDisplayers(deptPieChart, tableNoColumns); displayerCoordinator.addListener(listener); displayerCoordinator.drawAll(); // Click on the "Engineering" slice reset(listener); deptPieChart.filterUpdate(COLUMN_DEPARTMENT, 0); // Check the allRowsTable receives the filter request DataSet dataSet = allRowsTable.getDataSetHandler().getLastDataSet(); assertEquals(dataSet.getRowCount(), 19); verify(listener).onDataLookup(allRowsTable); verify(listener).onRedraw(tableNoColumns); } }
/** * Avoid IndexOutOfBoundsException caused when a filter is notified to * a table consuming the whole data set (no data lookup columns set). */ @Test public void testFullTableFilterEvent() { AbstractDisplayer tableNoColumns = createNewDisplayer( DisplayerSettingsFactory.newTableSettings() .dataset(EXPENSES) .filterOn(true, false, true) .buildSettings()); displayerCoordinator = new DisplayerCoordinator(rendererManager); displayerCoordinator.addDisplayers(deptPieChart, tableNoColumns); displayerCoordinator.addListener(listener); displayerCoordinator.drawAll(); // Click on the "Engineering" slice reset(listener); deptPieChart.filterUpdate(COLUMN_DEPARTMENT, 0); // Check the allRowsTable receives the filter request DataSet dataSet = allRowsTable.getDataSetHandler().getLastDataSet(); assertEquals(dataSet.getRowCount(), 19); verify(listener).onDataLookup(allRowsTable); verify(listener).onRedraw(tableNoColumns); } }
displayerCoordinator.addListener(displayerListener); when(view.getI18nService()).thenReturn(i18n);