1 10 package org.jgap.data.config; 11 12 import org.jgap.*; 13 import junit.framework.*; 14 15 21 public class ConfigPropertyTest 22 extends JGAPTestCase { 23 24 private final static String CVS_REVISION = "$Revision: 1.1 $"; 25 26 private final static int NUM_CHROMS = 5; 28 29 private final static int NUM_GENES = 2; 31 32 public static Test suite() { 33 TestSuite suite = new TestSuite(ConfigPropertyTest.class); 34 return suite; 35 } 36 37 public void testConstruct_0() throws Exception { 38 ConfigProperty cp = new ConfigProperty(); 39 assertEquals(0, cp.getName().length()); 40 assertEquals(0, cp.getLabel().length()); 41 assertEquals("JTextField", cp.getWidget()); 42 assertFalse(cp.getValuesIter().hasNext()); 43 } 44 45 public void testGetName_0() throws Exception { 46 ConfigProperty cp = new ConfigProperty(); 47 final String name = "MysTRING"; 48 cp.setName(name); 49 assertEquals(name, cp.getName()); 50 assertEquals(name, cp.getLabel()); 51 cp.setName("something"); 52 assertEquals(name, cp.getLabel()); 53 } 54 55 public void testGetWidget_0() throws Exception { 56 ConfigProperty cp = new ConfigProperty(); 57 final String name = "MysTRING"; 58 cp.setWidget(name); 59 assertEquals(name, cp.getWidget()); 60 } 61 62 public void testGetLabel_0() throws Exception { 63 ConfigProperty cp = new ConfigProperty(); 64 final String name = "MysTRING"; 65 cp.setLabel(name); 66 assertEquals(name, cp.getLabel()); 67 } 68 69 public void testAddValue_0() throws Exception { 70 ConfigProperty cp = new ConfigProperty(); 71 final String name = "MysTRING"; 72 cp.addValue(name); 73 assertTrue(cp.getValuesIter().hasNext()); 74 String value = (String )cp.getValuesIter().next(); 75 assertEquals(name, value); 76 } 77 } 78 | Popular Tags |