@@ -0,0 +1,2258 @@
+package com.cflint;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0Aimport java.io.IOException;%0Aimport java.util.Collection;%0Aimport java.util.List;%0Aimport java.util.Map;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport cfml.parsing.reporting.ParseException;%0A%0Aimport com.cflint.config.CFLintPluginInfo.PluginInfoRule;%0Aimport com.cflint.config.CFLintPluginInfo.PluginInfoRule.PluginMessage;%0Aimport com.cflint.config.ConfigRuntime;%0Aimport com.cflint.plugins.core.FileCaseChecker;%0A%0Apublic class TestFileCaseChecker %7B%0A%0A%09private CFLint cfBugs;%0A%0A%09@Before%0A%09public void setUp() %7B%0A%09%09final ConfigRuntime conf = new ConfigRuntime();%0A%09%09final PluginInfoRule pluginRule = new PluginInfoRule();%0A%09%09pluginRule.setName(%22FileCaseChecker%22);%0A%09%09conf.getRules().add(pluginRule);%0A%09%09PluginMessage pluginMessage = new PluginMessage(%22FILE_SHOULD_START_WITH_LOWERCASE%22);%0A%09%09pluginMessage.setSeverity(%22INFO%22);%0A%09%09pluginRule.getMessages().add(pluginMessage);%0A%0A%09%09cfBugs = new CFLint(conf, new FileCaseChecker());%0A%09%7D%0A%0A%09@Test%0A%09public void testLowerCaseCFMName() throws ParseException, IOException %7B%0A%09%09final String cfmSrc = %22%3Ccfset a = 23%3E%22;%0A%09%09cfBugs.process(cfmSrc, %22test.cfm%22);%0A%09%09Collection%3CList%3CBugInfo%3E%3E result = cfBugs.getBugs().getBugList().values();%0A%09%09assertEquals(0, result.size());%0A%09%7D%0A%0A%09@Test%0A%09public void testLowerCaseCFCName() throws ParseException, IOException %7B%0A%09%09final String cfcSrc = %22%3Ccfcomponent%3E%3C/cfcomponent%3E%22;%0A%09%09cfBugs.process(cfcSrc, %22test.cfc%22);%0A%09%09Collection%3CList%3CBugInfo%3E%3E result = cfBugs.getBugs().getBugList().values();%0A%09%09assertEquals(0, result.size());%0A%09%7D%0A%0A%09@Test%0A%09public void testUppeCaseCFMName() throws ParseException, IOException %7B%0A%09%09final String cfmSrc = %22%3Ccfset a = 23%3E%22;%0A%09%09cfBugs.process(cfmSrc, %22Test.cfm%22);%0A%09%09final List%3CBugInfo%3E result = cfBugs.getBugs().getBugList().values().iterator().next();%0A%09%09assertEquals(1, result.size());%0A%09%09assertEquals(%22FILE_SHOULD_START_WITH_LOWERCASE%22, result.get(0).getMessageCode());%0A%09%09assertEquals(1, result.get(0).getLine());%0A%09%7D%0A%0A%09@Test%0A%09public void testUppperCaseCFCName() throws ParseException, IOException %7B%0A%09%09final String cfcSrc = %22%3Ccfcomponent%3E%3C/cfcomponent%3E%22;%0A%09%09cfBugs.process(cfcSrc, %22Test.cfc%22);%0A%09%09Collection%3CList%3CBugInfo%3E%3E result = cfBugs.getBugs().getBugList().values();%0A%09%09assertEquals(0, result.size());%0A%09%7D%0A%0A%7D%0A

Add tests for file case checker rule