1 22 package org.jboss.test.aop.jdk15.annotated.declare; 23 24 import java.util.ArrayList ; 25 26 import org.jboss.test.aop.AOPTestWithSetup; 27 28 import junit.framework.Test; 29 import junit.framework.TestSuite; 30 import junit.textui.TestRunner; 31 32 33 38 public class AnnotatedDeclareTestCase extends AOPTestWithSetup 39 { 40 SystemOutDecorator out = null; 41 public static void main(String [] args) 42 { 43 TestRunner.run(suite()); 44 } 45 46 public static Test suite() 47 { 48 TestSuite suite = new TestSuite("AnnotatedDeclareTestCase"); 49 suite.addTestSuite(AnnotatedDeclareTestCase.class); 50 return suite; 51 } 52 53 public AnnotatedDeclareTestCase(String name) 54 { 55 super(name); 56 } 57 58 protected void setUp() throws Exception 59 { 60 out = SystemOutDecorator.initialise(); 61 super.setUp(); 62 } 63 64 public void testLoadtimeAnnotatedDeclare()throws Exception 65 { 66 System.out.println("*** testLoadtimeAnnotatedDeclare"); 67 POJO pojo = new POJO(); 68 pojo.someMethod(); 69 ArrayList actual = out.getWarnings(); 70 assertEquals("Wrong number of warnings generated", 1, actual.size()); 71 String s = (String )actual.get(0); 72 assertTrue("Warning does not end with the expected \"Expected annotated warning\"", s.endsWith("Expected annotated warning\n")); 73 } 74 75 } 76 | Popular Tags |