1 18 package org.apache.activemq.util; 19 20 import java.net.URI ; 21 import java.net.URISyntaxException ; 22 import java.util.HashMap ; 23 24 import org.apache.activemq.util.IntrospectionSupport; 25 26 import junit.framework.TestCase; 27 28 public class ReflectionSupportTest extends TestCase { 29 30 public void testSetProperties() throws URISyntaxException { 31 SimplePojo pojo = new SimplePojo(); 32 HashMap map = new HashMap (); 33 map.put("age", "27"); 34 map.put("name", "Hiram"); 35 map.put("enabled", "true"); 36 map.put("uri", "test://value"); 37 38 IntrospectionSupport.setProperties(pojo, map); 39 40 assertEquals(27, pojo.getAge()); 41 assertEquals("Hiram", pojo.getName()); 42 assertEquals(true, pojo.isEnabled()); 43 assertEquals(new URI ("test://value"), pojo.getUri()); 44 } 45 } 46 | Popular Tags |