Clover coverage report -
Coverage timestamp: Do Okt 21 2004 12:21:23 CEST
file stats: LOC: 66   Methods: 4
NCLOC: 43   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
CDataConfigParserTest.java - 41,7% 50% 42,9%
coverage coverage
 1    /*
 2    * Created on 23.07.2003
 3    *
 4    * To change the template for this generated file go to
 5    * Window>Preferences>Java>Code Generation>Code and Comments
 6    */
 7    package org.jconfig.parser;
 8   
 9    import java.io.File;
 10   
 11    import junit.framework.TestCase;
 12   
 13    import org.jconfig.Configuration;
 14    import org.jconfig.ConfigurationManager;
 15    import org.jconfig.handler.XMLFileHandler;
 16    /**
 17    * test cases for the new category object
 18    * these tests are an extension of the existing test
 19    * cases used in the ConfigurationTest
 20    *
 21    * @since 2.2
 22    * @author Andreas Mecky <andreas.mecky@xcom.de>
 23    * @author Terry Dye <terry.dye@xcom.de>
 24    */
 25    public class CDataConfigParserTest extends TestCase {
 26   
 27  1 public CDataConfigParserTest(String arg0) {
 28  1 super(arg0);
 29    }
 30   
 31  0 public static void main(String[] args) {
 32  0 junit.textui.TestRunner.run(CDataConfigParserTest.class);
 33    }
 34   
 35  1 public void testParseCDataConfig() {
 36  1 System.setProperty("jconfig.parser","org.jconfig.parser.CDataConfigParser");
 37  1 Configuration config = ConfigurationManager.getConfiguration("advanced");
 38  1 String world = config.getProperty("hello");
 39  1 assertEquals("world",world);
 40  1 String escape = config.getProperty("escapetest");
 41  1 assertEquals(escape,"this\nis\nme");
 42  1 String special = config.getProperty("special",null,"inner");
 43  1 assertEquals("one",special);
 44  1 System.setProperty("jconfig.parser","org.jconfig.parser.DefaultConfigParser");
 45    }
 46   
 47  0 public void _testParseSaveLoadNestedConfig() {
 48  0 System.setProperty("jconfig.parser","org.jconfig.parser.CDataConfigParser");
 49  0 try {
 50  0 XMLFileHandler fileHandler = new XMLFileHandler();
 51  0 String filename = System.getProperty("java.io.tmpdir")+"cdata_test_config.xml";
 52  0 File file = new File(filename);
 53  0 fileHandler.setFile(file);
 54  0 Configuration config = ConfigurationManager.getConfiguration("advanced");
 55  0 fileHandler.store(config);
 56  0 config = fileHandler.load(file, "MyTest");
 57  0 String special = config.getProperty("special",null,"inner");
 58  0 assertEquals("one",special);
 59    }
 60    catch (Exception e) {
 61  0 e.printStackTrace();
 62  0 fail("unexpected exception");
 63    }
 64    }
 65   
 66    }