diff gwt-client/src/test/java/test/sinfo/SinfoFlowdepthRunner.java @ 9422:e567fac95e3d

uinfo salix no scenario jUnit test
author gernotbelger
date Fri, 17 Aug 2018 11:43:42 +0200
parents
children 86e522bc7f36
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gwt-client/src/test/java/test/sinfo/SinfoFlowdepthRunner.java	Fri Aug 17 11:43:42 2018 +0200
@@ -0,0 +1,70 @@
+/** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde
+ * Software engineering by
+ *  Björnsen Beratende Ingenieure GmbH
+ *  Dr. Schumacher Ingenieurbüro für Wasser und Umwelt
+ *
+ * This file is Free Software under the GNU AGPL (>=v3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out the
+ * documentation coming with Dive4Elements River for details.
+ */
+package test.sinfo;
+
+import java.io.IOException;
+import java.util.ArrayList;
+
+import org.dive4elements.artifacts.httpclient.exceptions.ConnectionException;
+import org.dive4elements.river.client.shared.exceptions.ServerException;
+import org.dive4elements.river.client.shared.model.Data;
+import org.dive4elements.river.client.shared.model.DataItem;
+import org.dive4elements.river.client.shared.model.DefaultDataItem;
+import org.dive4elements.river.client.shared.model.StringOptionsData;
+
+import test.AbstractBerechnungsartenTester.River;
+import test.AbstractModuleRunner;
+import test.ICalcMode;
+import test.IFilenameMapper;
+import test.SimpleRecommendation;
+
+/**
+ * @author Domenico Nardi Tironi
+ *
+ */
+final class SinfoFlowdepthRunner extends AbstractModuleRunner {
+
+    private final boolean useTkh;
+    private final ArrayList<String> pairIds = new ArrayList<String>();
+
+    public SinfoFlowdepthRunner(final ICalcMode sinfoCalcFlowDepth, final IFilenameMapper file, final double from, final double to, final River river,
+            final boolean useTkh) throws ConnectionException, ServerException {
+        super(AbstractModuleRunner.Infotype.sinfo, sinfoCalcFlowDepth, file, from, to, river);
+        this.useTkh = useTkh;
+    }
+
+    public void addRecommendationPair(final SimpleRecommendation rec1, final SimpleRecommendation rec2) throws ConnectionException, ServerException {
+        this.pairIds.add(super.getRecommendationPairString(rec1, rec2));
+    }
+
+    @Override
+    public void runTest(final boolean exportToFile) throws ServerException, IOException {
+        /* Select River */
+        super.selectRiver();
+
+        /* Select ICalcMode */
+        super.selectCalcMode();
+
+        /* Select Range */
+        super.selectRange();
+
+        /* Select Fixpunkte */
+        feedAndGo(extractPairData(this.pairIds, "diffids"), 0);
+
+        /* Select TRANSPORTKÖRPERHÖHHEN - einziger Unterschied zu FlowdepthMinMax */
+        final String useTkhStr = String.valueOf(this.useTkh);
+        feedAndGo(new Data[] { new StringOptionsData("use_transport_bodies", "use_transport_bodies",
+                new DataItem[] { new DefaultDataItem(useTkhStr, useTkhStr, useTkhStr) }) }, 0);
+
+        describeCollection();
+
+        super.export(exportToFile);
+    }
+}

http://dive4elements.wald.intevation.org