KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > puppycrawl > tools > checkstyle > checks > sizes > LineLengthCheckTest


1 package com.puppycrawl.tools.checkstyle.checks.sizes;
2
3 import com.puppycrawl.tools.checkstyle.BaseCheckTestCase;
4 import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
5
6 public class LineLengthCheckTest extends BaseCheckTestCase
7 {
8     public void testSimple()
9         throws Exception JavaDoc
10     {
11         final DefaultConfiguration checkConfig =
12             createCheckConfig(LineLengthCheck.class);
13         checkConfig.addAttribute("max", "80");
14         checkConfig.addAttribute("ignorePattern", "^.*is OK.*regexp.*$");
15         final String JavaDoc[] expected = {
16             "18: Line is longer than 80 characters.",
17             "145: Line is longer than 80 characters.",
18         };
19         verify(checkConfig, getPath("InputSimple.java"), expected);
20     }
21 }
22
Popular Tags