comparison gwt-client/src/test/java/test/AbstractModuleRunner.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
1 package test; 1 package test;
2 2
3 import java.io.File;
3 import java.io.IOException; 4 import java.io.IOException;
4 import java.util.ArrayList; 5 import java.util.ArrayList;
5 import java.util.List; 6 import java.util.List;
6 7
7 import org.dive4elements.artifacts.common.ArtifactNamespaceContext; 8 import org.dive4elements.artifacts.common.ArtifactNamespaceContext;
64 private final double from; 65 private final double from;
65 private final double to; 66 private final double to;
66 private final River river; 67 private final River river;
67 private final List<ModuleRunnerOutput> outputList; 68 private final List<ModuleRunnerOutput> outputList;
68 69
69 public AbstractModuleRunner(final Infotype infotype, final ICalcMode calcmode, final double from, final double to, final River beispielfluss) 70 protected final File testFolder;
70 throws ConnectionException, ServerException { 71
72 public AbstractModuleRunner(final File testFolder, final Infotype infotype, final ICalcMode calcmode, final double from, final double to,
73 final River beispielfluss) throws ConnectionException, ServerException {
71 // common attributes (evtl. doch in subklassen, evtl. Zwischenhierarchiestufe einführen 74 // common attributes (evtl. doch in subklassen, evtl. Zwischenhierarchiestufe einführen
72 this.outputList = new ArrayList<ModuleRunnerOutput>(); 75 this.outputList = new ArrayList<ModuleRunnerOutput>();
73 this.iCalcMode = calcmode; 76 this.iCalcMode = calcmode;
74 this.river = beispielfluss; 77 this.river = beispielfluss;
75 this.from = from; 78 this.from = from;
76 this.to = to; 79 this.to = to;
80 this.testFolder = testFolder;
77 81
78 this.infotype = infotype; 82 this.infotype = infotype;
79 83
80 // init 84 // init
81 this.client = new HttpClientImpl(this.serverUrl, this.locale); 85 this.client = new HttpClientImpl(this.serverUrl, this.locale);
259 for (final ModuleRunnerOutput output : this.outputList) { 263 for (final ModuleRunnerOutput output : this.outputList) {
260 final String name = output.getOutputModename(); 264 final String name = output.getOutputModename();
261 if (!stateHasRequiredOutputMode(name)) { 265 if (!stateHasRequiredOutputMode(name)) {
262 Assert.fail("Unbekannter outputmode " + name); 266 Assert.fail("Unbekannter outputmode " + name);
263 } 267 }
264 output.assertAndWriteToFile(this.client, this.collection.identifier()); 268 output.assertAndWriteToFile(this.client, this.collection.identifier(), this.testFolder);
265 } 269 }
266 } 270 }
267 271
268 private final boolean stateHasRequiredOutputMode(final String outputMode) throws ConnectionException, ServerException { 272 private final boolean stateHasRequiredOutputMode(final String outputMode) throws ConnectionException, ServerException {
269 final OutputMode[] modes = getArtifact().getArtifactDescription().getOutputModes(); 273 final OutputMode[] modes = getArtifact().getArtifactDescription().getOutputModes();

http://dive4elements.wald.intevation.org