Package com.puppycrawl.tools.checkstyle

Examples of com.puppycrawl.tools.checkstyle.DefaultConfiguration.addAttribute()


   
    public void testIgnoreFormat() throws Exception
        {
            final DefaultConfiguration checkConfig =
                createCheckConfig(UnusedLocalVariableCheck.class);
            checkConfig.addAttribute("ignoreFormat", "Array$");
            final String[] expected = {
                "13:13: Unused local variable 'mUnreadPrimitive'.",
                "24:16: Unused local variable 'unreadObject'.",
                "45:13: Unused local variable 'java'.",
            };
View Full Code Here


            new DefaultConfiguration("configuration");
        final DefaultConfiguration checksConfig =
            createCheckConfig(TreeWalker.class);
        final DefaultConfiguration holderConfig =
            createCheckConfig(SuppressWarningsHolder.class);
        holderConfig.addAttribute("aliasList",
            "com.puppycrawl.tools.checkstyle.checks.sizes."
                + "ParameterNumberCheck=paramnum");
        checksConfig.addChild(holderConfig);
        checksConfig.addChild(createCheckConfig(MemberNameCheck.class));
        checksConfig.addChild(createCheckConfig(ConstantNameCheck.class));
View Full Code Here

    @Test
    public void testAllowEscapesForControlCharacterst() throws Exception
    {
        DefaultConfiguration checkConfig =
                createCheckConfig(AvoidEscapedUnicodeCharactersCheck.class);
        checkConfig.addAttribute("allowEscapesForControlCharacters", "true");
        final String[] expected = {
            "5: " + MSG,
            "7: " + MSG,
            "9: " + MSG,
            "13: " + MSG,
View Full Code Here

    @Test
    public void testAllowByTailComment() throws Exception
    {
        DefaultConfiguration checkConfig =
                createCheckConfig(AvoidEscapedUnicodeCharactersCheck.class);
        checkConfig.addAttribute("allowByTailComment", "true");
        final String[] expected = {
            "5: " + MSG,
            "13: " + MSG,
            "21: " + MSG,
            "27: " + MSG,
View Full Code Here

    @Test
    public void testAllowAllCharactersEscaped() throws Exception
    {
        DefaultConfiguration checkConfig =
                createCheckConfig(AvoidEscapedUnicodeCharactersCheck.class);
        checkConfig.addAttribute("allowIfAllCharactersEscaped", "true");
        final String[] expected = {
            "5: " + MSG,
            "7: " + MSG,
            "9: " + MSG,
            "13: " + MSG,
View Full Code Here

    @Test
    public void allowNonPrintableEscapes() throws Exception
    {
        DefaultConfiguration checkConfig =
                createCheckConfig(AvoidEscapedUnicodeCharactersCheck.class);
        checkConfig.addAttribute("allowNonPrintableEscapes", "true");
        final String[] expected = {
            "5: " + MSG,
            "7: " + MSG,
            "9: " + MSG,
            "13: " + MSG,
View Full Code Here

    public void testCStyle()
        throws Exception
    {
        final DefaultConfiguration checkConfig =
            createCheckConfig(ArrayTypeStyleCheck.class);
        checkConfig.addAttribute("javaStyle", "false");
        final String[] expected = {
            "13:16: Array brackets at illegal position.",
            "16:39: Array brackets at illegal position.",
            "22:18: Array brackets at illegal position.",
            "30:20: Array brackets at illegal position.",
View Full Code Here

    @Test
    public void testProcessJavadoc() throws Exception
    {
        final DefaultConfiguration checkConfig = createCheckConfig(UnusedImportsCheck.class);
        checkConfig.addAttribute("processJavadoc", "true");
        final String[] expected = {
            "8:45: Unused import - com.puppycrawl.tools.checkstyle.imports.GlobalProperties.",
            "11:8: Unused import - java.lang.String.",
            "13:8: Unused import - java.util.List.",
            "14:8: Unused import - java.util.List.",
View Full Code Here

    public void testExcludedClasses()
        throws Exception
    {
        final DefaultConfiguration checkConfig =
            createCheckConfig(UncommentedMainCheck.class);
        checkConfig.addAttribute("excludedClasses", "\\.Main$");
        final String[] expected = {
            "14: Uncommented main method found.",
            "32: Uncommented main method found.",
        };
        verify(checkConfig, getPath("InputUncommentedMain.java"), expected);
View Full Code Here

{
    private Checker getChecker() throws Exception
    {
        final DefaultConfiguration checkConfig =
            createCheckConfig(VisibilityModifierCheck.class);
        checkConfig.addAttribute("publicMemberPattern", "^f[A-Z][a-zA-Z0-9]*$");
        return createChecker(checkConfig);
    }

    @Test
    public void testInner()
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.