comparison 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
comparison
equal deleted inserted replaced
115:158e89c2263b 116:820238357bab
427 } 427 }
428 428
429 public void testHorizontalProfileInstantaneousPointArtifact(){ 429 public void testHorizontalProfileInstantaneousPointArtifact(){
430 try { 430 try {
431 log.debug("GNVArtifactsTestCase.testHorizontalProfileInstantaneousPointArtifact"); 431 log.debug("GNVArtifactsTestCase.testHorizontalProfileInstantaneousPointArtifact");
432 String artefactName = "fis_instantaneouspoint"; 432 String artefactName = "fis_delphin";
433 ArtifactFactory artifactFactory = this.getArtifactFactory(artefactName); 433 ArtifactFactory artifactFactory = this.getArtifactFactory(artefactName);
434 assertNotNull(artifactFactory); 434 assertNotNull(artifactFactory);
435 log.debug("VerticalProfile-ArtifactFactory is available"); 435 log.debug("VerticalProfile-ArtifactFactory is available");
436 Artifact artifact = artifactFactory.createArtifact(""+System.currentTimeMillis(),bootstrap.getContext()); 436 Artifact artifact = artifactFactory.createArtifact(""+System.currentTimeMillis(),bootstrap.getContext());
437 assertNotNull(artifact); 437 assertNotNull(artifact);
438 log.debug("VerticalProfile-Artifact is available"); 438 log.debug("VerticalProfile-Artifact is available");
439 439
440 440
441 CallContext cc = new TestCallContext(bootstrap.getContext()); 441 CallContext cc = new TestCallContext(bootstrap.getContext());
442
443 // Erster Schritt
444 this.doNextStep(artifact, cc,
445 "src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_00_feed.xml",
446 "src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_00_advance.xml");
447
442 448
443 // Erster Schritt 449 // Erster Schritt
444 this.doNextStep(artifact, cc, 450 this.doNextStep(artifact, cc,
445 "src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_01_feed.xml", 451 "src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_01_feed.xml",
446 "src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_01_advance.xml"); 452 "src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_01_advance.xml");
494 log.error(e,e); 500 log.error(e,e);
495 fail(); 501 fail();
496 } 502 }
497 } 503 }
498 504
505 public void testHorizontalProfileMeshPointArtifact(){
506 try {
507 log.debug("GNVArtifactsTestCase.testHorizontalProfileInstantaneousPointArtifact");
508 String artefactName = "fis_modeldata";
509 ArtifactFactory artifactFactory = this.getArtifactFactory(artefactName);
510 assertNotNull(artifactFactory);
511 log.debug("VerticalProfile-ArtifactFactory is available");
512 Artifact artifact = artifactFactory.createArtifact(""+System.currentTimeMillis(),bootstrap.getContext());
513 assertNotNull(artifact);
514 log.debug("VerticalProfile-Artifact is available");
515
516
517 CallContext cc = new TestCallContext(bootstrap.getContext());
518
519
520
521 // Erster Schritt
522 this.doNextStep(artifact, cc,
523 "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_01_feed.xml",
524 "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_01_advance.xml");
525
526 // Zweiter Schritt
527 this.doNextStep(artifact, cc,
528 "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_02_feed.xml",
529 "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_02_advance.xml");
530 // Dritter Schritt
531 this.doNextStep(artifact, cc,
532 "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_03_feed.xml",
533 "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_03_advance.xml");
534 // Vierter Schritt
535 this.doNextStep(artifact, cc,
536 "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_04_feed.xml",
537 "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_04_advance.xml");
538 // Fünfter Schritt
539 this.doNextStep(artifact, cc,
540 "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_05_feed.xml",
541 "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_05_advance.xml");
542
543 // Sechster Schritt
544 this.doNextStep(artifact, cc,
545 "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_06_feed.xml",
546 "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_06_advance.xml");
547
548 // Siebter Schritt
549 this.doNextStep(artifact, cc,
550 "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_07_feed.xml",
551 "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_07_advance.xml");
552
553 Document outputData = artifact.describe(null);
554 FileOutputStream fos = null;
555 FileOutputStream fos2 = null;
556 FileOutputStream fos3 = null;
557 try{
558 fos = new FileOutputStream("src/test/results/horizontalProfile_mesh"+System.currentTimeMillis()+".png");
559 fos2 = new FileOutputStream("src/test/results/horizontalProfile_mesh"+System.currentTimeMillis()+".xml");
560 fos3 = new FileOutputStream("src/test/results/horizontalProfile_mesh"+System.currentTimeMillis()+".csv");
561 artifact.feed(this.readDocument("src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_08_feed.xml"), cc);
562 artifact.out(this.readDocument("src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_08_out_statistics.xml"),fos2, cc);
563 artifact.out(this.readDocument("src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_08_out_chart.xml"),fos, cc);
564 // artifact.out(this.readDocument("src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_08_out_csv.xml"),fos3, cc);
565 } catch (Exception e){
566 log.error(e,e);
567 fail();
568 }finally{
569 try {
570 fos.flush();
571 fos.close();
572 fos2.flush();
573 fos2.close();
574 fos3.flush();
575 fos3.close();
576 } catch (Exception e) {
577 log.error(e,e);
578 }
579 }
580 } catch (Exception e) {
581 log.error(e,e);
582 fail();
583 }
584 }
585
499 protected void createFile(byte[] content, String fileName){ 586 protected void createFile(byte[] content, String fileName){
500 try { 587 try {
501 FileOutputStream fos = new FileOutputStream(new File(fileName)); 588 FileOutputStream fos = new FileOutputStream(new File(fileName));
502 ByteArrayInputStream bis = new ByteArrayInputStream(content); 589 ByteArrayInputStream bis = new ByteArrayInputStream(content);
503 byte[] buf = new byte[4096]; 590 byte[] buf = new byte[4096];

http://dive4elements.wald.intevation.org