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 |
|
12 import java.io.IOException; |
|
13 import java.util.ArrayList; |
|
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.SimpleRecommendation; |
|
26 |
|
27 /** |
|
28 * @author Domenico Nardi Tironi |
|
29 * |
|
30 */ |
|
31 final class SinfoFlowdepthRunner extends AbstractModuleRunner { |
|
32 |
|
33 private final boolean useTkh; |
|
34 private final ArrayList<String> pairIds = new ArrayList<String>(); |
|
35 |
9567
|
36 public SinfoFlowdepthRunner(final ICalcMode sinfoCalcFlowDepth, final double from, final double to, final River river, final boolean useTkh) |
|
37 throws ConnectionException, ServerException { |
|
38 super(AbstractModuleRunner.Infotype.sinfo, sinfoCalcFlowDepth, from, to, river); |
9422
|
39 this.useTkh = useTkh; |
|
40 } |
|
41 |
|
42 public void addRecommendationPair(final SimpleRecommendation rec1, final SimpleRecommendation rec2) throws ConnectionException, ServerException { |
|
43 this.pairIds.add(super.getRecommendationPairString(rec1, rec2)); |
|
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 /* Select Range */ |
|
55 super.selectRange(); |
|
56 |
|
57 /* Select Fixpunkte */ |
|
58 feedAndGo(extractPairData(this.pairIds, "diffids"), 0); |
|
59 |
|
60 /* Select TRANSPORTKÖRPERHÖHHEN - einziger Unterschied zu FlowdepthMinMax */ |
|
61 final String useTkhStr = String.valueOf(this.useTkh); |
|
62 feedAndGo(new Data[] { new StringOptionsData("use_transport_bodies", "use_transport_bodies", |
|
63 new DataItem[] { new DefaultDataItem(useTkhStr, useTkhStr, useTkhStr) }) }, 0); |
|
64 |
|
65 describeCollection(); |
|
66 |
9567
|
67 super.runTests(); |
9422
|
68 } |
|
69 } |