view gwt-client/src/test/java/test/RunnerCreatorHelper.java @ 9226:83aee0942eae

JUnit-Tests - tkh works
author gernotbelger
date Wed, 04 Jul 2018 17:14:16 +0200
parents 48d87af1243e
children dba14da43f23
line wrap: on
line source
/** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde
 * Software engineering by
 *  Björnsen Beratende Ingenieure GmbH
 *  Dr. Schumacher Ingenieurbüro für Wasser und Umwelt
 *
 * This file is Free Software under the GNU AGPL (>=v3)
 * and comes with ABSOLUTELY NO WARRANTY! Check out the
 * documentation coming with Dive4Elements River for details.
 */
package test;

import org.dive4elements.artifacts.httpclient.exceptions.ConnectionException;
import org.dive4elements.river.client.shared.exceptions.ServerException;

import test.BerechnungsartenTester.CalcMode;
import test.BerechnungsartenTester.FilenameMapper;
import test.BerechnungsartenTester.River;

/**
 * @author Domenico Nardi Tironi
 *
 */
public final class RunnerCreatorHelper {

    private final static String user = "belger";

    private final static String pw = "belger";

    private RunnerCreatorHelper() {
        throw new UnsupportedOperationException();
    }

    // HELPER-Methods:

    public final static AbstractModuleRunner createSinfoFlowdepthMinMaxTest(final FilenameMapper helloWorldFile, final double from, final double to,
            final River beispielfluss) throws ConnectionException, ServerException {
        // TODO: make recommendationPair to method parameter if needed
        final SinfoFlowdepthMinMaxRunner proof = new SinfoFlowdepthMinMaxRunner(user, pw, CalcMode.sinfo_calc_flow_depth_minmax, helloWorldFile, from, to,
                beispielfluss);
        proof.addRecommendationPair(new SimpleRecommendation("staticwqkms", "additionals-wstv-0-103", "sinfo_flowdepth_waterlevels"),
                new SimpleRecommendation("bedheight", "bedheight-single-36-2015-FP-2015_0-502", "sinfo_flowdepthminmax_heights"));

        return proof;
    }

    public final static AbstractModuleRunner createSinfoFlowdepthTest(final FilenameMapper file, final double from, final double to, final River river,
            final boolean useTkh, final SimpleRecommendation rec0, final SimpleRecommendation rec1) throws ConnectionException, ServerException {
        final SinfoFlowdepthRunner proof = new SinfoFlowdepthRunner(user, pw, CalcMode.sinfo_calc_flow_depth, file, from, to, river, useTkh);
        proof.addRecommendationPair(rec0, rec1);

        return proof;
    }

    public final static AbstractModuleRunner createSinfoFlowdepthDevelopmentTest(final FilenameMapper file, final double from, final double to,
            final River river, final SimpleRecommendation rec0_curr, final SimpleRecommendation rec1_curr, final SimpleRecommendation rec0_hist,
            final SimpleRecommendation rec1_hist) throws ConnectionException, ServerException {
        final SinfoFlowdepthDevelopmentRunner proof = new SinfoFlowdepthDevelopmentRunner(user, pw, CalcMode.sinfo_calc_flow_depth_development, file, from, to,
                river);
        proof.addCurrentRecommendationPair(rec0_curr, rec1_curr);
        proof.addHistoricalRecommendationPair(rec0_hist, rec1_hist);
        return proof;
    }

    public final static AbstractModuleRunner createSinfoTkhTest(final FilenameMapper file, final double from, final double to, final River river,
            // final boolean useTkh,
            final double[] wasserspiegellage) throws ConnectionException, ServerException {
        final SinfoTkhRunner proof = new SinfoTkhRunner(user, pw, CalcMode.sinfo_calc_transport_bodies_heights, file, from, to, river, wasserspiegellage);

        return proof;
    }

}

http://dive4elements.wald.intevation.org