use of com.puppycrawl.tools.checkstyle.api.Configuration in project checkstyle by checkstyle.
the class CatchParameterNameCheckTest method testDefaultConfigurationOnCorrectFile.
@Test
public void testDefaultConfigurationOnCorrectFile() throws Exception {
final Configuration checkConfig = createCheckConfig(CatchParameterNameCheck.class);
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
verify(checkConfig, getPath("InputSimple.java"), expected);
}
use of com.puppycrawl.tools.checkstyle.api.Configuration in project checkstyle by checkstyle.
the class SuppressWarningsHolderTest method testAnnotationWithFullName.
@Test
public void testAnnotationWithFullName() throws Exception {
final Configuration checkConfig = createCheckConfig(SuppressWarningsHolder.class);
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
verify(checkConfig, getPath("InputSuppressWarningsHolder4.java"), expected);
}
use of com.puppycrawl.tools.checkstyle.api.Configuration in project checkstyle by checkstyle.
the class TranslationCheckTest method testTranslation.
@Test
public void testTranslation() throws Exception {
final Configuration checkConfig = createCheckConfig(TranslationCheck.class);
final String[] expected = { "0: " + getCheckMessage(MSG_KEY, "only.english") };
final File[] propertyFiles = { new File(getPath("messages_test_de.properties")), new File(getPath("messages_test.properties")) };
verify(createChecker(checkConfig), propertyFiles, getPath("messages_test_de.properties"), expected);
}
use of com.puppycrawl.tools.checkstyle.api.Configuration in project checkstyle by checkstyle.
the class PropertyCacheFileTest method testConfigHashOnReset.
@Test
public void testConfigHashOnReset() throws IOException {
final Configuration config = new DefaultConfiguration("myName");
final String filePath = temporaryFolder.newFile().getPath();
final PropertyCacheFile cache = new PropertyCacheFile(config, filePath);
cache.load();
final String hash = cache.get(PropertyCacheFile.CONFIG_HASH_KEY);
assertNotNull(hash);
cache.reset();
assertEquals(hash, cache.get(PropertyCacheFile.CONFIG_HASH_KEY));
}
use of com.puppycrawl.tools.checkstyle.api.Configuration in project checkstyle by checkstyle.
the class PropertyCacheFileTest method testPathToCacheContainsOnlyFileName.
@Test
public void testPathToCacheContainsOnlyFileName() throws IOException {
final Configuration config = new DefaultConfiguration("myName");
final String filePath = "temp.cache";
final PropertyCacheFile cache = new PropertyCacheFile(config, filePath);
// no exception expected
cache.persist();
if (Files.exists(Paths.get(filePath))) {
Files.delete(Paths.get(filePath));
}
}
Aggregations