@@ -0,0 +1,1851 @@
+package com.cflint;%0D%0A%0D%0Aimport static org.junit.Assert.assertEquals;%0D%0A%0D%0Aimport java.io.IOException;%0D%0Aimport java.util.List;%0D%0A%0D%0Aimport org.junit.Before;%0D%0Aimport org.junit.Test;%0D%0A%0D%0Aimport cfml.parsing.reporting.ParseException;%0D%0A%0D%0Aimport com.cflint.config.ConfigRuntime;%0D%0Aimport com.cflint.config.CFLintPluginInfo.PluginInfoRule;%0D%0Aimport com.cflint.config.CFLintPluginInfo.PluginInfoRule.PluginMessage;%0D%0Aimport com.cflint.plugins.core.VarScoper;%0D%0A%0D%0Apublic class TestParsingErrors %7B%0D%0A%0D%0A%09private CFLint cfBugs;%0D%0A%0D%0A%09@Before%0D%0A%09public void setUp() %7B%0D%0A%09%09ConfigRuntime conf = new ConfigRuntime();%0D%0A%09%09PluginInfoRule pluginRule = new PluginInfoRule();%0D%0A%09%09pluginRule.setName(%22VarScoper%22);%0D%0A%09%09conf.getRules().add(pluginRule);%0D%0A%09%09PluginMessage pluginMessage = new PluginMessage(%22MISSING_VAR%22);%0D%0A%09%09pluginMessage.setSeverity(%22ERROR%22);%0D%0A%09%09pluginMessage%0D%0A%09%09%09%09.setMessageText(%22Variable $%7Bvariable%7D is not declared with a var statement.%22);%0D%0A%09%09pluginRule.getMessages().add(pluginMessage);%0D%0A%0D%0A%09%09cfBugs = new CFLint(conf, new VarScoper());%0D%0A%09%7D%0D%0A%0D%0A%09@Test%0D%0A%09public void testMissingSemiColon() throws ParseException, IOException%7B%0D%0A%09%09final String cfcSrc = %22%3Ccfcomponent%3E%5Cr%5Cn%22 +%0D%0A%09%09%09%09%22%3Ccffunction name=%5C%22test%5C%22%3E%5Cr%5Cn%22 +%0D%0A%09%09%09%09%22%09%3Ccfscript%3E%5Cr%5Cn%22 +%0D%0A%09%09%09%09%22   var xx = 123%5Cr%5Cn%22 +%0D%0A%09%09%09%09%22   yy = 123%5Cr%5Cn%22 +%0D%0A%09%09%09%09%22%09%3C/cfscript%3E%5Cr%5Cn%22 +%0D%0A%09%09%09%09%22%3C/cffunction%3E%5Cr%5Cn%22 +%0D%0A%09%09%09%09%22%3C/cfcomponent%3E%22;%0D%0A%09%09cfBugs.process(cfcSrc,%22test%22);%0D%0A%09%09assertEquals(1,cfBugs.getBugs().getFlatBugList().size());%0D%0A%09%09List%3CBugInfo%3E result = cfBugs.getBugs().getFlatBugList();%0D%0A%09%09assertEquals(1,result.size());%0D%0A%09%09assertEquals(%22MISSING_VAR%22,result.get(0).getMessageCode());%0D%0A%09%09assertEquals(%22yy%22,result.get(0).getVariable());%0D%0A%09%09assertEquals(5,result.get(0).getLine());%0D%0A%09%09assertEquals(%22ERROR%22,result.get(0).getSeverity());%0D%0A%09%09assertEquals(%22Variable yy is not declared with a var statement.%22,result.get(0).getMessage());%0D%0A%09%7D%0D%0A%7D%0D%0A

add test