diff gwt-client/src/test/java/test/BerechnungsartenTester.java @ 9226:83aee0942eae

JUnit-Tests - tkh works
author gernotbelger
date Wed, 04 Jul 2018 17:14:16 +0200
parents 48d87af1243e
children dba14da43f23
line wrap: on
line diff
--- a/gwt-client/src/test/java/test/BerechnungsartenTester.java	Wed Jul 04 17:13:31 2018 +0200
+++ b/gwt-client/src/test/java/test/BerechnungsartenTester.java	Wed Jul 04 17:14:16 2018 +0200
@@ -1,13 +1,5 @@
 package test;
 
-/*
- * Copyright (c) 2010 by Intevation GmbH
- *
- * This program is free software under the LGPL (>=v2.1)
- * Read the file LGPL.txt coming with the software for details
- * or visit http://www.gnu.org/licenses/ if it does not exist.
- */
-
 import java.io.IOException;
 
 import org.dive4elements.artifacts.httpclient.exceptions.ConnectionException;
@@ -20,11 +12,11 @@
 
 // REMARK: ignored, because maven will auto-test all tests, but this one needs a running river-artifacts
 // For running the JUunit test, the annotation @Ignore has to be disabled
-// @Ignore
+@Ignore
 public class BerechnungsartenTester {
 
     public static enum CalcMode {
-        sinfo_calc_flow_depth, sinfo_calc_flow_depth_development, sinfo_calc_flow_depth_minmax, sinfo_calc_collision, Transportkörperhöhen, sinfo_calc_flood_duration
+        sinfo_calc_flow_depth, sinfo_calc_flow_depth_development, sinfo_calc_flow_depth_minmax, sinfo_calc_collision, sinfo_calc_transport_bodies_heights, sinfo_calc_flood_duration
     };
 
     public static enum River {
@@ -33,14 +25,17 @@
 
     public static enum FilenameMapper {
 
-        HELLO_WORLD_FILE("/sinfo/flowdepthminmax/sinfo_flowdepthminmax_export.csv"), //
+        FT_MINMAX_RHEIN_1_FILE("/sinfo/flowdepthminmax/sinfo_minmaxft_01.csv"), //
+        FT_MINMAX_ELBE_2_FILE("/sinfo/flowdepthminmax/sinfo_minmaxft_02.csv"), //
 
-        // Schäfer-Tests:
         FT_RHEIN_1_FILE("/sinfo/flowdepth/sinfo_ft_01.csv"), //
-        FT_RHEIN_3_FILE("/sinfo/flowdepth/sinfo_ft_03.csv"), //
+        FT_RHEIN_2_FILE("/sinfo/flowdepth/sinfo_ft_02.csv"), //
 
         FTE_ELBE_FILE("/sinfo/flowdepthdevelopment/sinfo_fte_01.csv"), //
-        FTE_RHEIN_FILE("/sinfo/flowdepthdevelopment/sinfo_fte_02.csv");
+        FTE_RHEIN_FILE("/sinfo/flowdepthdevelopment/sinfo_fte_02.csv"),
+
+        TKH_1_ELBE_FILE("/sinfo/flowdepthtkh/sinfo_tkh_01.csv"), //
+        TKH_2_RHEIN_FILE("/sinfo/flowdepthtkh/sinfo_tkh_02.csv");
 
         private final String filename;
 
@@ -57,16 +52,22 @@
         return null;
     }
 
-    /* FLOWDEPTH MIN MAX */
-    @Test
-    public void testHelloWorld() throws ServerException, IOException {
-
-        /* Hello World Test */
-        RunnerCreatorHelper.createSinfoFlowdepthMinMaxTest(FilenameMapper.HELLO_WORLD_FILE, 10, 100, River.Beispielfluss)
-                .runTest(overrideFileExport() != null ? overrideFileExport() : true);
-    }
-
-    /* FLOWDEPTH */
+    /* DO NOT DELETE FLOWDEPTH MIN MAX -used to work */
+    // @Test
+    // public void testFTMINMAX1() throws ServerException, IOException {
+    //
+    // RunnerCreatorHelper.createSinfoFlowdepthMinMaxTest(FilenameMapper.FT_MINMAX_RHEIN_1_FILE, 430, 450, River.Rhein)
+    // .runTest(overrideFileExport() != null ? overrideFileExport() : true);
+    // }
+    //
+    // @Test
+    // public void testFTMINMAX2() throws ServerException, IOException {
+    //
+    // RunnerCreatorHelper.createSinfoFlowdepthMinMaxTest(FilenameMapper.FT_MINMAX_ELBE_2_FILE, 0, 90, River.Elbe)
+    // .runTest(overrideFileExport() != null ? overrideFileExport() : true);
+    // }
+    //
+    /* DO NOT DELETE FLOWDEPTH - used to work */
     @Test
     public void testRhein1FT() throws ConnectionException, ServerException, IOException {
 
@@ -79,48 +80,64 @@
     }
 
     @Test
-    public void testRhein3FT() throws ConnectionException, ServerException, IOException {
+    public void testRhein2FT() throws ConnectionException, ServerException, IOException {
         RunnerCreatorHelper
-                .createSinfoFlowdepthTest(FilenameMapper.FT_RHEIN_3_FILE, 655, 675, River.Rhein, true,
+                .createSinfoFlowdepthTest(FilenameMapper.FT_RHEIN_2_FILE, 655, 675, River.Rhein, true,
                         new SimpleRecommendation("staticwqkms", "fixations-wstv-0-323", "longitudinal_section"),
                         new SimpleRecommendation("bedheight", "bedheight-soundings-92-2004-NIEDERRHEIN_QP-2004_Epoche_NHN", "longitudinal_section"))
                 .runTest(overrideFileExport() != null ? overrideFileExport() : true);
     }
 
-    /* FLOWDEPTH DEVELOPMENT */
-
-    @Test
-    public void testElbeFTE() throws ConnectionException, ServerException, IOException {
-        RunnerCreatorHelper.createSinfoFlowdepthDevelopmentTest(FilenameMapper.FTE_ELBE_FILE, 210, 230, River.Elbe,
-                // current
-                new SimpleRecommendation("staticwqkms", "fixations-wstv-0-196", "longitudinal_section", "05.05.2008"), // sicher
-                new SimpleRecommendation("bedheight", "bedheight-soundings-66-2008-FP-QP-2008",
-                        // "bedheight-single-66-2008-MW-FP-QP-2008",
-                        "longitudinal_section"),
+    /* DO NOT DELETE FLOWDEPTH DEVELOPMENT - used to work */
 
-                // historical
-                new SimpleRecommendation("staticwqkms", "fixations-wstv-0-186", "longitudinal_section", "18.03.1997"), // sicher
-                new SimpleRecommendation("bedheight", "bedheight-soundings-70-1995-QP-1995",
-                        // "bedheight-single-70-1995-MW-QP-1995",
-                        "longitudinal_section"))
-                .runTest(overrideFileExport() != null ? overrideFileExport() : true);
-    }
+    // @Test
+    // public void testElbeFTE() throws ConnectionException, ServerException, IOException {
+    // RunnerCreatorHelper.createSinfoFlowdepthDevelopmentTest(FilenameMapper.FTE_ELBE_FILE, 210, 230, River.Elbe,
+    // // current
+    // new SimpleRecommendation("staticwqkms", "fixations-wstv-0-196", "longitudinal_section", "05.05.2008"), // sicher
+    // new SimpleRecommendation("bedheight", "bedheight-soundings-66-2008-FP-QP-2008",
+    // // "bedheight-single-66-2008-MW-FP-QP-2008",
+    // "longitudinal_section"),
+    //
+    // // historical
+    // new SimpleRecommendation("staticwqkms", "fixations-wstv-0-186", "longitudinal_section", "18.03.1997"), // sicher
+    // new SimpleRecommendation("bedheight", "bedheight-soundings-70-1995-QP-1995",
+    // // "bedheight-single-70-1995-MW-QP-1995",
+    // "longitudinal_section"))
+    // .runTest(overrideFileExport() != null ? overrideFileExport() : true);
+    // }
+    //
+    // @Test
+    // public void testRheinFTE() throws ConnectionException, ServerException, IOException {
+    // RunnerCreatorHelper.createSinfoFlowdepthDevelopmentTest(FilenameMapper.FTE_RHEIN_FILE, 655, 665, River.Rhein,
+    // // current
+    // new SimpleRecommendation("staticwqkms", "fixations-wstv-0-372", "longitudinal_section", "23.09.2009-1"), // sicher
+    // new SimpleRecommendation("bedheight", "bedheight-single-94-2008-MW-NIEDERRHEIN_QP-2008_Epoche_NHN",
+    // // "bedheight-single....",
+    // "longitudinal_section"),
+    //
+    // // historical
+    // new SimpleRecommendation("staticwqkms", "fixations-wstv-0-374", "longitudinal_section", "23.09.1991"), // sicher
+    // new SimpleRecommendation("bedheight", "bedheight-single-89-1991-MW-NIEDERRHEIN_QP-1991_Epoche_NHN",
+    // // "bedheight-soundings-89-1991-NIEDERRHEIN_QP-1991_Epoche_NHN",
+    // "longitudinal_section"))
+    // .runTest(overrideFileExport() != null ? overrideFileExport() : true);
+    // }
 
-    @Test
-    public void testRheinFTE() throws ConnectionException, ServerException, IOException {
-        RunnerCreatorHelper.createSinfoFlowdepthDevelopmentTest(FilenameMapper.FTE_RHEIN_FILE, 655, 665, River.Rhein,
-                // current
-                new SimpleRecommendation("staticwqkms", "fixations-wstv-0-372", "longitudinal_section", "23.09.2009-1"), // sicher
-                new SimpleRecommendation("bedheight", "bedheight-soundings-80-2008-FP-2008_NHN",
-                        // "bedheight-single....",
-                        "longitudinal_section"),
+    /* TKH - works */
 
-                // historical
-                new SimpleRecommendation("staticwqkms", "fixations-wstv-0-374", "longitudinal_section", "18.03.1997"), // sicher
-                new SimpleRecommendation("bedheight", "bedheight-single-89-1991-MW-NIEDERRHEIN_QP-1991_Epoche_NHN",
-                        // "bedheight-soundings-89-1991-NIEDERRHEIN_QP-1991_Epoche_NHN",
-                        "longitudinal_section"))
-                .runTest(overrideFileExport() != null ? overrideFileExport() : true);
-    }
+    // @Test
+    // public void testElbeTKH_1() throws ConnectionException, ServerException, IOException {
+    // RunnerCreatorHelper.createSinfoTkhTest(FilenameMapper.TKH_1_ELBE_FILE, 150, 160, River.Elbe, new double[] { 1520.0 })
+    // .runTest(overrideFileExport() != null ? overrideFileExport() : true);
+    // }
+    //
+    // @Test
+    // public void testRheinTKH_2() throws ConnectionException, ServerException, IOException {
+    // RunnerCreatorHelper.createSinfoTkhTest(FilenameMapper.TKH_2_RHEIN_FILE, 600, 610, River.Rhein, new double[] { 6125,
+    // 6526 })
+    //
+    // .runTest(overrideFileExport() != null ? overrideFileExport() : true);
+    // }
 
 }
\ No newline at end of file

http://dive4elements.wald.intevation.org