Mercurial > dive4elements > river
diff gwt-client/src/test/java/test/SinfoFlowdepthDevelopmentRunner.java @ 9148:48d87af1243e
Unit testing flowdepthdevelopment added
author | gernotbelger |
---|---|
date | Tue, 12 Jun 2018 15:04:40 +0200 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gwt-client/src/test/java/test/SinfoFlowdepthDevelopmentRunner.java Tue Jun 12 15:04:40 2018 +0200 @@ -0,0 +1,67 @@ +/** 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 java.util.ArrayList; +import java.util.List; + +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 class SinfoFlowdepthDevelopmentRunner extends AbstractModuleRunner { + + private final List<String> pairIdsCurrent = new ArrayList<String>(); + private final List<String> pairIdsHistorical = new ArrayList<String>(); + + public SinfoFlowdepthDevelopmentRunner(final String username, final String password, final CalcMode sinfoCalcFlowDepth, final FilenameMapper file, + final double from, final double to, final River river) throws ConnectionException, ServerException { + super(username, password, AbstractModuleRunner.Infotype.sinfo, sinfoCalcFlowDepth, file, from, to, river); + + } + + public void addCurrentRecommendationPair(final SimpleRecommendation rec1, final SimpleRecommendation rec2) throws ConnectionException, ServerException { + this.pairIdsCurrent.add(super.getRecommendationPairString(rec1, rec2)); + } + + public void addHistoricalRecommendationPair(final SimpleRecommendation rec1, final SimpleRecommendation rec2) throws ConnectionException, ServerException { + this.pairIdsHistorical.add(super.getRecommendationPairString(rec1, rec2)); + } + + @Override + public void runTest(final boolean exportToFile) throws ServerException, IOException { + /* Select River */ + super.selectRiver(); + + /* Select CalcMode */ + super.selectCalcMode(); + + /* Select Range */ + super.selectRange(); + + /* Select current Fixpunkte */ + feedAndGo(super.extractPairData(this.pairIdsCurrent, "diffid_current"), 0); + + /* Select historical Fixpunkte */ + feedAndGo(super.extractPairData(this.pairIdsHistorical, "diffid_historical"), 0); + + describeCollection(); + + super.export(exportToFile); + } +}