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 InnerAssignmentCheckTest 9 extends BaseCheckTestCase 10 { 11 public void testIt() throws Exception 12 { 13 final DefaultConfiguration checkConfig = 14 createCheckConfig(InnerAssignmentCheck.class); 15 final String [] expected = { 16 "11:15: Inner assignments should be avoided.", 17 "11:19: Inner assignments should be avoided.", 18 "13:39: Inner assignments should be avoided.", 19 "15:35: Inner assignments should be avoided.", 20 21 "33:16: Inner assignments should be avoided.", 22 "34:24: Inner assignments should be avoided.", 23 "35:19: Inner assignments should be avoided.", 24 "36:17: Inner assignments should be avoided.", 25 "37:29: Inner assignments should be avoided.", 26 "38:20: Inner assignments should be avoided.", 27 "39:17: Inner assignments should be avoided.", 28 "39:31: Inner assignments should be avoided.", 29 "39:41: Inner assignments should be avoided.", 30 "40:16: Inner assignments should be avoided.", 31 "40:27: Inner assignments should be avoided.", 32 "41:32: Inner assignments should be avoided.", 33 }; 34 verify(checkConfig, getPath("coding" + File.separator + "InputInnerAssignment.java"), expected); 35 } 36 } 37 | Popular Tags |