KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > puppycrawl > tools > checkstyle > checks > imports > RedundantImportCheckTest


1 package com.puppycrawl.tools.checkstyle.checks.imports;
2
3 import com.puppycrawl.tools.checkstyle.BaseCheckTestCase;
4 import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
5
6 public class RedundantImportCheckTest
7     extends BaseCheckTestCase
8 {
9     public void testWithChecker()
10         throws Exception JavaDoc
11     {
12         final DefaultConfiguration checkConfig =
13             createCheckConfig(RedundantImportCheck.class);
14         final String JavaDoc[] expected = {
15             "7:1: Redundant import from the same package - com.puppycrawl.tools.checkstyle.*.",
16             "8:38: Redundant import from the same package - com.puppycrawl.tools.checkstyle.GlobalProperties.",
17             "10:1: Redundant import from the java.lang package - java.lang.*.",
18             "11:1: Redundant import from the java.lang package - java.lang.String.",
19             "14:1: Duplicate import to line 13 - java.util.List.",
20             "26:1: Duplicate import to line 25 - javax.swing.WindowConstants.*."
21         };
22         verify(checkConfig, getPath("InputImport.java"), expected);
23     }
24 }
25
Popular Tags