comparison gwt-client/src/test/java/test/sinfo/SinfoFlowdepthRunner.java @ 9422:e567fac95e3d

uinfo salix no scenario jUnit test
author gernotbelger
date Fri, 17 Aug 2018 11:43:42 +0200
parents
children 86e522bc7f36
comparison
equal deleted inserted replaced
9420:2c8ba17b807e 9422:e567fac95e3d
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.IFilenameMapper;
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
37 public SinfoFlowdepthRunner(final ICalcMode sinfoCalcFlowDepth, final IFilenameMapper file, final double from, final double to, final River river,
38 final boolean useTkh) throws ConnectionException, ServerException {
39 super(AbstractModuleRunner.Infotype.sinfo, sinfoCalcFlowDepth, file, from, to, river);
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
48 public void runTest(final boolean exportToFile) throws ServerException, IOException {
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
68 super.export(exportToFile);
69 }
70 }

http://dive4elements.wald.intevation.org