1 16 package net.sf.cglib.beans; 17 18 import junit.framework.*; 19 import java.util.*; 20 21 25 public class TestBeanMapProxy extends net.sf.cglib.CodeGenTestCase { 26 public void testBeanMap() throws Exception { 27 HashMap identity = new HashMap(); 28 Person person = (Person)BeanMapProxy.newInstance(identity, new Class []{ Person.class }); 29 person.setName("Chris"); 30 assertTrue("Chris".equals(person.getName())); 31 assertTrue("Chris".equals(identity.get("Name"))); 32 } 33 34 public interface Person { 35 public String getName(); 36 public void setName(String name); 37 } 38 39 public TestBeanMapProxy(String testName) { 40 super(testName); 41 } 42 43 public static void main(String [] args) { 44 junit.textui.TestRunner.run(suite()); 45 } 46 47 public static Test suite() { 48 return new TestSuite(TestBeanMapProxy.class); 49 } 50 51 public void perform(ClassLoader loader) throws Throwable { 52 } 54 55 public void testFailOnMemoryLeak() throws Throwable { 56 } 57 58 } 59 | Popular Tags |