# HG changeset patch # User Tim Englich # Date 1254227825 0 # Node ID 11b2d43da90de82a846bfbee1e565ea1bafdac75 # Parent 5e086156e3d1683114f29fc5f80f78a75b97f0ab TestCaseRequests for VerticalProfile FIS Mesh gnv-artifacts/trunk@154 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 5e086156e3d1 -r 11b2d43da90d gnv-artifacts/Changelog --- 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 + + * 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 * src/main/java/de/intevation/gnv/utils/InputValidator.java (isInputValid) Edited: diff -r 5e086156e3d1 -r 11b2d43da90d gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java --- 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"; diff -r 5e086156e3d1 -r 11b2d43da90d gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_01_advance.xml --- /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 @@ + + + + + + + \ No newline at end of file diff -r 5e086156e3d1 -r 11b2d43da90d gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_01_feed.xml --- /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 @@ + + + + + + + + + \ No newline at end of file diff -r 5e086156e3d1 -r 11b2d43da90d gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_02_advance.xml --- /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 @@ + + + + + + + \ No newline at end of file diff -r 5e086156e3d1 -r 11b2d43da90d gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_02_feed.xml --- /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 @@ + + + + + + + + + \ No newline at end of file diff -r 5e086156e3d1 -r 11b2d43da90d gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_03_advance.xml --- /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 @@ + + + + + + + \ No newline at end of file diff -r 5e086156e3d1 -r 11b2d43da90d gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_03_feed.xml --- /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 @@ + + + + + + + \ No newline at end of file diff -r 5e086156e3d1 -r 11b2d43da90d gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_04_advance.xml --- /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 @@ + + + + + + + \ No newline at end of file diff -r 5e086156e3d1 -r 11b2d43da90d gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_04_feed.xml --- /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 @@ + + + + + + + + + \ No newline at end of file diff -r 5e086156e3d1 -r 11b2d43da90d gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_05_advance.xml --- /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 @@ + + + + + + + \ No newline at end of file diff -r 5e086156e3d1 -r 11b2d43da90d gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_05_feed.xml --- /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 @@ + + + + + + + + + + \ No newline at end of file diff -r 5e086156e3d1 -r 11b2d43da90d gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_06_feed.xml --- /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 @@ + + + + + + + + + \ No newline at end of file diff -r 5e086156e3d1 -r 11b2d43da90d gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_06_out_chart.xml --- /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 @@ + + + + + + + + + + + + + \ No newline at end of file diff -r 5e086156e3d1 -r 11b2d43da90d gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_06_out_csv.xml --- /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 @@ + + + + + + + + + + \ No newline at end of file diff -r 5e086156e3d1 -r 11b2d43da90d gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_06_out_statistics.xml --- /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 @@ + + + + + + + + + + \ No newline at end of file