1 5 package org.jdesktop.swing.form; 6 7 import java.util.ArrayList ; 8 import java.util.List ; 9 10 import javax.swing.JComponent ; 11 import javax.swing.ListModel ; 12 13 import junit.framework.TestCase; 14 15 import org.jdesktop.swing.data.MetaData; 16 17 20 public class ComponentMapTest extends TestCase { 21 22 26 public void testAssignables() { 27 MetaData metaData = new MetaData("list", List .class); 28 JComponent listComp = ComponentMap.getInstance().createComponent(metaData); 29 MetaData arrayMetaData = new MetaData("array", Object [].class); 30 JComponent arrayComp = ComponentMap.getInstance().createComponent(arrayMetaData); 31 assertEquals("array and list must produce same component", listComp.getClass(), arrayComp.getClass()); 32 MetaData arrayListMetaData = new MetaData("arrayList", ArrayList .class); 33 JComponent arrayListComp = ComponentMap.getInstance().createComponent(arrayListMetaData); 34 assertEquals("arrayList and list must produce same component", listComp.getClass(), arrayListComp.getClass()); 35 } 40 } 41 | Popular Tags |