Package com.puppycrawl.tools.checkstyle

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


    public void testVersionRegularEx()
        throws Exception
    {
        final DefaultConfiguration checkConfig =
            createCheckConfig(JavadocTypeCheck.class);
        checkConfig.addAttribute("versionFormat", "^\\p{Digit}+\\.\\p{Digit}+$");
        final String[] expected = {
            "22: Type Javadoc comment is missing an @version tag.",
            "58: Type Javadoc comment is missing an @version tag.",
            "94: Type Javadoc comment is missing an @version tag.",
        };
View Full Code Here


    public void testVersionRegularExError()
        throws Exception
    {
        final DefaultConfiguration checkConfig =
            createCheckConfig(JavadocTypeCheck.class);
        checkConfig.addAttribute("versionFormat", "\\$Revision.*\\$");
        final String[] expected = {
            "13: Type Javadoc tag @version must match pattern '\\$Revision.*\\$'.",
            "22: Type Javadoc comment is missing an @version tag.",
            "31: Type Javadoc tag @version must match pattern '\\$Revision.*\\$'.",
            "40: Type Javadoc tag @version must match pattern '\\$Revision.*\\$'.",
 
View Full Code Here

    @Test
    public void testScopes2() throws Exception
    {
        final DefaultConfiguration checkConfig =
            createCheckConfig(JavadocTypeCheck.class);
        checkConfig.addAttribute("scope", Scope.PROTECTED.getName());
        final String[] expected = {
            "3: Missing a Javadoc comment.",
            "15: Missing a Javadoc comment.",
        };
        verify(checkConfig,
View Full Code Here

    @Test
    public void testExcludeScope() throws Exception
    {
        final DefaultConfiguration checkConfig =
            createCheckConfig(JavadocTypeCheck.class);
        checkConfig.addAttribute("scope", Scope.PRIVATE.getName());
        checkConfig.addAttribute("excludeScope", Scope.PROTECTED.getName());
        final String[] expected = {
            "27: Missing a Javadoc comment.",
            "39: Missing a Javadoc comment.",
            "52: Missing a Javadoc comment.",
View Full Code Here

    public void testExcludeScope() throws Exception
    {
        final DefaultConfiguration checkConfig =
            createCheckConfig(JavadocTypeCheck.class);
        checkConfig.addAttribute("scope", Scope.PRIVATE.getName());
        checkConfig.addAttribute("excludeScope", Scope.PROTECTED.getName());
        final String[] expected = {
            "27: Missing a Javadoc comment.",
            "39: Missing a Javadoc comment.",
            "52: Missing a Javadoc comment.",
            "63: Missing a Javadoc comment.",
View Full Code Here

    @Test
    public void testAllowMissingTypeParameters() throws Exception
    {
        final DefaultConfiguration checkConfig =
            createCheckConfig(JavadocTypeCheck.class);
        checkConfig.addAttribute("allowMissingParamTags", "true");
        final String[] expected = {
            "7:4: Unused @param tag for '<D123>'.",
        };
        verify(checkConfig, getPath("InputTypeParamsTags.java"), expected);
    }
View Full Code Here

    @Test
    public void testBadTagSuppress() throws Exception
    {
        final DefaultConfiguration checkConfig =
            createCheckConfig(JavadocTypeCheck.class);
        checkConfig.addAttribute("allowUnknownTags", "true");
        final String[] expected = {
        };
        verify(checkConfig,
               getPath("javadoc" + File.separator + "InputBadTag.java"),
               expected);
View Full Code Here

    public void testAnother2()
        throws Exception
    {
        final DefaultConfiguration checkConfig =
            createCheckConfig(JavadocVariableCheck.class);
        checkConfig.addAttribute("scope", Scope.PUBLIC.getName());
        final String[] expected = {
        };
        verify(checkConfig, getPath("InputInner.java"), expected);
    }
View Full Code Here

    public void testAnother4()
        throws Exception
    {
        final DefaultConfiguration checkConfig =
            createCheckConfig(JavadocVariableCheck.class);
        checkConfig.addAttribute("scope", Scope.PUBLIC.getName());
        final String[] expected = {
            "46:5: Missing a Javadoc comment.",
        };
        verify(checkConfig, getPath("InputPublicOnly.java"), expected);
    }
View Full Code Here

    @Test
    public void testScopes2() throws Exception
    {
        final DefaultConfiguration checkConfig =
            createCheckConfig(JavadocVariableCheck.class);
        checkConfig.addAttribute("scope", Scope.PROTECTED.getName());
        final String[] expected = {
            "5:5: Missing a Javadoc comment.",
            "6:5: Missing a Javadoc comment.",
            "16:9: Missing a Javadoc comment.",
            "17:9: Missing a Javadoc comment.",
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.