Mercurial > dive4elements > river
diff gwt-client/src/test/java/test/sinfo/SinfoRunnerCreatorHelper.java @ 9422:e567fac95e3d
uinfo salix no scenario jUnit test
author | gernotbelger |
---|---|
date | Fri, 17 Aug 2018 11:43:42 +0200 |
parents | gwt-client/src/test/java/test/RunnerCreatorHelper.java@9fe26f525ae3 |
children | 86e522bc7f36 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gwt-client/src/test/java/test/sinfo/SinfoRunnerCreatorHelper.java Fri Aug 17 11:43:42 2018 +0200 @@ -0,0 +1,98 @@ +/** 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.IFilenameMapper; +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 IFilenameMapper file, final double from, final double to, + final River beispielfluss, 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, file, from, to, beispielfluss); + proof.addRecommendationPair(rec0, rec1); + + return proof; + } + + public static AbstractModuleRunner createSinfoFlowdepthMinMaxTest(final IFilenameMapper file, 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(file, from, to, river, simpleRecommendation0, + simpleRecommendation1); + proof.addRecommendationPair(simpleRecommendation2, simpleRecommendation3); + return proof; + } + + public final static AbstractModuleRunner createSinfoFlowdepthTest(final IFilenameMapper 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(CalcMode.sinfo_calc_flow_depth, file, from, to, river, useTkh); + proof.addRecommendationPair(rec0, rec1); + + return proof; + } + + public final static AbstractModuleRunner createSinfoFlowdepthDevelopmentTest(final IFilenameMapper 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(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 IFilenameMapper file, 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, file, from, to, river, wasserspiegellage); + + return proof; + } + + public final static AbstractModuleRunner createSinfoCollisionYearsTest(final IFilenameMapper file, final double from, final double to, final River river, + final int[] years) throws ConnectionException, ServerException { + final SinfoCollisionRunner proof = new SinfoCollisionRunner(file, from, to, river, years, null); + + return proof; + } + + public final static AbstractModuleRunner createSinfoCollisionEpochsTest(final IFilenameMapper file, final double from, final double to, final River river, + final String epochs) throws ConnectionException, ServerException { + final SinfoCollisionRunner proof = new SinfoCollisionRunner(file, from, to, river, null, epochs); + + return proof; + } + + public final static AbstractModuleRunner createSinfoFloodDurationTest(final IFilenameMapper file, 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, file, from, to, river, wasserspiegellage, + riverside, showWspl); + + return proof; + } +} \ No newline at end of file