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.uinfo; |
|
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.uinfo.UInfoBerechnungsartenTester.CalcMode; |
|
25 |
|
26 /** |
|
27 * @author Domenico Nardi Tironi |
|
28 * |
|
29 */ |
9424
|
30 class UinfoSalixRunner extends AbstractModuleRunner { |
9422
|
31 private final String scenarioChoice; |
|
32 private boolean isUseScenario; |
|
33 |
9570
|
34 public UinfoSalixRunner(final File testFolder, final double from, final double to, final River river, final String scenarioChoice) |
|
35 throws ConnectionException, ServerException { |
|
36 super(testFolder, AbstractModuleRunner.Infotype.uinfo, CalcMode.uinfo_salix_line, from, to, river); |
9422
|
37 this.scenarioChoice = scenarioChoice; |
|
38 this.isUseScenario = (scenarioChoice != null) ? (this.isUseScenario = true) : (this.isUseScenario = false); |
|
39 } |
|
40 |
|
41 @Override |
9567
|
42 public void runTest() throws ServerException, IOException { |
9422
|
43 /* Select River */ |
|
44 super.selectRiver(); |
|
45 |
|
46 /* Select ICalcMode */ |
|
47 super.selectCalcMode(); |
|
48 |
|
49 super.feed(new Data[] { |
|
50 new StringOptionsData("ld_mode", "ld_mode", new DataItem[] { new DefaultDataItem("distance_only", "distance_only", "distance_only") }) }); // ggf |
|
51 |
|
52 /* Select Range */ |
|
53 super.selectRange(); |
|
54 |
9424
|
55 /* use scenario */ |
|
56 final String key = "use_scenario"; |
|
57 final String value = String.valueOf(this.isUseScenario); |
|
58 |
9441
|
59 super.feedAndGoSimpleTextInput(key, value); |
9422
|
60 |
|
61 if (this.isUseScenario) { |
|
62 // TODO: make regional, supraregional, historical |
9424
|
63 makeScenario(); |
9422
|
64 } |
|
65 |
|
66 describeCollection(); |
|
67 |
9567
|
68 super.runTests(); |
9422
|
69 } |
9424
|
70 |
|
71 protected void makeScenario() throws ConnectionException, ServerException { |
|
72 // Override in subs |
|
73 } |
|
74 |
|
75 protected final String getScenarioChoice() { |
|
76 |
|
77 return this.scenarioChoice; |
|
78 } |
9422
|
79 } |