Package org.jconfig.handler

Examples of org.jconfig.handler.XMLFileHandler.store()


    public void _testSaveConfig() {
        Configuration cfg = ConfigurationManager.getConfiguration("inheritance");
        try {
            String fileName = System.getProperty("java.io.tmpdir")+File.separator+"test_config.xml";                       
            XMLFileHandler handler = new XMLFileHandler(fileName);
            handler.store(cfg);
        }
        catch (Exception e) {
            e.printStackTrace();
            fail("unexpected exception");
        }
View Full Code Here


            XMLFileHandler fileHandler = new XMLFileHandler();
            String filename = System.getProperty("java.io.tmpdir")+"test_config.xml";           
            File file = new File(filename);
            fileHandler.setFile(file);
            Configuration config = ConfigurationManager.getConfiguration("nested");                       
            fileHandler.store(config);
            config = fileHandler.load(file, "MyTest");
            String next = config.getProperty("inner",null,"inner/myinner");
            assertEquals("value",next);
            next = config.getProperty("hello",null,"inner/myinner/moreinner");
            assertEquals("universe",next);
View Full Code Here

            XMLFileHandler fileHandler = new XMLFileHandler();
            String filename = System.getProperty("java.io.tmpdir")+"cdata_test_config.xml";           
            File file = new File(filename);
            fileHandler.setFile(file);
            Configuration config = ConfigurationManager.getConfiguration("advanced");
            fileHandler.store(config);
            config = fileHandler.load(file, "MyTest");
            String special = config.getProperty("special",null,"inner");
            assertEquals("one",special);
        }
        catch (Exception e) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.