use of org.eclipse.jdt.ls.core.internal.handlers.ProgressReporterManager in project eclipse.jdt.ls by eclipse.
the class AbstractProjectsManagerBasedTest method initProjectManager.
@Before
public void initProjectManager() throws CoreException {
clientRequests.clear();
logListener = new SimpleLogListener();
Platform.addLogListener(logListener);
preferences = new Preferences();
if (preferenceManager != null) {
when(preferenceManager.getPreferences()).thenReturn(preferences);
ClientPreferences clientPreferences = mock(ClientPreferences.class);
when(clientPreferences.isProgressReportSupported()).thenReturn(true);
when(preferenceManager.getClientPreferences()).thenReturn(clientPreferences);
}
projectsManager = new ProjectsManager(preferenceManager);
ProgressReporterManager progressManager = new ProgressReporterManager(this.client, preferenceManager);
// disable throttling to ensure we capture all events
progressManager.setReportThrottle(0);
Job.getJobManager().setProgressProvider(progressManager);
monitor = progressManager.getDefaultMonitor();
WorkingCopyOwner.setPrimaryBufferProvider(new WorkingCopyOwner() {
@Override
public IBuffer createBuffer(ICompilationUnit workingCopy) {
ICompilationUnit original = workingCopy.getPrimary();
IResource resource = original.getResource();
if (resource instanceof IFile) {
return new DocumentAdapter(workingCopy, (IFile) resource);
}
return DocumentAdapter.Null;
}
});
}
Aggregations