Mercurial > dive4elements > gnv-client
changeset 103:4042844339ee
Testcases for VerticalProfile and VerticalProfile Instantaneouspoint added
gnv-artifacts/trunk@152 c6561f87-3c4e-4783-a992-168aeb5c3f6f
line wrap: on
line diff
--- a/gnv-artifacts/Changelog Tue Sep 29 09:55:40 2009 +0000 +++ b/gnv-artifacts/Changelog Tue Sep 29 12:01:41 2009 +0000 @@ -1,3 +1,13 @@ +2009-09-29 Tim Englich <tim.englich@intevation.de> + + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (testVerticalProfileArtifact): + (testVerticalProfileInstantaneousPointArtifact) Edited: + Added Testcases for VerticalProfile and VerticalProfile Instantaneouspoint + * src/test/ressources/verticalprofile_instantaneouspoint/*.xml Added: + TestCaseRequests for VerticalProfile Instantaneouspoint + * src/test/ressources/verticalprofile/*.xml Added: + TestCaseRequests for VerticalProfile FIS Marnet + 2009-09-29 Tim Englich <tim.englich@intevation.de> * src/test/ressources/queries.properties Edited:
--- a/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java Tue Sep 29 09:55:40 2009 +0000 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java Tue Sep 29 12:01:41 2009 +0000 @@ -22,7 +22,6 @@ import de.intevation.artifactdatabase.Config; import de.intevation.artifactdatabase.FactoryBootstrap; -import de.intevation.artifactdatabase.ArtifactDatabaseImpl.CallContextImpl; import de.intevation.artifacts.Artifact; import de.intevation.artifacts.ArtifactFactory; import de.intevation.artifacts.CallContext; @@ -131,6 +130,136 @@ } } + public void testVerticalProfileArtifact(){ + log.debug("GNVArtifactsTestCase.testVerticalProfileArtifact"); + String artefactName = "fis_marnet"; + 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/verticalprofile_step_01_feed.xml"), cc); + outputData = artifact.advance(this.readDocument("src/test/ressources/verticalprofile/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/verticalprofile_step_02_feed.xml"), cc); + outputData = artifact.advance(this.readDocument("src/test/ressources/verticalprofile/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/verticalprofile_step_03_feed.xml"), cc); + outputData = artifact.advance(this.readDocument("src/test/ressources/verticalprofile/verticalprofile_step_03_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"+System.currentTimeMillis()+".png"); + fos2 = new FileOutputStream("src/test/results/verticalprofile"+System.currentTimeMillis()+".xml"); + fos3 = new FileOutputStream("src/test/results/verticalprofile"+System.currentTimeMillis()+".csv"); + artifact.feed(this.readDocument("src/test/ressources/verticalprofile/verticalprofile_step_04_feed.xml"), cc); + artifact.out(this.readDocument("src/test/ressources/verticalprofile/verticalprofile_step_04_out_statistics.xml"),fos2, cc); + artifact.out(this.readDocument("src/test/ressources/verticalprofile/verticalprofile_step_04_out_chart.xml"),fos, cc); + artifact.out(this.readDocument("src/test/ressources/verticalprofile/verticalprofile_step_04_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"; + 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_instantaneouspoint/verticalprofile_step_01_feed.xml"), cc); + outputData = artifact.advance(this.readDocument("src/test/ressources/verticalprofile_instantaneouspoint/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_instantaneouspoint/verticalprofile_step_02_feed.xml"), cc); + outputData = artifact.advance(this.readDocument("src/test/ressources/verticalprofile_instantaneouspoint/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_instantaneouspoint/verticalprofile_step_03_feed.xml"), cc); + outputData = artifact.advance(this.readDocument("src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_03_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_instantaneouspoint"+System.currentTimeMillis()+".png"); + fos2 = new FileOutputStream("src/test/results/verticalprofile_instantaneouspoint"+System.currentTimeMillis()+".xml"); + fos3 = new FileOutputStream("src/test/results/verticalprofile_instantaneouspoint"+System.currentTimeMillis()+".csv"); + artifact.feed(this.readDocument("src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_04_feed.xml"), cc); + artifact.out(this.readDocument("src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_04_out_statistics.xml"),fos2, cc); + artifact.out(this.readDocument("src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_04_out_chart.xml"),fos, cc); + artifact.out(this.readDocument("src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_04_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); + } + } + } + protected void createFile(byte[] content, String fileName){ try { FileOutputStream fos = new FileOutputStream(new File(fileName));
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_01_advance.xml Tue Sep 29 12:01: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="4319eb60-5419-4ce9-80b2-3ffac5b50146" /> + <art:hash value="18171662" /> + <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/verticalprofile_step_01_feed.xml Tue Sep 29 12:01: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="4319eb60-5419-4ce9-80b2-3ffac5b50146" /> + <art:hash value="18171662" /> + <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/verticalprofile_step_02_advance.xml Tue Sep 29 12:01: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="4319eb60-5419-4ce9-80b2-3ffac5b50146" /> + <art:hash value="18171662" /> + <art:target name="verticalprofile_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/verticalprofile_step_02_feed.xml Tue Sep 29 12:01: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="4319eb60-5419-4ce9-80b2-3ffac5b50146" /> + <art:hash value="18171662" /> + <art:data> + <art:input name="featureid" value="100011" /> + </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/verticalprofile_step_03_advance.xml Tue Sep 29 12:01: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="b47ab4ca-ffa7-4e4d-8212-0769e39418a2" /> + <art:hash value="11096221" /> + <art:target name="verticalprofile_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/verticalprofile_step_03_feed.xml Tue Sep 29 12:01: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="4319eb60-5419-4ce9-80b2-3ffac5b50146" /> + <art:hash value="18171662" /> + <art:data> + <art:input name="parameterid" value="2" /> + <art:input name="parameterid" value="31" /> + </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/verticalprofile_step_04_feed.xml Tue Sep 29 12:01: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="b47ab4ca-ffa7-4e4d-8212-0769e39418a2" /> + <art:hash value="11096221" /> + <art:data> + <art:input name="dateid" value="2008.12.09 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/verticalprofile_step_04_out_chart.xml Tue Sep 29 12:01: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="b47ab4ca-ffa7-4e4d-8212-0769e39418a2" /> + <art:hash value="11096221" /> + <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/verticalprofile_step_04_out_csv.xml Tue Sep 29 12:01: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="b47ab4ca-ffa7-4e4d-8212-0769e39418a2" /> + <art:hash value="11096221" /> + <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/verticalprofile_step_04_out_statistics.xml Tue Sep 29 12:01: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="b47ab4ca-ffa7-4e4d-8212-0769e39418a2" /> + <art:hash value="11096221" /> + <art:out name="statistics"> + <art:out value="text/xml" /> + <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_instantaneouspoint/verticalprofile_step_01_advance.xml Tue Sep 29 12:01: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="4319eb60-5419-4ce9-80b2-3ffac5b50146" /> + <art:hash value="18171662" /> + <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_instantaneouspoint/verticalprofile_step_01_feed.xml Tue Sep 29 12:01: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="4319eb60-5419-4ce9-80b2-3ffac5b50146" /> + <art:hash value="18171662" /> + <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_instantaneouspoint/verticalprofile_step_02_advance.xml Tue Sep 29 12:01: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="793c935e-a3f3-44ce-a8f1-3d05459ca3d3" /> + <art:hash value="9390720" /> + <art:target name="verticalprofile_instantaneouspoint_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_instantaneouspoint/verticalprofile_step_02_feed.xml Tue Sep 29 12:01: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="793c935e-a3f3-44ce-a8f1-3d05459ca3d3" /> + <art:hash value="9390720" /> + <art:data> + <art:input name="featureid" value="186" /> + </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_instantaneouspoint/verticalprofile_step_03_advance.xml Tue Sep 29 12:01: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="793c935e-a3f3-44ce-a8f1-3d05459ca3d3" /> + <art:hash value="9390720" /> + <art:target name="verticalprofile_instantaneouspoint_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_instantaneouspoint/verticalprofile_step_03_feed.xml Tue Sep 29 12:01: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="793c935e-a3f3-44ce-a8f1-3d05459ca3d3" /> + <art:hash value="9390720" /> + <art:data> + <art:input name="instantaneouspoint_point" value="4371970" /> + </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_instantaneouspoint/verticalprofile_step_04_feed.xml Tue Sep 29 12:01: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="793c935e-a3f3-44ce-a8f1-3d05459ca3d3" /> + <art:hash value="9390720" /> + <art:data> + <art:input name="parameterid" value="2" /> + <art:input name="parameterid" value="30" /> + </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_instantaneouspoint/verticalprofile_step_04_out_chart.xml Tue Sep 29 12:01: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="793c935e-a3f3-44ce-a8f1-3d05459ca3d3" /> + <art:hash value="9390720" /> + <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_instantaneouspoint/verticalprofile_step_04_out_csv.xml Tue Sep 29 12:01:41 2009 +0000 @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +<art:action xmlns:art="http://www.intevation.de/2009/artifacts"><art:type name="out"/><art:uuid value="793c935e-a3f3-44ce-a8f1-3d05459ca3d3"/><art:hash value="9390720"/><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_instantaneouspoint/verticalprofile_step_04_out_statistics.xml Tue Sep 29 12:01: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="793c935e-a3f3-44ce-a8f1-3d05459ca3d3" /> + <art:hash value="9390720" /> + <art:out name="statistics"> + <art:out value="text/xml" /> + <art:params /> + </art:out> +</art:action> \ No newline at end of file