package com.puppycrawl.tools.checkstyle.checks.coding;

import com.puppycrawl.tools.checkstyle.BaseCheckTestCase;
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;

import java.io.File;
public class ReturnCountCheckTest extends BaseCheckTestCase
{
    public void testDefault() throws Exception
    {
        final DefaultConfiguration checkConfig =
            createCheckConfig(ReturnCountCheck.class);
        final String[] expected = {
            "18:5: Return count is 7 (max allowed is 2).",
            "35:17: Return count is 6 (max allowed is 2).",
        };
        verify(checkConfig, getPath("coding" + File.separator + "InputReturnCount.java"), expected);
    }
}

@@ -681,11 +681,549 @@
 );%0A    %7D
+%0A%0A    public void testFormat() throws Exception%0A    %7B%0A        final DefaultConfiguration checkConfig =%0A            createCheckConfig(ReturnCountCheck.class);%0A        checkConfig.addAttribute(%22format%22, %22%5E$%22);%0A        final String%5B%5D expected = %7B%0A            %225:5: Return count is 7 (max allowed is 2).%22,%0A            %2218:5: Return count is 7 (max allowed is 2).%22,%0A            %2235:17: Return count is 6 (max allowed is 2).%22,%0A        %7D;%0A        verify(checkConfig, getPath(%22coding%22 + File.separator + %22InputReturnCount.java%22), expected);%0A    %7D
 %0A%7D%0A

Test for format property of ReturnCount check