01: /*
02: * This file is part of JGAP.
03: *
04: * JGAP offers a dual license model containing the LGPL as well as the MPL.
05: *
06: * For licencing information please see the file license.txt included with JGAP
07: * or have a look at the top of class org.jgap.Chromosome which representatively
08: * includes the JGAP license policy applicable for any file delivered with JGAP.
09: */
10: package org.jgap.data.config;
11:
12: import java.util.*;
13: import org.jgap.*;
14: import junit.framework.*;
15:
16: /**
17: * Tests the MetaConfig class.
18: *
19: * @author Klaus Meffert
20: * @since 3.0
21: */
22: public class MetaConfigTest extends JGAPTestCase {
23: /** String containing the CVS revision. Read out via reflection!*/
24: private final static String CVS_REVISION = "$Revision: 1.2 $";
25:
26: // number of chromosomes used in test case
27: private final static int NUM_CHROMS = 5;
28:
29: // number of genes used in test case
30: private final static int NUM_GENES = 2;
31:
32: public static Test suite() {
33: TestSuite suite = new TestSuite(MetaConfigTest.class);
34: return suite;
35: }
36:
37: public void testSingleton_0() throws Exception {
38: MetaConfig mc = MetaConfig.getInstance();
39: assertSame(MetaConfig.getInstance(), mc);
40: assertSame(MetaConfig.getInstance(), mc);
41: }
42:
43: public void testGetConfigProperty_0() throws Exception {
44: MetaConfig mc = MetaConfig.getInstance();
45: List props = mc.getConfigProperty("org.jgap.Configuration");
46: assertEquals(4, props.size());
47: props = mc
48: .getConfigProperty("org.jgap.impl.TournamentSelector");
49: assertEquals(1, props.size());
50: }
51: }
|