DataSetEditor implements IsWidget,
                                                                     DataSetDefEditor<T> { public void init() { view.init(this); view.initWidgets(basicAttributesEditor.view, providerAttributesEditorView, columnsAndFilterEditor.view, previewTable.view, backendCacheAttributesEditor.view, clientCacheAttributesEditor.view, refreshEditor.view); view.addConfigurationTabItemClickHandler(configurationTabItemClickHandler); view.addPreviewTabItemClickHandler(previewTabItemClickHandler); view.addAdvancedTabItemClickHandler(advancedTabItemClickHandler); columnsAndFilterEditor.setMaxHeight("400px"); backendCacheAttributesEditor.setRange(200d, 10000d); clientCacheAttributesEditor.setRange(00d, 4096d); } @Inject  DataSetEditor(final DataSetDefBasicAttributesEditor basicAttributesEditor,
                         final IsWidget providerAttributesEditorView,
                         final DataSetDefColumnsFilterEditor columnsAndFilterEditor,
                         final DataSetDefPreviewTable previewTable,
                         final DataSetDefBackendCacheAttributesEditor backendCacheAttributesEditor,
                         final DataSetDefClientCacheAttributesEditor clientCacheAttributesEditor,
                         final DataSetDefRefreshAttributesEditor refreshEditor,
                         final DataSetClientServices clientServices,
                         final LoadingBox loadingBox,
                         final Event<ErrorEvent> errorEvent,
                         final Event<TabChangedEvent> tabChangedEvent,
                         final View view); void init(); @Override Widget asWidget(); void showConfigurationTab(); void showPreviewTab(); void showAdvancedTab(); @Override void setAcceptableValues(final List<DataColumnDef> acceptableValues); @Override void flush(); @Override void onPropertyChange(final String... paths); @Override void setValue(final T value); @Override void setDelegate(final EditorDelegate<T> delegate); @Override org.dashbuilder.dataset.client.editor.DataSetDefBasicAttributesEditor basicAttributesEditor(); @Override org.dashbuilder.dataset.client.editor.DataSetDefColumnsFilterEditor columnsAndFilterEditor(); @Override DataSetDefBackendCacheAttributesEditor backendCacheEditor(); @Override org.dashbuilder.dataset.client.editor.DataSetDefClientCacheAttributesEditor clientCacheEditor(); @Override org.dashbuilder.dataset.client.editor.DataSetDefRefreshAttributesEditor refreshEditor(); static final String TAB_CONFIGURATION; static final String TAB_PREVIEW; static final String TAB_ADVANCED; public View view; }
@Test public void testInit() { presenter.init(); verify(view, times(1)).init(presenter); verify(view, times(1)).initWidgets( any(DataSetDefBasicAttributesEditor.View.class), any(IsWidget.class), any(DataSetDefColumnsFilterEditor.View.class), any(DataSetDefPreviewTable.View.class), any(DataSetDefCacheAttributesEditorView.class), any(DataSetDefCacheAttributesEditorView.class), any(DataSetDefRefreshAttributesEditor.View.class) ); verify(view, times(1)).addConfigurationTabItemClickHandler(any(Command.class)); verify(view, times(1)).addPreviewTabItemClickHandler(any(Command.class)); verify(view, times(1)).addAdvancedTabItemClickHandler(any(Command.class)); verify(columnsAndFilterEditor, times(1)).setMaxHeight(anyString()); verify(backendCacheAttributesEditor, times(1)).setRange(anyDouble(), anyDouble()); verify(clientCacheAttributesEditor, times(1)).setRange(anyDouble(), anyDouble()); verify(view, times(0)).showConfigurationTab(); verify(view, times(0)).showPreviewTab(); verify(view, times(0)).showAdvancedTab(); verify(view, times(0)).openColumnsFilterPanel(anyString()); verify(view, times(0)).closeColumnsFilterPanel(anyString()); verify(view, times(0)).showErrorNotification(any(SafeHtml.class)); verify(view, times(0)).clearErrorNotification(); }