diff gwt-client/src/test/java/test/SinfoFlowdepthRunner.java @ 9148:48d87af1243e

Unit testing flowdepthdevelopment added
author gernotbelger
date Tue, 12 Jun 2018 15:04:40 +0200
parents af73fdd96920
children
line wrap: on
line diff
--- a/gwt-client/src/test/java/test/SinfoFlowdepthRunner.java	Tue Jun 12 10:40:33 2018 +0200
+++ b/gwt-client/src/test/java/test/SinfoFlowdepthRunner.java	Tue Jun 12 15:04:40 2018 +0200
@@ -10,6 +10,7 @@
 package test;
 
 import java.io.IOException;
+import java.util.ArrayList;
 
 import org.dive4elements.artifacts.httpclient.exceptions.ConnectionException;
 import org.dive4elements.river.client.shared.exceptions.ServerException;
@@ -26,16 +27,21 @@
  * @author Domenico Nardi Tironi
  *
  */
-public class SinfoFlowdepthRunner extends ModuleRunner {
+public class SinfoFlowdepthRunner extends AbstractModuleRunner {
 
     private final boolean useTkh;
+    private final ArrayList<String> pairIds = new ArrayList<String>();
 
     public SinfoFlowdepthRunner(final String username, final String password, final CalcMode sinfoCalcFlowDepth, final FilenameMapper file, final double from,
             final double to, final River river, final boolean useTkh) throws ConnectionException, ServerException {
-        super(username, password, ModuleRunner.Infotype.sinfo, sinfoCalcFlowDepth, file, from, to, river);
+        super(username, password, 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 */
@@ -48,7 +54,7 @@
         super.selectRange();
 
         /* Select Fixpunkte */
-        feedAndGo(super.getPairData(), 0);
+        feedAndGo(extractPairData(this.pairIds, "diffids"), 0);
 
         /* Select TRANSPORTKÖRPERHÖHHEN - einziger Unterschied zu FlowdepthMinMax */
         final String useTkhStr = String.valueOf(this.useTkh);

http://dive4elements.wald.intevation.org