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.MessageBeanCheck; 5 6 public class MessageBeanCheckTest extends BaseCheckTestCase 7 { 8 public void testDefault() 9 throws Exception 10 { 11 final DefaultConfiguration checkConfig = 12 createCheckConfig(MessageBeanCheck.class); 13 final String [] expected = { 14 "12:14: Message bean 'InputMessageBean' must have method 'ejbCreate()'.", 15 "41:16: Message bean 'AbstractMessageBean' must be public.", 16 "41:16: Message bean 'AbstractMessageBean' must not have modifier 'abstract'.", 17 "53:13: Message bean 'FinalMessageBean' must be public.", 18 "53:13: Message bean 'FinalMessageBean' must not have modifier 'final'.", 19 "67:32: Method 'ejbCreate' must be public.", 20 "67:32: Method 'ejbCreate' must be void.", 21 "67:32: Method 'ejbCreate' must have 0 parameter(s).", 22 "67:32: Method 'ejbCreate' must not have modifier 'final'.", 23 "67:32: Method 'ejbCreate' must not have modifier 'static'.", 24 }; 25 verify(checkConfig, getPath("j2ee/InputMessageBean.java"), expected); 26 } 27 } 28 | Popular Tags |