view gwt-client/src/test/java/test/SinfoFlowdepthTest.java @ 9127:dbb26bc81843

Testing
author gernotbelger
date Wed, 06 Jun 2018 13:05:57 +0200
parents
children
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 java.io.IOException;

import org.dive4elements.artifacts.httpclient.exceptions.ConnectionException;
import org.dive4elements.river.client.shared.exceptions.ServerException;
import org.dive4elements.river.client.shared.model.Data;
import org.dive4elements.river.client.shared.model.DataItem;
import org.dive4elements.river.client.shared.model.DefaultDataItem;
import org.dive4elements.river.client.shared.model.StringOptionsData;

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

/**
 * @author Domenico Nardi Tironi
 *
 */
public class SinfoFlowdepthTest extends ModuleRunner {

    private final boolean useTkh;

    public SinfoFlowdepthTest(final String username, final String password, final CalcMode sinfoCalcFlowDepth, final FilenameMapper file, final double from,
            final double to, final River river, final boolean useTkh) throws ConnectionException, ServerException {
        super(username, password, ModuleRunner.Infotype.sinfo, sinfoCalcFlowDepth, file, from, to, river);
        this.useTkh = useTkh;
    }

    @Override
    public void runTest(final boolean exportToFile) throws ServerException, IOException {
        /* Select River */
        super.selectRiver();

        /* Select CalcMode */
        super.selectCalcMode();

        /* Select Range */
        super.selectRange();

        /* Select Fixpunkte */
        feedAndGo(super.getPairData(), 0);

        /* Select TRANSPORTKÖRPERHÖHHEN - einziger Unterschied zu FlowdepthMinMax */
        final String useTkhStr = String.valueOf(this.useTkh);
        feedAndGo(new Data[] { new StringOptionsData("use_transport_bodies", "use_transport_bodies",
                new DataItem[] { new DefaultDataItem(useTkhStr, useTkhStr, useTkhStr) }) }, 0);

        describeCollection(); // wichtig, damit die Facets erzeugt werden

        super.export(exportToFile);
    }
}

http://dive4elements.wald.intevation.org