Package org.geoserver.config

Source Code of org.geoserver.config.LegacyConfigurationImporterTest

package org.geoserver.config;

import java.io.File;

import org.geoserver.config.GeoServer;
import org.geoserver.config.GeoServerInfo;
import org.geoserver.config.impl.GeoServerFactoryImpl;
import org.geoserver.config.impl.GeoServerImpl;
import org.geoserver.config.util.LegacyConfigurationImporter;
import org.geotools.data.DataUtilities;

import junit.framework.TestCase;

public class LegacyConfigurationImporterTest extends TestCase {

    LegacyConfigurationImporter importer;
   
    protected void setUp() throws Exception {
        GeoServer gs = new GeoServerImpl();
        gs.setFactory( new GeoServerFactoryImpl(gs) );
       
        importer = new LegacyConfigurationImporter( gs );
        importer.imprt(DataUtilities.urlToFile(getClass().getResource("services.xml")).getParentFile());
    }
   
    public void testGlobal() throws Exception {
        GeoServerInfo info = importer.getConfiguration().getGlobal();
        assertNotNull( info );
       
        LoggingInfo logging = importer.getConfiguration().getLogging();
        assertNotNull( logging );
       
        assertEquals( "DEFAULT_LOGGING.properties", logging.getLevel() );
        assertTrue( logging.isStdOutLogging() );
        assertEquals( "logs/geoserver.log", logging.getLocation() );
        assertFalse( info.isVerbose() );
        assertFalse( info.isVerboseExceptions() )
        assertEquals( 8, info.getNumDecimals() );
        assertEquals( "UTF-8", info.getCharset() );
        assertEquals( 3, info.getUpdateSequence() );
    }
}
TOP

Related Classes of org.geoserver.config.LegacyConfigurationImporterTest

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.