@Test public void testGetOntologies_doNotSelectActiveOntology() { uut.getOntologies(false); verify(editorGridViewMock).clearAndAdd(null); verify(previewGridViewMock).clearAndAdd(null); verify(viewMock).clearTreeStore(isA(OntologiesView.ViewType.class)); verify(serviceFacadeMock).getOntologies(asyncCallbackOntologyListCaptor.capture()); asyncCallbackOntologyListCaptor.getValue().onSuccess(listOntologyMock); verify(viewMock).showOntologyVersions(eq(listOntologyMock)); verify(viewMock).unmaskTree(isA(OntologiesView.ViewType.class)); verifyNoMoreInteractions(viewMock); }
void getOntologies(final boolean selectActiveOntology) { editorGridPresenter.getView().clearAndAdd(null); previewGridPresenter.getView().clearAndAdd(null); view.clearTreeStore(OntologiesView.ViewType.ALL); serviceFacade.getOntologies(new AsyncCallback<List<Ontology>>() { @Override public void onFailure(Throwable caught) { ErrorHandler.post(caught); view.unmaskTree(OntologiesView.ViewType.EDITOR); } @Override public void onSuccess(List<Ontology> result) { Collections.reverse(result); view.showOntologyVersions(result); view.unmaskTree(OntologiesView.ViewType.EDITOR); if (selectActiveOntology) { for (Ontology ontology : result) { if (ontology.isActive()){ view.selectActiveOntology(ontology); return; } } } } }); }
OntologiesPresenterImpl implements OntologiesView.Presenter,
                                                RefreshOntologiesEvent.RefreshOntologiesEventHandler,
                                                SelectOntologyVersionEvent.SelectOntologyVersionEventHandler,
                                                SaveOntologyHierarchyEvent.SaveOntologyHierarchyEventHandler,
                                                PublishOntologyClickEvent.PublishOntologyClickEventHandler,
                                                HierarchySelectedEvent.HierarchySelectedEventHandler,
                                                PreviewHierarchySelectedEvent.PreviewHierarchySelectedEventHandler,
                                                CategorizeButtonClickedEvent.CategorizeButtonClickedEventHandler,
                                                DeleteOntologyButtonClickedEvent.DeleteOntologyButtonClickedEventHandler,
                                                DeleteHierarchyEvent.DeleteHierarchyEventHandler,
                                                DeleteAppsSelected.DeleteAppsSelectedHandler,
                                                RefreshPreviewButtonClicked.RefreshPreviewButtonClickedHandler,
                                                AppSearchResultLoadEvent.AppSearchResultLoadEventHandler,
                                                RestoreAppButtonClicked.RestoreAppButtonClickedHandler { void getOntologies(final boolean selectActiveOntology) { editorGridPresenter.getView().clearAndAdd(null); previewGridPresenter.getView().clearAndAdd(null); view.clearTreeStore(OntologiesView.ViewType.ALL); serviceFacade.getOntologies(new AsyncCallback<List<Ontology>>() { @Override public void onFailure(Throwable caught) { ErrorHandler.post(caught); view.unmaskTree(OntologiesView.ViewType.EDITOR); } @Override public void onSuccess(List<Ontology> result) { Collections.reverse(result); view.showOntologyVersions(result); view.unmaskTree(OntologiesView.ViewType.EDITOR); if (selectActiveOntology) { for (Ontology ontology : result) { if (ontology.isActive()){ view.selectActiveOntology(ontology); return; } } } } }); } }
OntologiesPresenterImpl implements OntologiesView.Presenter,
                                                RefreshOntologiesEvent.RefreshOntologiesEventHandler,
                                                SelectOntologyVersionEvent.SelectOntologyVersionEventHandler,
                                                SaveOntologyHierarchyEvent.SaveOntologyHierarchyEventHandler,
                                                PublishOntologyClickEvent.PublishOntologyClickEventHandler,
                                                HierarchySelectedEvent.HierarchySelectedEventHandler,
                                                PreviewHierarchySelectedEvent.PreviewHierarchySelectedEventHandler,
                                                CategorizeButtonClickedEvent.CategorizeButtonClickedEventHandler,
                                                DeleteOntologyButtonClickedEvent.DeleteOntologyButtonClickedEventHandler,
                                                DeleteHierarchyEvent.DeleteHierarchyEventHandler,
                                                DeleteAppsSelected.DeleteAppsSelectedHandler,
                                                RefreshPreviewButtonClicked.RefreshPreviewButtonClickedHandler,
                                                AppSearchResultLoadEvent.AppSearchResultLoadEventHandler,
                                                RestoreAppButtonClicked.RestoreAppButtonClickedHandler { void getOntologies(final boolean selectActiveOntology) { editorGridPresenter.getView().clearAndAdd(null); previewGridPresenter.getView().clearAndAdd(null); view.clearTreeStore(OntologiesView.ViewType.ALL); serviceFacade.getOntologies(new AsyncCallback<List<Ontology>>() { @Override public void onFailure(Throwable caught) { ErrorHandler.post(caught); view.unmaskTree(OntologiesView.ViewType.EDITOR); } @Override public void onSuccess(List<Ontology> result) { Collections.reverse(result); view.showOntologyVersions(result); view.unmaskTree(OntologiesView.ViewType.EDITOR); if (selectActiveOntology) { for (Ontology ontology : result) { if (ontology.isActive()){ view.selectActiveOntology(ontology); return; } } } } }); } @Inject  OntologiesPresenterImpl(OntologyServiceFacade serviceFacade,
                                   AppServiceFacade appService,
                                   final TreeStore<OntologyHierarchy> editorTreeStore,
                                   final TreeStore<OntologyHierarchy> previewTreeStore,
                                   OntologiesViewFactory factory,
                                   AvuAutoBeanFactory avuFactory,
                                   OntologiesView.OntologiesViewAppearance appearance,
                                   AdminAppsGridView.Presenter previewGridPresenter,
                                   AdminAppsGridView.Presenter editorGridPresenter,
                                   AppCategorizeView categorizeView); }
OntologiesPresenterImpl implements OntologiesView.Presenter,
                                                RefreshOntologiesEvent.RefreshOntologiesEventHandler,
                                                SelectOntologyVersionEvent.SelectOntologyVersionEventHandler,
                                                SaveOntologyHierarchyEvent.SaveOntologyHierarchyEventHandler,
                                                PublishOntologyClickEvent.PublishOntologyClickEventHandler,
                                                HierarchySelectedEvent.HierarchySelectedEventHandler,
                                                PreviewHierarchySelectedEvent.PreviewHierarchySelectedEventHandler,
                                                CategorizeButtonClickedEvent.CategorizeButtonClickedEventHandler,
                                                DeleteOntologyButtonClickedEvent.DeleteOntologyButtonClickedEventHandler,
                                                DeleteHierarchyEvent.DeleteHierarchyEventHandler,
                                                DeleteAppsSelected.DeleteAppsSelectedHandler,
                                                RefreshPreviewButtonClicked.RefreshPreviewButtonClickedHandler,
                                                AppSearchResultLoadEvent.AppSearchResultLoadEventHandler,
                                                RestoreAppButtonClicked.RestoreAppButtonClickedHandler { void getOntologies(final boolean selectActiveOntology) { editorGridPresenter.getView().clearAndAdd(null); previewGridPresenter.getView().clearAndAdd(null); view.clearTreeStore(OntologiesView.ViewType.ALL); serviceFacade.getOntologies(new AsyncCallback<List<Ontology>>() { @Override public void onFailure(Throwable caught) { ErrorHandler.post(caught); view.unmaskTree(OntologiesView.ViewType.EDITOR); } @Override public void onSuccess(List<Ontology> result) { Collections.reverse(result); view.showOntologyVersions(result); view.unmaskTree(OntologiesView.ViewType.EDITOR); if (selectActiveOntology) { for (Ontology ontology : result) { if (ontology.isActive()){ view.selectActiveOntology(ontology); return; } } } } }); } @Inject  OntologiesPresenterImpl(OntologyServiceFacade serviceFacade,
                                   AppServiceFacade appService,
                                   final TreeStore<OntologyHierarchy> editorTreeStore,
                                   final TreeStore<OntologyHierarchy> previewTreeStore,
                                   OntologiesViewFactory factory,
                                   AvuAutoBeanFactory avuFactory,
                                   OntologiesView.OntologiesViewAppearance appearance,
                                   AdminAppsGridView.Presenter previewGridPresenter,
                                   AdminAppsGridView.Presenter editorGridPresenter,
                                   AppCategorizeView categorizeView); @Override void go(HasOneWidget container); @Override OntologiesView getView(); @Override void appsDNDtoHierarchy(List<App> apps, OntologyHierarchy hierarchy); @Override void hierarchyDNDtoApp(final OntologyHierarchy hierarchy, final App targetApp); @Override void onRefreshOntologies(RefreshOntologiesEvent event); @Override void onSelectOntologyVersion(SelectOntologyVersionEvent event); @Override void onSaveOntologyHierarchy(SaveOntologyHierarchyEvent event); @Override void onCategorizeButtonClicked(CategorizeButtonClickedEvent event); @Override void onPublishOntologyClick(PublishOntologyClickEvent event); @Override void onPreviewHierarchySelected(PreviewHierarchySelectedEvent event); @Override void onHierarchySelected(HierarchySelectedEvent event); @Override OntologyHierarchy getHierarchyFromElement(Element el); @Override OntologyHierarchy getSelectedHierarchy(); @Override Ontology getSelectedOntology(); @Override void onDeleteOntologyButtonClicked(final DeleteOntologyButtonClickedEvent event); @Override void onDeleteHierarchy(final DeleteHierarchyEvent event); @Override void onDeleteAppsSelected(DeleteAppsSelected event); @Override void onRefreshPreviewButtonClicked(RefreshPreviewButtonClicked event); @Override void onAppSearchResultLoad(AppSearchResultLoadEvent event); void onRestoreAppButtonClicked(RestoreAppButtonClicked event); void getTrashItems(); }
OntologiesPresenterImpl implements OntologiesView.Presenter,
                                                RefreshOntologiesEvent.RefreshOntologiesEventHandler,
                                                SelectOntologyVersionEvent.SelectOntologyVersionEventHandler,
                                                SaveOntologyHierarchyEvent.SaveOntologyHierarchyEventHandler,
                                                PublishOntologyClickEvent.PublishOntologyClickEventHandler,
                                                HierarchySelectedEvent.HierarchySelectedEventHandler,
                                                PreviewHierarchySelectedEvent.PreviewHierarchySelectedEventHandler,
                                                CategorizeButtonClickedEvent.CategorizeButtonClickedEventHandler,
                                                DeleteOntologyButtonClickedEvent.DeleteOntologyButtonClickedEventHandler,
                                                DeleteHierarchyEvent.DeleteHierarchyEventHandler,
                                                DeleteAppsSelected.DeleteAppsSelectedHandler,
                                                RefreshPreviewButtonClicked.RefreshPreviewButtonClickedHandler,
                                                AppSearchResultLoadEvent.AppSearchResultLoadEventHandler,
                                                RestoreAppButtonClicked.RestoreAppButtonClickedHandler { void getOntologies(final boolean selectActiveOntology) { editorGridPresenter.getView().clearAndAdd(null); previewGridPresenter.getView().clearAndAdd(null); view.clearTreeStore(OntologiesView.ViewType.ALL); serviceFacade.getOntologies(new AsyncCallback<List<Ontology>>() { @Override public void onFailure(Throwable caught) { ErrorHandler.post(caught); view.unmaskTree(OntologiesView.ViewType.EDITOR); } @Override public void onSuccess(List<Ontology> result) { Collections.reverse(result); view.showOntologyVersions(result); view.unmaskTree(OntologiesView.ViewType.EDITOR); if (selectActiveOntology) { for (Ontology ontology : result) { if (ontology.isActive()){ view.selectActiveOntology(ontology); return; } } } } }); } @Inject  OntologiesPresenterImpl(OntologyServiceFacade serviceFacade,
                                   AppServiceFacade appService,
                                   final TreeStore<OntologyHierarchy> editorTreeStore,
                                   final TreeStore<OntologyHierarchy> previewTreeStore,
                                   OntologiesViewFactory factory,
                                   AvuAutoBeanFactory avuFactory,
                                   OntologiesView.OntologiesViewAppearance appearance,
                                   AdminAppsGridView.Presenter previewGridPresenter,
                                   AdminAppsGridView.Presenter editorGridPresenter,
                                   AppCategorizeView categorizeView); @Override void go(HasOneWidget container); @Override OntologiesView getView(); @Override void appsDNDtoHierarchy(List<App> apps, OntologyHierarchy hierarchy); @Override void hierarchyDNDtoApp(final OntologyHierarchy hierarchy, final App targetApp); @Override void onRefreshOntologies(RefreshOntologiesEvent event); @Override void onSelectOntologyVersion(SelectOntologyVersionEvent event); @Override void onSaveOntologyHierarchy(SaveOntologyHierarchyEvent event); @Override void onCategorizeButtonClicked(CategorizeButtonClickedEvent event); @Override void onPublishOntologyClick(PublishOntologyClickEvent event); @Override void onPreviewHierarchySelected(PreviewHierarchySelectedEvent event); @Override void onHierarchySelected(HierarchySelectedEvent event); @Override OntologyHierarchy getHierarchyFromElement(Element el); @Override OntologyHierarchy getSelectedHierarchy(); @Override Ontology getSelectedOntology(); @Override void onDeleteOntologyButtonClicked(final DeleteOntologyButtonClickedEvent event); @Override void onDeleteHierarchy(final DeleteHierarchyEvent event); @Override void onDeleteAppsSelected(DeleteAppsSelected event); @Override void onRefreshPreviewButtonClicked(RefreshPreviewButtonClicked event); @Override void onAppSearchResultLoad(AppSearchResultLoadEvent event); void onRestoreAppButtonClicked(RestoreAppButtonClicked event); void getTrashItems();  }