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 import java.util.ArrayList; |
|
15 |
|
16 import org.dive4elements.artifacts.httpclient.exceptions.ConnectionException; |
|
17 import org.dive4elements.river.client.shared.exceptions.ServerException; |
|
18 import org.dive4elements.river.client.shared.model.Data; |
|
19 import org.dive4elements.river.client.shared.model.DataItem; |
|
20 import org.dive4elements.river.client.shared.model.DefaultDataItem; |
|
21 import org.dive4elements.river.client.shared.model.StringOptionsData; |
|
22 |
|
23 import test.AbstractBerechnungsartenTester.River; |
|
24 import test.AbstractModuleRunner; |
|
25 import test.ICalcMode; |
|
26 import test.SimpleRecommendation; |
|
27 |
|
28 /** |
|
29 * @author Domenico Nardi Tironi |
|
30 * |
|
31 */ |
|
32 final class SinfoFlowdepthRunner extends AbstractModuleRunner { |
|
33 |
|
34 private final boolean useTkh; |
|
35 private final ArrayList<String> pairIds = new ArrayList<String>(); |
|
36 |
9570
|
37 public SinfoFlowdepthRunner(final File testFolder, final ICalcMode sinfoCalcFlowDepth, final double from, final double to, final River river, |
|
38 final boolean useTkh) throws ConnectionException, ServerException { |
|
39 super(testFolder, AbstractModuleRunner.Infotype.sinfo, sinfoCalcFlowDepth, from, to, river); |
9422
|
40 this.useTkh = useTkh; |
|
41 } |
|
42 |
|
43 public void addRecommendationPair(final SimpleRecommendation rec1, final SimpleRecommendation rec2) throws ConnectionException, ServerException { |
|
44 this.pairIds.add(super.getRecommendationPairString(rec1, rec2)); |
|
45 } |
|
46 |
|
47 @Override |
9567
|
48 public void runTest() throws ServerException, IOException { |
9422
|
49 /* Select River */ |
|
50 super.selectRiver(); |
|
51 |
|
52 /* Select ICalcMode */ |
|
53 super.selectCalcMode(); |
|
54 |
|
55 /* Select Range */ |
|
56 super.selectRange(); |
|
57 |
|
58 /* Select Fixpunkte */ |
|
59 feedAndGo(extractPairData(this.pairIds, "diffids"), 0); |
|
60 |
|
61 /* Select TRANSPORTKÖRPERHÖHHEN - einziger Unterschied zu FlowdepthMinMax */ |
|
62 final String useTkhStr = String.valueOf(this.useTkh); |
|
63 feedAndGo(new Data[] { new StringOptionsData("use_transport_bodies", "use_transport_bodies", |
|
64 new DataItem[] { new DefaultDataItem(useTkhStr, useTkhStr, useTkhStr) }) }, 0); |
|
65 |
|
66 describeCollection(); |
|
67 |
9567
|
68 super.runTests(); |
9422
|
69 } |
|
70 } |