Mercurial > dive4elements > gnv-client
diff gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java @ 116:820238357bab
Added Horizontal-Profile-Support for Meshes.
Modify the Workflow for Horizontal-Profile-InstantaneousPoint
gnv-artifacts/trunk@169 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Fri, 02 Oct 2009 08:07:00 +0000 |
parents | d8d38a4dd965 |
children | ef157bd2fa92 |
line wrap: on
line diff
--- a/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java Thu Oct 01 08:57:49 2009 +0000 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java Fri Oct 02 08:07:00 2009 +0000 @@ -429,7 +429,7 @@ public void testHorizontalProfileInstantaneousPointArtifact(){ try { log.debug("GNVArtifactsTestCase.testHorizontalProfileInstantaneousPointArtifact"); - String artefactName = "fis_instantaneouspoint"; + String artefactName = "fis_delphin"; ArtifactFactory artifactFactory = this.getArtifactFactory(artefactName); assertNotNull(artifactFactory); log.debug("VerticalProfile-ArtifactFactory is available"); @@ -442,6 +442,12 @@ // Erster Schritt this.doNextStep(artifact, cc, + "src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_00_feed.xml", + "src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_00_advance.xml"); + + + // Erster Schritt + this.doNextStep(artifact, cc, "src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_01_feed.xml", "src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_01_advance.xml"); @@ -496,6 +502,87 @@ } } + public void testHorizontalProfileMeshPointArtifact(){ + try { + log.debug("GNVArtifactsTestCase.testHorizontalProfileInstantaneousPointArtifact"); + 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 + this.doNextStep(artifact, cc, + "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_01_feed.xml", + "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_01_advance.xml"); + + // Zweiter Schritt + this.doNextStep(artifact, cc, + "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_02_feed.xml", + "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_02_advance.xml"); + // Dritter Schritt + this.doNextStep(artifact, cc, + "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_03_feed.xml", + "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_03_advance.xml"); + // Vierter Schritt + this.doNextStep(artifact, cc, + "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_04_feed.xml", + "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_04_advance.xml"); + // Fünfter Schritt + this.doNextStep(artifact, cc, + "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_05_feed.xml", + "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_05_advance.xml"); + + // Sechster Schritt + this.doNextStep(artifact, cc, + "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_06_feed.xml", + "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_06_advance.xml"); + + // Siebter Schritt + this.doNextStep(artifact, cc, + "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_07_feed.xml", + "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_07_advance.xml"); + + Document outputData = artifact.describe(null); + FileOutputStream fos = null; + FileOutputStream fos2 = null; + FileOutputStream fos3 = null; + try{ + fos = new FileOutputStream("src/test/results/horizontalProfile_mesh"+System.currentTimeMillis()+".png"); + fos2 = new FileOutputStream("src/test/results/horizontalProfile_mesh"+System.currentTimeMillis()+".xml"); + fos3 = new FileOutputStream("src/test/results/horizontalProfile_mesh"+System.currentTimeMillis()+".csv"); + artifact.feed(this.readDocument("src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_08_feed.xml"), cc); + artifact.out(this.readDocument("src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_08_out_statistics.xml"),fos2, cc); + artifact.out(this.readDocument("src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_08_out_chart.xml"),fos, cc); +// artifact.out(this.readDocument("src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_08_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(); + } + } + protected void createFile(byte[] content, String fileName){ try { FileOutputStream fos = new FileOutputStream(new File(fileName));