Search in sources :

Example 1 with CheckstyleAntTaskStub

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:");
}
Also used : Project(org.apache.tools.ant.Project) CheckstyleAntTaskStub(com.puppycrawl.tools.checkstyle.internal.testmodules.CheckstyleAntTaskStub) BuildException(org.apache.tools.ant.BuildException) File(java.io.File) Test(org.junit.jupiter.api.Test)

Aggregations

CheckstyleAntTaskStub (com.puppycrawl.tools.checkstyle.internal.testmodules.CheckstyleAntTaskStub)1 File (java.io.File)1 BuildException (org.apache.tools.ant.BuildException)1 Project (org.apache.tools.ant.Project)1 Test (org.junit.jupiter.api.Test)1