Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java @ 242:5925739d25ac
Added ODV-Export to HorizontalProfiles in Meshes
gnv-artifacts/trunk@310 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Tue, 10 Nov 2009 08:35:18 +0000 |
parents | 8500529d82af |
children | b599de3db552 |
comparison
equal
deleted
inserted
replaced
241:8500529d82af | 242:5925739d25ac |
---|---|
677 } | 677 } |
678 } | 678 } |
679 | 679 |
680 public void testHorizontalProfileMeshPointArtifact() { | 680 public void testHorizontalProfileMeshPointArtifact() { |
681 try { | 681 try { |
682 log | 682 log.debug("GNVArtifactsTestCase." + |
683 .debug("GNVArtifactsTestCase.testHorizontalProfileInstantaneousPointArtifact"); | 683 "testHorizontalProfileInstantaneousPointArtifact"); |
684 String artefactName = "fis_modeldata"; | 684 String artefactName = "fis_modeldata"; |
685 ArtifactFactory artifactFactory = this | 685 ArtifactFactory artifactFactory = this |
686 .getArtifactFactory(artefactName); | 686 .getArtifactFactory(artefactName); |
687 assertNotNull(artifactFactory); | 687 assertNotNull(artifactFactory); |
688 log.debug("VerticalProfile-ArtifactFactory is available"); | 688 log.debug("VerticalProfile-ArtifactFactory is available"); |
691 assertNotNull(artifact); | 691 assertNotNull(artifact); |
692 log.debug("VerticalProfile-Artifact is available"); | 692 log.debug("VerticalProfile-Artifact is available"); |
693 | 693 |
694 CallContext cc = createCallContext(); | 694 CallContext cc = createCallContext(); |
695 Document describeDocument = this.readDocument("src/test/ressources/horizontalProfile_mesh/horizontalprofile_describe.xml"); | 695 Document describeDocument = this.readDocument("src/test/ressources/horizontalProfile_mesh/horizontalprofile_describe.xml"); |
696 // Erster Schritt | 696 |
697 this | 697 int steps = 9; |
698 .doNextStep( | 698 |
699 artifact, | 699 for (int i = 1; i <= steps; i++){ |
700 cc, | 700 |
701 "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_01_feed.xml", | 701 this.doNextStep( |
702 "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_01_advance.xml", describeDocument); | 702 artifact, |
703 | 703 cc, |
704 // Zweiter Schritt | 704 "src/test/ressources/horizontalProfile_mesh/" + |
705 this | 705 "horizontalprofile_step_0"+i+"_feed.xml", |
706 .doNextStep( | 706 "src/test/ressources/horizontalProfile_mesh/" + |
707 artifact, | 707 "horizontalprofile_step_0"+i+"_advance.xml", |
708 cc, | 708 describeDocument); |
709 "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_02_feed.xml", | 709 } |
710 "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_02_advance.xml", describeDocument); | 710 |
711 // Dritter Schritt | |
712 this | |
713 .doNextStep( | |
714 artifact, | |
715 cc, | |
716 "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_03_feed.xml", | |
717 "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_03_advance.xml", describeDocument); | |
718 // Vierter Schritt | |
719 this | |
720 .doNextStep( | |
721 artifact, | |
722 cc, | |
723 "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_04_feed.xml", | |
724 "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_04_advance.xml", describeDocument); | |
725 // Fünfter Schritt | |
726 this | |
727 .doNextStep( | |
728 artifact, | |
729 cc, | |
730 "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_05_feed.xml", | |
731 "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_05_advance.xml", describeDocument); | |
732 | |
733 // Sechster Schritt | |
734 this | |
735 .doNextStep( | |
736 artifact, | |
737 cc, | |
738 "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_06_feed.xml", | |
739 "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_06_advance.xml", describeDocument); | |
740 | |
741 // Siebter Schritt | |
742 this | |
743 .doNextStep( | |
744 artifact, | |
745 cc, | |
746 "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_07_feed.xml", | |
747 "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_07_advance.xml", describeDocument); | |
748 | |
749 // Achter Schritt | |
750 this | |
751 .doNextStep( | |
752 artifact, | |
753 cc, | |
754 "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_08_feed.xml", | |
755 "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_08_advance.xml", describeDocument); | |
756 | |
757 // Neunter Schritt | |
758 this | |
759 .doNextStep( | |
760 artifact, | |
761 cc, | |
762 "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_09_feed.xml", | |
763 "src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_09_advance.xml", describeDocument); | |
764 | |
765 Document outputData = artifact.describe(describeDocument,cc); | 711 Document outputData = artifact.describe(describeDocument,cc); |
766 FileOutputStream fos = null; | 712 FileOutputStream fos = null; |
767 FileOutputStream fos2 = null; | 713 FileOutputStream fos2 = null; |
768 FileOutputStream fos3 = null; | 714 FileOutputStream fos3 = null; |
715 FileOutputStream fos4 = null; | |
769 try { | 716 try { |
770 fos = new FileOutputStream( | 717 fos = new FileOutputStream( |
771 "src/test/results/horizontalProfile_mesh" | 718 "src/test/results/horizontalProfile_mesh" |
772 + System.currentTimeMillis() + ".png"); | 719 + System.currentTimeMillis() + ".png"); |
773 fos2 = new FileOutputStream( | 720 fos2 = new FileOutputStream( |
774 "src/test/results/horizontalProfile_mesh" | 721 "src/test/results/horizontalProfile_mesh" |
775 + System.currentTimeMillis() + ".xml"); | 722 + System.currentTimeMillis() + ".xml"); |
776 fos3 = new FileOutputStream( | 723 fos3 = new FileOutputStream( |
777 "src/test/results/horizontalProfile_mesh" | 724 "src/test/results/horizontalProfile_mesh" |
778 + System.currentTimeMillis() + ".csv"); | 725 + System.currentTimeMillis() + ".csv"); |
779 artifact | 726 fos4 = new FileOutputStream( |
780 .feed( | 727 "src/test/results/horizontalProfile_mesh" |
781 this | 728 + System.currentTimeMillis() + ".odv"); |
782 .readDocument("src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_10_feed.xml"), | 729 artifact.feed(this.readDocument("src/test/ressources/" + |
783 cc); | 730 "horizontalProfile_mesh/" + |
784 artifact | 731 "horizontalprofile_step_10_feed.xml"), |
785 .out( | 732 cc); |
786 this | 733 artifact.out(this.readDocument("src/test/ressources/" + |
787 .readDocument("src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_10_out_statistics.xml"), | 734 "horizontalProfile_mesh/" + |
788 fos2, cc); | 735 "horizontalprofile_step_10_out_statistics.xml"), |
789 artifact | 736 fos2, cc); |
790 .out( | 737 artifact.out(this.readDocument("src/test/ressources/" + |
791 this | 738 "horizontalProfile_mesh/" + |
792 .readDocument("src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_10_out_chart.xml"), | 739 "horizontalprofile_step_10_out_chart.xml"), |
793 fos, cc); | 740 fos, cc); |
794 artifact.out(this.readDocument("src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_10_out_csv.xml"), | 741 artifact.out(this.readDocument("src/test/ressources/" + |
795 fos3, | 742 "horizontalProfile_mesh/" + |
796 cc); | 743 "horizontalprofile_step_10_out_csv.xml"), |
744 fos3, cc); | |
745 artifact.out(this.readDocument("src/test/ressources/" + | |
746 "horizontalProfile_mesh/" + | |
747 "horizontalprofile_step_10_out_odv.xml"), | |
748 fos4, cc); | |
797 } catch (Exception e) { | 749 } catch (Exception e) { |
798 log.error(e, e); | 750 log.error(e, e); |
799 fail(); | 751 fail(); |
800 } finally { | 752 } finally { |
801 try { | 753 try { |
803 fos.close(); | 755 fos.close(); |
804 fos2.flush(); | 756 fos2.flush(); |
805 fos2.close(); | 757 fos2.close(); |
806 fos3.flush(); | 758 fos3.flush(); |
807 fos3.close(); | 759 fos3.close(); |
760 fos4.flush(); | |
761 fos4.close(); | |
808 } catch (Exception e) { | 762 } catch (Exception e) { |
809 log.error(e, e); | 763 log.error(e, e); |
810 } | 764 } |
811 } | 765 } |
812 } catch (Exception e) { | 766 } catch (Exception e) { |