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