changeset 219:f8cb64d5fe4f

Added the Testcase for Horizontal Cross-Sections gnv-artifacts/trunk@279 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Fri, 30 Oct 2009 11:42:58 +0000
parents 926530bda1a7
children ee2d4134d0b3
files gnv-artifacts/ChangeLog gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_01_advance.xml gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_01_feed.xml gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_02_advance.xml gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_02_feed.xml gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_03_advance.xml gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_03_feed.xml gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_04_advance.xml gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_04_feed.xml gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_05_feed.xml gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_05_out_chart.xml gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_05_out_csv.xml gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_05_out_statistics.xml
diffstat 14 files changed, 208 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gnv-artifacts/ChangeLog	Fri Oct 30 11:26:03 2009 +0000
+++ b/gnv-artifacts/ChangeLog	Fri Oct 30 11:42:58 2009 +0000
@@ -1,5 +1,11 @@
 2009-10-30  Tim Englich  <tim.englich@intevation.de>
 
+	* src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_*.xml:
+	  Added the Testdata for the Unittest for HorizontalCrossSectionMeshArtifacts.
+	* src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (testHorizontalCrossSectionMeshArtifact):
+	  Added the UnitTest-Case for HorizontalCrossSectionMeshArtifacts
+	
+2009-10-30  Tim Englich  <tim.englich@intevation.de>
 	* doc/conf/queries.properties: 
 	  Added the Query for selecting the Data for generating Outputs of
 	  HorizontalCrossSectionMeshOutputTransition
--- a/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java	Fri Oct 30 11:26:03 2009 +0000
+++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java	Fri Oct 30 11:42:58 2009 +0000
@@ -870,6 +870,102 @@
         }
     }
     
+    public void testHorizontalCrossSectionMeshArtifact() {
+        try {
+            log.debug("GNVArtifactsTestCase.testHorizontalCrossSectionMeshArtifact");
+            String artefactName = "fis_modeldata";
+            ArtifactFactory artifactFactory = this
+                    .getArtifactFactory(artefactName);
+            assertNotNull(artifactFactory);
+            log.debug("HorizontalCrossSectionMesh-ArtifactFactory is available");
+            Artifact artifact = artifactFactory.createArtifact(
+                    "" + System.currentTimeMillis(), bootstrap.getContext());
+            assertNotNull(artifact);
+            log.debug("HorizontalCrossSectionMesh-Artifact is available");
+
+            CallContext cc = createCallContext();
+
+            // Erster Schritt
+            this
+                    .doNextStep(
+                            artifact,
+                            cc,
+                            "src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_01_feed.xml",
+                            "src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_01_advance.xml");
+
+            // Zweiter Schritt
+            this
+                    .doNextStep(
+                            artifact,
+                            cc,
+                            "src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_02_feed.xml",
+                            "src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_02_advance.xml");
+            // Dritter Schritt
+            this
+                    .doNextStep(
+                            artifact,
+                            cc,
+                            "src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_03_feed.xml",
+                            "src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_03_advance.xml");
+            // Vierter Schritt
+            this
+                    .doNextStep(
+                            artifact,
+                            cc,
+                            "src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_04_feed.xml",
+                            "src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_04_advance.xml");
+            
+            Document outputData = artifact.describe(cc);
+            FileOutputStream fos = null;
+            FileOutputStream fos2 = null;
+            FileOutputStream fos3 = null;
+            try {
+                fos = new FileOutputStream(
+                        "src/test/results/horizontalcrosssection_mesh"
+                                + System.currentTimeMillis() + ".png");
+                fos2 = new FileOutputStream(
+                        "src/test/results/horizontalcrosssection_mesh"
+                                + System.currentTimeMillis() + ".xml");
+                fos3 = new FileOutputStream(
+                        "src/test/results/horizontalcrosssection_mesh"
+                                + System.currentTimeMillis() + ".csv");
+                artifact
+                        .feed(this.readDocument("src/test/ressources/horizontal" +
+                                                "crosssection_mesh/horizontalcrosssection_step_05_feed.xml"),
+                              cc);
+                artifact
+                        .out(this.readDocument("src/test/ressources/horizontal" +
+                                               "crosssection_mesh/horizontalcrosssection_step_05_out_statistics.xml"),
+                              fos2, cc);
+                artifact
+                        .out(this.readDocument("src/test/ressources/horizontal" +
+                                               "crosssection_mesh/horizontalcrosssection_step_05_out_chart.xml"),
+                              fos, cc);
+                artifact.out(this.readDocument("src/test/ressources/horizontal" +
+                                               "crosssection_mesh/horizontalcrosssection_step_05_out_csv.xml"),
+                             fos3,
+                             cc);
+            } catch (Exception e) {
+                log.error(e, e);
+                fail();
+            } finally {
+                try {
+                    fos.flush();
+                    fos.close();
+                    fos2.flush();
+                    fos2.close();
+                    fos3.flush();
+                    fos3.close();
+                } catch (Exception e) {
+                    log.error(e, e);
+                }
+            }
+        } catch (Exception e) {
+            log.error(e, e);
+            fail();
+        }
+    }
+    
     public void testVerticalCrossSectionMeshArtifact() {
         try {
             log.debug("GNVArtifactsTestCase.testHVerticalCrossSectionMeshArtifact");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_01_advance.xml	Fri Oct 30 11:42:58 2009 +0000
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<art:action xmlns:art="http://www.intevation.de/2009/artifacts">
+    <art:type name="advance" />
+    <art:uuid value="74baff94-b172-4667-b6d8-db21abeb1b81" />
+    <art:hash value="6292125" />
+    <art:target name="horizontalCrossSection" />
+</art:action>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_01_feed.xml	Fri Oct 30 11:42:58 2009 +0000
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<art:action xmlns:art="http://www.intevation.de/2009/artifacts">
+    <art:type name="feed" />
+    <art:uuid value="74baff94-b172-4667-b6d8-db21abeb1b81" />
+    <art:hash value="6292125" />
+    <art:data>
+        <art:input name="product" value="horizontalCrossSection" />
+    </art:data>
+</art:action>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_02_advance.xml	Fri Oct 30 11:42:58 2009 +0000
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<art:action xmlns:art="http://www.intevation.de/2009/artifacts">
+	<art:type name="advance" />
+	<art:uuid value="74baff94-b172-4667-b6d8-db21abeb1b81" />
+	<art:hash value="6292125" />
+	<art:target name="horizontalcrosssection_meshpoint_parameter" />
+</art:action>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_02_feed.xml	Fri Oct 30 11:42:58 2009 +0000
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<art:action xmlns:art="http://www.intevation.de/2009/artifacts">
+	<art:type name="feed" />
+	<art:uuid value="74baff94-b172-4667-b6d8-db21abeb1b81" />
+	<art:hash value="6292125" />
+	<art:data>
+		<art:input name="meshid" value="3" />
+	</art:data>
+</art:action>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_03_advance.xml	Fri Oct 30 11:42:58 2009 +0000
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<art:action xmlns:art="http://www.intevation.de/2009/artifacts">
+	<art:type name="advance" />
+	<art:uuid value="74baff94-b172-4667-b6d8-db21abeb1b81" />
+	<art:hash value="6292125" />
+	<art:target name="horizontalcrosssection_mesh_date" />
+</art:action>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_03_feed.xml	Fri Oct 30 11:42:58 2009 +0000
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<art:action xmlns:art="http://www.intevation.de/2009/artifacts">
+	<art:type name="feed" />
+	<art:uuid value="74baff94-b172-4667-b6d8-db21abeb1b81" />
+	<art:hash value="6292125" />
+	<art:data>
+		<art:input name="depthid" value="1" />
+	</art:data>
+</art:action>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_04_advance.xml	Fri Oct 30 11:42:58 2009 +0000
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<art:action xmlns:art="http://www.intevation.de/2009/artifacts">
+	<art:type name="advance" />
+	<art:uuid value="74baff94-b172-4667-b6d8-db21abeb1b81" />
+	<art:hash value="6292125" />
+	<art:target name="horizontalcrosssection_mesh_calculate_results" />
+</art:action>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_04_feed.xml	Fri Oct 30 11:42:58 2009 +0000
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<art:action xmlns:art="http://www.intevation.de/2009/artifacts">
+	<art:type name="feed" />
+	<art:uuid value="74baff94-b172-4667-b6d8-db21abeb1b81" />
+	<art:hash value="6292125" />
+	<art:data>
+		<art:input name="parameterid" value="2" />
+	</art:data>
+</art:action>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_05_feed.xml	Fri Oct 30 11:42:58 2009 +0000
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<art:action xmlns:art="http://www.intevation.de/2009/artifacts">
+	<art:type name="feed" />
+	<art:uuid value="74baff94-b172-4667-b6d8-db21abeb1b81" />
+	<art:hash value="6292125" />
+	<art:data>
+		<art:input name="dateid" value="2009.10.23 01:00:00" />
+	</art:data>
+</art:action>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_05_out_chart.xml	Fri Oct 30 11:42:58 2009 +0000
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<art:action xmlns:art="http://www.intevation.de/2009/artifacts">
+	<art:type name="out" />
+    <art:uuid value="74baff94-b172-4667-b6d8-db21abeb1b81" />
+    <art:hash value="6292125" />
+	<art:out name="chart">
+		<art:out value="image/png" />
+		<art:params>
+			<art:input name="width" value="600" />
+			<art:input name="height" value="400" />
+		</art:params>
+	</art:out>
+</art:action>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_05_out_csv.xml	Fri Oct 30 11:42:58 2009 +0000
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<art:action xmlns:art="http://www.intevation.de/2009/artifacts">
+	<art:type name="out" />
+    <art:uuid value="74baff94-b172-4667-b6d8-db21abeb1b81" />
+    <art:hash value="6292125" />
+	<art:out name="csv">
+		<art:out value="text/plain" />
+		<art:params />
+	</art:out>
+</art:action>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_05_out_statistics.xml	Fri Oct 30 11:42:58 2009 +0000
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<art:action xmlns:art="http://www.intevation.de/2009/artifacts">
+	<art:type name="out" />
+    <art:uuid value="74baff94-b172-4667-b6d8-db21abeb1b81" />
+    <art:hash value="6292125" />
+	<art:out name="statistics">
+		<art:out value="text/xml" />
+		<art:params />
+	</art:out>
+</art:action>
\ No newline at end of file

http://dive4elements.wald.intevation.org