KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > puppycrawl > tools > checkstyle > checks > j2ee > ThisReturnCheckTest


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 JavaDoc
10     {
11         final DefaultConfiguration checkConfig =
12             createCheckConfig(ThisReturnCheck.class);
13         final String JavaDoc[] 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 JavaDoc
21     {
22         final DefaultConfiguration checkConfig =
23             createCheckConfig(ThisReturnCheck.class);
24         final String JavaDoc[] 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 JavaDoc
32     {
33         final DefaultConfiguration checkConfig =
34             createCheckConfig(ThisReturnCheck.class);
35         final String JavaDoc[] expected = {
36             "77:16: Do not return 'this'.",
37         };
38         verify(checkConfig, getPath("j2ee/InputSessionBean.java"), expected);
39     }
40 }
41
Popular Tags