Mercurial > dive4elements > gnv-client
changeset 72:1fece4da4f2f
TestCase moved from TimeSeriesArtifact to FISArtifact. Used FIS: Marnet
gnv-artifacts/trunk@63 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Thu, 10 Sep 2009 13:14:03 +0000 |
parents | e4ecf3188bdf |
children | 504570de21fd |
files | gnv-artifacts/Changelog gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java gnv-artifacts/src/test/ressources/conf.xml gnv-artifacts/src/test/ressources/timeseries/timeseries_step_01_advance.xml gnv-artifacts/src/test/ressources/timeseries/timeseries_step_01_feed.xml |
diffstat | 5 files changed, 60 insertions(+), 30 deletions(-) [+] |
line wrap: on
line diff
--- a/gnv-artifacts/Changelog Thu Sep 10 13:11:24 2009 +0000 +++ b/gnv-artifacts/Changelog Thu Sep 10 13:14:03 2009 +0000 @@ -1,3 +1,11 @@ +2009-09-10 Tim Englich <tim.englich@intevation.de> + + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java Edited, + src/test/ressources/timeseries/timeseries_step_01_feed.xml Edited, + src/test/ressources/timeseries/timeseries_step_01_advance.xml Edited, + src/test/ressources/conf.xml Edited: + TestCase moced from TimeSeriesArtifact to FISArtifact. Used FIS: Marnet + 2009-09-10 Tim Englich <tim.englich@intevation.de> * src/main/java/de/intevation/gnv/utils/ArtifactXMLUtilities.java Added:
--- a/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java Thu Sep 10 13:11:24 2009 +0000 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java Thu Sep 10 13:14:03 2009 +0000 @@ -8,18 +8,12 @@ import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; -import java.io.StringWriter; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.TransformerFactoryConfigurationError; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; + +import junit.framework.TestCase; import org.apache.log4j.BasicConfigurator; import org.apache.log4j.Logger; @@ -31,7 +25,7 @@ import de.intevation.artifacts.Artifact; import de.intevation.artifacts.ArtifactFactory; import de.intevation.gnv.artifacts.context.GNVArtifactContext; -import junit.framework.TestCase; +import de.intevation.gnv.utils.ArtifactXMLUtilities; /** * @author Tim Englich <tim.englich@intevation.de> @@ -75,7 +69,7 @@ public void testTimeSeriesArtifact(){ log.debug("GNVArtifactsTestCase.testTimeSeriesArtifact"); - String artefactName = "timeSeries"; + String artefactName = "fis_marnet"; ArtifactFactory artifactFactory = this.getArtifactFactory(artefactName); assertNotNull(artifactFactory); log.debug("TimeSeries-ArtifactFactory is available"); @@ -153,21 +147,7 @@ } protected void writeDocument2Log(Document document){ - try { - TransformerFactory transformerFactory = TransformerFactory.newInstance(); - Transformer transformer = transformerFactory.newTransformer(); - DOMSource source = new DOMSource(document); - StringWriter sw = new StringWriter(); - StreamResult result = new StreamResult(sw); - transformer.transform(source, result); - log.debug(sw.getBuffer().toString()); - } catch (TransformerConfigurationException e) { - log.error(e,e); - } catch (TransformerFactoryConfigurationError e) { - log.error(e,e); - } catch (TransformerException e) { - log.error(e,e); - } + log.debug(new ArtifactXMLUtilities().writeDocument2String(document)); }
--- a/gnv-artifacts/src/test/ressources/conf.xml Thu Sep 10 13:11:24 2009 +0000 +++ b/gnv-artifacts/src/test/ressources/conf.xml Thu Sep 10 13:14:03 2009 +0000 @@ -3,12 +3,54 @@ <factories> <context-factory>de.intevation.gnv.artifacts.context.GNVArtifactContextFactory</context-factory> <artifact-factories> - <artifact-factory - name="timeSeries" description="Artiefactfactory for instantiating TimeSeriesArtifacts" ttl="60000" - artifact="de.intevation.gnv.timeseries.TimeSeriesArtifact">de.intevation.artifactdatabase.DefaultArtifactFactory</artifact-factory> + <artifact-factory name="fis_marnet" description="Artiefactfactory for Instantiating the Artifact for the FIS Marnet" + ttl="60000" artifact="de.intevation.gnv.artifacts.fis.FISArtifact">de.intevation.artifactdatabase.DefaultArtifactFactory</artifact-factory> + <artifact-factory name="fis_imis" description="Artiefactfactory for Instantiating the Artifact for the FIS IMIS" + ttl="60000" artifact="de.intevation.gnv.artifacts.fis.FISArtifact">de.intevation.artifactdatabase.DefaultArtifactFactory</artifact-factory> + <artifact-factory name="fis_staun" description="Artiefactfactory for Instantiating the Artifact for the FIS STAUN" + ttl="60000" artifact="de.intevation.gnv.artifacts.fis.FISArtifact">de.intevation.artifactdatabase.DefaultArtifactFactory</artifact-factory> + <artifact-factory name="fis_modeldata" description="Artiefactfactory for Instantiating the Artifact for the FIS Modeldata" + ttl="60000" artifact="de.intevation.gnv.artifacts.fis.FISArtifact">de.intevation.artifactdatabase.DefaultArtifactFactory</artifact-factory> </artifact-factories> </factories> <artifacts> + <artifact name="fis_marnet"> + <products> + <product name= "timeSeries"> + <artifact-factory name="timeSeries" description="Artiefactfactory for Instantiating the Artifact for the FIS Modeldata" + ttl="60000" artifact="de.intevation.gnv.timeseries.TimeSeriesArtifact">de.intevation.artifactdatabase.DefaultArtifactFactory</artifact-factory> + <parameters> + <parameter name="sourceid" value="4"/> + </parameters> + </product> + </products> + </artifact> + <artifact name="fis_imis"> + <products> + <product name= "timeSeries"> + <artifact-factory name="timeSeries" description="Artiefactfactory for Instantiating the Artifact for the FIS Modeldata" + ttl="60000" artifact="de.intevation.gnv.timeseries.TimeSeriesArtifact">de.intevation.artifactdatabase.DefaultArtifactFactory</artifact-factory> + <parameters> + <parameter name="sourceid" value="18"/> + </parameters> + </product> + </products> + </artifact> + <artifact name="fis_staun"> + <products> + <product name= "timeSeries"> + <artifact-factory name="timeSeries" description="Artiefactfactory for Instantiating the Artifact for the FIS Modeldata" + ttl="60000" artifact="de.intevation.gnv.timeseries.TimeSeriesArtifact">de.intevation.artifactdatabase.DefaultArtifactFactory</artifact-factory> + <parameters> + <parameter name="sourceid" value="17"/> + </parameters> + </product> + </products> + </artifact> + <artifact name="fis_modeldata"> + <products> + </products> + </artifact> <artifact name="timeSeries"> <transitions>
--- a/gnv-artifacts/src/test/ressources/timeseries/timeseries_step_01_advance.xml Thu Sep 10 13:11:24 2009 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries/timeseries_step_01_advance.xml Thu Sep 10 13:14:03 2009 +0000 @@ -4,5 +4,5 @@ <art:type name="advance"/> <art:uuid value="dd87ce50-9bbe-11de-8a39-0800200c9a66"/> <art:hash value="8392d409b5518044465ac8e9b7daf5ef"/> - <art:target name="timeseries_parameter"/> + <art:target name="timeSeriess"/> </art:action>
--- a/gnv-artifacts/src/test/ressources/timeseries/timeseries_step_01_feed.xml Thu Sep 10 13:11:24 2009 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries/timeseries_step_01_feed.xml Thu Sep 10 13:14:03 2009 +0000 @@ -5,6 +5,6 @@ <art:uuid value="dd87ce50-9bbe-11de-8a39-0800200c9a66"/> <art:hash value="8392d409b5518044465ac8e9b7daf5ef"/> <art:data> - <art:input name="sourceid" value="4"/> + <art:input name="product" value="timeSeries"/> </art:data> </art:action> \ No newline at end of file