Mercurial > dive4elements > river
comparison gwt-client/src/test/java/test/BerechnungsartenTester.java @ 9226:83aee0942eae
JUnit-Tests - tkh works
author | gernotbelger |
---|---|
date | Wed, 04 Jul 2018 17:14:16 +0200 |
parents | 48d87af1243e |
children | dba14da43f23 |
comparison
equal
deleted
inserted
replaced
9225:001a8ed1e71d | 9226:83aee0942eae |
---|---|
1 package test; | 1 package test; |
2 | |
3 /* | |
4 * Copyright (c) 2010 by Intevation GmbH | |
5 * | |
6 * This program is free software under the LGPL (>=v2.1) | |
7 * Read the file LGPL.txt coming with the software for details | |
8 * or visit http://www.gnu.org/licenses/ if it does not exist. | |
9 */ | |
10 | 2 |
11 import java.io.IOException; | 3 import java.io.IOException; |
12 | 4 |
13 import org.dive4elements.artifacts.httpclient.exceptions.ConnectionException; | 5 import org.dive4elements.artifacts.httpclient.exceptions.ConnectionException; |
14 import org.dive4elements.river.client.shared.exceptions.ServerException; | 6 import org.dive4elements.river.client.shared.exceptions.ServerException; |
18 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | 10 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
19 */ | 11 */ |
20 | 12 |
21 // REMARK: ignored, because maven will auto-test all tests, but this one needs a running river-artifacts | 13 // REMARK: ignored, because maven will auto-test all tests, but this one needs a running river-artifacts |
22 // For running the JUunit test, the annotation @Ignore has to be disabled | 14 // For running the JUunit test, the annotation @Ignore has to be disabled |
23 // @Ignore | 15 @Ignore |
24 public class BerechnungsartenTester { | 16 public class BerechnungsartenTester { |
25 | 17 |
26 public static enum CalcMode { | 18 public static enum CalcMode { |
27 sinfo_calc_flow_depth, sinfo_calc_flow_depth_development, sinfo_calc_flow_depth_minmax, sinfo_calc_collision, Transportkörperhöhen, sinfo_calc_flood_duration | 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 |
28 }; | 20 }; |
29 | 21 |
30 public static enum River { | 22 public static enum River { |
31 Beispielfluss, Rhein, Elbe | 23 Beispielfluss, Rhein, Elbe |
32 }; | 24 }; |
33 | 25 |
34 public static enum FilenameMapper { | 26 public static enum FilenameMapper { |
35 | 27 |
36 HELLO_WORLD_FILE("/sinfo/flowdepthminmax/sinfo_flowdepthminmax_export.csv"), // | 28 FT_MINMAX_RHEIN_1_FILE("/sinfo/flowdepthminmax/sinfo_minmaxft_01.csv"), // |
29 FT_MINMAX_ELBE_2_FILE("/sinfo/flowdepthminmax/sinfo_minmaxft_02.csv"), // | |
37 | 30 |
38 // Schäfer-Tests: | |
39 FT_RHEIN_1_FILE("/sinfo/flowdepth/sinfo_ft_01.csv"), // | 31 FT_RHEIN_1_FILE("/sinfo/flowdepth/sinfo_ft_01.csv"), // |
40 FT_RHEIN_3_FILE("/sinfo/flowdepth/sinfo_ft_03.csv"), // | 32 FT_RHEIN_2_FILE("/sinfo/flowdepth/sinfo_ft_02.csv"), // |
41 | 33 |
42 FTE_ELBE_FILE("/sinfo/flowdepthdevelopment/sinfo_fte_01.csv"), // | 34 FTE_ELBE_FILE("/sinfo/flowdepthdevelopment/sinfo_fte_01.csv"), // |
43 FTE_RHEIN_FILE("/sinfo/flowdepthdevelopment/sinfo_fte_02.csv"); | 35 FTE_RHEIN_FILE("/sinfo/flowdepthdevelopment/sinfo_fte_02.csv"), |
36 | |
37 TKH_1_ELBE_FILE("/sinfo/flowdepthtkh/sinfo_tkh_01.csv"), // | |
38 TKH_2_RHEIN_FILE("/sinfo/flowdepthtkh/sinfo_tkh_02.csv"); | |
44 | 39 |
45 private final String filename; | 40 private final String filename; |
46 | 41 |
47 FilenameMapper(final String filename) { | 42 FilenameMapper(final String filename) { |
48 this.filename = filename; | 43 this.filename = filename; |
55 | 50 |
56 private final Boolean overrideFileExport() { | 51 private final Boolean overrideFileExport() { |
57 return null; | 52 return null; |
58 } | 53 } |
59 | 54 |
60 /* FLOWDEPTH MIN MAX */ | 55 /* DO NOT DELETE FLOWDEPTH MIN MAX -used to work */ |
61 @Test | 56 // @Test |
62 public void testHelloWorld() throws ServerException, IOException { | 57 // public void testFTMINMAX1() throws ServerException, IOException { |
63 | 58 // |
64 /* Hello World Test */ | 59 // RunnerCreatorHelper.createSinfoFlowdepthMinMaxTest(FilenameMapper.FT_MINMAX_RHEIN_1_FILE, 430, 450, River.Rhein) |
65 RunnerCreatorHelper.createSinfoFlowdepthMinMaxTest(FilenameMapper.HELLO_WORLD_FILE, 10, 100, River.Beispielfluss) | 60 // .runTest(overrideFileExport() != null ? overrideFileExport() : true); |
66 .runTest(overrideFileExport() != null ? overrideFileExport() : true); | 61 // } |
67 } | 62 // |
68 | 63 // @Test |
69 /* FLOWDEPTH */ | 64 // public void testFTMINMAX2() throws ServerException, IOException { |
65 // | |
66 // RunnerCreatorHelper.createSinfoFlowdepthMinMaxTest(FilenameMapper.FT_MINMAX_ELBE_2_FILE, 0, 90, River.Elbe) | |
67 // .runTest(overrideFileExport() != null ? overrideFileExport() : true); | |
68 // } | |
69 // | |
70 /* DO NOT DELETE FLOWDEPTH - used to work */ | |
70 @Test | 71 @Test |
71 public void testRhein1FT() throws ConnectionException, ServerException, IOException { | 72 public void testRhein1FT() throws ConnectionException, ServerException, IOException { |
72 | 73 |
73 RunnerCreatorHelper | 74 RunnerCreatorHelper |
74 .createSinfoFlowdepthTest(FilenameMapper.FT_RHEIN_1_FILE, 350, 380, River.Rhein, false, | 75 .createSinfoFlowdepthTest(FilenameMapper.FT_RHEIN_1_FILE, 350, 380, River.Rhein, false, |
77 .runTest(overrideFileExport() != null ? overrideFileExport() : true); | 78 .runTest(overrideFileExport() != null ? overrideFileExport() : true); |
78 | 79 |
79 } | 80 } |
80 | 81 |
81 @Test | 82 @Test |
82 public void testRhein3FT() throws ConnectionException, ServerException, IOException { | 83 public void testRhein2FT() throws ConnectionException, ServerException, IOException { |
83 RunnerCreatorHelper | 84 RunnerCreatorHelper |
84 .createSinfoFlowdepthTest(FilenameMapper.FT_RHEIN_3_FILE, 655, 675, River.Rhein, true, | 85 .createSinfoFlowdepthTest(FilenameMapper.FT_RHEIN_2_FILE, 655, 675, River.Rhein, true, |
85 new SimpleRecommendation("staticwqkms", "fixations-wstv-0-323", "longitudinal_section"), | 86 new SimpleRecommendation("staticwqkms", "fixations-wstv-0-323", "longitudinal_section"), |
86 new SimpleRecommendation("bedheight", "bedheight-soundings-92-2004-NIEDERRHEIN_QP-2004_Epoche_NHN", "longitudinal_section")) | 87 new SimpleRecommendation("bedheight", "bedheight-soundings-92-2004-NIEDERRHEIN_QP-2004_Epoche_NHN", "longitudinal_section")) |
87 .runTest(overrideFileExport() != null ? overrideFileExport() : true); | 88 .runTest(overrideFileExport() != null ? overrideFileExport() : true); |
88 } | 89 } |
89 | 90 |
90 /* FLOWDEPTH DEVELOPMENT */ | 91 /* DO NOT DELETE FLOWDEPTH DEVELOPMENT - used to work */ |
91 | 92 |
92 @Test | 93 // @Test |
93 public void testElbeFTE() throws ConnectionException, ServerException, IOException { | 94 // public void testElbeFTE() throws ConnectionException, ServerException, IOException { |
94 RunnerCreatorHelper.createSinfoFlowdepthDevelopmentTest(FilenameMapper.FTE_ELBE_FILE, 210, 230, River.Elbe, | 95 // RunnerCreatorHelper.createSinfoFlowdepthDevelopmentTest(FilenameMapper.FTE_ELBE_FILE, 210, 230, River.Elbe, |
95 // current | 96 // // current |
96 new SimpleRecommendation("staticwqkms", "fixations-wstv-0-196", "longitudinal_section", "05.05.2008"), // sicher | 97 // new SimpleRecommendation("staticwqkms", "fixations-wstv-0-196", "longitudinal_section", "05.05.2008"), // sicher |
97 new SimpleRecommendation("bedheight", "bedheight-soundings-66-2008-FP-QP-2008", | 98 // new SimpleRecommendation("bedheight", "bedheight-soundings-66-2008-FP-QP-2008", |
98 // "bedheight-single-66-2008-MW-FP-QP-2008", | 99 // // "bedheight-single-66-2008-MW-FP-QP-2008", |
99 "longitudinal_section"), | 100 // "longitudinal_section"), |
101 // | |
102 // // historical | |
103 // new SimpleRecommendation("staticwqkms", "fixations-wstv-0-186", "longitudinal_section", "18.03.1997"), // sicher | |
104 // new SimpleRecommendation("bedheight", "bedheight-soundings-70-1995-QP-1995", | |
105 // // "bedheight-single-70-1995-MW-QP-1995", | |
106 // "longitudinal_section")) | |
107 // .runTest(overrideFileExport() != null ? overrideFileExport() : true); | |
108 // } | |
109 // | |
110 // @Test | |
111 // public void testRheinFTE() throws ConnectionException, ServerException, IOException { | |
112 // RunnerCreatorHelper.createSinfoFlowdepthDevelopmentTest(FilenameMapper.FTE_RHEIN_FILE, 655, 665, River.Rhein, | |
113 // // current | |
114 // new SimpleRecommendation("staticwqkms", "fixations-wstv-0-372", "longitudinal_section", "23.09.2009-1"), // sicher | |
115 // new SimpleRecommendation("bedheight", "bedheight-single-94-2008-MW-NIEDERRHEIN_QP-2008_Epoche_NHN", | |
116 // // "bedheight-single....", | |
117 // "longitudinal_section"), | |
118 // | |
119 // // historical | |
120 // new SimpleRecommendation("staticwqkms", "fixations-wstv-0-374", "longitudinal_section", "23.09.1991"), // sicher | |
121 // new SimpleRecommendation("bedheight", "bedheight-single-89-1991-MW-NIEDERRHEIN_QP-1991_Epoche_NHN", | |
122 // // "bedheight-soundings-89-1991-NIEDERRHEIN_QP-1991_Epoche_NHN", | |
123 // "longitudinal_section")) | |
124 // .runTest(overrideFileExport() != null ? overrideFileExport() : true); | |
125 // } | |
100 | 126 |
101 // historical | 127 /* TKH - works */ |
102 new SimpleRecommendation("staticwqkms", "fixations-wstv-0-186", "longitudinal_section", "18.03.1997"), // sicher | |
103 new SimpleRecommendation("bedheight", "bedheight-soundings-70-1995-QP-1995", | |
104 // "bedheight-single-70-1995-MW-QP-1995", | |
105 "longitudinal_section")) | |
106 .runTest(overrideFileExport() != null ? overrideFileExport() : true); | |
107 } | |
108 | 128 |
109 @Test | 129 // @Test |
110 public void testRheinFTE() throws ConnectionException, ServerException, IOException { | 130 // public void testElbeTKH_1() throws ConnectionException, ServerException, IOException { |
111 RunnerCreatorHelper.createSinfoFlowdepthDevelopmentTest(FilenameMapper.FTE_RHEIN_FILE, 655, 665, River.Rhein, | 131 // RunnerCreatorHelper.createSinfoTkhTest(FilenameMapper.TKH_1_ELBE_FILE, 150, 160, River.Elbe, new double[] { 1520.0 }) |
112 // current | 132 // .runTest(overrideFileExport() != null ? overrideFileExport() : true); |
113 new SimpleRecommendation("staticwqkms", "fixations-wstv-0-372", "longitudinal_section", "23.09.2009-1"), // sicher | 133 // } |
114 new SimpleRecommendation("bedheight", "bedheight-soundings-80-2008-FP-2008_NHN", | 134 // |
115 // "bedheight-single....", | 135 // @Test |
116 "longitudinal_section"), | 136 // public void testRheinTKH_2() throws ConnectionException, ServerException, IOException { |
117 | 137 // RunnerCreatorHelper.createSinfoTkhTest(FilenameMapper.TKH_2_RHEIN_FILE, 600, 610, River.Rhein, new double[] { 6125, |
118 // historical | 138 // 6526 }) |
119 new SimpleRecommendation("staticwqkms", "fixations-wstv-0-374", "longitudinal_section", "18.03.1997"), // sicher | 139 // |
120 new SimpleRecommendation("bedheight", "bedheight-single-89-1991-MW-NIEDERRHEIN_QP-1991_Epoche_NHN", | 140 // .runTest(overrideFileExport() != null ? overrideFileExport() : true); |
121 // "bedheight-soundings-89-1991-NIEDERRHEIN_QP-1991_Epoche_NHN", | 141 // } |
122 "longitudinal_section")) | |
123 .runTest(overrideFileExport() != null ? overrideFileExport() : true); | |
124 } | |
125 | 142 |
126 } | 143 } |