KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jgap > data > config > MetaConfigTest


1 /*
2  * This file is part of JGAP.
3  *
4  * JGAP offers a dual license model containing the LGPL as well as the MPL.
5  *
6  * For licencing information please see the file license.txt included with JGAP
7  * or have a look at the top of class org.jgap.Chromosome which representatively
8  * includes the JGAP license policy applicable for any file delivered with JGAP.
9  */

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
23     extends JGAPTestCase {
24   /** String containing the CVS revision. Read out via reflection!*/
25   private final static String JavaDoc CVS_REVISION = "$Revision: 1.1 $";
26
27   // number of chromosomes used in test case
28
private final static int NUM_CHROMS = 5;
29
30   // number of genes used in test case
31
private final static int NUM_GENES = 2;
32
33   public static Test suite() {
34     TestSuite suite = new TestSuite(MetaConfigTest.class);
35     return suite;
36   }
37
38   public void testSingleton_0() throws Exception JavaDoc {
39     MetaConfig mc = MetaConfig.getInstance();
40     assertSame(MetaConfig.getInstance(), mc);
41     assertSame(MetaConfig.getInstance(), mc);
42   }
43
44   public void testGetConfigProperty_0() throws Exception JavaDoc {
45     MetaConfig mc = MetaConfig.getInstance();
46     List props = mc.getConfigProperty("org.jgap.Configuration");
47     assertEquals(4, props.size());
48     props = mc.getConfigProperty("org.jgap.impl.TournamentSelector");
49     assertEquals(1, props.size());
50   }
51
52 }
53
Popular Tags