view geo-backend/src/test/java/de/intevation/gnv/geobackend/base/query/cache/CacheCleanerTestCase.java @ 1127:ebeb56428409

Added license headers and license file. geo-backend/trunk@1261 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 02 Nov 2010 17:52:22 +0000
parents 02cd2935b5fa
children
line wrap: on
line source
/*
 * Copyright (c) 2010 by Intevation GmbH
 *
 * This program is free software under the LGPL (>=v2.1)
 * Read the file LGPL.txt coming with the software for details
 * or visit http://www.gnu.org/licenses/ if it does not exist.
 */

package de.intevation.gnv.geobackend.base.query.cache;

import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Properties;

import junit.framework.TestCase;

import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Logger;

import de.intevation.gnv.geobackend.base.connectionpool.ConnectionPoolFactory;
import de.intevation.gnv.geobackend.base.query.container.QueryContainerFactory;

public class CacheCleanerTestCase extends TestCase {

    /**
     * the logger, used to log exceptions and additonaly information
     */
    private static Logger log = null;

    static{
        BasicConfigurator.configure();
        log = Logger.getLogger(CacheCleanerTestCase.class);
    }

    public void testCachCleaner(){
        log.debug("CacheCleanerTestCase.testCachCleaner");
        CacheCleaner cc = new CacheCleaner();
        boolean success = cc.test();
        if (!success){
            log.error("TestCase failed.");
            fail();
        }
    }

    /**
     * @see junit.framework.TestCase#setUp()
     */
    @Override
    protected void setUp() throws Exception {

        super.setUp();
        InputStream inputStream = new FileInputStream("src/test/ressources/ArcSDEConnectionPoolTestCase.properties");
        Properties properties = new Properties();
        properties.load(inputStream);

        ConnectionPoolFactory cpf = ConnectionPoolFactory.getInstance();
        cpf.initializeConnectionPool(properties);


        inputStream = new FileInputStream("src/test/ressources/QueryExecutorTestCase.properties");
        properties = new Properties();
        properties.load(inputStream);

        QueryContainerFactory qcf = QueryContainerFactory.getInstance();
        qcf.initializeQueryContainer(properties);
    }
}

http://dive4elements.wald.intevation.org