KickJava   Java API By Example, From Geeks To Geeks.

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


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.ThisParameterCheck;
5
6 public class ThisParameterCheckTest extends BaseCheckTestCase
7 {
8     public void testEntityBean()
9             throws Exception JavaDoc
10     {
11         final DefaultConfiguration checkConfig =
12             createCheckConfig(ThisParameterCheck.class);
13         final String JavaDoc[] expected = {
14             "23:20: Do not pass 'this' as a parameter.",
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(ThisParameterCheck.class);
24         final String JavaDoc[] expected = {
25             "63:19: Do not pass 'this' as a parameter.",
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(ThisParameterCheck.class);
35         final String JavaDoc[] expected = {
36             "76:19: Do not pass 'this' as a parameter.",
37         };
38         verify(checkConfig, getPath("j2ee/InputSessionBean.java"), expected);
39     }
40 }
41
Popular Tags