Package com.puppycrawl.tools.checkstyle

Examples of com.puppycrawl.tools.checkstyle.Checker


    @Test
    public void testValidDotWithChecker()
        throws Exception
    {
        final DefaultConfiguration checkConfig = createCheckConfig(IndentationCheck.class);
        final Checker c = createChecker(checkConfig);
        final String fname = getPath("indentation/InputValidDotIndent.java");
        final String[] expected = {
        };
        verify(c, fname, expected);
    }
View Full Code Here


    @Test
    public void testValidMethodWithChecker()
        throws Exception
    {
        final DefaultConfiguration checkConfig = createCheckConfig(IndentationCheck.class);
        final Checker c = createChecker(checkConfig);
        final String fname = getPath("indentation/InputValidMethodIndent.java");
        final String[] expected = {
            "125: 'void' have incorrect indentation level 4, expected level should be 8.",
            "126: 'method5' have incorrect indentation level 4, expected level should be 8.",
        };
View Full Code Here

    @Test
    public void testInvalidMethodWithChecker()
        throws Exception
    {
        final DefaultConfiguration checkConfig = createCheckConfig(IndentationCheck.class);
        final Checker c = createChecker(checkConfig);
        final String fname = getPath("indentation/InputInvalidMethodIndent.java");
        final String[] expected = {
            "17: 'ctor def rcurly' have incorrect indentation level 6, expected level should be 4.",
            "20: 'ctor def modifier' have incorrect indentation level 6, expected level should be 4.",
            "21: 'ctor def lcurly' have incorrect indentation level 2, expected level should be 4.",
View Full Code Here

    @Test
    public void testInvalidSwitchWithChecker()
        throws Exception
    {
        final DefaultConfiguration checkConfig = createCheckConfig(IndentationCheck.class);
        final Checker c = createChecker(checkConfig);
        final String fname = getPath("indentation/InputInvalidSwitchIndent.java");
        final String[] expected = {
            "26: 'switch' have incorrect indentation level 6, expected level should be 8.",
            "28: 'case' child have incorrect indentation level 10, expected level should be 12.",
            "29: 'block' child have incorrect indentation level 14, expected level should be 16.",
View Full Code Here

    @Test
    public void testValidSwitchWithChecker()
        throws Exception
    {
        final DefaultConfiguration checkConfig = createCheckConfig(IndentationCheck.class);
        final Checker c = createChecker(checkConfig);
        final String fname = getPath("indentation/InputValidSwitchIndent.java");
        final String[] expected = {
        };
        verify(c, fname, expected);
    }
View Full Code Here

    @Test
    public void testValidArrayInitDefaultIndentWithChecker()
        throws Exception
    {
        final DefaultConfiguration checkConfig = createCheckConfig(IndentationCheck.class);
        final Checker c = createChecker(checkConfig);
        final String fname = getPath("indentation/InputValidArrayInitDefaultIndent.java");
        final String[] expected = {
        };
        verify(c, fname, expected);
    }
View Full Code Here

        throws Exception
    {
        final DefaultConfiguration checkConfig = createCheckConfig(IndentationCheck.class);
        checkConfig.addAttribute("arrayInitIndent", Integer.valueOf(8).toString());

        final Checker c = createChecker(checkConfig);
        final String fname = getPath("indentation/InputValidArrayInitIndent.java");
        final String[] expected = {};
        verify(c, fname, expected);
    }
View Full Code Here

    @Test
    public void testInvalidArrayInitWithChecker()
        throws Exception
    {
        final DefaultConfiguration checkConfig = createCheckConfig(IndentationCheck.class);
        final Checker c = createChecker(checkConfig);
        final String fname = getPath("indentation/InputInvalidArrayInitIndent.java");
        final String[] expected = {
            "17: 'member def type' have incorrect indentation level 2, expected level should be 4.",
            "18: 'member def type' have incorrect indentation level 6, expected level should be 4.",
            "20: 'member def type' have incorrect indentation level 2, expected level should be 4.",
View Full Code Here

    @Test
    public void testValidTryWithChecker()
        throws Exception
    {
        final DefaultConfiguration checkConfig = createCheckConfig(IndentationCheck.class);
        final Checker c = createChecker(checkConfig);
        final String fname = getPath("indentation/InputValidTryIndent.java");
        final String[] expected = {
        };
        verify(c, fname, expected);
    }
View Full Code Here

    @Test
    public void testInvalidTryWithChecker()
        throws Exception
    {
        final DefaultConfiguration checkConfig = createCheckConfig(IndentationCheck.class);
        final Checker c = createChecker(checkConfig);
        final String fname = getPath("indentation/InputInvalidTryIndent.java");
        final String[] expected = {
            "21: 'try' have incorrect indentation level 9, expected level should be 8.",
            "22: 'try rcurly' have incorrect indentation level 7, expected level should be 8.",
            "24: 'catch rcurly' have incorrect indentation level 7, expected level should be 8.",
View Full Code Here

TOP

Related Classes of com.puppycrawl.tools.checkstyle.Checker

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.