Examples of Checker


Examples of com.puppycrawl.tools.checkstyle.Checker

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

Examples of com.puppycrawl.tools.checkstyle.Checker

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

Examples of com.puppycrawl.tools.checkstyle.Checker

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

Examples of com.puppycrawl.tools.checkstyle.Checker

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

Examples of com.puppycrawl.tools.checkstyle.Checker

    @Test
    public void testValidClassDefWithChecker()
        throws Exception
    {
        final DefaultConfiguration checkConfig = createCheckConfig(IndentationCheck.class);
        final Checker c = createChecker(checkConfig);
        final String fname = getPath("indentation/InputValidClassDefIndent.java");
        final String[] expected = {
            "46: 'class' have incorrect indentation level 0, expected level should be 4.",
            "68: 'int' have incorrect indentation level 8, expected level should be 12.",
        };
View Full Code Here

Examples of com.puppycrawl.tools.checkstyle.Checker

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

Examples of com.puppycrawl.tools.checkstyle.Checker

    public void testValidCommaWithChecker()
        throws Exception
    {

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

Examples of com.puppycrawl.tools.checkstyle.Checker

            "19: Found duplicate of 4 lines in " + path + ", starting from line 26",
        };
        final File[] checkedFiles = new File[] {
            new File(path),
        };
        final Checker checker = createChecker(checkConfig);
        verify(checker, checkedFiles, path, expected);
    }
View Full Code Here

Examples of com.puppycrawl.tools.checkstyle.Checker

        final String[] expected = {
        };
        final File[] checkedFiles = new File[] {
            new File(path),
        };
        final Checker checker = createChecker(checkConfig);
        verify(checker, checkedFiles, path, expected);
    }
View Full Code Here

Examples of com.puppycrawl.tools.checkstyle.Checker

    }
  }

  protected Checker createChecker(Configuration aCheckConfig) throws Exception
  {
    Checker checker = new Checker();
    // make sure the tests always run with english error messages
    // so the tests don't fail in supported locales like german
    Locale locale = Locale.ENGLISH;
    checker.setLocaleCountry(locale.getCountry());
    checker.setLocaleLanguage(locale.getLanguage());
    checker.setModuleClassLoader(Thread.currentThread().getContextClassLoader());

    DefaultConfiguration defaultConfig = createCheckerConfig(aCheckConfig);
    checker.configure(defaultConfig);

    checker.addListener(new BriefLogger(printStream));
    return checker;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.