Mercurial > dive4elements > river
annotate gwt-client/src/test/java/test/BerechnungsartenTester.java @ 9418:9fe26f525ae3
sinfo floodduration jUnit test
author | gernotbelger |
---|---|
date | Thu, 16 Aug 2018 18:15:54 +0200 |
parents | 46e3e23cca0b |
children |
rev | line source |
---|---|
9031 | 1 package test; |
2 | |
3 import java.io.IOException; | |
4 | |
9127 | 5 import org.dive4elements.artifacts.httpclient.exceptions.ConnectionException; |
9031 | 6 import org.dive4elements.river.client.shared.exceptions.ServerException; |
9418 | 7 import org.junit.Ignore; |
9127 | 8 import org.junit.Test; |
9031 | 9 |
9418 | 10 import test.SinfoFloodDurationRiversideChoice.RiversideChoiceKey; |
11 | |
9031 | 12 /** |
13 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | |
14 */ | |
15 | |
9127 | 16 // REMARK: ignored, because maven will auto-test all tests, but this one needs a running river-artifacts |
17 // For running the JUunit test, the annotation @Ignore has to be disabled | |
9418 | 18 @Ignore |
9127 | 19 public class BerechnungsartenTester { |
9031 | 20 |
9127 | 21 public static enum CalcMode { |
9226 | 22 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 | 23 }; |
24 | |
25 public static enum River { | |
9148 | 26 Beispielfluss, Rhein, Elbe |
9127 | 27 }; |
28 | |
29 public static enum FilenameMapper { | |
30 | |
9226 | 31 FT_MINMAX_RHEIN_1_FILE("/sinfo/flowdepthminmax/sinfo_minmaxft_01.csv"), // |
32 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
|
33 |
9148 | 34 FT_RHEIN_1_FILE("/sinfo/flowdepth/sinfo_ft_01.csv"), // |
9226 | 35 FT_RHEIN_2_FILE("/sinfo/flowdepth/sinfo_ft_02.csv"), // |
9148 | 36 |
37 FTE_ELBE_FILE("/sinfo/flowdepthdevelopment/sinfo_fte_01.csv"), // | |
9226 | 38 FTE_RHEIN_FILE("/sinfo/flowdepthdevelopment/sinfo_fte_02.csv"), |
39 | |
40 TKH_1_ELBE_FILE("/sinfo/flowdepthtkh/sinfo_tkh_01.csv"), // | |
9228 | 41 TKH_2_RHEIN_FILE("/sinfo/flowdepthtkh/sinfo_tkh_02.csv"), |
42 | |
9417 | 43 TKH_TKH_RHEIN_FILE("/sinfo/tkh/sinfo_tkh_export.csv"), // |
9127 | 44 |
9417 | 45 COLLISION_RHEIN_HELLO_WORLD_FILE("/sinfo/collision/sinfo_collision_export.csv"), // |
9418 | 46 COLLISION_RHEIN_EPOCH_HELLO_WORLD_FILE("/sinfo/collision/sinfo_collision_epoch_export.csv"), // |
47 | |
48 FLOOD_DURATION_HELLO_WORLD_FILE("/sinfo/floodduration/sinfo_floodduration_export.csv"); | |
9127 | 49 private final String filename; |
50 | |
51 FilenameMapper(final String filename) { | |
52 this.filename = filename; | |
53 } | |
54 | |
55 public String getFilename() { | |
56 return this.filename; | |
57 } | |
9031 | 58 } |
9127 | 59 |
60 private final Boolean overrideFileExport() { | |
61 return null; | |
62 } | |
63 | |
9228 | 64 /* FLOWDEPTH MIN MAX */ |
65 @Test | |
66 public void testFTMINMAX1() throws ServerException, IOException { | |
67 | |
68 RunnerCreatorHelper.createSinfoFlowdepthMinMaxTest(FilenameMapper.FT_MINMAX_RHEIN_1_FILE, 430, 450, River.Rhein, | |
69 new SimpleRecommendation("bedheight", "bedheight-single-79-2004-MW-DGM-2004_Epoche_NHN", "longitudinal_section"), | |
70 new SimpleRecommendation("staticwqkms", "additionals-wstv-0-269", "longitudinal_section", "Amtl.Festlegung_GlQ(2002)") | |
71 | |
72 ).runTest(overrideFileExport() != null ? overrideFileExport() : true); | |
73 } | |
74 | |
75 @Test | |
76 public void testFTMINMAX2() throws ConnectionException, ServerException, IOException { | |
77 RunnerCreatorHelper.createSinfoFlowdepthMinMaxTest(FilenameMapper.FT_MINMAX_ELBE_2_FILE, 0, 90, River.Elbe, | |
78 // first | |
79 new SimpleRecommendation("bedheight", "bedheight-single-58-2015-MW-FP-2015_0-502", "longitudinal_section", "FP-2015_0-502"), | |
80 new SimpleRecommendation("staticwqkms", "fixations-wstv-0-156", "longitudinal_section", "02.09.2004"), | |
81 | |
82 // second | |
83 new SimpleRecommendation("bedheight", "bedheight-single-58-2015-MW-FP-2015_0-502", "longitudinal_section", "FP-2015_0-502"), | |
84 new SimpleRecommendation("staticwqkms", "fixations-wstv-1-156", "longitudinal_section", "03.09.2004")) | |
85 .runTest(overrideFileExport() != null ? overrideFileExport() : true); | |
86 } | |
87 | |
88 /* FLOWDEPTH */ | |
9127 | 89 @Test |
9148 | 90 public void testRhein1FT() throws ConnectionException, ServerException, IOException { |
9127 | 91 |
9228 | 92 RunnerCreatorHelper.createSinfoFlowdepthTest(FilenameMapper.FT_RHEIN_1_FILE, 350, 380, River.Rhein, false, |
93 | |
94 new SimpleRecommendation("bedheight", "bedheight-soundings-79-2004-DGM-2004_Epoche_NHN", "longitudinal_section"), | |
95 new SimpleRecommendation("staticwqkms", "additionals-wstv-0-415", "longitudinal_section")) | |
9127 | 96 .runTest(overrideFileExport() != null ? overrideFileExport() : true); |
97 | |
98 } | |
99 | |
100 @Test | |
9226 | 101 public void testRhein2FT() throws ConnectionException, ServerException, IOException { |
9127 | 102 RunnerCreatorHelper |
9226 | 103 .createSinfoFlowdepthTest(FilenameMapper.FT_RHEIN_2_FILE, 655, 675, River.Rhein, true, |
9228 | 104 new SimpleRecommendation("bedheight", "bedheight-soundings-92-2004-NIEDERRHEIN_QP-2004_Epoche_NHN", "longitudinal_section"), |
105 new SimpleRecommendation("staticwqkms", "fixations-wstv-0-323", "longitudinal_section")) | |
106 | |
9127 | 107 .runTest(overrideFileExport() != null ? overrideFileExport() : true); |
108 } | |
109 | |
9228 | 110 /* FLOWDEPTH DEVELOPMENT */ |
9148 | 111 |
9228 | 112 @Test |
113 public void testElbeFTE() throws ConnectionException, ServerException, IOException { | |
114 RunnerCreatorHelper.createSinfoFlowdepthDevelopmentTest(FilenameMapper.FTE_ELBE_FILE, 210, 230, River.Elbe, | |
115 // current | |
116 new SimpleRecommendation("bedheight", "bedheight-soundings-66-2008-FP-QP-2008", | |
117 // "bedheight-single-66-2008-MW-FP-QP-2008", | |
118 "longitudinal_section"), | |
119 new SimpleRecommendation("staticwqkms", "fixations-wstv-0-196", "longitudinal_section", "05.05.2008"), // sicher | |
9148 | 120 |
9228 | 121 // historical |
122 new SimpleRecommendation("bedheight", "bedheight-soundings-70-1995-QP-1995", | |
123 // "bedheight-single-70-1995-MW-QP-1995", | |
124 "longitudinal_section"), | |
125 new SimpleRecommendation("staticwqkms", "fixations-wstv-0-186", "longitudinal_section", "18.03.1997")// sicher | |
126 ).runTest(overrideFileExport() != null ? overrideFileExport() : true); | |
127 } | |
9148 | 128 |
9228 | 129 @Test |
130 public void testRheinFTE() throws ConnectionException, ServerException, IOException { | |
131 RunnerCreatorHelper.createSinfoFlowdepthDevelopmentTest(FilenameMapper.FTE_RHEIN_FILE, 655, 665, River.Rhein, | |
132 // current | |
133 new SimpleRecommendation("bedheight", "bedheight-single-94-2008-MW-NIEDERRHEIN_QP-2008_Epoche_NHN", | |
134 // "bedheight-single....", | |
135 "longitudinal_section"), | |
136 new SimpleRecommendation("staticwqkms", "fixations-wstv-0-372", "longitudinal_section", "23.09.2009-1"), // sicher | |
137 | |
138 // historical | |
139 new SimpleRecommendation("bedheight", "bedheight-single-89-1991-MW-NIEDERRHEIN_QP-1991_Epoche_NHN", | |
140 // "bedheight-soundings-89-1991-NIEDERRHEIN_QP-1991_Epoche_NHN", | |
141 "longitudinal_section"), | |
142 new SimpleRecommendation("staticwqkms", "fixations-wstv-0-374", "longitudinal_section", "23.09.1991") // sicher | |
143 ).runTest(overrideFileExport() != null ? overrideFileExport() : true); | |
144 } | |
145 | |
146 /* TKH */ | |
147 | |
148 @Test | |
149 public void testElbeTKH_1() throws ConnectionException, ServerException, IOException { | |
150 RunnerCreatorHelper.createSinfoTkhTest(FilenameMapper.TKH_1_ELBE_FILE, 150, 160, River.Elbe, new double[] { 1520.0 }) | |
151 .runTest(overrideFileExport() != null ? overrideFileExport() : true); | |
152 } | |
153 | |
154 @Test | |
155 public void testRheinTKH_2() throws ConnectionException, ServerException, IOException { | |
156 RunnerCreatorHelper.createSinfoTkhTest(FilenameMapper.TKH_2_RHEIN_FILE, 600, 610, River.Rhein, new double[] { 6125, 6526 }) | |
157 .runTest(overrideFileExport() != null ? overrideFileExport() : true); | |
158 } | |
159 | |
160 @Test | |
161 public void testTKhTkh() throws ConnectionException, ServerException, IOException { | |
162 RunnerCreatorHelper.createSinfoTkhTest(FilenameMapper.TKH_TKH_RHEIN_FILE, 0, 182.4, River.Beispielfluss, new double[] { 1059.446 }) | |
163 .runTest(overrideFileExport() != null ? overrideFileExport() : true); | |
164 } | |
9148 | 165 |
9417 | 166 @Test |
167 public void testCollision() throws ConnectionException, ServerException, IOException { | |
168 RunnerCreatorHelper.createSinfoCollisionYearsTest(FilenameMapper.COLLISION_RHEIN_HELLO_WORLD_FILE, 336.2, 866.3, River.Rhein, new int[] { 2006, 2008 }) | |
169 .runTest(overrideFileExport() != null ? overrideFileExport() : true); | |
170 } | |
171 | |
172 @Test | |
173 public void testCollisionEpochs() throws ConnectionException, ServerException, IOException { | |
174 RunnerCreatorHelper.createSinfoCollisionEpochsTest(FilenameMapper.COLLISION_RHEIN_EPOCH_HELLO_WORLD_FILE, 336.2, 866.3, River.Rhein, "2006,2008;") | |
175 .runTest(overrideFileExport() != null ? overrideFileExport() : true); | |
176 } | |
177 | |
9418 | 178 @Test |
179 public void testFloodDuration() throws ConnectionException, ServerException, IOException { | |
180 RunnerCreatorHelper | |
181 .createSinfoFloodDurationTest(FilenameMapper.FLOOD_DURATION_HELLO_WORLD_FILE, 0, 182.4, River.Beispielfluss, new double[] { 2091.011 }, true, | |
182 RiversideChoiceKey.BOTH) | |
183 | |
184 .runTest(overrideFileExport() != null ? overrideFileExport() : true); | |
185 } | |
186 | |
9049 | 187 } |