comparison gwt-client/src/test/java/test/BerechnungsartenTester.java @ 9127:dbb26bc81843

Testing
author gernotbelger
date Wed, 06 Jun 2018 13:05:57 +0200
parents gwt-client/src/test/java/test/TestMain.java@95643dffd006
children af73fdd96920
comparison
equal deleted inserted replaced
9126:7235a610558a 9127:dbb26bc81843
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
11 import java.io.IOException;
12
13 import org.dive4elements.artifacts.httpclient.exceptions.ConnectionException;
14 import org.dive4elements.river.client.shared.exceptions.ServerException;
15 import org.junit.Ignore;
16 import org.junit.Test;
17
18 /**
19 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
20 */
21
22 // REMARK: ignored, because maven will auto-test all tests, but this one needs a running river-artifacts
23 // For running the JUunit test, the annotation @Ignore has to be disabled
24 @Ignore
25 public class BerechnungsartenTester {
26
27 public static enum CalcMode {
28 sinfo_calc_flow_depth, sinfo_calc_flow_depth_development, sinfo_calc_flow_depth_minmax, sinfo_calc_collision, Transportkörperhöhen, sinfo_calc_flood_duration
29 };
30
31 public static enum River {
32 Beispielfluss, Rhein
33 };
34
35 public static enum FilenameMapper {
36
37 HELLO_WORLD_FILE("/sinfo/flowdepthminmax/sinfo_flowdepthminmax_export.csv"), //
38 RHEIN_1_FILE("/sinfo/flowdepth/sinfo_ft_01.csv"), //
39 RHEIN_2_FILE("/sinfo/flowdepth/sinfo_ft_02.csv"), //
40 RHEIN_3_FILE("/sinfo/flowdepth/sinfo_ft_03.csv");
41
42 private final String filename;
43
44 FilenameMapper(final String filename) {
45 this.filename = filename;
46 }
47
48 public String getFilename() {
49 return this.filename;
50 }
51 }
52
53 private final Boolean overrideFileExport() {
54 return null;
55 }
56
57 @Test
58 public void testHelloWorld() throws ServerException, IOException {
59
60 /* Hello World Test */
61 RunnerCreatorHelper.createSinfoFlowdepthMinMaxTest(FilenameMapper.HELLO_WORLD_FILE, 10, 100, River.Beispielfluss)
62 .runTest(overrideFileExport() != null ? overrideFileExport() : true);
63 }
64
65 @Test
66 public void testRhein1() throws ConnectionException, ServerException, IOException {
67
68 RunnerCreatorHelper
69 .createSinfoFlowdepthTest(FilenameMapper.RHEIN_1_FILE, 350, 380, River.Rhein, false,
70 new SimpleRecommendation("staticwqkms", "additionals-wstv-0-415", "longitudinal_section"),
71 new SimpleRecommendation("bedheight", "bedheight-soundings-79-2004-DGM-2004_Epoche_NHN", "longitudinal_section"))
72 .runTest(overrideFileExport() != null ? overrideFileExport() : true);
73
74 }
75
76 @Test
77 public void testRhein2() throws ConnectionException, ServerException, IOException {
78 // 2004 :: DGM-2004_Epoche FEHLT
79 RunnerCreatorHelper.createSinfoFlowdepthTest(FilenameMapper.RHEIN_2_FILE, 350, 380, River.Rhein, false,
80 new SimpleRecommendation("staticwqkms", "additionals-wstv-0-415", "longitudinal_section"),
81 new SimpleRecommendation("bedheight", "bedheight-soundings-79-2004-DGM-2004_Epoche", // FEHLT: 2004 :: DGM-2004_Epoche
82
83 "longitudinal_section"))
84 .runTest(overrideFileExport() != null ? overrideFileExport() : true);
85 }
86
87 @Test
88 public void testRhein3() throws ConnectionException, ServerException, IOException {
89 RunnerCreatorHelper
90 .createSinfoFlowdepthTest(FilenameMapper.RHEIN_3_FILE, 655, 675, River.Rhein, true,
91 new SimpleRecommendation("staticwqkms", "fixations-wstv-0-323", "longitudinal_section"),
92 new SimpleRecommendation("bedheight", "bedheight-soundings-92-2004-NIEDERRHEIN_QP-2004_Epoche_NHN", "longitudinal_section"))
93 .runTest(overrideFileExport() != null ? overrideFileExport() : true);
94 }
95
96 }

http://dive4elements.wald.intevation.org