diff gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java @ 232:3d6d89bcbf42

Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68 gnv-artifacts/trunk@300 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Mon, 09 Nov 2009 08:55:01 +0000
parents a610c0a01afc
children 76897b73db4e
line wrap: on
line diff
--- a/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java	Fri Nov 06 11:12:45 2009 +0000
+++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java	Mon Nov 09 08:55:01 2009 +0000
@@ -92,64 +92,56 @@
             // Erster Schritt
 
             Document describeDocument = this.readDocument("src/test/ressources/timeseries/timeseries_describe.xml");
-            this
-                    .doNextStep(
-                            artifact,
-                            cc,
-                            "src/test/ressources/timeseries/timeseries_step_01_feed.xml",
-                            "src/test/ressources/timeseries/timeseries_step_01_advance.xml", describeDocument);
-
-            // Zweiter Schritt
-            this
-                    .doNextStep(
-                            artifact,
-                            cc,
-                            "src/test/ressources/timeseries/timeseries_step_02_feed.xml",
-                            "src/test/ressources/timeseries/timeseries_step_02_advance.xml", describeDocument);
-
-            // Dritter Schritt
-            this
-                    .doNextStep(
-                            artifact,
-                            cc,
-                            "src/test/ressources/timeseries/timeseries_step_03_feed.xml",
-                            "src/test/ressources/timeseries/timeseries_step_03_advance.xml", describeDocument);
-
-            // Vierter Schritt
-            this
-                    .doNextStep(
+            
+            int steps = 5;
+            
+            for (int i = 1; i <= steps; i++){
+            
+            this.doNextStep(
                             artifact,
                             cc,
-                            "src/test/ressources/timeseries/timeseries_step_04_feed.xml",
-                            "src/test/ressources/timeseries/timeseries_step_04_advance.xml", describeDocument);
-            
-            // Fünfter Schritt
-            this
-                    .doNextStep(
-                            artifact,
-                            cc,
-                            "src/test/ressources/timeseries/timeseries_step_05_feed.xml",
-                            "src/test/ressources/timeseries/timeseries_step_05_advance.xml", describeDocument);
-
+                            "src/test/ressources/timeseries/" +
+                            "timeseries_step_0"+i+"_feed.xml",
+                            "src/test/ressources/timeseries/" +
+                            "timeseries_step_0"+i+"_advance.xml", 
+                            describeDocument);
 
-            Document outputData;
-            // Fünfter Schritt
-            outputData = artifact.describe(describeDocument,cc);
+            }
+            
+            Document outputData = artifact.describe(describeDocument,cc);
             FileOutputStream fos = null;
+            FileOutputStream fos2 = null;
+            FileOutputStream fos3 = null;
+            FileOutputStream fos4 = null;
             try {
-                fos = new FileOutputStream(
-                        "src/test/results/timeseriesdiagramm"
-                                + System.currentTimeMillis() + ".png");
-                artifact
-                        .feed(
-                                this
-                                        .readDocument("src/test/ressources/timeseries/timeseries_step_06_feed.xml"),
-                                cc);
-                artifact
-                        .out(
-                                this
-                                        .readDocument("src/test/ressources/timeseries/timeseries_step_06_out.xml"),
-                                fos, cc);
+                fos = new FileOutputStream("src/test/results/timeseries"
+                                           + System.currentTimeMillis()
+                                           + ".png");
+                fos2 = new FileOutputStream("src/test/results/timeseries"
+                                            + System.currentTimeMillis()
+                                            + ".xml");
+                fos3 = new FileOutputStream("src/test/results/timeseries"
+                                            + System.currentTimeMillis()
+                                            + ".csv");
+                fos4 = new FileOutputStream("src/test/results/timeseries"
+                        + System.currentTimeMillis()
+                        + ".odv");
+            
+                artifact.feed(this
+                              .readDocument("src/test/ressources/timeseries/timeseries_step_06_feed.xml"),
+                                            cc);
+                artifact.out(this
+                             .readDocument("src/test/ressources/timeseries/timeseries_step_06_out_chart.xml"),
+                                           fos, cc);
+                artifact.out(this
+                        .readDocument("src/test/ressources/timeseries/timeseries_step_06_out_statistics.xml"),
+                                      fos2, cc);
+                artifact.out(this
+                        .readDocument("src/test/ressources/timeseries/timeseries_step_06_out_csv.xml"),
+                                      fos3, cc);
+                artifact.out(this
+                        .readDocument("src/test/ressources/timeseries/timeseries_step_06_out_odv.xml"),
+                                      fos4, cc);
             } catch (Exception e) {
                 log.error(e, e);
                 fail();

http://dive4elements.wald.intevation.org