changeset 105:11b2d43da90d

TestCaseRequests for VerticalProfile FIS Mesh gnv-artifacts/trunk@154 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Tue, 29 Sep 2009 12:37:05 +0000
parents 5e086156e3d1
children 10d9a440f52e
files gnv-artifacts/Changelog gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_01_advance.xml gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_01_feed.xml gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_02_advance.xml gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_02_feed.xml gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_03_advance.xml gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_03_feed.xml gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_04_advance.xml gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_04_feed.xml gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_05_advance.xml gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_05_feed.xml gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_06_feed.xml gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_06_out_chart.xml gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_06_out_csv.xml gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_06_out_statistics.xml
diffstat 16 files changed, 209 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gnv-artifacts/Changelog	Tue Sep 29 12:03:39 2009 +0000
+++ b/gnv-artifacts/Changelog	Tue Sep 29 12:37:05 2009 +0000
@@ -1,3 +1,10 @@
+2009-09-29  Tim Englich  <tim.englich@intevation.de>
+
+    * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (testVerticalProfileMeshArtifact) Edited:
+      Added TestCase for Vertical Profiles for Mesh 
+    * src/test/ressources/verticalprofile_mesh/*.xml Added:
+      TestCaseRequests for VerticalProfile FIS Mesh 
+       
 2009-09-29  Tim Englich  <tim.englich@intevation.de>
 
     * src/main/java/de/intevation/gnv/utils/InputValidator.java (isInputValid) Edited:
--- a/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java	Tue Sep 29 12:03:39 2009 +0000
+++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java	Tue Sep 29 12:37:05 2009 +0000
@@ -195,6 +195,87 @@
         }
     }
     
+    public void testVerticalProfileMeshArtifact(){
+        log.debug("GNVArtifactsTestCase.testVerticalProfileArtifact");
+        String artefactName = "fis_modeldata"; 
+        ArtifactFactory artifactFactory = this.getArtifactFactory(artefactName);
+        assertNotNull(artifactFactory);
+        log.debug("VerticalProfile-ArtifactFactory is available");
+        Artifact artifact = artifactFactory.createArtifact(""+System.currentTimeMillis(),bootstrap.getContext());
+        assertNotNull(artifact);
+        log.debug("VerticalProfile-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/verticalprofile_mesh/verticalprofile_step_01_feed.xml"), cc);
+        outputData = artifact.advance(this.readDocument("src/test/ressources/verticalprofile_mesh/verticalprofile_step_01_advance.xml"), cc);
+        this.writeDocument2Log(outputData);
+        
+        // Zweiter Schritt
+        outputData = artifact.describe(null);
+        this.writeDocument2Log(outputData);
+        artifact.feed(this.readDocument("src/test/ressources/verticalprofile_mesh/verticalprofile_step_02_feed.xml"), cc);
+        outputData = artifact.advance(this.readDocument("src/test/ressources/verticalprofile_mesh/verticalprofile_step_02_advance.xml"), cc);
+        this.writeDocument2Log(outputData);
+        
+        // Dritter Schritt
+        outputData = artifact.describe(null);
+        this.writeDocument2Log(outputData);
+        artifact.feed(this.readDocument("src/test/ressources/verticalprofile_mesh/verticalprofile_step_03_feed.xml"), cc);
+        outputData = artifact.advance(this.readDocument("src/test/ressources/verticalprofile_mesh/verticalprofile_step_03_advance.xml"), cc);
+        this.writeDocument2Log(outputData);
+        
+        
+        // Vierter Schritt
+        outputData = artifact.describe(null);
+        this.writeDocument2Log(outputData);
+        artifact.feed(this.readDocument("src/test/ressources/verticalprofile_mesh/verticalprofile_step_04_feed.xml"), cc);
+        outputData = artifact.advance(this.readDocument("src/test/ressources/verticalprofile_mesh/verticalprofile_step_04_advance.xml"), cc);
+        this.writeDocument2Log(outputData);
+        
+       // 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);
+        outputData = artifact.advance(this.readDocument("src/test/ressources/verticalprofile_mesh/verticalprofile_step_05_advance.xml"), cc);
+        this.writeDocument2Log(outputData);
+          
+       // Vierter Schritt
+        outputData = artifact.describe(null);
+        FileOutputStream fos = null;
+        FileOutputStream fos2 = null;
+        FileOutputStream fos3 = null;
+        try{
+            fos = new FileOutputStream("src/test/results/verticalprofile_mesh"+System.currentTimeMillis()+".png");
+            fos2 = new FileOutputStream("src/test/results/verticalprofile_mesh"+System.currentTimeMillis()+".xml");
+            fos3 = new FileOutputStream("src/test/results/verticalprofile_mesh"+System.currentTimeMillis()+".csv");
+            artifact.feed(this.readDocument("src/test/ressources/verticalprofile_mesh/verticalprofile_step_06_feed.xml"), cc);
+            artifact.out(this.readDocument("src/test/ressources/verticalprofile_mesh/verticalprofile_step_06_out_statistics.xml"),fos2, cc);
+            artifact.out(this.readDocument("src/test/ressources/verticalprofile_mesh/verticalprofile_step_06_out_chart.xml"),fos, cc);
+            artifact.out(this.readDocument("src/test/ressources/verticalprofile_mesh/verticalprofile_step_06_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);
+            }
+        }
+    }
+    
+    
+    
     public void testVerticalProfileInstantaneousPointArtifact(){
         log.debug("GNVArtifactsTestCase.testVerticalProfileArtifact");
         String artefactName = "fis_instantaneouspoint"; 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_01_advance.xml	Tue Sep 29 12:37:05 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="041fd0b2-5d77-49a8-b19f-5f3f553bda5d" />
+	<art:hash value="31343478" />
+	<art:target name="verticalProfile" />
+</art:action>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_01_feed.xml	Tue Sep 29 12:37:05 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="041fd0b2-5d77-49a8-b19f-5f3f553bda5d" />
+	<art:hash value="31343478" />
+	<art:data>
+		<art:input name="product" value="verticalProfile" />
+	</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/verticalprofile_mesh/verticalprofile_step_02_advance.xml	Tue Sep 29 12:37:05 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="041fd0b2-5d77-49a8-b19f-5f3f553bda5d" />
+	<art:hash value="31343478" />
+	<art:target name="verticalprofile_mesh_point" />
+</art:action>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_02_feed.xml	Tue Sep 29 12:37:05 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="041fd0b2-5d77-49a8-b19f-5f3f553bda5d" />
+	<art:hash value="31343478" />
+	<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/verticalprofile_mesh/verticalprofile_step_03_advance.xml	Tue Sep 29 12:37:05 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="041fd0b2-5d77-49a8-b19f-5f3f553bda5d" />
+	<art:hash value="31343478" />
+	<art:target name="verticalprofile_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/verticalprofile_mesh/verticalprofile_step_03_feed.xml	Tue Sep 29 12:37:05 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="feed" />
+	<art:uuid value="041fd0b2-5d77-49a8-b19f-5f3f553bda5d" />
+	<art:hash value="31343478" />
+	<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/verticalprofile_mesh/verticalprofile_step_04_advance.xml	Tue Sep 29 12:37:05 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="041fd0b2-5d77-49a8-b19f-5f3f553bda5d" />
+	<art:hash value="31343478" />
+	<art:target name="verticalprofile_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/verticalprofile_mesh/verticalprofile_step_04_feed.xml	Tue Sep 29 12:37:05 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="041fd0b2-5d77-49a8-b19f-5f3f553bda5d" />
+	<art:hash value="31343478" />
+	<art:data>
+		<art:input name="mesh_point" value="3002488" />
+	</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/verticalprofile_mesh/verticalprofile_step_05_advance.xml	Tue Sep 29 12:37:05 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="041fd0b2-5d77-49a8-b19f-5f3f553bda5d" />
+	<art:hash value="31343478" />
+	<art:target name="verticalprofile_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/verticalprofile_mesh/verticalprofile_step_05_feed.xml	Tue Sep 29 12:37:05 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="041fd0b2-5d77-49a8-b19f-5f3f553bda5d" />
+	<art:hash value="31343478" />
+	<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/verticalprofile_mesh/verticalprofile_step_06_feed.xml	Tue Sep 29 12:37:05 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="041fd0b2-5d77-49a8-b19f-5f3f553bda5d" />
+	<art:hash value="31343478" />
+	<art:data>
+		<art:input name="dateid" value="2009.10.01 00: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/verticalprofile_mesh/verticalprofile_step_06_out_chart.xml	Tue Sep 29 12:37:05 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/verticalprofile_mesh/verticalprofile_step_06_out_csv.xml	Tue Sep 29 12:37:05 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/verticalprofile_mesh/verticalprofile_step_06_out_statistics.xml	Tue Sep 29 12:37:05 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="statistics">
+		<art:out value="text/xml" />
+		<art:params />
+	</art:out>
+</art:action>
\ No newline at end of file

http://dive4elements.wald.intevation.org