Package com.puppycrawl.tools.checkstyle

Examples of com.puppycrawl.tools.checkstyle.DefaultConfiguration


    }

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


    }

    @Test
    public void testAuthorRequired() throws Exception
    {
        final DefaultConfiguration checkConfig =
            createCheckConfig(JavadocTypeCheck.class);
        checkConfig.addAttribute("authorFormat", "\\S");
        final String[] expected =
        {
            "13: Type Javadoc comment is missing an @author tag.",
        };
        verify(checkConfig, getPath("InputWhitespace.java"), expected);
View Full Code Here

    @Test
    public void testAuthorRegularEx()
        throws Exception
    {
        final DefaultConfiguration checkConfig =
            createCheckConfig(JavadocTypeCheck.class);
        checkConfig.addAttribute("authorFormat", "0*");
        final String[] expected = {
            "22: Type Javadoc comment is missing an @author tag.",
            "58: Type Javadoc comment is missing an @author tag.",
            "94: Type Javadoc comment is missing an @author tag.",
        };
View Full Code Here

    @Test
    public void testAuthorRegularExError()
        throws Exception
    {
        final DefaultConfiguration checkConfig =
            createCheckConfig(JavadocTypeCheck.class);
        checkConfig.addAttribute("authorFormat", "ABC");
        final String[] expected = {
            "13: Type Javadoc tag @author must match pattern 'ABC'.",
            "22: Type Javadoc comment is missing an @author tag.",
            "31: Type Javadoc tag @author must match pattern 'ABC'.",
            "49: Type Javadoc tag @author must match pattern 'ABC'.",
View Full Code Here

    @Test
    public void testVersionRequired()
        throws Exception
    {
        final DefaultConfiguration checkConfig =
            createCheckConfig(JavadocTypeCheck.class);
        checkConfig.addAttribute("versionFormat", "\\S");
        final String[] expected = {
            "13: Type Javadoc comment is missing an @version tag.",
        };
        verify(checkConfig, getPath("InputWhitespace.java"), expected);
    }
View Full Code Here

    @Test
    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

    @Test
    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 testScopes() throws Exception
    {
        final DefaultConfiguration checkConfig =
            createCheckConfig(JavadocTypeCheck.class);
        final String[] expected = {
            "3: Missing a Javadoc comment.",
            "15: Missing a Javadoc comment.",
            "27: Missing a Javadoc comment.",
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.",
            "63: Missing a Javadoc comment.",
View Full Code Here

TOP

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

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.