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