Search in sources :

Example 46 with CFLintResult

use of com.cflint.api.CFLintResult in project CFLint by cflint.

the class TestCFBugs_Comments method testVarAndArgs_DisabledCase.

@Test
public void testVarAndArgs_DisabledCase() throws CFLintScanException {
    final String cfcSrc = "<cfcomponent>\r\n" + "<cffunction name=\"test\">\r\n" + "	" + "<!---cflint-disable ARG_DEFAULT_MISSING   --->" + "<cfargument name=\"xyz\">\r\n" + "</cffunction>\r\n" + "</cfcomponent>";
    CFLintResult lintresult = cfBugs.scan(cfcSrc, "test");
    final Map<String, List<BugInfo>> result = lintresult.getIssues();
    assertEquals(0, result.size());
}
Also used : List(java.util.List) CFLintResult(com.cflint.api.CFLintResult) Test(org.junit.Test)

Example 47 with CFLintResult

use of com.cflint.api.CFLintResult in project CFLint by cflint.

the class TestCFBugs_Comments method testVarAndArgs_DisabledSpacing.

@Test
public void testVarAndArgs_DisabledSpacing() throws CFLintScanException {
    final String cfcSrc = "<cfcomponent>\r\n" + "<cffunction name=\"test\">\r\n" + "	" + "<!---    CFLINT-DISABLE  ARG_DEFAULT_MISSING   --->" + "<cfargument name=\"xyz\">\r\n" + "</cffunction>\r\n" + "</cfcomponent>";
    CFLintResult lintresult = cfBugs.scan(cfcSrc, "test");
    final Map<String, List<BugInfo>> result = lintresult.getIssues();
    assertEquals(0, result.size());
}
Also used : List(java.util.List) CFLintResult(com.cflint.api.CFLintResult) Test(org.junit.Test)

Example 48 with CFLintResult

use of com.cflint.api.CFLintResult in project CFLint by cflint.

the class TestCFBugs_Comments method testVarAndArgs_Disabled2.

@Test
public void testVarAndArgs_Disabled2() throws CFLintScanException {
    final String cfcSrc = "<cfcomponent>\r\n" + "<cffunction name=\"test\">\r\n" + "	" + "<!---CFLINT-DISABLE ARG_DEFAULT_MISSING ,XXX --->" + "<cfargument name=\"xyz\">\r\n" + "</cffunction>\r\n" + "</cfcomponent>";
    CFLintResult lintresult = cfBugs.scan(cfcSrc, "test");
    final Map<String, List<BugInfo>> result = lintresult.getIssues();
    assertEquals(0, result.size());
}
Also used : List(java.util.List) CFLintResult(com.cflint.api.CFLintResult) Test(org.junit.Test)

Example 49 with CFLintResult

use of com.cflint.api.CFLintResult in project CFLint by cflint.

the class TestCFBugs_Comments method testVarAndArgs_DisabledOnParent.

@Test
public void testVarAndArgs_DisabledOnParent() throws CFLintScanException {
    final String cfcSrc = "<cfcomponent>\r\n" + "<!---CFLINT-DISABLE ARG_DEFAULT_MISSING --->" + "<cffunction name=\"test\">\r\n" + "	" + "<cfargument name=\"xyz\">\r\n" + "</cffunction>\r\n" + "</cfcomponent>";
    CFLintResult lintresult = cfBugs.scan(cfcSrc, "test");
    final Map<String, List<BugInfo>> result = lintresult.getIssues();
    assertEquals(0, result.size());
}
Also used : List(java.util.List) CFLintResult(com.cflint.api.CFLintResult) Test(org.junit.Test)

Example 50 with CFLintResult

use of com.cflint.api.CFLintResult in project CFLint by cflint.

the class TestCFBugs_Comments method testVarAndArgs_DisabledOnParent2.

@Test
public void testVarAndArgs_DisabledOnParent2() throws CFLintScanException {
    final String cfcSrc = "<!---CFLINT-DISABLE ARG_DEFAULT_MISSING ---><cfcomponent>\r\n" + "<cffunction name=\"test\">\r\n" + "	" + "<cfargument name=\"xyz\">\r\n" + "</cffunction>\r\n" + "</cfcomponent>";
    CFLintResult lintresult = cfBugs.scan(cfcSrc, "test");
    final Map<String, List<BugInfo>> result = lintresult.getIssues();
    assertEquals(0, result.size());
}
Also used : List(java.util.List) CFLintResult(com.cflint.api.CFLintResult) Test(org.junit.Test)

Aggregations

CFLintResult (com.cflint.api.CFLintResult)298 Test (org.junit.Test)289 List (java.util.List)70 CFLintAPI (com.cflint.api.CFLintAPI)2 StringWriter (java.io.StringWriter)2 Ignore (org.junit.Ignore)2 CFLintConfiguration (com.cflint.config.CFLintConfiguration)1 CFLintConfigurationException (com.cflint.exception.CFLintConfigurationException)1 CFLintScanException (com.cflint.exception.CFLintScanException)1 MarshallerException (com.cflint.xml.MarshallerException)1 File (java.io.File)1 FileWriter (java.io.FileWriter)1 IOException (java.io.IOException)1 InputStreamReader (java.io.InputStreamReader)1 OutputStreamWriter (java.io.OutputStreamWriter)1 PrintWriter (java.io.PrintWriter)1 Writer (java.io.Writer)1 JAXBException (javax.xml.bind.JAXBException)1 TransformerException (javax.xml.transform.TransformerException)1