Mercurial > dive4elements > river
view gwt-client/src/test/java/test/sinfo/SinfoRunnerCreatorHelper.java @ 9567:86e522bc7f36
jUnit-Tests completed
author | gernotbelger |
---|---|
date | Mon, 05 Nov 2018 13:21:57 +0100 |
parents | e567fac95e3d |
children | 531a60b7af95 |
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.sinfo; import org.dive4elements.artifacts.httpclient.exceptions.ConnectionException; import org.dive4elements.river.client.shared.exceptions.ServerException; import test.AbstractBerechnungsartenTester.River; import test.AbstractModuleRunner; import test.SimpleRecommendation; import test.sinfo.SinfoBerechnungsartenTester.CalcMode; import test.sinfo.SinfoFloodDurationRiversideChoice.RiversideChoiceKey; /** * @author Domenico Nardi Tironi * */ final class SinfoRunnerCreatorHelper { private SinfoRunnerCreatorHelper() { throw new UnsupportedOperationException(); } // HELPER-Methods: public final static AbstractModuleRunner createSinfoFlowdepthMinMaxTest(final double from, final double to, final River river, final SimpleRecommendation rec0, final SimpleRecommendation rec1) throws ConnectionException, ServerException { // TODO: make recommendationPair to method parameter if needed final SinfoFlowdepthMinMaxRunner proof = new SinfoFlowdepthMinMaxRunner(CalcMode.sinfo_calc_flow_depth_minmax, from, to, river); proof.addRecommendationPair(rec0, rec1); return proof; } public static AbstractModuleRunner createSinfoFlowdepthMinMaxTest(final int from, final int to, final River river, final SimpleRecommendation simpleRecommendation0, final SimpleRecommendation simpleRecommendation1, final SimpleRecommendation simpleRecommendation2, final SimpleRecommendation simpleRecommendation3) throws ConnectionException, ServerException { final SinfoFlowdepthMinMaxRunner proof = (SinfoFlowdepthMinMaxRunner) createSinfoFlowdepthMinMaxTest(from, to, river, simpleRecommendation0, simpleRecommendation1); proof.addRecommendationPair(simpleRecommendation2, simpleRecommendation3); return proof; } public final static AbstractModuleRunner createSinfoFlowdepthTest(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(CalcMode.sinfo_calc_flow_depth, from, to, river, useTkh); proof.addRecommendationPair(rec0, rec1); return proof; } public final static AbstractModuleRunner createSinfoFlowdepthDevelopmentTest(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(CalcMode.sinfo_calc_flow_depth_development, from, to, river); proof.addCurrentRecommendationPair(rec0_curr, rec1_curr); proof.addHistoricalRecommendationPair(rec0_hist, rec1_hist); return proof; } public final static AbstractModuleRunner createSinfoTkhTest(final double from, final double to, final River river, // final boolean useTkh, final double[] wasserspiegellage) throws ConnectionException, ServerException { final SinfoTkhRunner proof = new SinfoTkhRunner(CalcMode.sinfo_calc_transport_bodies_heights, from, to, river, wasserspiegellage); return proof; } public final static AbstractModuleRunner createSinfoCollisionYearsTest(final double from, final double to, final River river, final int[] years) throws ConnectionException, ServerException { final SinfoCollisionRunner proof = new SinfoCollisionRunner(from, to, river, years, null) // .addOutputTest(file, outputModeName, overideWriteToDisk, // params) ; return proof; } public final static AbstractModuleRunner createSinfoCollisionEpochsTest(final double from, final double to, final River river, final String epochs) throws ConnectionException, ServerException { final SinfoCollisionRunner proof = new SinfoCollisionRunner(from, to, river, null, epochs); return proof; } public final static AbstractModuleRunner createSinfoFloodDurationTest(final double from, final double to, final River river, final double[] wasserspiegellage, final boolean showWspl, final RiversideChoiceKey riverside) throws ConnectionException, ServerException { final SinfoFloodDurationRunner proof = new SinfoFloodDurationRunner(CalcMode.sinfo_calc_flood_duration, from, to, river, wasserspiegellage, riverside, showWspl); return proof; } }