KickJava   Java API By Example, From Geeks To Geeks.

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


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 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
22     extends JGAPTestCase {
23   /** String containing the CVS revision. Read out via reflection!*/
24   private final static String JavaDoc CVS_REVISION = "$Revision: 1.1 $";
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(RootConfigurationHandlerTest.class);
34     return suite;
35   }
36
37   public void testConstruct_0() throws Exception JavaDoc {
38     RootConfigurationHandler root = new RootConfigurationHandler();
39     assertNull(root.getConfigProperties());
40   }
41
42   public void testGetNameSpace_0() throws Exception JavaDoc {
43     RootConfigurationHandler root = new RootConfigurationHandler();
44     assertEquals("org.jgap.Configuration",root.getNS());
45   }
46
47   public void testGetPrivateField_0() throws Exception JavaDoc {
48     RootConfigurationHandler root = new RootConfigurationHandler();
49     assertNull(root.getPrivateField(root, "nix"));
50   }
51
52   public void testGetPrivateField_1() throws Exception JavaDoc {
53     RootConfigurationHandler root = new RootConfigurationHandler();
54     assertNull(root.getPrivateField(root, "CONFIG_NAMESPACe"));
55     java.lang.reflect.Field JavaDoc f = root.getPrivateField(root, "CONFIG_NAMESPACE");
56     assertEquals(root.getClass(), f.getDeclaringClass());
57     assertTrue(f.isAccessible());
58   }
59
60 }
61
Popular Tags