comparison gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java @ 246:b7f69809239c

Added ODV-Export to VerticalCrossSection on Meshes gnv-artifacts/trunk@315 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Tue, 10 Nov 2009 14:37:42 +0000
parents 9697a6b8d2c9
children 008709f79611
comparison
equal deleted inserted replaced
245:9697a6b8d2c9 246:b7f69809239c
823 } 823 }
824 } 824 }
825 825
826 public void testVerticalCrossSectionMeshArtifact() { 826 public void testVerticalCrossSectionMeshArtifact() {
827 try { 827 try {
828 log.debug("GNVArtifactsTestCase.testHVerticalCrossSectionMeshArtifact"); 828 log.debug("GNVArtifactsTestCase." +
829 "testHVerticalCrossSectionMeshArtifact");
829 String artefactName = "fis_modeldata"; 830 String artefactName = "fis_modeldata";
830 ArtifactFactory artifactFactory = this 831 ArtifactFactory artifactFactory = this
831 .getArtifactFactory(artefactName); 832 .getArtifactFactory(artefactName);
832 assertNotNull(artifactFactory); 833 assertNotNull(artifactFactory);
833 log.debug("VerticalProfile-ArtifactFactory is available"); 834 log.debug("VerticalProfile-ArtifactFactory is available");
836 assertNotNull(artifact); 837 assertNotNull(artifact);
837 log.debug("VerticalProfile-Artifact is available"); 838 log.debug("VerticalProfile-Artifact is available");
838 839
839 CallContext cc = createCallContext(); 840 CallContext cc = createCallContext();
840 Document describeDocument = this.readDocument("src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_describe.xml"); 841 Document describeDocument = this.readDocument("src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_describe.xml");
841 // Erster Schritt 842
842 this 843 int steps = 7;
843 .doNextStep( 844
845 for (int i = 1; i <= steps; i++){
846
847 this.doNextStep(
844 artifact, 848 artifact,
845 cc, 849 cc,
846 "src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_01_feed.xml", 850 "src/test/ressources/verticalcrosssection_mesh/" +
847 "src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_01_advance.xml", describeDocument); 851 "verticalcrosssection_step_0"+i+"_feed.xml",
848 852 "src/test/ressources/verticalcrosssection_mesh/" +
849 // Zweiter Schritt 853 "verticalcrosssection_step_0"+i+"_advance.xml",
850 this 854 describeDocument);
851 .doNextStep( 855 }
852 artifact, 856
853 cc,
854 "src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_02_feed.xml",
855 "src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_02_advance.xml", describeDocument);
856 // Dritter Schritt
857 this
858 .doNextStep(
859 artifact,
860 cc,
861 "src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_03_feed.xml",
862 "src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_03_advance.xml", describeDocument);
863 // Vierter Schritt
864 this
865 .doNextStep(
866 artifact,
867 cc,
868 "src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_04_feed.xml",
869 "src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_04_advance.xml", describeDocument);
870 // Fünfter Schritt
871 this
872 .doNextStep(
873 artifact,
874 cc,
875 "src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_05_feed.xml",
876 "src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_05_advance.xml", describeDocument);
877
878 // Sechster Schritt
879 this
880 .doNextStep(
881 artifact,
882 cc,
883 "src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_06_feed.xml",
884 "src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_06_advance.xml", describeDocument);
885 // Siebter Schritt
886 this
887 .doNextStep(
888 artifact,
889 cc,
890 "src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_07_feed.xml",
891 "src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_07_advance.xml", describeDocument);
892
893 Document outputData = artifact.describe(describeDocument,cc); 857 Document outputData = artifact.describe(describeDocument,cc);
894 FileOutputStream fos = null; 858 FileOutputStream fos = null;
895 FileOutputStream fos2 = null; 859 FileOutputStream fos2 = null;
896 FileOutputStream fos3 = null; 860 FileOutputStream fos3 = null;
861 FileOutputStream fos4 = null;
897 try { 862 try {
898 fos = new FileOutputStream( 863 fos = new FileOutputStream(
899 "src/test/results/verticalcrosssection_mesh" 864 "src/test/results/verticalcrosssection_mesh"
900 + System.currentTimeMillis() + ".png"); 865 + System.currentTimeMillis() + ".png");
901 fos2 = new FileOutputStream( 866 fos2 = new FileOutputStream(
902 "src/test/results/verticalcrosssection_mesh" 867 "src/test/results/verticalcrosssection_mesh"
903 + System.currentTimeMillis() + ".xml"); 868 + System.currentTimeMillis() + ".xml");
904 fos3 = new FileOutputStream( 869 fos3 = new FileOutputStream(
905 "src/test/results/verticalcrosssection_mesh" 870 "src/test/results/verticalcrosssection_mesh"
906 + System.currentTimeMillis() + ".csv"); 871 + System.currentTimeMillis() + ".csv");
907 artifact 872 fos4 = new FileOutputStream(
908 .feed( 873 "src/test/results/verticalcrosssection_mesh"
909 this 874 + System.currentTimeMillis() + ".odv");
910 .readDocument("src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_08_feed.xml"), 875 artifact.feed(this.readDocument("src/test/ressources/" +
911 cc); 876 "verticalcrosssection_mesh/" +
912 artifact 877 "verticalcrosssection_step_08_feed.xml"),
913 .out( 878 cc);
914 this 879 artifact.out(this.readDocument("src/test/ressources/" +
915 .readDocument("src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_08_out_statistics.xml"), 880 "verticalcrosssection_mesh/" +
916 fos2, cc); 881 "verticalcrosssection_step_08_out_statistics.xml"),
917 artifact 882 fos2, cc);
918 .out( 883 artifact.out(this.readDocument("src/test/ressources/" +
919 this 884 "verticalcrosssection_mesh/" +
920 .readDocument("src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_08_out_chart.xml"), 885 "verticalcrosssection_step_08_out_chart.xml"),
921 fos, cc); 886 fos, cc);
922 artifact.out(this.readDocument("src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_08_out_csv.xml"), 887 artifact.out(this.readDocument("src/test/ressources/" +
923 fos3, 888 "verticalcrosssection_mesh/" +
924 cc); 889 "verticalcrosssection_step_08_out_csv.xml"),
890 fos3,cc);
891 artifact.out(this.readDocument("src/test/ressources/" +
892 "verticalcrosssection_mesh/" +
893 "verticalcrosssection_step_08_out_odv.xml"),
894 fos4,cc);
895
925 } catch (Exception e) { 896 } catch (Exception e) {
926 log.error(e, e); 897 log.error(e, e);
927 fail(); 898 fail();
928 } finally { 899 } finally {
929 try { 900 try {

http://dive4elements.wald.intevation.org