9422
|
1 /** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde |
|
2 * Software engineering by |
|
3 * Björnsen Beratende Ingenieure GmbH |
|
4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt |
|
5 * |
|
6 * This file is Free Software under the GNU AGPL (>=v3) |
|
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
|
8 * documentation coming with Dive4Elements River for details. |
|
9 */ |
|
10 package test.sinfo; |
|
11 |
9570
|
12 import java.io.File; |
9422
|
13 import java.io.IOException; |
|
14 |
|
15 import org.dive4elements.artifacts.httpclient.exceptions.ConnectionException; |
|
16 import org.dive4elements.river.client.shared.exceptions.ServerException; |
|
17 import org.dive4elements.river.client.shared.model.Data; |
|
18 import org.dive4elements.river.client.shared.model.DataItem; |
|
19 import org.dive4elements.river.client.shared.model.DefaultDataItem; |
|
20 import org.dive4elements.river.client.shared.model.StringOptionsData; |
|
21 |
|
22 import test.AbstractBerechnungsartenTester.River; |
|
23 import test.AbstractModuleRunner; |
|
24 import test.ICalcMode; |
|
25 import test.WQInputHelper; |
|
26 import test.sinfo.SinfoFloodDurationRiversideChoice.RiversideChoiceKey; |
|
27 |
|
28 /** |
|
29 * @author Domenico Nardi Tironi |
|
30 * |
|
31 */ |
|
32 final class SinfoFloodDurationRunner extends AbstractModuleRunner { |
|
33 |
|
34 private final double[] wasserspiegellage; |
|
35 private final boolean showWspl; |
|
36 private final RiversideChoiceKey riverside; |
|
37 |
9570
|
38 public SinfoFloodDurationRunner(final File testFolder, final ICalcMode calcmode, final double from, final double to, final River river, |
|
39 final double[] wasserspiegellage, final RiversideChoiceKey riverside, final boolean showWspl) throws ConnectionException, ServerException { |
|
40 super(testFolder, AbstractModuleRunner.Infotype.sinfo, calcmode, from, to, river); |
9422
|
41 this.wasserspiegellage = wasserspiegellage; |
|
42 this.showWspl = showWspl; |
|
43 this.riverside = riverside; |
|
44 } |
|
45 |
|
46 @Override |
9567
|
47 public void runTest() throws ServerException, IOException { |
9422
|
48 /* Select River */ |
|
49 super.selectRiver(); |
|
50 |
|
51 /* Select ICalcMode */ |
|
52 super.selectCalcMode(); |
|
53 |
|
54 super.feed(new Data[] { |
|
55 new StringOptionsData("ld_mode", "ld_mode", new DataItem[] { new DefaultDataItem("distance_only", "distance_only", "distance_only") }) }); // |
|
56 |
|
57 /* Select Range */ |
|
58 super.selectRange(); |
|
59 |
|
60 final Data riversideData = new StringOptionsData("riverside", "riverside", |
|
61 new DataItem[] { new DefaultDataItem("riverside", "riverside", this.riverside.toString()) }); |
|
62 feedAndGo(new Data[] { riversideData }, 0); |
|
63 |
|
64 final Data showWsplData = new StringOptionsData("wspl", "wspl", new DataItem[] { new DefaultDataItem("wspl", "wspl", String.valueOf(this.showWspl)) }); |
|
65 feedAndGo(new Data[] { showWsplData }, 0); |
|
66 |
9567
|
67 if (this.showWspl) { |
|
68 final WQInputHelper helper = new WQInputHelper(this.wasserspiegellage); |
|
69 super.feedAndGo(helper.getDataforFeed(), // |
|
70 0);// reachable state index |
|
71 } |
9422
|
72 |
|
73 describeCollection(); |
|
74 |
9567
|
75 super.runTests(); |
9422
|
76 } |
|
77 } |