Mercurial > dive4elements > river
comparison gwt-client/src/test/java/test/uinfo/UInfoBerechnungsartenTester.java @ 9567:86e522bc7f36
jUnit-Tests completed
author | gernotbelger |
---|---|
date | Mon, 05 Nov 2018 13:21:57 +0100 |
parents | 173f188569c6 |
children | 531a60b7af95 |
comparison
equal
deleted
inserted
replaced
9566:9826b465b751 | 9567:86e522bc7f36 |
---|---|
8 import org.dive4elements.river.client.shared.model.SalixZone; | 8 import org.dive4elements.river.client.shared.model.SalixZone; |
9 import org.junit.Ignore; | 9 import org.junit.Ignore; |
10 import org.junit.Test; | 10 import org.junit.Test; |
11 | 11 |
12 import test.AbstractBerechnungsartenTester; | 12 import test.AbstractBerechnungsartenTester; |
13 import test.FilenameSupplier; | |
13 import test.ICalcMode; | 14 import test.ICalcMode; |
14 import test.IFilenameMapper; | |
15 | 15 |
16 @Ignore | 16 @Ignore |
17 public class UInfoBerechnungsartenTester extends AbstractBerechnungsartenTester { | 17 public class UInfoBerechnungsartenTester extends AbstractBerechnungsartenTester { |
18 | |
19 private final String UINFO_SALIX_MAIN_EXPORT_MODE_NAME = "uinfo_salix_line_export"; | |
20 private final String UINFO_SALIX_LAENGS_CHART_NAME = "uinfo_salix_line"; | |
18 | 21 |
19 public static enum CalcMode implements ICalcMode { | 22 public static enum CalcMode implements ICalcMode { |
20 uinfo_salix_line, // | 23 uinfo_salix_line, // |
21 // der Vollständigkeit halber | 24 // der Vollständigkeit halber |
22 uinfo_inundation_duration, uinfo_vegetation_zones | 25 uinfo_inundation_duration, uinfo_vegetation_zones |
24 | 27 |
25 // Szenarien: | 28 // Szenarien: |
26 // scenarioType.option1 | 29 // scenarioType.option1 |
27 // scenarioType.option2 | 30 // scenarioType.option2 |
28 // scenarioType.option3 | 31 // scenarioType.option3 |
32 /* | |
33 * HELLO WORLD FILES: | |
34 * FilenameSupplier SALIX_NO_SCENARIO = new FilenameSupplier("/uinfo/salix/salix_no_scenario.csv"); // | |
35 * FilenameSupplier SALIX_REGIONAL_SCENARIO = new FilenameSupplier("/uinfo/salix/salix_regional.csv"); // | |
36 * FilenameSupplier SALIX_SUPRAREGIONAL_SCENARIO = new FilenameSupplier("/uinfo/salix/salix_supraregional.csv"); // | |
37 * FilenameSupplier SALIX_HISTORICAL_SCENARIO = new FilenameSupplier("/uinfo/salix/salix_historical.csv"); // | |
38 */ | |
29 | 39 |
30 public static enum FilenameMapper implements IFilenameMapper { | 40 FilenameSupplier SALIX_01 = new FilenameSupplier("/uinfo/salix/uinfo_salix_01.csv"); // |
41 FilenameSupplier SALIX_02 = new FilenameSupplier("/uinfo/salix/uinfo_salix_02.csv"); // | |
42 FilenameSupplier SALIX_02_CHART = new FilenameSupplier("/uinfo/salix/uinfo_salix_02_chart_laengs.csv"); // | |
43 FilenameSupplier SALIX_03 = new FilenameSupplier("/uinfo/salix/uinfo_salix_03.csv"); // | |
44 FilenameSupplier SALIX_03_CHART = new FilenameSupplier("/uinfo/salix/uinfo_salix_03_chart_laengs.csv"); // | |
45 FilenameSupplier SALIX_04 = new FilenameSupplier("/uinfo/salix/uinfo_salix_04.csv"); // | |
31 | 46 |
32 SALIX_NO_SCENARIO("/uinfo/salix/salix_no_scenario.csv"), // | |
33 SALIX_REGIONAL_SCENARIO("/uinfo/salix/salix_regional.csv"), // | |
34 SALIX_SUPRAREGIONAL_SCENARIO("/uinfo/salix/salix_supraregional.csv"), // | |
35 SALIX_HISTORICAL_SCENARIO("/uinfo/salix/salix_historical.csv"); // | |
36 private final String filename; | |
37 | |
38 FilenameMapper(final String filename) { | |
39 this.filename = filename; | |
40 } | |
41 | |
42 @Override | |
43 public String getFilename() { | |
44 return this.filename; | |
45 } | |
46 } | |
47 | |
48 /* Salix no Scenario */ | |
49 @Test | 47 @Test |
50 public void testSalixNoScenario() throws ServerException, IOException { | 48 public void test01() throws ServerException, IOException { |
51 new UinfoSalixRunner(FilenameMapper.SALIX_NO_SCENARIO, 0., 182.4, River.Beispielfluss, null) | 49 new UinfoSalixRunner(336.2, 866.3, River.Rhein, null) // |
52 .runTest(overrideFileExport() != null ? overrideFileExport() : true); | 50 .addOutputTest(this.SALIX_01, this.UINFO_SALIX_MAIN_EXPORT_MODE_NAME, null) // |
51 .runTest(); | |
52 // this.SALIX_NO_SCENARIO | |
53 } | 53 } |
54 | 54 |
55 @Test | 55 @Test |
56 public void testSalixRegionalScenario() throws ServerException, IOException { | 56 public void test02() throws ServerException, IOException { |
57 new UinfoSalixRegionalRunner(FilenameMapper.SALIX_REGIONAL_SCENARIO, 0., 182.4, River.Beispielfluss, "scenarioType.option1", 50., 60., "5 -10 12 0") | 57 new UinfoSalixRegionalRunner(336.2, 866.3, River.Rhein, "scenarioType.option1", 336.2, 866.3, "-50 50")// |
58 .runTest(overrideFileExport() != null ? overrideFileExport() : true); | 58 .addOutputTest(this.SALIX_02, this.UINFO_SALIX_MAIN_EXPORT_MODE_NAME, null) // |
59 .addOutputTest(this.SALIX_02_CHART, this.UINFO_SALIX_LAENGS_CHART_NAME, null) // | |
60 .runTest(); | |
61 // this.SALIX_REGIONAL_SCENARIO, | |
59 } | 62 } |
60 | 63 |
61 @Test | 64 @Test |
62 public void testSalixSupraregionalScenario() throws ServerException, IOException { | 65 public void test03() throws ServerException, IOException { |
63 final List<SalixZone> zones = new ArrayList<SalixZone>(); | 66 final List<SalixZone> zones = new ArrayList<SalixZone>(); |
64 zones.add(SalixZone.createFromTableEntry("2", "0", "50")); | 67 zones.add(SalixZone.createFromTableEntry("0", "0", "100")); |
65 zones.add(SalixZone.createFromTableEntry("5", "50", "100")); | 68 zones.add(SalixZone.createFromTableEntry("-50", "100", "200")); |
66 zones.add(SalixZone.createFromTableEntry("2", "100", "182.4")); | 69 zones.add(SalixZone.createFromTableEntry("0", "200", "300")); |
67 new UinfoSalixSupraregionalRunner(FilenameMapper.SALIX_SUPRAREGIONAL_SCENARIO, 0., 182.4, River.Beispielfluss, "scenarioType.option2", zones) | 70 zones.add(SalixZone.createFromTableEntry("30", "300", "450")); |
68 .runTest(overrideFileExport() != null ? overrideFileExport() : true); | 71 zones.add(SalixZone.createFromTableEntry("0", "450", "550")); |
72 | |
73 new UinfoSalixSupraregionalRunner(0., 550.0, River.Elbe, "scenarioType.option2", zones) | |
74 .addOutputTest(this.SALIX_03, this.UINFO_SALIX_MAIN_EXPORT_MODE_NAME, null) // | |
75 .addOutputTest(this.SALIX_03_CHART, this.UINFO_SALIX_LAENGS_CHART_NAME, null) // | |
76 .runTest(); | |
77 // this.SALIX_SUPRAREGIONAL_SCENARIO, | |
69 } | 78 } |
70 | 79 |
71 @Test | 80 @Test |
72 public void testSalixHistoricalScenario() throws ServerException, IOException { | 81 public void test04() throws ServerException, IOException { |
82 // name of sounding can be found in ParameterMatrixPanel.getData | |
83 new UinfoSalixHistoricalRunner(0., 598.3, River.Elbe, "scenarioType.option3", "single-68", 0.1, 585.3) | |
84 .addOutputTest(this.SALIX_04, this.UINFO_SALIX_MAIN_EXPORT_MODE_NAME, null) // | |
85 .runTest(); | |
86 // this.SALIX_HISTORICAL_SCENARIO, | |
87 } | |
73 | 88 |
74 // name of sounding can be found in ParameterMatrixPanel.getData | 89 /* |
75 new UinfoSalixHistoricalRunner(FilenameMapper.SALIX_HISTORICAL_SCENARIO, 0., 182.4, River.Beispielfluss, "scenarioType.option3", "single-18", 149.6, | 90 * HELLO |
76 182.4).runTest(overrideFileExport() != null ? overrideFileExport() : true); | 91 * WORLD (below) |
77 } | 92 */ |
93 /* | |
94 * /* Salix no Scenario | |
95 */ | |
96 /* | |
97 * // @Test | |
98 * public void testSalixNoScenario() throws ServerException, IOException { | |
99 * new UinfoSalixRunner(0., 182.4, River.Beispielfluss, null) // | |
100 * .addOutputTest(this.SALIX_NO_SCENARIO, this.UINFO_SALIX_MAIN_EXPORT_MODE_NAME, null) // | |
101 * .runTest(); | |
102 * // this.SALIX_NO_SCENARIO | |
103 * } | |
104 * // @Test | |
105 * public void testSalixRegionalScenario() throws ServerException, IOException { | |
106 * new UinfoSalixRegionalRunner(0., 182.4, River.Beispielfluss, "scenarioType.option1", 50., 60., "5 -10 12 0") | |
107 * .addOutputTest(this.SALIX_REGIONAL_SCENARIO, this.UINFO_SALIX_MAIN_EXPORT_MODE_NAME, null) // | |
108 * .runTest(); | |
109 * // this.SALIX_REGIONAL_SCENARIO, | |
110 * } | |
111 * // @Test | |
112 * public void testSalixSupraregionalScenario() throws ServerException, IOException { | |
113 * final List<SalixZone> zones = new ArrayList<SalixZone>(); | |
114 * zones.add(SalixZone.createFromTableEntry("2", "0", "50")); | |
115 * zones.add(SalixZone.createFromTableEntry("5", "50", "100")); | |
116 * zones.add(SalixZone.createFromTableEntry("2", "100", "182.4")); | |
117 * new UinfoSalixSupraregionalRunner(0., 182.4, River.Beispielfluss, "scenarioType.option2", zones) | |
118 * .addOutputTest(this.SALIX_SUPRAREGIONAL_SCENARIO, this.UINFO_SALIX_MAIN_EXPORT_MODE_NAME, null) // | |
119 * .runTest(); | |
120 * // this.SALIX_SUPRAREGIONAL_SCENARIO, | |
121 * } | |
122 * // @Test | |
123 * public void testSalixHistoricalScenario() throws ServerException, IOException { | |
124 * // name of sounding can be found in ParameterMatrixPanel.getData | |
125 * new UinfoSalixHistoricalRunner(0., 182.4, River.Beispielfluss, "scenarioType.option3", "single-18", 149.6, 182.4) | |
126 * .addOutputTest(this.SALIX_HISTORICAL_SCENARIO, this.UINFO_SALIX_MAIN_EXPORT_MODE_NAME, null) // | |
127 * .runTest(); | |
128 * // this.SALIX_HISTORICAL_SCENARIO, | |
129 * } | |
130 */ | |
78 } | 131 } |