comparison gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java @ 244:9048bc4b17cd

Added ODV-Export to HorizontalProfiles on InstantaneousPoint gnv-artifacts/trunk@313 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Tue, 10 Nov 2009 11:48:41 +0000
parents b599de3db552
children 9697a6b8d2c9
comparison
equal deleted inserted replaced
243:b599de3db552 244:9048bc4b17cd
554 } 554 }
555 } 555 }
556 556
557 public void testHorizontalProfileInstantaneousPointArtifact() { 557 public void testHorizontalProfileInstantaneousPointArtifact() {
558 try { 558 try {
559 log 559 log.debug("GNVArtifactsTestCase." +
560 .debug("GNVArtifactsTestCase.testHorizontalProfileInstantaneousPointArtifact"); 560 "testHorizontalProfileInstantaneousPointArtifact");
561 String artefactName = "fis_delphin"; 561 String artefactName = "fis_delphin";
562 ArtifactFactory artifactFactory = this 562 ArtifactFactory artifactFactory = this
563 .getArtifactFactory(artefactName); 563 .getArtifactFactory(artefactName);
564 assertNotNull(artifactFactory); 564 assertNotNull(artifactFactory);
565 log.debug("VerticalProfile-ArtifactFactory is available"); 565 log.debug("VerticalProfile-ArtifactFactory is available");
568 assertNotNull(artifact); 568 assertNotNull(artifact);
569 log.debug("VerticalProfile-Artifact is available"); 569 log.debug("VerticalProfile-Artifact is available");
570 570
571 CallContext cc = createCallContext(); 571 CallContext cc = createCallContext();
572 Document describeDocument = this.readDocument("src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_describe.xml"); 572 Document describeDocument = this.readDocument("src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_describe.xml");
573 // Erster Schritt 573
574 this 574 int steps = 6;
575 .doNextStep( 575
576 artifact, 576 for (int i = 0; i < steps; i++){
577 cc, 577
578 "src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_00_feed.xml", 578 this.doNextStep(
579 "src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_00_advance.xml", describeDocument); 579 artifact,
580 580 cc,
581 // Erster Schritt 581 "src/test/ressources/horizontalProfile_instantaneouspoint/" +
582 this 582 "horizontalprofile_step_0"+i+"_feed.xml",
583 .doNextStep( 583 "src/test/ressources/horizontalProfile_instantaneouspoint/" +
584 artifact, 584 "horizontalprofile_step_0"+i+"_advance.xml",
585 cc, 585 describeDocument);
586 "src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_01_feed.xml", 586 }
587 "src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_01_advance.xml", describeDocument);
588
589 // Zweiter Schritt
590 this
591 .doNextStep(
592 artifact,
593 cc,
594 "src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_02_feed.xml",
595 "src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_02_advance.xml", describeDocument);
596 // Dritter Schritt
597 this
598 .doNextStep(
599 artifact,
600 cc,
601 "src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_03_feed.xml",
602 "src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_03_advance.xml", describeDocument);
603 // Vierter Schritt
604 this
605 .doNextStep(
606 artifact,
607 cc,
608 "src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_04_feed.xml",
609 "src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_04_advance.xml", describeDocument);
610 // Fünfter Schritt
611 this
612 .doNextStep(
613 artifact,
614 cc,
615 "src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_05_feed.xml",
616 "src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_05_advance.xml", describeDocument);
617 587
618 Document outputData = artifact.describe(describeDocument, cc); 588 Document outputData = artifact.describe(describeDocument, cc);
619 FileOutputStream fos = null; 589 FileOutputStream fos = null;
620 FileOutputStream fos2 = null; 590 FileOutputStream fos2 = null;
621 FileOutputStream fos3 = null; 591 FileOutputStream fos3 = null;
592 FileOutputStream fos4 = null;
622 try { 593 try {
623 fos = new FileOutputStream( 594 fos = new FileOutputStream(
624 "src/test/results/horizontalprofile_instantaneouspoint" 595 "src/test/results/horizontalprofile_instantaneouspoint"
625 + System.currentTimeMillis() + ".png"); 596 + System.currentTimeMillis() + ".png");
626 fos2 = new FileOutputStream( 597 fos2 = new FileOutputStream(
627 "src/test/results/horizontalprofile_instantaneouspoint" 598 "src/test/results/horizontalprofile_instantaneouspoint"
628 + System.currentTimeMillis() + ".xml"); 599 + System.currentTimeMillis() + ".xml");
629 fos3 = new FileOutputStream( 600 fos3 = new FileOutputStream(
630 "src/test/results/horizontalprofile_instantaneouspoint" 601 "src/test/results/horizontalprofile_instantaneouspoint"
631 + System.currentTimeMillis() + ".csv"); 602 + System.currentTimeMillis() + ".csv");
632 artifact 603 fos4 = new FileOutputStream(
633 .feed( 604 "src/test/results/horizontalprofile_instantaneouspoint"
634 this.readDocument("src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_06_feed.xml"), 605 + System.currentTimeMillis() + ".odv");
635 cc); 606 artifact.feed(this.readDocument("src/test/ressources/" +
636 artifact.out(this.readDocument("src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_06_out_statistics.xml"), 607 "horizontalProfile_instantaneouspoint/" +
637 fos2, 608 "horizontalprofile_step_06_feed.xml"),
638 cc); 609 cc);
639 artifact.out( 610 artifact.out(this.readDocument("src/test/ressources/" +
640 this.readDocument("src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_06_out_chart.xml"), 611 "horizontalProfile_instantaneouspoint/" +
641 fos, 612 "horizontalprofile_step_06_out_statistics.xml"),
642 cc); 613 fos2,cc);
643 artifact.out(this.readDocument("src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_06_out_csv.xml"), 614 artifact.out(this.readDocument("src/test/ressources/" +
644 fos3, 615 "horizontalProfile_instantaneouspoint/" +
645 cc); 616 "horizontalprofile_step_06_out_chart.xml"),
617 fos,cc);
618 artifact.out(this.readDocument("src/test/ressources/" +
619 "horizontalProfile_instantaneouspoint/" +
620 "horizontalprofile_step_06_out_csv.xml"),
621 fos3,cc);
622 artifact.out(this.readDocument("src/test/ressources/" +
623 "horizontalProfile_instantaneouspoint/" +
624 "horizontalprofile_step_06_out_odv.xml"),
625 fos4,cc);
646 } catch (Exception e) { 626 } catch (Exception e) {
647 log.error(e, e); 627 log.error(e, e);
648 fail(); 628 fail();
649 } finally { 629 } finally {
650 try { 630 try {

http://dive4elements.wald.intevation.org