1 10 package org.jgap.event; 11 12 import junit.framework.*; 13 14 15 import org.jgap.*; 16 17 23 public class GeneticEventTest 24 extends JGAPTestCase { 25 26 private final static String CVS_REVISION = "$Revision: 1.7 $"; 27 28 public static Test suite() { 29 TestSuite suite = new TestSuite(GeneticEventTest.class); 30 return suite; 31 } 32 33 37 public void testConstruct_0() { 38 try { 39 new GeneticEvent("testEventName", null); 40 fail(); 41 } 42 catch (IllegalArgumentException illex) { 43 ; } 45 } 46 47 51 public void testConstruct_1() { 52 GeneticEvent event = new GeneticEvent(null, this); 53 assertNull(event.getEventName()); 54 } 55 56 60 public void testConstruct_2() { 61 GeneticEvent event = new GeneticEvent("testName", this); 62 assertEquals("testName", event.getEventName()); 63 } 64 65 69 public void testConstruct_3() { 70 GeneticEvent event = new GeneticEvent("testName", this, "aValue"); 71 assertEquals("testName", event.getEventName()); 72 assertEquals("aValue", event.getValue()); 73 } 74 75 79 public void testGetEventName_0() { 80 GeneticEvent event = new GeneticEvent("testEventName", this); 81 assertEquals("testEventName", event.getEventName()); 82 } 83 84 88 public void testGENOTYPE_EVOLVED_EVENT_0() { 89 assertTrue(GeneticEvent.GENOTYPE_EVOLVED_EVENT != null); 90 assertTrue(GeneticEvent.GENOTYPE_EVOLVED_EVENT.length() > 0); 91 } 92 93 } 94 | Popular Tags |