use of com.puppycrawl.tools.checkstyle.internal.testmodules.CheckstyleAntTaskStub in project checkstyle by checkstyle.
the class CheckstyleAntTaskTest method testCheckerException.
@Test
public void testCheckerException() throws IOException {
final CheckstyleAntTask antTask = new CheckstyleAntTaskStub();
antTask.setConfig(getPath(CONFIG_FILE));
antTask.setProject(new Project());
antTask.setFile(new File(""));
final BuildException ex = assertThrows(BuildException.class, antTask::execute, "BuildException is expected");
assertWithMessage("Error message is unexpected").that(ex).hasMessageThat().startsWith("Unable to process files:");
}
Aggregations