diff --git a/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/ProgressReporterManagerTest.java b/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/ProgressReporterManagerTest.java index cb835a7dfd..70fdc591e4 100644 --- a/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/ProgressReporterManagerTest.java +++ b/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/handlers/ProgressReporterManagerTest.java @@ -103,6 +103,40 @@ protected IStatus run(IProgressMonitor monitor) { assertTrue(report.isComplete()); } + @Test + public void testMulticastJobReporting() throws InterruptedException { + manager.setReportThrottle(275); + Job job = new Job("Test Job") { + @Override + protected IStatus run(IProgressMonitor monitor) { + return null; + } + @Override + public boolean belongsTo(Object family) { + return family == InitHandler.JAVA_LS_INITIALIZATION_JOBS; + } + }; + + IProgressMonitor monitor = manager.createMonitor(job); + monitor.done(); + + ArgumentCaptor captorStatus = ArgumentCaptor.forClass(StatusReport.class); + verify(client, times(1)).sendStatusReport(captorStatus.capture()); + List statusReports = captorStatus.getAllValues(); + assertEquals(1, statusReports.size()); + StatusReport statusReport = statusReports.get(0); + assertEquals(ServiceStatus.Starting.name(), statusReport.getType()); + + ArgumentCaptor captorProgress = ArgumentCaptor.forClass(ProgressReport.class); + verify(client, times(1)).sendProgressReport(captorProgress.capture()); + List progressReports = captorProgress.getAllValues(); + assertEquals(1, progressReports.size()); + ProgressReport progressReport = progressReports.get(0); + assertEquals(job.getName(), progressReport.getStatus()); + assertEquals(job.getName(), progressReport.getTask()); + assertTrue(progressReport.isComplete()); + } + @Test public void testStartupJobReporting() throws InterruptedException { manager.setReportThrottle(0);