KickJava   Java API By Example, From Geeks To Geeks.

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


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.SessionBeanCheck;
5
6 public class SessionBeanCheckTest extends BaseCheckTestCase
7 {
8     public void testDefault()
9             throws Exception JavaDoc
10     {
11         final DefaultConfiguration checkConfig =
12             createCheckConfig(SessionBeanCheck.class);
13         final String JavaDoc[] expected = {
14             "12:14: Session bean 'InputSessionBean' must have method 'ejbCreate<METHOD>(...)'.",
15             "53:16: Session bean 'AbstractSessionBean' must be public.",
16             "53:16: Session bean 'AbstractSessionBean' must have method 'ejbCreate<METHOD>(...)'.",
17             "53:16: Session bean 'AbstractSessionBean' must not have modifier 'abstract'.",
18             "58:13: Session bean 'FinalSessionBean' must be public.",
19             "58:13: Session bean 'FinalSessionBean' must not define the 'finalize()' method.",
20             "58:13: Session bean 'FinalSessionBean' must not have modifier 'final'.",
21         };
22         verify(checkConfig, getPath("j2ee/InputSessionBean.java"), expected);
23     }
24 }
25
Popular Tags