use of nl.tudelft.watchdog.core.logic.event.eventtypes.staticanalysis.StaticAnalysisWarningEvent in project watchdog by TestRoots.
the class MarkupModelListenerTest method computes_warning_time_difference_for_removed_warning.
@Test
public void computes_warning_time_difference_for_removed_warning() throws Exception {
List<StaticAnalysisWarningEvent> generatedEvents = processMarkerAndReturnGeneratedWarningList(() -> {
try {
IMarker marker = this.testFile.createMarker(IMarker.PROBLEM);
marker.setAttribute(IMarker.MESSAGE, "This warning does not exist");
marker.setAttribute(IMarker.LINE_NUMBER, 15);
this.saveWorkspaceAndWaitForBuild();
marker.delete();
} catch (Exception e) {
e.printStackTrace();
}
});
assertEquals(generatedEvents.size(), 2);
// We simply want any time difference here. If there is any, it is not -1, but 0, 1 or anything above
// We do not want to rely on timing differences to assert on specific values, so asserting we have
// anything is sufficient
assertNotEquals(generatedEvents.get(1).warning.secondsBetween, -1);
}
use of nl.tudelft.watchdog.core.logic.event.eventtypes.staticanalysis.StaticAnalysisWarningEvent in project watchdog by TestRoots.
the class MarkupModelListenerTest method correctly_generates_document_information.
@Test
public void correctly_generates_document_information() throws Exception {
List<StaticAnalysisWarningEvent> generatedWarnings = this.deleteMarkerAndReturnGeneratedWarningList(this.preExistingMarker);
assertEquals(generatedWarnings.size(), 1);
Document document = generatedWarnings.get(0).document;
assertEquals(document.getFileName(), "Existing.java");
assertEquals(document.getContent().split("\\d+").length, 25);
}
Aggregations