Clover coverage report -
Coverage timestamp: Do Okt 21 2004 12:21:23 CEST
file stats: LOC: 61   Methods: 6
NCLOC: 44   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
InheritanceParserTest.java - 96,2% 83,3% 93,8%
coverage coverage
 1    package org.jconfig.parser;
 2   
 3    import junit.framework.TestCase;
 4    import org.jconfig.Configuration;
 5    import org.jconfig.ConfigurationManager;
 6    /**
 7    * Testcase for testig the NestedConfiguration
 8    *
 9    * @since 2.2
 10    * @author Andreas Mecky <andreas.mecky@xcom.de>
 11    * @author Terry Dye <terry.dye@xcom.de>
 12    */
 13    public class InheritanceParserTest extends TestCase {
 14   
 15  2 public InheritanceParserTest(String arg0) {
 16  2 super(arg0);
 17    }
 18   
 19  0 public static void main(String[] args) {
 20  0 junit.textui.TestRunner.run(InheritanceParserTest.class);
 21    }
 22   
 23  2 public void setUp() throws Exception {
 24    //ConfigurationManager.getInstance().removeConfiguration("e1");
 25    //ConfigurationManager.getInstance().removeConfiguration("e3");
 26  2 System.setProperty("jconfig.parser","org.jconfig.parser.NestedConfigParser");
 27    }
 28   
 29  2 public void tearDown() throws Exception {
 30  2 System.setProperty("jconfig.parser","org.jconfig.parser.DefaultConfigParser");
 31    }
 32   
 33  1 public void testParseConfig() {
 34  1 Configuration config = ConfigurationManager.getConfiguration("e1");
 35  1 String next = config.getProperty("inner",null,"inner/myinner");
 36  1 assertEquals("value",next);
 37  1 next = config.getProperty("hello",null,"inner/myinner/moreinner");
 38  1 assertEquals("universe",next);
 39  1 next = config.getProperty("text",null,"inner/2");
 40  1 assertNull(next);
 41  1 next = config.getProperty("special",null,"inner/2");
 42  1 assertEquals("two",next);
 43  1 config.setProperty("max","10000","inner/myinner/moreinner");
 44  1 next = config.getProperty("max",null,"inner/myinner/moreinner");
 45  1 assertEquals("10000",next);
 46  1 next = config.getProperty("vartest","not set","inner/myinner/moreinner");
 47  1 assertEquals("VarValue-is here",next);
 48  1 config.removeProperty("max","inner/myinner/moreinner");
 49  1 next = config.getProperty("max",null,"inner/myinner/moreinner");
 50  1 assertEquals(null,next);
 51    }
 52   
 53  1 public void testParseCircularDependency() {
 54  1 Configuration config2 = ConfigurationManager.getConfiguration("e1");
 55  1 Configuration config = ConfigurationManager.getConfiguration("e3");
 56  1 String next = config.getProperty("inner",null,"inner/myinner");
 57    // should not be set since the base config was not set
 58  1 System.out.println("next:"+next);
 59  1 assertNull(next);
 60    }
 61    }