use of com.cflint.api.CFLintResult in project CFLint by cflint.
the class TestCFBugs_ComponentNames method nameTooWordyScript.
@Test
public void nameTooWordyScript() throws CFLintScanException {
final String scriptSrc = "component {\r\n" + "}";
CFLintResult lintresult = cfBugs.scan(scriptSrc, "NameIsTooWordy.cfc");
final List<BugInfo> result = lintresult.getIssues().values().iterator().next();
assertEquals(1, result.size());
assertEquals("COMPONENT_TOO_WORDY", result.get(0).getMessageCode());
assertEquals(1, result.get(0).getLine());
}
use of com.cflint.api.CFLintResult in project CFLint by cflint.
the class TestCFBugs_ComponentNames method nameTooLongTag.
@Test
public void nameTooLongTag() throws CFLintScanException {
final String tagSrc = "<cfcomponent>\r\n" + "</cfcomponent>";
CFLintResult lintresult = cfBugs.scan(tagSrc, "Acomponentwithaveryverylongcomponentname.cfc");
final List<BugInfo> result = lintresult.getIssues().values().iterator().next();
assertEquals(1, result.size());
assertEquals("COMPONENT_TOO_LONG", result.get(0).getMessageCode());
assertEquals(1, result.get(0).getLine());
}
use of com.cflint.api.CFLintResult in project CFLint by cflint.
the class TestCFBugs_ComponentNames method nameEndsInNumberTag.
@Test
public void nameEndsInNumberTag() throws CFLintScanException {
final String tagSrc = "<cfcomponent>\r\n" + "</cfcomponent>";
CFLintResult lintresult = cfBugs.scan(tagSrc, "Component23.cfc");
final List<BugInfo> result = lintresult.getIssues().values().iterator().next();
assertEquals(1, result.size());
assertEquals("COMPONENT_INVALID_NAME", result.get(0).getMessageCode());
assertEquals(1, result.get(0).getLine());
}
use of com.cflint.api.CFLintResult in project CFLint by cflint.
the class TestCFBugs_ComponentNames method testUpercaseNameScript.
@Test
public void testUpercaseNameScript() throws CFLintScanException {
final String scriptSrc = "component {\r\n" + "}";
CFLintResult lintresult = cfBugs.scan(scriptSrc, "UPPERCASE.cfc");
final List<BugInfo> result = lintresult.getIssues().values().iterator().next();
assertEquals(1, result.size());
assertEquals("COMPONENT_ALLCAPS_NAME", result.get(0).getMessageCode());
assertEquals(1, result.get(0).getLine());
}
use of com.cflint.api.CFLintResult in project CFLint by cflint.
the class TestCFBugs_FunctionHint method testBlankHint.
@Test
public void testBlankHint() throws CFLintScanException {
final String cfcSrc = "<cfcomponent>\r\n" + "<cffunction name=\"test\" hint=\"\">\r\n" + " <cfargument name=\"xyz\" default=\"123\">\r\n" + "</cffunction>\r\n" + "</cfcomponent>";
CFLintResult lintresult = cfBugs.scan(cfcSrc, "test");
final List<BugInfo> result = lintresult.getIssues().values().iterator().next();
assertEquals(1, result.size());
assertEquals("FUNCTION_HINT_MISSING", result.get(0).getMessageCode());
assertEquals(2, result.get(0).getLine());
}
Aggregations