1 package com.puppycrawl.tools.checkstyle.checks.coding; 2 3 import java.io.File ; 4 5 import com.puppycrawl.tools.checkstyle.BaseCheckTestCase; 6 import com.puppycrawl.tools.checkstyle.DefaultConfiguration; 7 8 public class StringLiteralEqualityCheckTest 9 extends BaseCheckTestCase 10 { 11 public void testIt() 12 throws Exception 13 { 14 final DefaultConfiguration checkConfig = 15 createCheckConfig(StringLiteralEqualityCheck.class); 16 final String [] expected = { 17 "11:18: Literal Strings should be compared using equals(), not '=='.", 18 "16:20: Literal Strings should be compared using equals(), not '=='.", 19 "21:22: Literal Strings should be compared using equals(), not '=='.", 20 }; 21 verify(checkConfig, getPath("coding" + File.separator + "InputStringLiteralEquality.java"), expected); 22 } 23 } 24 25 | Popular Tags |