annotate gwt-client/src/test/java/test/SinfoFlowdepthRunner.java @ 9194:c373909fb7ca

Fixed: used java 7 feature although java 6 comliance level is configured
author gernotbelger
date Fri, 29 Jun 2018 13:09:29 +0200
parents 48d87af1243e
children
rev   line source
9127
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
1 /** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
2 * Software engineering by
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
3 * Björnsen Beratende Ingenieure GmbH
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
5 *
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
6 * This file is Free Software under the GNU AGPL (>=v3)
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
8 * documentation coming with Dive4Elements River for details.
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
9 */
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
10 package test;
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
11
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
12 import java.io.IOException;
9148
48d87af1243e Unit testing flowdepthdevelopment added
gernotbelger
parents: 9133
diff changeset
13 import java.util.ArrayList;
9127
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
14
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
15 import org.dive4elements.artifacts.httpclient.exceptions.ConnectionException;
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
16 import org.dive4elements.river.client.shared.exceptions.ServerException;
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
17 import org.dive4elements.river.client.shared.model.Data;
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
18 import org.dive4elements.river.client.shared.model.DataItem;
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
19 import org.dive4elements.river.client.shared.model.DefaultDataItem;
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
20 import org.dive4elements.river.client.shared.model.StringOptionsData;
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
21
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
22 import test.BerechnungsartenTester.CalcMode;
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
23 import test.BerechnungsartenTester.FilenameMapper;
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
24 import test.BerechnungsartenTester.River;
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
25
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
26 /**
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
27 * @author Domenico Nardi Tironi
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
28 *
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
29 */
9148
48d87af1243e Unit testing flowdepthdevelopment added
gernotbelger
parents: 9133
diff changeset
30 public class SinfoFlowdepthRunner extends AbstractModuleRunner {
9127
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
31
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
32 private final boolean useTkh;
9148
48d87af1243e Unit testing flowdepthdevelopment added
gernotbelger
parents: 9133
diff changeset
33 private final ArrayList<String> pairIds = new ArrayList<String>();
9127
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
34
9133
af73fdd96920 Title current/historical diff pair; limit on entries in diff'pair twin_panel
gernotbelger
parents: 9127
diff changeset
35 public SinfoFlowdepthRunner(final String username, final String password, final CalcMode sinfoCalcFlowDepth, final FilenameMapper file, final double from,
9127
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
36 final double to, final River river, final boolean useTkh) throws ConnectionException, ServerException {
9148
48d87af1243e Unit testing flowdepthdevelopment added
gernotbelger
parents: 9133
diff changeset
37 super(username, password, AbstractModuleRunner.Infotype.sinfo, sinfoCalcFlowDepth, file, from, to, river);
9127
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
38 this.useTkh = useTkh;
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
39 }
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
40
9148
48d87af1243e Unit testing flowdepthdevelopment added
gernotbelger
parents: 9133
diff changeset
41 public void addRecommendationPair(final SimpleRecommendation rec1, final SimpleRecommendation rec2) throws ConnectionException, ServerException {
48d87af1243e Unit testing flowdepthdevelopment added
gernotbelger
parents: 9133
diff changeset
42 this.pairIds.add(super.getRecommendationPairString(rec1, rec2));
48d87af1243e Unit testing flowdepthdevelopment added
gernotbelger
parents: 9133
diff changeset
43 }
48d87af1243e Unit testing flowdepthdevelopment added
gernotbelger
parents: 9133
diff changeset
44
9127
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
45 @Override
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
46 public void runTest(final boolean exportToFile) throws ServerException, IOException {
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
47 /* Select River */
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
48 super.selectRiver();
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
49
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
50 /* Select CalcMode */
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
51 super.selectCalcMode();
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
52
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
53 /* Select Range */
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
54 super.selectRange();
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
55
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
56 /* Select Fixpunkte */
9148
48d87af1243e Unit testing flowdepthdevelopment added
gernotbelger
parents: 9133
diff changeset
57 feedAndGo(extractPairData(this.pairIds, "diffids"), 0);
9127
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
58
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
59 /* Select TRANSPORTKÖRPERHÖHHEN - einziger Unterschied zu FlowdepthMinMax */
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
60 final String useTkhStr = String.valueOf(this.useTkh);
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
61 feedAndGo(new Data[] { new StringOptionsData("use_transport_bodies", "use_transport_bodies",
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
62 new DataItem[] { new DefaultDataItem(useTkhStr, useTkhStr, useTkhStr) }) }, 0);
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
63
9133
af73fdd96920 Title current/historical diff pair; limit on entries in diff'pair twin_panel
gernotbelger
parents: 9127
diff changeset
64 describeCollection();
9127
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
65
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
66 super.export(exportToFile);
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
67 }
dbb26bc81843 Testing
gernotbelger
parents:
diff changeset
68 }

http://dive4elements.wald.intevation.org