annotate gwt-client/src/test/java/test/BerechnungsartenTester.java @ 9390:f575ff573cbb

"Name der Peilung" columname minfo.
author gernotbelger
date Thu, 09 Aug 2018 15:22:31 +0200
parents dba14da43f23
children 46e3e23cca0b
rev   line source
9031
efd2de78d158 work on unit testing
gernotbelger
parents:
diff changeset
1 package test;
efd2de78d158 work on unit testing
gernotbelger
parents:
diff changeset
2
efd2de78d158 work on unit testing
gernotbelger
parents:
diff changeset
3 import java.io.IOException;
efd2de78d158 work on unit testing
gernotbelger
parents:
diff changeset
4
9127
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
5 import org.dive4elements.artifacts.httpclient.exceptions.ConnectionException;
9031
efd2de78d158 work on unit testing
gernotbelger
parents:
diff changeset
6 import org.dive4elements.river.client.shared.exceptions.ServerException;
9228
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
7 import org.junit.Ignore;
9127
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
8 import org.junit.Test;
9031
efd2de78d158 work on unit testing
gernotbelger
parents:
diff changeset
9
efd2de78d158 work on unit testing
gernotbelger
parents:
diff changeset
10 /**
efd2de78d158 work on unit testing
gernotbelger
parents:
diff changeset
11 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
efd2de78d158 work on unit testing
gernotbelger
parents:
diff changeset
12 */
efd2de78d158 work on unit testing
gernotbelger
parents:
diff changeset
13
9127
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
14 // REMARK: ignored, because maven will auto-test all tests, but this one needs a running river-artifacts
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
15 // For running the JUunit test, the annotation @Ignore has to be disabled
9226
83aee0942eae JUnit-Tests - tkh works
gernotbelger
parents: 9148
diff changeset
16 @Ignore
9127
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
17 public class BerechnungsartenTester {
9031
efd2de78d158 work on unit testing
gernotbelger
parents:
diff changeset
18
9127
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
19 public static enum CalcMode {
9226
83aee0942eae JUnit-Tests - tkh works
gernotbelger
parents: 9148
diff changeset
20 sinfo_calc_flow_depth, sinfo_calc_flow_depth_development, sinfo_calc_flow_depth_minmax, sinfo_calc_collision, sinfo_calc_transport_bodies_heights, sinfo_calc_flood_duration
9127
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
21 };
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
22
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
23 public static enum River {
9148
48d87af1243e Unit testing flowdepthdevelopment added
gernotbelger
parents: 9133
diff changeset
24 Beispielfluss, Rhein, Elbe
9127
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
25 };
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
26
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
27 public static enum FilenameMapper {
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
28
9226
83aee0942eae JUnit-Tests - tkh works
gernotbelger
parents: 9148
diff changeset
29 FT_MINMAX_RHEIN_1_FILE("/sinfo/flowdepthminmax/sinfo_minmaxft_01.csv"), //
83aee0942eae JUnit-Tests - tkh works
gernotbelger
parents: 9148
diff changeset
30 FT_MINMAX_ELBE_2_FILE("/sinfo/flowdepthminmax/sinfo_minmaxft_02.csv"), //
9133
af73fdd96920 Title current/historical diff pair; limit on entries in diff'pair twin_panel
gernotbelger
parents: 9127
diff changeset
31
9148
48d87af1243e Unit testing flowdepthdevelopment added
gernotbelger
parents: 9133
diff changeset
32 FT_RHEIN_1_FILE("/sinfo/flowdepth/sinfo_ft_01.csv"), //
9226
83aee0942eae JUnit-Tests - tkh works
gernotbelger
parents: 9148
diff changeset
33 FT_RHEIN_2_FILE("/sinfo/flowdepth/sinfo_ft_02.csv"), //
9148
48d87af1243e Unit testing flowdepthdevelopment added
gernotbelger
parents: 9133
diff changeset
34
48d87af1243e Unit testing flowdepthdevelopment added
gernotbelger
parents: 9133
diff changeset
35 FTE_ELBE_FILE("/sinfo/flowdepthdevelopment/sinfo_fte_01.csv"), //
9226
83aee0942eae JUnit-Tests - tkh works
gernotbelger
parents: 9148
diff changeset
36 FTE_RHEIN_FILE("/sinfo/flowdepthdevelopment/sinfo_fte_02.csv"),
83aee0942eae JUnit-Tests - tkh works
gernotbelger
parents: 9148
diff changeset
37
83aee0942eae JUnit-Tests - tkh works
gernotbelger
parents: 9148
diff changeset
38 TKH_1_ELBE_FILE("/sinfo/flowdepthtkh/sinfo_tkh_01.csv"), //
9228
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
39 TKH_2_RHEIN_FILE("/sinfo/flowdepthtkh/sinfo_tkh_02.csv"),
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
40
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
41 TKH_TKH_RHEIN_FILE("/sinfo/tkh/sinfo_tkh_export.csv");
9127
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
42
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
43 private final String filename;
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
44
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
45 FilenameMapper(final String filename) {
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
46 this.filename = filename;
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
47 }
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
48
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
49 public String getFilename() {
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
50 return this.filename;
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
51 }
9031
efd2de78d158 work on unit testing
gernotbelger
parents:
diff changeset
52 }
9127
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
53
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
54 private final Boolean overrideFileExport() {
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
55 return null;
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
56 }
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
57
9228
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
58 /* FLOWDEPTH MIN MAX */
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
59 @Test
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
60 public void testFTMINMAX1() throws ServerException, IOException {
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
61
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
62 RunnerCreatorHelper.createSinfoFlowdepthMinMaxTest(FilenameMapper.FT_MINMAX_RHEIN_1_FILE, 430, 450, River.Rhein,
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
63 new SimpleRecommendation("bedheight", "bedheight-single-79-2004-MW-DGM-2004_Epoche_NHN", "longitudinal_section"),
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
64 new SimpleRecommendation("staticwqkms", "additionals-wstv-0-269", "longitudinal_section", "Amtl.Festlegung_GlQ(2002)")
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
65
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
66 ).runTest(overrideFileExport() != null ? overrideFileExport() : true);
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
67 }
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
68
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
69 @Test
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
70 public void testFTMINMAX2() throws ConnectionException, ServerException, IOException {
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
71 RunnerCreatorHelper.createSinfoFlowdepthMinMaxTest(FilenameMapper.FT_MINMAX_ELBE_2_FILE, 0, 90, River.Elbe,
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
72 // first
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
73 new SimpleRecommendation("bedheight", "bedheight-single-58-2015-MW-FP-2015_0-502", "longitudinal_section", "FP-2015_0-502"),
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
74 new SimpleRecommendation("staticwqkms", "fixations-wstv-0-156", "longitudinal_section", "02.09.2004"),
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
75
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
76 // second
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
77 new SimpleRecommendation("bedheight", "bedheight-single-58-2015-MW-FP-2015_0-502", "longitudinal_section", "FP-2015_0-502"),
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
78 new SimpleRecommendation("staticwqkms", "fixations-wstv-1-156", "longitudinal_section", "03.09.2004"))
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
79 .runTest(overrideFileExport() != null ? overrideFileExport() : true);
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
80 }
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
81
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
82 /* FLOWDEPTH */
9127
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
83 @Test
9148
48d87af1243e Unit testing flowdepthdevelopment added
gernotbelger
parents: 9133
diff changeset
84 public void testRhein1FT() throws ConnectionException, ServerException, IOException {
9127
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
85
9228
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
86 RunnerCreatorHelper.createSinfoFlowdepthTest(FilenameMapper.FT_RHEIN_1_FILE, 350, 380, River.Rhein, false,
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
87
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
88 new SimpleRecommendation("bedheight", "bedheight-soundings-79-2004-DGM-2004_Epoche_NHN", "longitudinal_section"),
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
89 new SimpleRecommendation("staticwqkms", "additionals-wstv-0-415", "longitudinal_section"))
9127
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
90 .runTest(overrideFileExport() != null ? overrideFileExport() : true);
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
91
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
92 }
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
93
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
94 @Test
9226
83aee0942eae JUnit-Tests - tkh works
gernotbelger
parents: 9148
diff changeset
95 public void testRhein2FT() throws ConnectionException, ServerException, IOException {
9127
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
96 RunnerCreatorHelper
9226
83aee0942eae JUnit-Tests - tkh works
gernotbelger
parents: 9148
diff changeset
97 .createSinfoFlowdepthTest(FilenameMapper.FT_RHEIN_2_FILE, 655, 675, River.Rhein, true,
9228
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
98 new SimpleRecommendation("bedheight", "bedheight-soundings-92-2004-NIEDERRHEIN_QP-2004_Epoche_NHN", "longitudinal_section"),
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
99 new SimpleRecommendation("staticwqkms", "fixations-wstv-0-323", "longitudinal_section"))
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
100
9127
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
101 .runTest(overrideFileExport() != null ? overrideFileExport() : true);
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
102 }
dbb26bc81843 Testing
gernotbelger
parents: 9054
diff changeset
103
9228
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
104 /* FLOWDEPTH DEVELOPMENT */
9148
48d87af1243e Unit testing flowdepthdevelopment added
gernotbelger
parents: 9133
diff changeset
105
9228
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
106 @Test
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
107 public void testElbeFTE() throws ConnectionException, ServerException, IOException {
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
108 RunnerCreatorHelper.createSinfoFlowdepthDevelopmentTest(FilenameMapper.FTE_ELBE_FILE, 210, 230, River.Elbe,
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
109 // current
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
110 new SimpleRecommendation("bedheight", "bedheight-soundings-66-2008-FP-QP-2008",
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
111 // "bedheight-single-66-2008-MW-FP-QP-2008",
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
112 "longitudinal_section"),
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
113 new SimpleRecommendation("staticwqkms", "fixations-wstv-0-196", "longitudinal_section", "05.05.2008"), // sicher
9148
48d87af1243e Unit testing flowdepthdevelopment added
gernotbelger
parents: 9133
diff changeset
114
9228
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
115 // historical
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
116 new SimpleRecommendation("bedheight", "bedheight-soundings-70-1995-QP-1995",
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
117 // "bedheight-single-70-1995-MW-QP-1995",
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
118 "longitudinal_section"),
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
119 new SimpleRecommendation("staticwqkms", "fixations-wstv-0-186", "longitudinal_section", "18.03.1997")// sicher
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
120 ).runTest(overrideFileExport() != null ? overrideFileExport() : true);
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
121 }
9148
48d87af1243e Unit testing flowdepthdevelopment added
gernotbelger
parents: 9133
diff changeset
122
9228
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
123 @Test
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
124 public void testRheinFTE() throws ConnectionException, ServerException, IOException {
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
125 RunnerCreatorHelper.createSinfoFlowdepthDevelopmentTest(FilenameMapper.FTE_RHEIN_FILE, 655, 665, River.Rhein,
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
126 // current
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
127 new SimpleRecommendation("bedheight", "bedheight-single-94-2008-MW-NIEDERRHEIN_QP-2008_Epoche_NHN",
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
128 // "bedheight-single....",
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
129 "longitudinal_section"),
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
130 new SimpleRecommendation("staticwqkms", "fixations-wstv-0-372", "longitudinal_section", "23.09.2009-1"), // sicher
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
131
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
132 // historical
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
133 new SimpleRecommendation("bedheight", "bedheight-single-89-1991-MW-NIEDERRHEIN_QP-1991_Epoche_NHN",
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
134 // "bedheight-soundings-89-1991-NIEDERRHEIN_QP-1991_Epoche_NHN",
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
135 "longitudinal_section"),
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
136 new SimpleRecommendation("staticwqkms", "fixations-wstv-0-374", "longitudinal_section", "23.09.1991") // sicher
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
137 ).runTest(overrideFileExport() != null ? overrideFileExport() : true);
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
138 }
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
139
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
140 /* TKH */
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
141
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
142 @Test
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
143 public void testElbeTKH_1() throws ConnectionException, ServerException, IOException {
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
144 RunnerCreatorHelper.createSinfoTkhTest(FilenameMapper.TKH_1_ELBE_FILE, 150, 160, River.Elbe, new double[] { 1520.0 })
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
145 .runTest(overrideFileExport() != null ? overrideFileExport() : true);
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
146 }
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
147
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
148 @Test
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
149 public void testRheinTKH_2() throws ConnectionException, ServerException, IOException {
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
150 RunnerCreatorHelper.createSinfoTkhTest(FilenameMapper.TKH_2_RHEIN_FILE, 600, 610, River.Rhein, new double[] { 6125, 6526 })
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
151 .runTest(overrideFileExport() != null ? overrideFileExport() : true);
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
152 }
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
153
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
154 @Test
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
155 public void testTKhTkh() throws ConnectionException, ServerException, IOException {
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
156 RunnerCreatorHelper.createSinfoTkhTest(FilenameMapper.TKH_TKH_RHEIN_FILE, 0, 182.4, River.Beispielfluss, new double[] { 1059.446 })
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
157 .runTest(overrideFileExport() != null ? overrideFileExport() : true);
dba14da43f23 JUnit-Tests finish
gernotbelger
parents: 9226
diff changeset
158 }
9148
48d87af1243e Unit testing flowdepthdevelopment added
gernotbelger
parents: 9133
diff changeset
159
9049
2ffb55a53e8d Ignored database dependent unit test
gernotbelger
parents: 9031
diff changeset
160 }

http://dive4elements.wald.intevation.org