Package com.puppycrawl.tools.checkstyle

Examples of com.puppycrawl.tools.checkstyle.DefaultConfiguration


    }

    @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


    }

    @Test
    public void testExcludeScope() throws Exception
    {
        final DefaultConfiguration checkConfig =
            createCheckConfig(JavadocVariableCheck.class);
        checkConfig.addAttribute("scope", Scope.PRIVATE.getName());
        checkConfig.addAttribute("excludeScope", Scope.PROTECTED.getName());
        final String[] expected = {
            "7:5: Missing a Javadoc comment.",
            "8:5: Missing a Javadoc comment.",
            "18:9: Missing a Javadoc comment.",
            "19:9: Missing a Javadoc comment.",
View Full Code Here

    @Test
    public void testIgnoredVariableNames()
        throws Exception
    {
        final DefaultConfiguration checkConfig =
                createCheckConfig(JavadocVariableCheck.class);
        checkConfig.addAttribute("ignoreNamePattern", "log|logger");
        final String[] expected = {
            "5:5: Missing a Javadoc comment.",
            "6:5: Missing a Javadoc comment.",
            "7:5: Missing a Javadoc comment.",
            "8:5: Missing a Javadoc comment.",
View Full Code Here

{

    @Test
    public void testCorrect() throws Exception
    {
        DefaultConfiguration checkConfig = createCheckConfig(AtclauseOrderCheck.class);
        final String[] expected = {};

        verify(checkConfig, getPath("javadoc/InputCorrectAtClauseOrderCheck.java"), expected);
    }
View Full Code Here

    @Test
    public void testIncorrect() throws Exception
    {
        final String tagOrder = "'[@author, @version, @param, @return, @throws, @exception, @see,"
                + " @since, @serial, @serialField, @serialData, @deprecated]'.";
        DefaultConfiguration checkConfig = createCheckConfig(AtclauseOrderCheck.class);
        final String[] expected = {
            "9: At-clauses have to appear in the order " + tagOrder,
            "11: At-clauses have to appear in the order " + tagOrder,
            "12: At-clauses have to appear in the order " + tagOrder,
            "40: At-clauses have to appear in the order " + tagOrder,
View Full Code Here

    @Test
    public void testIncorrectCustom() throws Exception
    {
        final String tagOrder = "'[@author, @version, @param, @return, @throws, @exception, @see,"
                + " @since, @serial, @serialField, @serialData, @deprecated]'.";
        DefaultConfiguration checkConfig = createCheckConfig(AtclauseOrderCheck.class);
        checkConfig.addAttribute("target", "CLASS_DEF");

        final String[] expected = {
            "9: At-clauses have to appear in the order " + tagOrder,
            "11: At-clauses have to appear in the order " + tagOrder,
            "12: At-clauses have to appear in the order " + tagOrder,
View Full Code Here

    extends BcelCheckTestCase
{
    public void testIt()
            throws Exception
    {
        final DefaultConfiguration checkConfig =
            createCheckConfig(HiddenStaticMethodCheck.class);

        final String[] expected = {
            "0: Static method 'public static int staticMethod()' hides method in class 'com.puppycrawl.tools.checkstyle.bcel.checks.SuperClass'.",
            "0: Static method 'public static int staticMethodSameParamName(int i)' hides method in class 'com.puppycrawl.tools.checkstyle.bcel.checks.SuperClass'.",
View Full Code Here

    extends BcelCheckTestCase
{
    public void testIt()
            throws Exception
    {
        final DefaultConfiguration checkConfig =
            createCheckConfig(HiddenInheritedFieldCheck.class);

        final String[] expected = {
            "0: Field 'private int subClassPrivate' hides field in class 'com.puppycrawl.tools.checkstyle.bcel.checks.SuperClass'.",
            "0: Field 'protected int differentType' hides field in class 'com.puppycrawl.tools.checkstyle.bcel.checks.SuperClass'.",
View Full Code Here

public class UnusedParameterCheckTest
    extends BaseCheckTestCase
{
    public void testDefault() throws Exception
    {
        final DefaultConfiguration checkConfig =
            createCheckConfig(UnusedParameterCheck.class);
        final String[] expected = {
            "8:57: Unused parameter 'aUnreadPrimitive'.",
            "16:16: Unused parameter 'aUnreadObject'.",
            "29:66: Unused parameter 'aUnreadArray'.",           
View Full Code Here

        verify(checkConfig, getPath("usage/InputUnusedParameter.java"), expected);
    }
   
    public void testException() throws Exception
    {
        final DefaultConfiguration checkConfig =
            createCheckConfig(UnusedParameterCheck.class);
        checkConfig.addAttribute("ignoreCatch", Boolean.FALSE.toString());
        final String[] expected = {
            "8:57: Unused parameter 'aUnreadPrimitive'.",
            "16:16: Unused parameter 'aUnreadObject'.",
            "25:26: Unused parameter 'unreadException'.",
            "29:66: Unused parameter 'aUnreadArray'.",           
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.