01: package com.puppycrawl.tools.checkstyle.checks.sizes;
02:
03: import com.puppycrawl.tools.checkstyle.BaseCheckTestCase;
04: import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
05:
06: public class LineLengthCheckTest extends BaseCheckTestCase {
07: public void testSimple() throws Exception {
08: final DefaultConfiguration checkConfig = createCheckConfig(LineLengthCheck.class);
09: checkConfig.addAttribute("max", "80");
10: checkConfig
11: .addAttribute("ignorePattern", "^.*is OK.*regexp.*$");
12: final String[] expected = {
13: "18: Line is longer than 80 characters.",
14: "145: Line is longer than 80 characters.", };
15: verify(checkConfig, getPath("InputSimple.java"), expected);
16: }
17: }
|