Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java @ 219:f8cb64d5fe4f
Added the Testcase for Horizontal Cross-Sections
gnv-artifacts/trunk@279 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Fri, 30 Oct 2009 11:42:58 +0000 |
parents | c0a798299efc |
children | 3e82b4f1c455 |
comparison
equal
deleted
inserted
replaced
218:926530bda1a7 | 219:f8cb64d5fe4f |
---|---|
868 log.error(e, e); | 868 log.error(e, e); |
869 fail(); | 869 fail(); |
870 } | 870 } |
871 } | 871 } |
872 | 872 |
873 public void testHorizontalCrossSectionMeshArtifact() { | |
874 try { | |
875 log.debug("GNVArtifactsTestCase.testHorizontalCrossSectionMeshArtifact"); | |
876 String artefactName = "fis_modeldata"; | |
877 ArtifactFactory artifactFactory = this | |
878 .getArtifactFactory(artefactName); | |
879 assertNotNull(artifactFactory); | |
880 log.debug("HorizontalCrossSectionMesh-ArtifactFactory is available"); | |
881 Artifact artifact = artifactFactory.createArtifact( | |
882 "" + System.currentTimeMillis(), bootstrap.getContext()); | |
883 assertNotNull(artifact); | |
884 log.debug("HorizontalCrossSectionMesh-Artifact is available"); | |
885 | |
886 CallContext cc = createCallContext(); | |
887 | |
888 // Erster Schritt | |
889 this | |
890 .doNextStep( | |
891 artifact, | |
892 cc, | |
893 "src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_01_feed.xml", | |
894 "src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_01_advance.xml"); | |
895 | |
896 // Zweiter Schritt | |
897 this | |
898 .doNextStep( | |
899 artifact, | |
900 cc, | |
901 "src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_02_feed.xml", | |
902 "src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_02_advance.xml"); | |
903 // Dritter Schritt | |
904 this | |
905 .doNextStep( | |
906 artifact, | |
907 cc, | |
908 "src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_03_feed.xml", | |
909 "src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_03_advance.xml"); | |
910 // Vierter Schritt | |
911 this | |
912 .doNextStep( | |
913 artifact, | |
914 cc, | |
915 "src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_04_feed.xml", | |
916 "src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_04_advance.xml"); | |
917 | |
918 Document outputData = artifact.describe(cc); | |
919 FileOutputStream fos = null; | |
920 FileOutputStream fos2 = null; | |
921 FileOutputStream fos3 = null; | |
922 try { | |
923 fos = new FileOutputStream( | |
924 "src/test/results/horizontalcrosssection_mesh" | |
925 + System.currentTimeMillis() + ".png"); | |
926 fos2 = new FileOutputStream( | |
927 "src/test/results/horizontalcrosssection_mesh" | |
928 + System.currentTimeMillis() + ".xml"); | |
929 fos3 = new FileOutputStream( | |
930 "src/test/results/horizontalcrosssection_mesh" | |
931 + System.currentTimeMillis() + ".csv"); | |
932 artifact | |
933 .feed(this.readDocument("src/test/ressources/horizontal" + | |
934 "crosssection_mesh/horizontalcrosssection_step_05_feed.xml"), | |
935 cc); | |
936 artifact | |
937 .out(this.readDocument("src/test/ressources/horizontal" + | |
938 "crosssection_mesh/horizontalcrosssection_step_05_out_statistics.xml"), | |
939 fos2, cc); | |
940 artifact | |
941 .out(this.readDocument("src/test/ressources/horizontal" + | |
942 "crosssection_mesh/horizontalcrosssection_step_05_out_chart.xml"), | |
943 fos, cc); | |
944 artifact.out(this.readDocument("src/test/ressources/horizontal" + | |
945 "crosssection_mesh/horizontalcrosssection_step_05_out_csv.xml"), | |
946 fos3, | |
947 cc); | |
948 } catch (Exception e) { | |
949 log.error(e, e); | |
950 fail(); | |
951 } finally { | |
952 try { | |
953 fos.flush(); | |
954 fos.close(); | |
955 fos2.flush(); | |
956 fos2.close(); | |
957 fos3.flush(); | |
958 fos3.close(); | |
959 } catch (Exception e) { | |
960 log.error(e, e); | |
961 } | |
962 } | |
963 } catch (Exception e) { | |
964 log.error(e, e); | |
965 fail(); | |
966 } | |
967 } | |
968 | |
873 public void testVerticalCrossSectionMeshArtifact() { | 969 public void testVerticalCrossSectionMeshArtifact() { |
874 try { | 970 try { |
875 log.debug("GNVArtifactsTestCase.testHVerticalCrossSectionMeshArtifact"); | 971 log.debug("GNVArtifactsTestCase.testHVerticalCrossSectionMeshArtifact"); |
876 String artefactName = "fis_modeldata"; | 972 String artefactName = "fis_modeldata"; |
877 ArtifactFactory artifactFactory = this | 973 ArtifactFactory artifactFactory = this |