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 org.jgap.*;
13: import junit.framework.*;
14:
15: /**
16: * Tests the RootConfigurationHandler class
17: *
18: * @author Klaus Meffert
19: * @since 3.0
20: */
21: public class RootConfigurationHandlerTest extends JGAPTestCase {
22: /** String containing the CVS revision. Read out via reflection!*/
23: private final static String CVS_REVISION = "$Revision: 1.1 $";
24:
25: // number of chromosomes used in test case
26: private final static int NUM_CHROMS = 5;
27:
28: // number of genes used in test case
29: private final static int NUM_GENES = 2;
30:
31: public static Test suite() {
32: TestSuite suite = new TestSuite(
33: RootConfigurationHandlerTest.class);
34: return suite;
35: }
36:
37: public void testConstruct_0() throws Exception {
38: RootConfigurationHandler root = new RootConfigurationHandler();
39: assertNull(root.getConfigProperties());
40: }
41:
42: public void testGetNameSpace_0() throws Exception {
43: RootConfigurationHandler root = new RootConfigurationHandler();
44: assertEquals("org.jgap.Configuration", root.getNS());
45: }
46:
47: public void testGetPrivateField_0() throws Exception {
48: RootConfigurationHandler root = new RootConfigurationHandler();
49: assertNull(root.getPrivateField(root, "nix"));
50: }
51:
52: public void testGetPrivateField_1() throws Exception {
53: RootConfigurationHandler root = new RootConfigurationHandler();
54: assertNull(root.getPrivateField(root, "CONFIG_NAMESPACe"));
55: java.lang.reflect.Field f = root.getPrivateField(root,
56: "CONFIG_NAMESPACE");
57: assertEquals(root.getClass(), f.getDeclaringClass());
58: assertTrue(f.isAccessible());
59: }
60:
61: }
|