diff gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java @ 242:5925739d25ac

Added ODV-Export to HorizontalProfiles in Meshes gnv-artifacts/trunk@310 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Tue, 10 Nov 2009 08:35:18 +0000
parents 8500529d82af
children b599de3db552
line wrap: on
line diff
--- a/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java	Mon Nov 09 15:24:41 2009 +0000
+++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java	Tue Nov 10 08:35:18 2009 +0000
@@ -679,8 +679,8 @@
 
     public void testHorizontalProfileMeshPointArtifact() {
         try {
-            log
-                    .debug("GNVArtifactsTestCase.testHorizontalProfileInstantaneousPointArtifact");
+            log.debug("GNVArtifactsTestCase." +
+                      "testHorizontalProfileInstantaneousPointArtifact");
             String artefactName = "fis_modeldata";
             ArtifactFactory artifactFactory = this
                     .getArtifactFactory(artefactName);
@@ -693,79 +693,26 @@
 
             CallContext cc = createCallContext();
             Document describeDocument = this.readDocument("src/test/ressources/horizontalProfile_mesh/horizontalprofile_describe.xml");
-            // Erster Schritt
-            this
-                    .doNextStep(
-                            artifact,
-                            cc,
-                            "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_01_feed.xml",
-                            "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_01_advance.xml", describeDocument);
-
-            // Zweiter Schritt
-            this
-                    .doNextStep(
-                            artifact,
-                            cc,
-                            "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_02_feed.xml",
-                            "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_02_advance.xml", describeDocument);
-            // Dritter Schritt
-            this
-                    .doNextStep(
-                            artifact,
-                            cc,
-                            "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_03_feed.xml",
-                            "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_03_advance.xml", describeDocument);
-            // Vierter Schritt
-            this
-                    .doNextStep(
-                            artifact,
-                            cc,
-                            "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_04_feed.xml",
-                            "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_04_advance.xml", describeDocument);
-            // Fünfter Schritt
-            this
-                    .doNextStep(
+            
+            int steps = 9;
+            
+            for (int i = 1; i <= steps; i++){
+            
+                this.doNextStep(
                             artifact,
                             cc,
-                            "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_05_feed.xml",
-                            "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_05_advance.xml", describeDocument);
-
-            // Sechster Schritt
-            this
-                    .doNextStep(
-                            artifact,
-                            cc,
-                            "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_06_feed.xml",
-                            "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_06_advance.xml", describeDocument);
-
-            // Siebter Schritt
-            this
-                    .doNextStep(
-                            artifact,
-                            cc,
-                            "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_07_feed.xml",
-                            "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_07_advance.xml", describeDocument);
+                            "src/test/ressources/horizontalProfile_mesh/" +
+                            "horizontalprofile_step_0"+i+"_feed.xml",
+                            "src/test/ressources/horizontalProfile_mesh/" +
+                            "horizontalprofile_step_0"+i+"_advance.xml", 
+                            describeDocument);
+            }
             
-            // Achter Schritt
-            this
-                    .doNextStep(
-                            artifact,
-                            cc,
-                            "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_08_feed.xml",
-                            "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_08_advance.xml", describeDocument);
-            
-            // Neunter Schritt
-            this
-                    .doNextStep(
-                            artifact,
-                            cc,
-                            "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_09_feed.xml",
-                            "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_09_advance.xml", describeDocument);
-
             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/horizontalProfile_mesh"
@@ -776,24 +723,29 @@
                 fos3 = new FileOutputStream(
                         "src/test/results/horizontalProfile_mesh"
                                 + System.currentTimeMillis() + ".csv");
-                artifact
-                        .feed(
-                                this
-                                        .readDocument("src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_10_feed.xml"),
-                                cc);
-                artifact
-                        .out(
-                                this
-                                        .readDocument("src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_10_out_statistics.xml"),
-                                fos2, cc);
-                artifact
-                        .out(
-                                this
-                                        .readDocument("src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_10_out_chart.xml"),
+                fos4 = new FileOutputStream(
+                        "src/test/results/horizontalProfile_mesh"
+                                + System.currentTimeMillis() + ".odv");
+                artifact.feed(this.readDocument("src/test/ressources/" +
+                                                "horizontalProfile_mesh/" +
+                                                "horizontalprofile_step_10_feed.xml"),
+                              cc);
+                artifact.out(this.readDocument("src/test/ressources/" +
+                                               "horizontalProfile_mesh/" +
+                                               "horizontalprofile_step_10_out_statistics.xml"),
+                             fos2, cc);
+                artifact.out(this.readDocument("src/test/ressources/" +
+                                               "horizontalProfile_mesh/" +
+                                               "horizontalprofile_step_10_out_chart.xml"),
                                 fos, cc);
-                artifact.out(this.readDocument("src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_10_out_csv.xml"),
-                             fos3,
-                             cc);
+                artifact.out(this.readDocument("src/test/ressources/" +
+                                               "horizontalProfile_mesh/" +
+                                               "horizontalprofile_step_10_out_csv.xml"),
+                             fos3, cc);
+                artifact.out(this.readDocument("src/test/ressources/" +
+                                               "horizontalProfile_mesh/" +
+                                               "horizontalprofile_step_10_out_odv.xml"),
+                             fos4, cc);
             } catch (Exception e) {
                 log.error(e, e);
                 fail();
@@ -805,6 +757,8 @@
                     fos2.close();
                     fos3.flush();
                     fos3.close();
+                    fos4.flush();
+                    fos4.close();
                 } catch (Exception e) {
                     log.error(e, e);
                 }

http://dive4elements.wald.intevation.org