# HG changeset patch # User Tim Englich # Date 1254233861 0 # Node ID 4ebf9ad2e7eb8d58197ad6afd0df7f28f5d40f53 # Parent 10d9a440f52e1d6c5d9cad29f9828f5062773cae Added TestCase for TimeSeriesMesh gnv-artifacts/trunk@156 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 10d9a440f52e -r 4ebf9ad2e7eb gnv-artifacts/Changelog --- 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 + + * 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 * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (check4ExceptionReport) edited: diff -r 10d9a440f52e -r 4ebf9ad2e7eb 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: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; diff -r 10d9a440f52e -r 4ebf9ad2e7eb gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_01_advance.xml --- /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 @@ + + + + + + + \ No newline at end of file diff -r 10d9a440f52e -r 4ebf9ad2e7eb gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_01_feed.xml --- /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 @@ + + + + + + + + + \ No newline at end of file diff -r 10d9a440f52e -r 4ebf9ad2e7eb gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_02_advance.xml --- /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 @@ + + + + + + + \ No newline at end of file diff -r 10d9a440f52e -r 4ebf9ad2e7eb gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_02_feed.xml --- /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 @@ + + + + + + + + + \ No newline at end of file diff -r 10d9a440f52e -r 4ebf9ad2e7eb gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_03_advance.xml --- /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 @@ + + + + + + + \ No newline at end of file diff -r 10d9a440f52e -r 4ebf9ad2e7eb gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_03_feed.xml --- /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 @@ + + + + + + + + + \ No newline at end of file diff -r 10d9a440f52e -r 4ebf9ad2e7eb gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_04_advance.xml --- /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 @@ + + + + + + + \ No newline at end of file diff -r 10d9a440f52e -r 4ebf9ad2e7eb gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_04_feed.xml --- /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 @@ + + + + + + + + + \ No newline at end of file diff -r 10d9a440f52e -r 4ebf9ad2e7eb gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_05_advance.xml --- /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 @@ + + + + + + + \ No newline at end of file diff -r 10d9a440f52e -r 4ebf9ad2e7eb gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_05_feed.xml --- /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 @@ + + + + + + + + + + \ No newline at end of file diff -r 10d9a440f52e -r 4ebf9ad2e7eb gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_06_advance.xml --- /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 @@ + + + + + + + \ No newline at end of file diff -r 10d9a440f52e -r 4ebf9ad2e7eb gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_06_feed.xml --- /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 @@ + + + + + + + + + + \ No newline at end of file diff -r 10d9a440f52e -r 4ebf9ad2e7eb gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_07_feed.xml --- /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 @@ + + + + + + + + + + \ No newline at end of file diff -r 10d9a440f52e -r 4ebf9ad2e7eb gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_07_out_chart.xml --- /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 @@ + + + + + + + + + + + + + \ No newline at end of file diff -r 10d9a440f52e -r 4ebf9ad2e7eb gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_07_out_csv.xml --- /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 @@ + + + + + + + + + + \ No newline at end of file diff -r 10d9a440f52e -r 4ebf9ad2e7eb gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_07_out_statistics.xml --- /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 @@ + + + + + + + + + + \ No newline at end of file