1 package com.puppycrawl.tools.checkstyle.checks.j2ee; 2 import com.puppycrawl.tools.checkstyle.BaseCheckTestCase; 3 import com.puppycrawl.tools.checkstyle.DefaultConfiguration; 4 import com.puppycrawl.tools.checkstyle.checks.j2ee.ThisReturnCheck; 5 6 public class ThisReturnCheckTest extends BaseCheckTestCase 7 { 8 public void testEntityBean() 9 throws Exception 10 { 11 final DefaultConfiguration checkConfig = 12 createCheckConfig(ThisReturnCheck.class); 13 final String [] expected = { 14 "24:16: Do not return 'this'.", 15 }; 16 verify(checkConfig, getPath("j2ee/InputEntityBean.java"), expected); 17 } 18 19 public void testMessageBean() 20 throws Exception 21 { 22 final DefaultConfiguration checkConfig = 23 createCheckConfig(ThisReturnCheck.class); 24 final String [] expected = { 25 "64:16: Do not return 'this'.", 26 }; 27 verify(checkConfig, getPath("j2ee/InputMessageBean.java"), expected); 28 } 29 30 public void testSessionBean() 31 throws Exception 32 { 33 final DefaultConfiguration checkConfig = 34 createCheckConfig(ThisReturnCheck.class); 35 final String [] expected = { 36 "77:16: Do not return 'this'.", 37 }; 38 verify(checkConfig, getPath("j2ee/InputSessionBean.java"), expected); 39 } 40 } 41 | Popular Tags |