@Override public void callback(final WorkspaceProject workspaceProject) { explorerService.call(new RemoteCallback<ProjectExplorerContent>() { @Override public void callback(final ProjectExplorerContent projectExplorerContent) { if (workspaceProject != null) { WorkspaceProjectContextChangeEvent t = new WorkspaceProjectContextChangeEvent(workspaceProject, workspaceProject.getMainModule()); contextChangeEvent.fire(t); } contentCallback.callback(projectExplorerContent); } }, new HasBusyIndicatorDefaultErrorCallback(view)).getContent(path, activeOptions.getOptions()); } }).resolveProject(path);
private void refresh(final ProjectExplorerContentQuery query) { query.setOptions(activeOptions.getOptions()); explorerService.call(contentCallback, new HasBusyIndicatorDefaultErrorCallback(view)).getContent(query); }
@Test public void refreshWithoutActiveProject() { doReturn(null).when(activeContextItems).getActiveProject(); activeContextManager.refresh(); verify(explorerService, never()).getContent(any()); }
@Before public void setup() { when(view.getExplorer()).thenReturn(mock(Explorer.class)); when(explorerServiceActual.getContent(any(ProjectExplorerContentQuery.class))).thenReturn(content); when(activeContextOptions.getOptions()).thenReturn(new ActiveOptions()); }
@Before public void setup() { when(view.getExplorer()).thenReturn(mock(Explorer.class)); when(explorerServiceActual.getContent(any(ProjectExplorerContentQuery.class))).thenReturn(content); when(activeOptions.getOptions()).thenReturn(new ActiveOptions()); }
@Test public void refreshWithActiveProject() { final WorkspaceProject project = mock(WorkspaceProject.class); final Repository repository = mock(Repository.class); doReturn(repository).when(project).getRepository(); doReturn(project).when(activeContextItems).getActiveProject(); activeContextManager.refresh(); verify(explorerService).getContent(queryCaptor.capture()); assertSame(repository, queryCaptor.getValue().getRepository()); }
@Test public void initActiveContextWithPathString() throws Exception { final WorkspaceProject workspaceProject = mock(WorkspaceProject.class); doReturn(workspaceProject).when(explorerService).resolveProject("path"); final ProjectExplorerContent projectExplorerContent = mock(ProjectExplorerContent.class); doReturn(projectExplorerContent).when(explorerService).getContent(eq("path"), any(ActiveOptions.class)); activeContextManager.initActiveContext("path"); verify(view).showBusyIndicator("Loading"); verify(contextChangeEvent).fire(eventArgumentCaptor.capture()); assertEquals(workspaceProject, eventArgumentCaptor.getValue().getWorkspaceProject()); verify(contentCallback).callback(projectExplorerContent); } }
ProjectExplorerContentQuery query = new ProjectExplorerContentQuery( ou, repo, "master" ); query.setOptions( new ActiveOptions() ); ProjectExplorerContent content = projectExplorerService.getContent( query ); projects.addAll( content.getProjects() ); if ( projects.size() == 0 ) {
ProjectExplorerContentQuery query = new ProjectExplorerContentQuery( ou, repo, "master" ); query.setOptions( new ActiveOptions() ); ProjectExplorerContent content = projectExplorerService.getContent( query ); projects.addAll( content.getProjects() ); if ( projects.size() == 0 ) {
ProjectExplorerContentQuery query = new ProjectExplorerContentQuery( ou, repo, "master" ); query.setOptions( new ActiveOptions() ); ProjectExplorerContent content = projectExplorerService.getContent( query ); projects.addAll( content.getProjects() ); if ( projects.size() == 0 ) {