Package org.jconfig.server

Source Code of org.jconfig.server.ExternalConfigServerTest

package org.jconfig.server;

import java.io.InputStream;

import junit.framework.TestCase;

import org.jconfig.Configuration;
import org.jconfig.handler.ConfigServerHandler;
/**
* NOTE: This testcase only works if you have a config server
* running on a machine called r2d2!
* @author Andreas Mecky <andreas.mecky@xcom.de>
* @author Terry Dye <terry.dye@xcom.de>
*/
public class ExternalConfigServerTest extends TestCase {
   
    private static ConfigurationServer cs;
    private static final String URL = "jconfig://r2d2:8765";
   
    public ExternalConfigServerTest(String arg0) {
        super(arg0);       
    }
       
    public void setUp() throws Exception {       
    }
   
    public void testStartServer() {       
        java.net.URL jcfURL = null;
        InputStream is = null;
        try {           
            ConfigServerHandler urlHandler = new ConfigServerHandler();
            urlHandler.setURL(URL+"/config");
            Configuration config = urlHandler.load();
            assertNotNull(config);
            assertEquals("dice",config.getProperty("USER",null,"JDBC"));
        }
        catch ( Exception e ) {
            e.printStackTrace();
        }       
    }       
}
TOP

Related Classes of org.jconfig.server.ExternalConfigServerTest

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.