@Test public void testAutomaticModuleBuildDisabled() { final OrganizationalUnit ou = mock(OrganizationalUnit.class); final Repository repository = mock(Repository.class); final Module module = mock(Module.class); ApplicationPreferences.setUp(new HashMap<String, String>() {{ put(ExplorerService.BUILD_PROJECT_PROPERTY_NAME, "true"); }}); when(activeContextItems.setupActiveModule(content)).thenReturn(true); final WorkspaceProject project = mock(WorkspaceProject.class); when(project.getOrganizationalUnit()).thenReturn(ou); when(project.getRepository()).thenReturn(repository); when(project.getBranch()).thenReturn(new Branch("master", mock(Path.class))); when(activeContextItems.getActiveProject()).thenReturn(project); when(activeContextItems.getActiveModule()).thenReturn(module); presenter.doContentCallback(content); verify(buildServiceActual, never()).build(any(Module.class)); }
void doContentCallback(final ProjectExplorerContent content) { boolean buildSelectedModule = false; boolean signalChange = false; if (activeContextItems.setupActiveProject(content)) { signalChange = true; } if (activeContextItems.setupActiveModule(content)) { signalChange = true; buildSelectedModule = true; } boolean folderChange = activeContextItems.setupActiveFolderAndPackage( content); if (signalChange || folderChange) { activeContextItems.fireContextChangeEvent(); } if (buildSelectedModule) { buildModule(activeContextItems.getActiveModule()); } setActiveContent(content.getFolderListing()); baseView.getExplorer() .clear(); baseView.setContent(activeContextItems.getActiveModule(), activeContextItems.getActiveContent(), content.getSiblings()); if (activeContextItems.getActiveFolderItem() == null) { activeContextItems.setupActiveFolderAndPackage(content); } baseView.hideBusyIndicator(); }
BaseViewPresenter { void doContentCallback(final ProjectExplorerContent content) { boolean buildSelectedModule = false; boolean signalChange = false; if (activeContextItems.setupActiveProject(content)) { signalChange = true; } if (activeContextItems.setupActiveModule(content)) { signalChange = true; buildSelectedModule = true; } boolean folderChange = activeContextItems.setupActiveFolderAndPackage( content); if (signalChange || folderChange) { activeContextItems.fireContextChangeEvent(); } if (buildSelectedModule) { buildModule(activeContextItems.getActiveModule()); } setActiveContent(content.getFolderListing()); baseView.getExplorer() .clear(); baseView.setContent(activeContextItems.getActiveModule(), activeContextItems.getActiveContent(), content.getSiblings()); if (activeContextItems.getActiveFolderItem() == null) { activeContextItems.setupActiveFolderAndPackage(content); } baseView.hideBusyIndicator(); } }
BaseViewPresenter { void doContentCallback(final ProjectExplorerContent content) { boolean buildSelectedModule = false; boolean signalChange = false; if (activeContextItems.setupActiveProject(content)) { signalChange = true; } if (activeContextItems.setupActiveModule(content)) { signalChange = true; buildSelectedModule = true; } boolean folderChange = activeContextItems.setupActiveFolderAndPackage( content); if (signalChange || folderChange) { activeContextItems.fireContextChangeEvent(); } if (buildSelectedModule) { buildModule(activeContextItems.getActiveModule()); } setActiveContent(content.getFolderListing()); baseView.getExplorer() .clear(); baseView.setContent(activeContextItems.getActiveModule(), activeContextItems.getActiveContent(), content.getSiblings()); if (activeContextItems.getActiveFolderItem() == null) { activeContextItems.setupActiveFolderAndPackage(content); } baseView.hideBusyIndicator(); } BaseViewPresenter(BaseViewImpl baseView); }
BaseViewPresenter { void doContentCallback(final ProjectExplorerContent content) { boolean buildSelectedModule = false; boolean signalChange = false; if (activeContextItems.setupActiveProject(content)) { signalChange = true; } if (activeContextItems.setupActiveModule(content)) { signalChange = true; buildSelectedModule = true; } boolean folderChange = activeContextItems.setupActiveFolderAndPackage( content); if (signalChange || folderChange) { activeContextItems.fireContextChangeEvent(); } if (buildSelectedModule) { buildModule(activeContextItems.getActiveModule()); } setActiveContent(content.getFolderListing()); baseView.getExplorer() .clear(); baseView.setContent(activeContextItems.getActiveModule(), activeContextItems.getActiveContent(), content.getSiblings()); if (activeContextItems.getActiveFolderItem() == null) { activeContextItems.setupActiveFolderAndPackage(content); } baseView.hideBusyIndicator(); } BaseViewPresenter(BaseViewImpl baseView); @PostConstruct void init(); void onActiveOptionsChange(final @Observes ActiveOptionsChangedEvent changedEvent); void update(); void refresh(); void loadContent(final FolderItem item); FolderListing getActiveContent(); void deleteItem(final FolderItem folderItem); void renameItem(final FolderItem folderItem); void copyItem(final FolderItem folderItem); void uploadArchivedFolder(final FolderItem folderItem); String getCurrentTag(); Set<String> getActiveContentTags(); void onModuleSelected(final Module module); void onActiveFolderItemSelected(final FolderItem item); void onItemSelected(final FolderItem folderItem); void setVisible(final boolean visible); void onTagFilterChanged(@Observes TagChangedEvent event); void onResourceUpdated(@Observes final ResourceUpdatedEvent event); void onResourceAdded(@Observes final ResourceAddedEvent event); void onResourceDeleted(@Observes final ResourceDeletedEvent event); void onResourceCopied(@Observes final ResourceCopiedEvent event); void onLockStatusChange(@Observes final LockInfo lockInfo); void initialiseViewForActiveContext(final WorkspaceProjectContext context); void initialiseViewForActiveContext(String initPath); void onResourceRenamed(@Observes final ResourceRenamedEvent event); boolean canShowTags(); }
BaseViewPresenter { void doContentCallback(final ProjectExplorerContent content) { boolean buildSelectedModule = false; boolean signalChange = false; if (activeContextItems.setupActiveProject(content)) { signalChange = true; } if (activeContextItems.setupActiveModule(content)) { signalChange = true; buildSelectedModule = true; } boolean folderChange = activeContextItems.setupActiveFolderAndPackage( content); if (signalChange || folderChange) { activeContextItems.fireContextChangeEvent(); } if (buildSelectedModule) { buildModule(activeContextItems.getActiveModule()); } setActiveContent(content.getFolderListing()); baseView.getExplorer() .clear(); baseView.setContent(activeContextItems.getActiveModule(), activeContextItems.getActiveContent(), content.getSiblings()); if (activeContextItems.getActiveFolderItem() == null) { activeContextItems.setupActiveFolderAndPackage(content); } baseView.hideBusyIndicator(); } BaseViewPresenter(BaseViewImpl baseView); @PostConstruct void init(); void onActiveOptionsChange(final @Observes ActiveOptionsChangedEvent changedEvent); void update(); void refresh(); void loadContent(final FolderItem item); FolderListing getActiveContent(); void deleteItem(final FolderItem folderItem); void renameItem(final FolderItem folderItem); void copyItem(final FolderItem folderItem); void uploadArchivedFolder(final FolderItem folderItem); String getCurrentTag(); Set<String> getActiveContentTags(); void onModuleSelected(final Module module); void onActiveFolderItemSelected(final FolderItem item); void onItemSelected(final FolderItem folderItem); void setVisible(final boolean visible); void onTagFilterChanged(@Observes TagChangedEvent event); void onResourceUpdated(@Observes final ResourceUpdatedEvent event); void onResourceAdded(@Observes final ResourceAddedEvent event); void onResourceDeleted(@Observes final ResourceDeletedEvent event); void onResourceCopied(@Observes final ResourceCopiedEvent event); void onLockStatusChange(@Observes final LockInfo lockInfo); void initialiseViewForActiveContext(final WorkspaceProjectContext context); void initialiseViewForActiveContext(String initPath); void onResourceRenamed(@Observes final ResourceRenamedEvent event); boolean canShowTags();  }