1 29 30 package nextapp.echo2.app.test.componentxml; 31 32 import nextapp.echo2.app.Color; 33 import nextapp.echo2.app.componentxml.ComponentIntrospector; 34 import junit.framework.TestCase; 35 36 39 public class ComponentIntrospectorTest extends TestCase { 40 41 public void testIntrospection() 42 throws Exception { 43 ComponentIntrospector ci = ComponentIntrospector.forName("nextapp.echo2.app.Label", 44 ComponentIntrospectorTest.class.getClassLoader()); 45 assertEquals(String .class, ci.getPropertyClass("text")); 46 assertEquals(Color.class, ci.getPropertyClass("background")); 47 } 48 49 public void testConstants() 50 throws Exception { 51 ComponentIntrospector ci = ComponentIntrospector.forName("nextapp.echo2.app.Grid", 52 ComponentIntrospectorTest.class.getClassLoader()); 53 assertEquals(new Integer (0), ci.getConstantValue("ORIENTATION_HORIZONTAL")); 54 assertEquals(new Integer (1), ci.getConstantValue("ORIENTATION_VERTICAL")); 55 } 56 } 57 | Popular Tags |