changeset 107:4ebf9ad2e7eb

Added TestCase for TimeSeriesMesh gnv-artifacts/trunk@156 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Tue, 29 Sep 2009 14:17:41 +0000
parents 10d9a440f52e
children 2aae4a78e555
files gnv-artifacts/Changelog gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_01_advance.xml gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_01_feed.xml gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_02_advance.xml gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_02_feed.xml gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_03_advance.xml gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_03_feed.xml gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_04_advance.xml gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_04_feed.xml gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_05_advance.xml gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_05_feed.xml gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_06_advance.xml gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_06_feed.xml gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_07_feed.xml gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_07_out_chart.xml gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_07_out_csv.xml gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_07_out_statistics.xml
diffstat 18 files changed, 249 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/gnv-artifacts/Changelog	Tue Sep 29 12:56:27 2009 +0000
+++ b/gnv-artifacts/Changelog	Tue Sep 29 14:17:41 2009 +0000
@@ -1,3 +1,10 @@
+2009-09-29  Tim Englich  <tim.englich@intevation.de>
+
+    * src/test/ressources/timeseries_mesh/*.xml Added :
+      TestCaseRequests for Timeseries FIS Mesh  
+    * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (testTimeSeriesMeshArtifact) Edited:
+      Add Testcase for Timeseries Mesh 
+      
 2009-09-29  Tim Englich  <tim.englich@intevation.de>
 
     * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (check4ExceptionReport) edited:
--- a/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java	Tue Sep 29 12:56:27 2009 +0000
+++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java	Tue Sep 29 14:17:41 2009 +0000
@@ -138,6 +138,102 @@
         }
     }
     
+    public void testTimeSeriesMeshArtifact(){
+        try {
+            log.debug("GNVArtifactsTestCase.testTimeSeriesMeshArtifact");
+            String artefactName = "fis_modeldata"; 
+            ArtifactFactory artifactFactory = this.getArtifactFactory(artefactName);
+            assertNotNull(artifactFactory);
+            log.debug("TimeSeriesMesh-ArtifactFactory is available");
+            Artifact artifact = artifactFactory.createArtifact(""+System.currentTimeMillis(),bootstrap.getContext());
+            assertNotNull(artifact);
+            log.debug("TimeSeriesMesh-Artifact is available");
+            
+            
+            CallContext cc = new TestCallContext(bootstrap.getContext());
+            
+            // Erster Schritt
+            Document outputData = artifact.describe(null);
+            this.writeDocument2Log(outputData);
+            artifact.feed(this.readDocument("src/test/ressources/timeseries_mesh/timeseries_step_01_feed.xml"), cc);
+            outputData = artifact.advance(this.readDocument("src/test/ressources/timeseries_mesh/timeseries_step_01_advance.xml"), cc);
+            this.writeDocument2Log(outputData);
+            this.check4ExceptionReport(outputData);
+            
+            // Zweiter Schritt
+            outputData = artifact.describe(null);
+            this.writeDocument2Log(outputData);
+            artifact.feed(this.readDocument("src/test/ressources/timeseries_mesh/timeseries_step_02_feed.xml"), cc);
+            outputData = artifact.advance(this.readDocument("src/test/ressources/timeseries_mesh/timeseries_step_02_advance.xml"), cc);
+            this.writeDocument2Log(outputData);
+            
+            // Dritter Schritt
+            outputData = artifact.describe(null);
+            this.writeDocument2Log(outputData);
+            artifact.feed(this.readDocument("src/test/ressources/timeseries_mesh/timeseries_step_03_feed.xml"), cc);
+            outputData = artifact.advance(this.readDocument("src/test/ressources/timeseries_mesh/timeseries_step_03_advance.xml"), cc);
+            this.writeDocument2Log(outputData);
+            this.check4ExceptionReport(outputData);
+            
+            
+            // Vierter Schritt
+            outputData = artifact.describe(null);
+            this.writeDocument2Log(outputData);
+            artifact.feed(this.readDocument("src/test/ressources/timeseries_mesh/timeseries_step_04_feed.xml"), cc);
+            outputData = artifact.advance(this.readDocument("src/test/ressources/timeseries_mesh/timeseries_step_04_advance.xml"),cc);
+            this.writeDocument2Log(outputData);
+            this.check4ExceptionReport(outputData);
+            
+            // Fünfter Schritt
+            outputData = artifact.describe(null);
+            this.writeDocument2Log(outputData);
+            artifact.feed(this.readDocument("src/test/ressources/timeseries_mesh/timeseries_step_05_feed.xml"), cc);
+            outputData = artifact.advance(this.readDocument("src/test/ressources/timeseries_mesh/timeseries_step_05_advance.xml"),cc);
+            this.writeDocument2Log(outputData);
+            this.check4ExceptionReport(outputData);
+            
+            // Sechster Schritt
+            outputData = artifact.describe(null);
+            this.writeDocument2Log(outputData);
+            artifact.feed(this.readDocument("src/test/ressources/timeseries_mesh/timeseries_step_06_feed.xml"), cc);
+            outputData = artifact.advance(this.readDocument("src/test/ressources/timeseries_mesh/timeseries_step_06_advance.xml"),cc);
+            this.writeDocument2Log(outputData);
+            this.check4ExceptionReport(outputData);
+            
+            // Siebter Schritt
+            outputData = artifact.describe(null);
+            FileOutputStream fos = null;
+            FileOutputStream fos2 = null;
+            FileOutputStream fos3 = null;
+            try{
+                fos = new FileOutputStream("src/test/results/timeseries_mesh"+System.currentTimeMillis()+".png");
+                fos2 = new FileOutputStream("src/test/results/timeseries_mesh"+System.currentTimeMillis()+".xml");
+                fos3 = new FileOutputStream("src/test/results/timeseries_mesh"+System.currentTimeMillis()+".csv");
+                artifact.feed(this.readDocument("src/test/ressources/timeseries_mesh/timeseries_step_07_feed.xml"), cc);
+                artifact.out(this.readDocument("src/test/ressources/timeseries_mesh/timeseries_step_07_out_statistics.xml"),fos2, cc);
+                artifact.out(this.readDocument("src/test/ressources/timeseries_mesh/timeseries_step_07_out_chart.xml"),fos, cc);
+                artifact.out(this.readDocument("src/test/ressources/timeseries_mesh/timeseries_step_07_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 testVerticalProfileArtifact(){
         try {
             log.debug("GNVArtifactsTestCase.testVerticalProfileArtifact");
@@ -176,7 +272,7 @@
             this.writeDocument2Log(outputData);
             this.check4ExceptionReport(outputData);
             
-      // Vierter Schritt
+            // Vierter Schritt
             outputData = artifact.describe(null);
             FileOutputStream fos = null;
             FileOutputStream fos2 = null;
@@ -256,7 +352,7 @@
             this.writeDocument2Log(outputData);
             this.check4ExceptionReport(outputData);
             
-      // Fünfter Schritt
+            // Fünfter Schritt
             outputData = artifact.describe(null);
             this.writeDocument2Log(outputData);
             artifact.feed(this.readDocument("src/test/ressources/verticalprofile_mesh/verticalprofile_step_05_feed.xml"), cc);
@@ -264,7 +360,7 @@
             this.writeDocument2Log(outputData);
             this.check4ExceptionReport(outputData);
             
-      // Sechster Schritt
+            // Sechster Schritt
             outputData = artifact.describe(null);
             FileOutputStream fos = null;
             FileOutputStream fos2 = null;
@@ -322,7 +418,7 @@
             this.writeDocument2Log(outputData);
             this.check4ExceptionReport(outputData);
             
-    // Zweiter Schritt
+            // Zweiter Schritt
             outputData = artifact.describe(null);
             this.writeDocument2Log(outputData);
             artifact.feed(this.readDocument("src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_02_feed.xml"), cc);
@@ -338,7 +434,7 @@
             this.writeDocument2Log(outputData);
             this.check4ExceptionReport(outputData);
             
-      // Vierter Schritt
+            // Vierter Schritt
             outputData = artifact.describe(null);
             FileOutputStream fos = null;
             FileOutputStream fos2 = null;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_01_advance.xml	Tue Sep 29 14:17:41 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="1e9f6583-9073-4409-aac1-432ad06d7ce1" />
+	<art:hash value="29913235" />
+	<art:target name="timeSeriesMesh" />
+</art:action>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_01_feed.xml	Tue Sep 29 14:17:41 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="1e9f6583-9073-4409-aac1-432ad06d7ce1" />
+	<art:hash value="29913235" />
+	<art:data>
+		<art:input name="product" value="timeSeriesMesh" />
+	</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/timeseries_mesh/timeseries_step_02_advance.xml	Tue Sep 29 14:17:41 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="1e9f6583-9073-4409-aac1-432ad06d7ce1" />
+	<art:hash value="29913235" />
+	<art:target name="timeseries_meshpoint" />
+</art:action>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_02_feed.xml	Tue Sep 29 14:17:41 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="1e9f6583-9073-4409-aac1-432ad06d7ce1" />
+	<art:hash value="29913235" />
+	<art:data>
+		<art:input name="featureid" 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/timeseries_mesh/timeseries_step_03_advance.xml	Tue Sep 29 14:17:41 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="1e9f6583-9073-4409-aac1-432ad06d7ce1" />
+    <art:hash value="29913235" />
+    <art:target name="timeseries_meshpoint_depth" />
+</art:action>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_03_feed.xml	Tue Sep 29 14:17:41 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="1e9f6583-9073-4409-aac1-432ad06d7ce1" />
+	<art:hash value="29913235" />
+	<art:data>
+		<art:input name="mesh_coordinate" value="6.5 58.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/timeseries_mesh/timeseries_step_04_advance.xml	Tue Sep 29 14:17:41 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="1e9f6583-9073-4409-aac1-432ad06d7ce1" />
+	<art:hash value="29913235" />
+	<art:target name="timeseries_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/timeseries_mesh/timeseries_step_04_feed.xml	Tue Sep 29 14:17:41 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="1e9f6583-9073-4409-aac1-432ad06d7ce1" />
+	<art:hash value="29913235" />
+	<art:data>
+		<art:input name="mesh_point" value="3021827" />
+	</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/timeseries_mesh/timeseries_step_05_advance.xml	Tue Sep 29 14:17:41 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="1e9f6583-9073-4409-aac1-432ad06d7ce1" />
+	<art:hash value="29913235" />
+	<art:target name="timeseries_meshpoint_interval" />
+</art:action>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_05_feed.xml	Tue Sep 29 14:17:41 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="feed" />
+	<art:uuid value="1e9f6583-9073-4409-aac1-432ad06d7ce1" />
+	<art:hash value="29913235" />
+	<art:data>
+		<art:input name="measurementid" value="3043872" />
+		<art:input name="measurementid" value="3060353" />
+	</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/timeseries_mesh/timeseries_step_06_advance.xml	Tue Sep 29 14:17:41 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="1e9f6583-9073-4409-aac1-432ad06d7ce1" />
+	<art:hash value="29913235" />
+	<art:target name="timeseries_meshpoint_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/timeseries_mesh/timeseries_step_06_feed.xml	Tue Sep 29 14:17:41 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="feed" />
+	<art:uuid value="1e9f6583-9073-4409-aac1-432ad06d7ce1" />
+	<art:hash value="29913235" />
+	<art:data>
+		<art:input name="parameterid" value="2" />
+		<art:input name="parameterid" 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/timeseries_mesh/timeseries_step_07_feed.xml	Tue Sep 29 14:17:41 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="feed" />
+	<art:uuid value="1e9f6583-9073-4409-aac1-432ad06d7ce1" />
+	<art:hash value="29913235" />
+	<art:data>
+		<art:input name="maxvalue" value="2009.10.02 00:00:00" />
+		<art:input name="minvalue" value="2009.09.17 00:15: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/timeseries_mesh/timeseries_step_07_out_chart.xml	Tue Sep 29 14:17:41 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="041fd0b2-5d77-49a8-b19f-5f3f553bda5d" />
+	<art:hash value="31343478" />
+	<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/timeseries_mesh/timeseries_step_07_out_csv.xml	Tue Sep 29 14:17:41 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="041fd0b2-5d77-49a8-b19f-5f3f553bda5d" />
+	<art:hash value="31343478" />
+	<art:out name="csv">
+		<art:out value="test/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/timeseries_mesh/timeseries_step_07_out_statistics.xml	Tue Sep 29 14:17:41 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="1e9f6583-9073-4409-aac1-432ad06d7ce1" />
+	<art:hash value="29913235" />
+	<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