# HG changeset patch # User Tim Englich # Date 1254318482 0 # Node ID d8d38a4dd965a2552b54163d5e4577a5c8979d89 # Parent a16f5267803e04258e48abc6e57fe84c75ef6cd0 Added TestCase for HorizontalProfiles of InstataneousPoints and the required Configuration gnv-artifacts/trunk@164 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r a16f5267803e -r d8d38a4dd965 gnv-artifacts/Changelog --- a/gnv-artifacts/Changelog Wed Sep 30 13:42:51 2009 +0000 +++ b/gnv-artifacts/Changelog Wed Sep 30 13:48:02 2009 +0000 @@ -1,3 +1,14 @@ +2009-09-30 Tim Englich + + * src/test/ressources/queries.properties Edited: + Added the Queries for HorizontalProfiles of InstantaneousPoints. + * src/test/ressources/conf.xml Edited: + Added the Configuration for HorizontalProfilArtifact for InstantaneousPoints + * src/test/ressources/horizontalProfile_instantaneouspoint/*.xml Added: + Added XML-Requests for the TestCase of HorizontalProfiles of InstantaneousPoints. + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (testHorizontalProfileInstantaneousPointArtifact) Edited: + Added TestCase for HorizontalProfiles of InstantaneousPoints. + 2009-09-30 Tim Englich * src/main/java/de/intevation/gnv/utils/InputValidator.java (isInputValid) Edited: diff -r a16f5267803e -r d8d38a4dd965 gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java --- a/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java Wed Sep 30 13:42:51 2009 +0000 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java Wed Sep 30 13:48:02 2009 +0000 @@ -426,6 +426,76 @@ } } + public void testHorizontalProfileInstantaneousPointArtifact(){ + try { + log.debug("GNVArtifactsTestCase.testHorizontalProfileInstantaneousPointArtifact"); + String artefactName = "fis_instantaneouspoint"; + ArtifactFactory artifactFactory = this.getArtifactFactory(artefactName); + assertNotNull(artifactFactory); + log.debug("VerticalProfile-ArtifactFactory is available"); + Artifact artifact = artifactFactory.createArtifact(""+System.currentTimeMillis(),bootstrap.getContext()); + assertNotNull(artifact); + log.debug("VerticalProfile-Artifact is available"); + + + CallContext cc = new TestCallContext(bootstrap.getContext()); + + // Erster Schritt + this.doNextStep(artifact, cc, + "src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_01_feed.xml", + "src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_01_advance.xml"); + + // Zweiter Schritt + this.doNextStep(artifact, cc, + "src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_02_feed.xml", + "src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_02_advance.xml"); + // Dritter Schritt + this.doNextStep(artifact, cc, + "src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_03_feed.xml", + "src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_03_advance.xml"); + // Vierter Schritt + this.doNextStep(artifact, cc, + "src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_04_feed.xml", + "src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_04_advance.xml"); + // Fünfter Schritt + this.doNextStep(artifact, cc, + "src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_05_feed.xml", + "src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_05_advance.xml"); + + + Document outputData = artifact.describe(null); + FileOutputStream fos = null; + FileOutputStream fos2 = null; + FileOutputStream fos3 = null; + try{ + fos = new FileOutputStream("src/test/results/horizontalprofile_instantaneouspoint"+System.currentTimeMillis()+".png"); + fos2 = new FileOutputStream("src/test/results/horizontalprofile_instantaneouspoint"+System.currentTimeMillis()+".xml"); + fos3 = new FileOutputStream("src/test/results/horizontalprofile_instantaneouspoint"+System.currentTimeMillis()+".csv"); + artifact.feed(this.readDocument("src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_06_feed.xml"), cc); + //artifact.out(this.readDocument("src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_06_out_statistics.xml"),fos2, cc); + artifact.out(this.readDocument("src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_06_out_chart.xml"),fos, cc); +// artifact.out(this.readDocument("src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_06_out_csv.xml"),fos3, cc); + } catch (Exception e){ + log.error(e,e); + fail(); + }finally{ + try { + fos.flush(); + fos.close(); + fos2.flush(); + fos2.close(); + fos3.flush(); + fos3.close(); + } catch (Exception e) { + log.error(e,e); + } + } + } catch (Exception e) { + log.error(e,e); + fail(); + } + } + protected void createFile(byte[] content, String fileName){ try { FileOutputStream fos = new FileOutputStream(new File(fileName)); diff -r a16f5267803e -r d8d38a4dd965 gnv-artifacts/src/test/ressources/conf.xml --- a/gnv-artifacts/src/test/ressources/conf.xml Wed Sep 30 13:42:51 2009 +0000 +++ b/gnv-artifacts/src/test/ressources/conf.xml Wed Sep 30 13:48:02 2009 +0000 @@ -92,6 +92,12 @@ ttl="300000" artifact="de.intevation.gnv.profile.vertical.VerticalProfileInstantaneousPointArtifact">de.intevation.artifactdatabase.DefaultArtifactFactory + + de.intevation.artifactdatabase.DefaultArtifactFactory + + + @@ -457,7 +463,7 @@ - + verticalprofile_instantaneouspoint_chart_data @@ -477,7 +483,91 @@ - + + + + + horizontalprofile_instantaneouspoint_cruise + cruiseid + false + + horizontalprofile_instantaneouspoint_track + + + + + + horizontalprofile_instantaneouspoint_track + trackid + false + + horizontalprofile_instantaneouspoint_surveyinfo + + + + + + + horizontalprofile_instantaneouspoint_surveyinfo + surveyid + false + + horizontalprofile_instantaneouspoint_parameter + + + + + + + + horizontalprofile_instantaneouspoint_parameter + parameterid + true + + horizontalprofile_instantaneouspoint_depth + + + + + + + + + horizontalprofile_instantaneouspoint_depth + measurementid + true + + horizontalprofile_instantaneouspoint_calculate_results + + + + + + + + + + horizontalprofile_instantaneouspoint_chart_data + + + + + + + + + + + + + + + + + + + + src/test/ressources/ehcache.xml diff -r a16f5267803e -r d8d38a4dd965 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_01_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_01_advance.xml Wed Sep 30 13:48:02 2009 +0000 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r a16f5267803e -r d8d38a4dd965 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_01_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_01_feed.xml Wed Sep 30 13:48:02 2009 +0000 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r a16f5267803e -r d8d38a4dd965 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_02_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_02_advance.xml Wed Sep 30 13:48:02 2009 +0000 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r a16f5267803e -r d8d38a4dd965 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_02_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_02_feed.xml Wed Sep 30 13:48:02 2009 +0000 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r a16f5267803e -r d8d38a4dd965 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_03_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_03_advance.xml Wed Sep 30 13:48:02 2009 +0000 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r a16f5267803e -r d8d38a4dd965 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_03_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_03_feed.xml Wed Sep 30 13:48:02 2009 +0000 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r a16f5267803e -r d8d38a4dd965 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_04_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_04_advance.xml Wed Sep 30 13:48:02 2009 +0000 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r a16f5267803e -r d8d38a4dd965 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_04_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_04_feed.xml Wed Sep 30 13:48:02 2009 +0000 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r a16f5267803e -r d8d38a4dd965 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_05_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_05_advance.xml Wed Sep 30 13:48:02 2009 +0000 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r a16f5267803e -r d8d38a4dd965 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_05_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_05_feed.xml Wed Sep 30 13:48:02 2009 +0000 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -r a16f5267803e -r d8d38a4dd965 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_06_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_06_advance.xml Wed Sep 30 13:48:02 2009 +0000 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r a16f5267803e -r d8d38a4dd965 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_06_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_06_feed.xml Wed Sep 30 13:48:02 2009 +0000 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r a16f5267803e -r d8d38a4dd965 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_06_out_chart.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_06_out_chart.xml Wed Sep 30 13:48:02 2009 +0000 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff -r a16f5267803e -r d8d38a4dd965 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_06_out_csv.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_06_out_csv.xml Wed Sep 30 13:48:02 2009 +0000 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -r a16f5267803e -r d8d38a4dd965 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_06_out_statistics.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_06_out_statistics.xml Wed Sep 30 13:48:02 2009 +0000 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -r a16f5267803e -r d8d38a4dd965 gnv-artifacts/src/test/ressources/queries.properties --- a/gnv-artifacts/src/test/ressources/queries.properties Wed Sep 30 13:42:51 2009 +0000 +++ b/gnv-artifacts/src/test/ressources/queries.properties Wed Sep 30 13:48:02 2009 +0000 @@ -332,4 +332,66 @@ MSV.PARAMETERID in (?) \ ORDER BY IP.TIMEVALUE, \ MSV.PARAMETERID, \ - M.ZLOCATION \ No newline at end of file + M.ZLOCATION + +############################################# +############################################# +#### Horizontalprofil InstantaneousPoint #### +############################################# +############################################# + +horizontalprofile_instantaneouspoint_cruise = SELECT \ + CRUISEID KEY , \ + NAME VALUE \ + FROM MEDIAN.CRUISE \ + WHERE NAME IS NOT NULL \ + ORDER BY NAME +horizontalprofile_instantaneouspoint_track= SELECT \ + TRACKID KEY , \ + NAME VALUE \ + FROM MEDIAN.TRACK \ + WHERE CRUISEID = ? \ + ORDER BY NAME +horizontalprofile_instantaneouspoint_surveyinfo = SELECT \ + SURVEYID KEY , \ + DESCRIPTION VALUE \ + FROM MEDIAN.SURVEYINFO \ + WHERE TRACKID = ? \ + ORDER BY DESCRIPTION +horizontalprofile_instantaneouspoint_parameter = SELECT DISTINCT \ + P.PARAMETERID KEY , \ + P.GERMANNAME VALUE \ + FROM MEDIAN.PARAMETER P , \ + MEDIAN.MEASUREMENT M , \ + MEDIAN.INSTANTANEOUSPOINT IP , \ + MEDIAN.MEASUREDSCALARVALUE MSV \ + WHERE P.PARAMETERID = MSV.PARAMETERID AND \ + MSV.MEASUREMENTID = M.MEASUREMENTID AND \ + M.FEATUREID = IP.FEATUREID AND \ + IP.SURVEYID = ? \ + ORDER BY P.GERMANNAME +horizontalprofile_instantaneouspoint_depth = SELECT DISTINCT \ + M.ZLOCATION KEY, \ + M.ZLOCATION VALUE \ + FROM MEDIAN.MEASUREMENT M , \ + MEDIAN.INSTANTANEOUSPOINT IP \ + WHERE M.FEATUREID = IP.FEATUREID AND \ + IP.SURVEYID = ? \ + ORDER BY M.ZLOCATION +horizontalprofile_instantaneouspoint_chart_data = SELECT M.XLOCATION XORDINATE_XCOORD , \ + M.YLOCATION XORDINATE_YCOORD , \ + MSV.DATAVALUE YORDINATE , \ + MSV.PARAMETERID GROUP1 , \ + IP.TIMEVALUE GROUP2 , \ + 1 GROUP3 \ + FROM MEDIAN.INSTANTANEOUSPOINT IP, \ + MEDIAN.MEASUREMENT M, \ + MEDIAN.MEASUREDSCALARVALUE MSV \ + WHERE IP.FEATUREID = M.FEATUREID AND \ + M.MEASUREMENTID = MSV.MEASUREMENTID AND \ + IP.SURVEYID = ? AND \ + M.ZLOCATION IN (?) AND \ + MSV.PARAMETERID in (?) \ + ORDER BY IP.TIMEVALUE, \ + MSV.PARAMETERID, \ + M.ZLOCATION