1 10 package org.jgap; 11 12 import junit.framework.*; 13 14 20 public class BaseRateCalculatorTest 21 extends JGAPTestCase { 22 23 private final static String CVS_REVISION = "$Revision: 1.1 $"; 24 25 public static Test suite() { 26 TestSuite suite = new TestSuite(BaseRateCalculatorTest.class); 27 return suite; 28 } 29 30 37 public void testConstruct_0() 38 throws Exception { 39 assertNotNull(new BaseRateCalculatorImpl(conf)); 40 } 41 42 48 public void testConstruct_1() 49 throws Exception { 50 try { 51 new BaseRateCalculatorImpl(null); 52 fail(); 53 } 54 catch (InvalidConfigurationException iex) { 55 ; } 57 } 58 59 65 public void testGetConfiguration_0() 66 throws Exception { 67 BaseRateCalculator calc = new BaseRateCalculatorImpl(conf); 68 assertSame(conf, calc.getConfiguration()); 69 } 70 71 78 class BaseRateCalculatorImpl 79 extends BaseRateCalculator { 80 public BaseRateCalculatorImpl(final Configuration a_config) 81 throws InvalidConfigurationException { 82 super(a_config); 83 } 84 85 public int calculateCurrentRate() { 86 return 0; 87 } 88 89 public boolean toBePermutated(IChromosome a_chrom, int a_geneIndex) { 90 return true; 91 } 92 } 93 class AppDataForTest 94 implements IApplicationData { 95 public int compareTo(Object o2) { 96 return 0; 97 } 98 99 public Object clone() 100 throws CloneNotSupportedException { 101 return null; 102 } 103 } 104 } 105 | Popular Tags |