Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java @ 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 | 4042844339ee |
children | 10d9a440f52e |
comparison
equal
deleted
inserted
replaced
104:5e086156e3d1 | 105:11b2d43da90d |
---|---|
193 log.error(e,e); | 193 log.error(e,e); |
194 } | 194 } |
195 } | 195 } |
196 } | 196 } |
197 | 197 |
198 public void testVerticalProfileMeshArtifact(){ | |
199 log.debug("GNVArtifactsTestCase.testVerticalProfileArtifact"); | |
200 String artefactName = "fis_modeldata"; | |
201 ArtifactFactory artifactFactory = this.getArtifactFactory(artefactName); | |
202 assertNotNull(artifactFactory); | |
203 log.debug("VerticalProfile-ArtifactFactory is available"); | |
204 Artifact artifact = artifactFactory.createArtifact(""+System.currentTimeMillis(),bootstrap.getContext()); | |
205 assertNotNull(artifact); | |
206 log.debug("VerticalProfile-Artifact is available"); | |
207 | |
208 | |
209 CallContext cc = new TestCallContext(bootstrap.getContext()); | |
210 | |
211 // Erster Schritt | |
212 Document outputData = artifact.describe(null); | |
213 this.writeDocument2Log(outputData); | |
214 artifact.feed(this.readDocument("src/test/ressources/verticalprofile_mesh/verticalprofile_step_01_feed.xml"), cc); | |
215 outputData = artifact.advance(this.readDocument("src/test/ressources/verticalprofile_mesh/verticalprofile_step_01_advance.xml"), cc); | |
216 this.writeDocument2Log(outputData); | |
217 | |
218 // Zweiter Schritt | |
219 outputData = artifact.describe(null); | |
220 this.writeDocument2Log(outputData); | |
221 artifact.feed(this.readDocument("src/test/ressources/verticalprofile_mesh/verticalprofile_step_02_feed.xml"), cc); | |
222 outputData = artifact.advance(this.readDocument("src/test/ressources/verticalprofile_mesh/verticalprofile_step_02_advance.xml"), cc); | |
223 this.writeDocument2Log(outputData); | |
224 | |
225 // Dritter Schritt | |
226 outputData = artifact.describe(null); | |
227 this.writeDocument2Log(outputData); | |
228 artifact.feed(this.readDocument("src/test/ressources/verticalprofile_mesh/verticalprofile_step_03_feed.xml"), cc); | |
229 outputData = artifact.advance(this.readDocument("src/test/ressources/verticalprofile_mesh/verticalprofile_step_03_advance.xml"), cc); | |
230 this.writeDocument2Log(outputData); | |
231 | |
232 | |
233 // Vierter Schritt | |
234 outputData = artifact.describe(null); | |
235 this.writeDocument2Log(outputData); | |
236 artifact.feed(this.readDocument("src/test/ressources/verticalprofile_mesh/verticalprofile_step_04_feed.xml"), cc); | |
237 outputData = artifact.advance(this.readDocument("src/test/ressources/verticalprofile_mesh/verticalprofile_step_04_advance.xml"), cc); | |
238 this.writeDocument2Log(outputData); | |
239 | |
240 // Fünfter Schritt | |
241 outputData = artifact.describe(null); | |
242 this.writeDocument2Log(outputData); | |
243 artifact.feed(this.readDocument("src/test/ressources/verticalprofile_mesh/verticalprofile_step_05_feed.xml"), cc); | |
244 outputData = artifact.advance(this.readDocument("src/test/ressources/verticalprofile_mesh/verticalprofile_step_05_advance.xml"), cc); | |
245 this.writeDocument2Log(outputData); | |
246 | |
247 // Vierter Schritt | |
248 outputData = artifact.describe(null); | |
249 FileOutputStream fos = null; | |
250 FileOutputStream fos2 = null; | |
251 FileOutputStream fos3 = null; | |
252 try{ | |
253 fos = new FileOutputStream("src/test/results/verticalprofile_mesh"+System.currentTimeMillis()+".png"); | |
254 fos2 = new FileOutputStream("src/test/results/verticalprofile_mesh"+System.currentTimeMillis()+".xml"); | |
255 fos3 = new FileOutputStream("src/test/results/verticalprofile_mesh"+System.currentTimeMillis()+".csv"); | |
256 artifact.feed(this.readDocument("src/test/ressources/verticalprofile_mesh/verticalprofile_step_06_feed.xml"), cc); | |
257 artifact.out(this.readDocument("src/test/ressources/verticalprofile_mesh/verticalprofile_step_06_out_statistics.xml"),fos2, cc); | |
258 artifact.out(this.readDocument("src/test/ressources/verticalprofile_mesh/verticalprofile_step_06_out_chart.xml"),fos, cc); | |
259 artifact.out(this.readDocument("src/test/ressources/verticalprofile_mesh/verticalprofile_step_06_out_csv.xml"),fos3, cc); | |
260 } catch (Exception e){ | |
261 log.error(e,e); | |
262 fail(); | |
263 }finally{ | |
264 try { | |
265 fos.flush(); | |
266 fos.close(); | |
267 fos2.flush(); | |
268 fos2.close(); | |
269 fos3.flush(); | |
270 fos3.close(); | |
271 } catch (Exception e) { | |
272 log.error(e,e); | |
273 } | |
274 } | |
275 } | |
276 | |
277 | |
278 | |
198 public void testVerticalProfileInstantaneousPointArtifact(){ | 279 public void testVerticalProfileInstantaneousPointArtifact(){ |
199 log.debug("GNVArtifactsTestCase.testVerticalProfileArtifact"); | 280 log.debug("GNVArtifactsTestCase.testVerticalProfileArtifact"); |
200 String artefactName = "fis_instantaneouspoint"; | 281 String artefactName = "fis_instantaneouspoint"; |
201 ArtifactFactory artifactFactory = this.getArtifactFactory(artefactName); | 282 ArtifactFactory artifactFactory = this.getArtifactFactory(artefactName); |
202 assertNotNull(artifactFactory); | 283 assertNotNull(artifactFactory); |