@Test public void cancelled_analysis() { Scanner scanner = new TestScanner(context); context.setCancelled(true); thrown.expectMessage("Analysis cancelled"); try { scanner.execute(progressReport, ImmutableList.of(PhpTestUtils.inputFile("empty.php"))); } finally { verify(progressReport).cancel(); verify(progressReport, never()).stop(); } }
void execute(List<InputFile> files) { ProgressReport progressReport = new ProgressReport("PHP analyzer progress", TimeUnit.SECONDS.toMillis(10)); execute(progressReport, files); }
Scanner { void execute(List<InputFile> files) { ProgressReport progressReport = new ProgressReport("PHP analyzer progress", TimeUnit.SECONDS.toMillis(10)); execute(progressReport, files); } }
Scanner { void execute(List<InputFile> files) { ProgressReport progressReport = new ProgressReport("PHP analyzer progress", TimeUnit.SECONDS.toMillis(10)); execute(progressReport, files); } Scanner(SensorContext context); }
Scanner { void execute(List<InputFile> files) { ProgressReport progressReport = new ProgressReport("PHP analyzer progress", TimeUnit.SECONDS.toMillis(10)); execute(progressReport, files); } Scanner(SensorContext context);  }
Scanner { void execute(List<InputFile> files) { ProgressReport progressReport = new ProgressReport("PHP analyzer progress", TimeUnit.SECONDS.toMillis(10)); execute(progressReport, files); } Scanner(SensorContext context);   }