view gwt-client/src/test/java/test/uinfo/UInfoBerechnungsartenTester.java @ 9424:da19f1f58d72

jUnit test uinfo salix regional
author gernotbelger
date Fri, 17 Aug 2018 14:29:05 +0200
parents e567fac95e3d
children 15f274e6d83b
line wrap: on
line source
package test.uinfo;

import java.io.IOException;

import org.dive4elements.river.client.shared.exceptions.ServerException;
import org.junit.Test;

import test.AbstractBerechnungsartenTester;
import test.ICalcMode;
import test.IFilenameMapper;

/**
 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
 */

// REMARK: ignored, because maven will auto-test all tests, but this one needs a running river-artifacts
// For running the JUunit test, the annotation @Ignore has to be disabled
 import org.junit.Ignore;
 @Ignore
public class UInfoBerechnungsartenTester extends AbstractBerechnungsartenTester {

    public static enum CalcMode implements ICalcMode {
        uinfo_salix_line, //
        // der Vollständigkeit halber
        uinfo_inundation_duration, uinfo_vegetation_zones
    };

    // Szenarien:
    // scenarioType.option1
    // scenarioType.option2
    // scenarioType.option3

    public static enum FilenameMapper implements IFilenameMapper {

        SALIX_NO_SCENARIO("/uinfo/salix/salix_no_scenario.csv"), //
        SALIX_REGIONAL_SCENARIO("/uinfo/salix/salix_regional.csv"); //

        private final String filename;

        FilenameMapper(final String filename) {
            this.filename = filename;
        }

        @Override
        public String getFilename() {
            return this.filename;
        }
    }

    /* Salix no Scenario */
    @Test
    public void testSalixNoScenario() throws ServerException, IOException {
        new UinfoSalixRunner(FilenameMapper.SALIX_NO_SCENARIO, 0., 182.4, River.Beispielfluss, null)
                .runTest(overrideFileExport() != null ? overrideFileExport() : true);
    }

    @Test
    public void testSalixRegionalScenario() throws ServerException, IOException {
        new UinfoSalixRegionalRunner(FilenameMapper.SALIX_REGIONAL_SCENARIO, 0., 182.4, River.Beispielfluss, "scenarioType.option1", 50., 60., "5 -10 12 0")
                .runTest(overrideFileExport() != null ? overrideFileExport() : true);
    }
}

http://dive4elements.wald.intevation.org