use of com.cflint.api.CFLintResult in project CFLint by cflint.
the class TestCFBugs_ComponentNames method testLowercaseNameScript.
@Test
public void testLowercaseNameScript() throws CFLintScanException {
final String scriptSrc = "component {\r\n" + "}";
CFLintResult lintresult = cfBugs.scan(scriptSrc, "lowercase.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 testUpercaseNameTag.
@Test
public void testUpercaseNameTag() throws CFLintScanException {
final String tagSrc = "<cfcomponent>\r\n" + "</cfcomponent>";
CFLintResult lintresult = cfBugs.scan(tagSrc, "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_ComponentNames method invalidCharsInNameScript.
@Test
public void invalidCharsInNameScript() throws CFLintScanException {
final String scriptSrc = "component {\r\n" + "}";
CFLintResult lintresult = cfBugs.scan(scriptSrc, "Component$Name.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 nameIsTemporyTag.
@Test
public void nameIsTemporyTag() throws CFLintScanException {
final String tagSrc = "<cfcomponent>\r\n" + "</cfcomponent>";
CFLintResult lintresult = cfBugs.scan(tagSrc, "Temp.cfc");
final List<BugInfo> result = lintresult.getIssues().values().iterator().next();
assertEquals(1, result.size());
assertEquals("COMPONENT_IS_TEMPORARY", 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 nameTooLongScript.
@Test
public void nameTooLongScript() throws CFLintScanException {
final String scriptSrc = "component {\r\n" + "}";
CFLintResult lintresult = cfBugs.scan(scriptSrc, "Componenthasaverylongcomponentname.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());
}
Aggregations