use of org.mockito.internal.util.Checks in project checkstyle by checkstyle.
the class TreeWalkerTest method testBehaviourWithZeroChecks.
@Test
public void testBehaviourWithZeroChecks() throws Exception {
final TreeWalker treeWalker = new TreeWalker();
final PackageObjectFactory factory = new PackageObjectFactory(new HashSet<>(), Thread.currentThread().getContextClassLoader());
treeWalker.setModuleFactory(factory);
// create file that should throw exception
final File file = new File(temporaryFolder, "file.java");
final FileText fileText = new FileText(file, new ArrayList<>());
treeWalker.processFiltered(file, fileText);
final Collection<Checks> checks = TestUtil.getInternalState(treeWalker, "ordinaryChecks");
assertWithMessage("No checks -> No parsing").that(checks).isEmpty();
}
use of org.mockito.internal.util.Checks in project checkstyle by checkstyle.
the class TreeWalkerTest method testProcessNonJavaFilesWithoutException.
@Test
public void testProcessNonJavaFilesWithoutException() throws Exception {
final TreeWalker treeWalker = new TreeWalker();
treeWalker.setTabWidth(1);
treeWalker.configure(new DefaultConfiguration("default config"));
final File file = new File(getPath("InputTreeWalkerNotJava.xml"));
final FileText fileText = new FileText(file, StandardCharsets.ISO_8859_1.name());
treeWalker.processFiltered(file, fileText);
final Collection<Checks> checks = TestUtil.getInternalState(treeWalker, "ordinaryChecks");
assertWithMessage("No checks -> No parsing").that(checks).isEmpty();
}