1 22 package org.jboss.test.aop.annotateddeclare; 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 public static void main(String [] args) 41 { 42 TestRunner.run(suite()); 43 } 44 45 public static Test suite() 46 { 47 TestSuite suite = new TestSuite("AnnotatedDeclareTestCase"); 48 suite.addTestSuite(AnnotatedDeclareTestCase.class); 49 return suite; 50 } 51 52 public AnnotatedDeclareTestCase(String name) 53 { 54 super(name); 55 } 56 57 public void testLoadtimeAnnotatedDeclare()throws Exception 58 { 59 System.out.println("*** testLoadtimeAnnotatedDeclare"); 60 SystemOutDecorator out = null; 61 try 62 { 63 out = SystemOutDecorator.initialise(); 64 POJO pojo = new POJO(); 65 pojo.someMethod(); 66 ArrayList actual = out.getWarnings(); 67 assertEquals("Wrong number of warnings generated", 1, actual.size()); 68 String s = (String )actual.get(0); 69 assertTrue("Warning does not end with the expected \"Expected annotated warning\"", s.endsWith("Expected annotated warning\n")); 70 } 71 finally 72 { 73 out.kill(); 74 } 75 } 76 77 } 78 | Popular Tags |