comparison gwt-client/src/test/java/test/sinfo/SinfoRunnerCreatorHelper.java @ 9570:531a60b7af95

failed tests will be saved to disk
author gernotbelger
date Mon, 05 Nov 2018 17:15:30 +0100
parents 86e522bc7f36
children
comparison
equal deleted inserted replaced
9569:9f83ebf67c92 9570:531a60b7af95
6 * This file is Free Software under the GNU AGPL (>=v3) 6 * This file is Free Software under the GNU AGPL (>=v3)
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the 7 * and comes with ABSOLUTELY NO WARRANTY! Check out the
8 * documentation coming with Dive4Elements River for details. 8 * documentation coming with Dive4Elements River for details.
9 */ 9 */
10 package test.sinfo; 10 package test.sinfo;
11
12 import java.io.File;
11 13
12 import org.dive4elements.artifacts.httpclient.exceptions.ConnectionException; 14 import org.dive4elements.artifacts.httpclient.exceptions.ConnectionException;
13 import org.dive4elements.river.client.shared.exceptions.ServerException; 15 import org.dive4elements.river.client.shared.exceptions.ServerException;
14 16
15 import test.AbstractBerechnungsartenTester.River; 17 import test.AbstractBerechnungsartenTester.River;
28 throw new UnsupportedOperationException(); 30 throw new UnsupportedOperationException();
29 } 31 }
30 32
31 // HELPER-Methods: 33 // HELPER-Methods:
32 34
33 public final static AbstractModuleRunner createSinfoFlowdepthMinMaxTest(final double from, final double to, final River river, 35 public final static AbstractModuleRunner createSinfoFlowdepthMinMaxTest(final File testFolder, final double from, final double to, final River river,
34 final SimpleRecommendation rec0, final SimpleRecommendation rec1) throws ConnectionException, ServerException { 36 final SimpleRecommendation rec0, final SimpleRecommendation rec1) throws ConnectionException, ServerException {
35 // TODO: make recommendationPair to method parameter if needed 37 // TODO: make recommendationPair to method parameter if needed
36 final SinfoFlowdepthMinMaxRunner proof = new SinfoFlowdepthMinMaxRunner(CalcMode.sinfo_calc_flow_depth_minmax, from, to, river); 38 final SinfoFlowdepthMinMaxRunner proof = new SinfoFlowdepthMinMaxRunner(testFolder, CalcMode.sinfo_calc_flow_depth_minmax, from, to, river);
37 proof.addRecommendationPair(rec0, rec1); 39 proof.addRecommendationPair(rec0, rec1);
38 40
39 return proof; 41 return proof;
40 } 42 }
41 43
42 public static AbstractModuleRunner createSinfoFlowdepthMinMaxTest(final int from, final int to, final River river, 44 public static AbstractModuleRunner createSinfoFlowdepthMinMaxTest(final File testFolder, final int from, final int to, final River river,
43 final SimpleRecommendation simpleRecommendation0, final SimpleRecommendation simpleRecommendation1, 45 final SimpleRecommendation simpleRecommendation0, final SimpleRecommendation simpleRecommendation1,
44 final SimpleRecommendation simpleRecommendation2, final SimpleRecommendation simpleRecommendation3) throws ConnectionException, ServerException { 46 final SimpleRecommendation simpleRecommendation2, final SimpleRecommendation simpleRecommendation3) throws ConnectionException, ServerException {
45 final SinfoFlowdepthMinMaxRunner proof = (SinfoFlowdepthMinMaxRunner) createSinfoFlowdepthMinMaxTest(from, to, river, simpleRecommendation0, 47 final SinfoFlowdepthMinMaxRunner proof = (SinfoFlowdepthMinMaxRunner) createSinfoFlowdepthMinMaxTest(testFolder, from, to, river, simpleRecommendation0,
46 simpleRecommendation1); 48 simpleRecommendation1);
47 proof.addRecommendationPair(simpleRecommendation2, simpleRecommendation3); 49 proof.addRecommendationPair(simpleRecommendation2, simpleRecommendation3);
48 return proof; 50 return proof;
49 } 51 }
50 52
51 public final static AbstractModuleRunner createSinfoFlowdepthTest(final double from, final double to, final River river, final boolean useTkh, 53 public final static AbstractModuleRunner createSinfoFlowdepthTest(final File testFolder, final double from, final double to, final River river,
52 final SimpleRecommendation rec0, final SimpleRecommendation rec1) throws ConnectionException, ServerException { 54 final boolean useTkh, final SimpleRecommendation rec0, final SimpleRecommendation rec1) throws ConnectionException, ServerException {
53 final SinfoFlowdepthRunner proof = new SinfoFlowdepthRunner(CalcMode.sinfo_calc_flow_depth, from, to, river, useTkh); 55 final SinfoFlowdepthRunner proof = new SinfoFlowdepthRunner(testFolder, CalcMode.sinfo_calc_flow_depth, from, to, river, useTkh);
54 proof.addRecommendationPair(rec0, rec1); 56 proof.addRecommendationPair(rec0, rec1);
55 57
56 return proof; 58 return proof;
57 } 59 }
58 60
59 public final static AbstractModuleRunner createSinfoFlowdepthDevelopmentTest(final double from, final double to, final River river, 61 public final static AbstractModuleRunner createSinfoFlowdepthDevelopmentTest(final File testFolder, final double from, final double to, final River river,
60 final SimpleRecommendation rec0_curr, final SimpleRecommendation rec1_curr, final SimpleRecommendation rec0_hist, 62 final SimpleRecommendation rec0_curr, final SimpleRecommendation rec1_curr, final SimpleRecommendation rec0_hist,
61 final SimpleRecommendation rec1_hist) throws ConnectionException, ServerException { 63 final SimpleRecommendation rec1_hist) throws ConnectionException, ServerException {
62 final SinfoFlowdepthDevelopmentRunner proof = new SinfoFlowdepthDevelopmentRunner(CalcMode.sinfo_calc_flow_depth_development, from, to, river); 64 final SinfoFlowdepthDevelopmentRunner proof = new SinfoFlowdepthDevelopmentRunner(testFolder, CalcMode.sinfo_calc_flow_depth_development, from, to,
65 river);
63 proof.addCurrentRecommendationPair(rec0_curr, rec1_curr); 66 proof.addCurrentRecommendationPair(rec0_curr, rec1_curr);
64 proof.addHistoricalRecommendationPair(rec0_hist, rec1_hist); 67 proof.addHistoricalRecommendationPair(rec0_hist, rec1_hist);
65 return proof; 68 return proof;
66 } 69 }
67 70
68 public final static AbstractModuleRunner createSinfoTkhTest(final double from, final double to, final River river, 71 public final static AbstractModuleRunner createSinfoTkhTest(final File testFolder, final double from, final double to, final River river,
69 // final boolean useTkh, 72 // final boolean useTkh,
70 final double[] wasserspiegellage) throws ConnectionException, ServerException { 73 final double[] wasserspiegellage) throws ConnectionException, ServerException {
71 final SinfoTkhRunner proof = new SinfoTkhRunner(CalcMode.sinfo_calc_transport_bodies_heights, from, to, river, wasserspiegellage); 74 final SinfoTkhRunner proof = new SinfoTkhRunner(testFolder, CalcMode.sinfo_calc_transport_bodies_heights, from, to, river, wasserspiegellage);
72 75
73 return proof; 76 return proof;
74 } 77 }
75 78
76 public final static AbstractModuleRunner createSinfoCollisionYearsTest(final double from, final double to, final River river, final int[] years) 79 public final static AbstractModuleRunner createSinfoCollisionYearsTest(final File testFolder, final double from, final double to, final River river,
77 throws ConnectionException, ServerException { 80 final int[] years) throws ConnectionException, ServerException {
78 final SinfoCollisionRunner proof = new SinfoCollisionRunner(from, to, river, years, null) 81 final SinfoCollisionRunner proof = new SinfoCollisionRunner(testFolder, from, to, river, years, null)
79 // .addOutputTest(file, outputModeName, overideWriteToDisk, 82 // .addOutputTest(file, outputModeName, overideWriteToDisk,
80 // params) 83 // params)
81 ; 84 ;
82 85
83 return proof; 86 return proof;
84 } 87 }
85 88
86 public final static AbstractModuleRunner createSinfoCollisionEpochsTest(final double from, final double to, final River river, final String epochs) 89 public final static AbstractModuleRunner createSinfoCollisionEpochsTest(final File testFolder, final double from, final double to, final River river,
87 throws ConnectionException, ServerException { 90 final String epochs) throws ConnectionException, ServerException {
88 final SinfoCollisionRunner proof = new SinfoCollisionRunner(from, to, river, null, epochs); 91 final SinfoCollisionRunner proof = new SinfoCollisionRunner(testFolder, from, to, river, null, epochs);
89 92
90 return proof; 93 return proof;
91 } 94 }
92 95
93 public final static AbstractModuleRunner createSinfoFloodDurationTest(final double from, final double to, final River river, 96 public final static AbstractModuleRunner createSinfoFloodDurationTest(final File testFolder, final double from, final double to, final River river,
94 final double[] wasserspiegellage, final boolean showWspl, final RiversideChoiceKey riverside) throws ConnectionException, ServerException { 97 final double[] wasserspiegellage, final boolean showWspl, final RiversideChoiceKey riverside) throws ConnectionException, ServerException {
95 final SinfoFloodDurationRunner proof = new SinfoFloodDurationRunner(CalcMode.sinfo_calc_flood_duration, from, to, river, wasserspiegellage, riverside, 98 final SinfoFloodDurationRunner proof = new SinfoFloodDurationRunner(testFolder, CalcMode.sinfo_calc_flood_duration, from, to, river, wasserspiegellage,
96 showWspl); 99 riverside, showWspl);
97 100
98 return proof; 101 return proof;
99 } 102 }
100 } 103 }

http://dive4elements.wald.intevation.org