01: package com.puppycrawl.tools.checkstyle.checks.j2ee;
02:
03: import com.puppycrawl.tools.checkstyle.BaseCheckTestCase;
04: import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
05: import com.puppycrawl.tools.checkstyle.checks.j2ee.SessionBeanCheck;
06:
07: public class SessionBeanCheckTest extends BaseCheckTestCase {
08: public void testDefault() throws Exception {
09: final DefaultConfiguration checkConfig = createCheckConfig(SessionBeanCheck.class);
10: final String[] expected = {
11: "12:14: Session bean 'InputSessionBean' must have method 'ejbCreate<METHOD>(...)'.",
12: "53:16: Session bean 'AbstractSessionBean' must be public.",
13: "53:16: Session bean 'AbstractSessionBean' must have method 'ejbCreate<METHOD>(...)'.",
14: "53:16: Session bean 'AbstractSessionBean' must not have modifier 'abstract'.",
15: "58:13: Session bean 'FinalSessionBean' must be public.",
16: "58:13: Session bean 'FinalSessionBean' must not define the 'finalize()' method.",
17: "58:13: Session bean 'FinalSessionBean' must not have modifier 'final'.", };
18: verify(checkConfig, getPath("j2ee/InputSessionBean.java"),
19: expected);
20: }
21: }
|