Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/puppycrawl/tools/checkstyle/checks/imports/RedundantImportCheckTest.java


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
11      {
12          final DefaultConfiguration checkConfig =
13              createCheckConfig(RedundantImportCheck.class);
14          final String[] 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          };
21          verify(checkConfig, getPath("InputImport.java"), expected);
22      }
23  }