KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > puppycrawl > tools > checkstyle > checks > coding > PackageDeclarationCheckTest


1 package com.puppycrawl.tools.checkstyle.checks.coding;
2
3 import com.puppycrawl.tools.checkstyle.BaseCheckTestCase;
4 import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
5
6 import java.io.File JavaDoc;
7
8 public class PackageDeclarationCheckTest extends BaseCheckTestCase
9 {
10     public void testDefault() throws Exception JavaDoc
11     {
12         DefaultConfiguration checkConfig = createCheckConfig(PackageDeclarationCheck.class);
13
14         String JavaDoc[] expected = {
15             "4: Missing package declaration.",
16         };
17
18         verify(checkConfig, getPath("coding" + File.separator + "InputNoPackage.java"), expected);
19     }
20
21     public void testDefault1() throws Exception JavaDoc
22     {
23         DefaultConfiguration checkConfig = createCheckConfig(PackageDeclarationCheck.class);
24
25         String JavaDoc[] expected = {
26         };
27
28         verify(checkConfig, getPath("coding" + File.separator + "InputIllegalCatchCheck.java"), expected);
29     }
30 }
31
Popular Tags