9422
|
1 package test.uinfo; |
|
2 |
|
3 import java.io.IOException; |
9428
|
4 import java.util.ArrayList; |
|
5 import java.util.List; |
9422
|
6 |
|
7 import org.dive4elements.river.client.shared.exceptions.ServerException; |
9428
|
8 import org.dive4elements.river.client.shared.model.SalixZone; |
9422
|
9 import org.junit.Test; |
|
10 |
|
11 import test.AbstractBerechnungsartenTester; |
|
12 import test.ICalcMode; |
|
13 import test.IFilenameMapper; |
|
14 |
9428
|
15 //@Ignore |
9422
|
16 public class UInfoBerechnungsartenTester extends AbstractBerechnungsartenTester { |
|
17 |
|
18 public static enum CalcMode implements ICalcMode { |
|
19 uinfo_salix_line, // |
|
20 // der Vollständigkeit halber |
|
21 uinfo_inundation_duration, uinfo_vegetation_zones |
|
22 }; |
|
23 |
9424
|
24 // Szenarien: |
|
25 // scenarioType.option1 |
|
26 // scenarioType.option2 |
|
27 // scenarioType.option3 |
|
28 |
9422
|
29 public static enum FilenameMapper implements IFilenameMapper { |
|
30 |
9424
|
31 SALIX_NO_SCENARIO("/uinfo/salix/salix_no_scenario.csv"), // |
9428
|
32 SALIX_REGIONAL_SCENARIO("/uinfo/salix/salix_regional.csv"), // |
|
33 SALIX_SUPRAREGIONAL_SCENARIO("/uinfo/salix/salix_supraregional.csv"), // |
|
34 SALIX_HISTORICAL_SCENARIO("/uinfo/salix/salix_historical.csv"); // |
9422
|
35 private final String filename; |
|
36 |
|
37 FilenameMapper(final String filename) { |
|
38 this.filename = filename; |
|
39 } |
|
40 |
|
41 @Override |
|
42 public String getFilename() { |
|
43 return this.filename; |
|
44 } |
|
45 } |
|
46 |
|
47 /* Salix no Scenario */ |
|
48 @Test |
|
49 public void testSalixNoScenario() throws ServerException, IOException { |
9424
|
50 new UinfoSalixRunner(FilenameMapper.SALIX_NO_SCENARIO, 0., 182.4, River.Beispielfluss, null) |
9422
|
51 .runTest(overrideFileExport() != null ? overrideFileExport() : true); |
|
52 } |
|
53 |
9424
|
54 @Test |
|
55 public void testSalixRegionalScenario() throws ServerException, IOException { |
|
56 new UinfoSalixRegionalRunner(FilenameMapper.SALIX_REGIONAL_SCENARIO, 0., 182.4, River.Beispielfluss, "scenarioType.option1", 50., 60., "5 -10 12 0") |
|
57 .runTest(overrideFileExport() != null ? overrideFileExport() : true); |
|
58 } |
9428
|
59 |
|
60 @Test |
|
61 public void testSalixSupraregionalScenario() throws ServerException, IOException { |
|
62 final List<SalixZone> zones = new ArrayList<SalixZone>(); |
|
63 zones.add(SalixZone.createFromTableEntry("2", "0", "50")); |
|
64 zones.add(SalixZone.createFromTableEntry("5", "50", "100")); |
|
65 zones.add(SalixZone.createFromTableEntry("2", "100", "182.4")); |
|
66 new UinfoSalixSupraregionalRunner(FilenameMapper.SALIX_SUPRAREGIONAL_SCENARIO, 0., 182.4, River.Beispielfluss, "scenarioType.option2", zones) |
|
67 .runTest(overrideFileExport() != null ? overrideFileExport() : true); |
|
68 } |
|
69 |
|
70 @Test |
|
71 public void testSalixHistoricalScenario() throws ServerException, IOException { |
|
72 |
|
73 // name of sounding can be found in ParameterMatrixPanel.getData |
|
74 new UinfoSalixHistoricalRunner(FilenameMapper.SALIX_HISTORICAL_SCENARIO, 0., 182.4, River.Beispielfluss, "scenarioType.option3", "single-18", 149.6, |
|
75 182.4).runTest(overrideFileExport() != null ? overrideFileExport() : true); |
|
76 } |
9422
|
77 } |