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