Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java @ 73:504570de21fd
Refactoring Work depending on Infrastructurchanges in the Artifact-Module
gnv-artifacts/trunk@79 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Mon, 14 Sep 2009 10:32:38 +0000 |
parents | 1fece4da4f2f |
children | 994a39b084d6 |
comparison
equal
deleted
inserted
replaced
72:1fece4da4f2f | 73:504570de21fd |
---|---|
76 Artifact artifact = artifactFactory.createArtifact(""+System.currentTimeMillis(),bootstrap.getContext()); | 76 Artifact artifact = artifactFactory.createArtifact(""+System.currentTimeMillis(),bootstrap.getContext()); |
77 assertNotNull(artifact); | 77 assertNotNull(artifact); |
78 log.debug("TimeSeries-Artifact is available"); | 78 log.debug("TimeSeries-Artifact is available"); |
79 | 79 |
80 // Erster Schritt | 80 // Erster Schritt |
81 Document outputData = artifact.describe(bootstrap.getContext()); | 81 Document outputData = artifact.describe(null); |
82 this.writeDocument2Log(outputData); | 82 this.writeDocument2Log(outputData); |
83 artifact.feed(this.readDocument("src/test/ressources/timeseries/timeseries_step_01_feed.xml"), bootstrap.getContext()); | 83 artifact.feed(this.readDocument("src/test/ressources/timeseries/timeseries_step_01_feed.xml"), null); |
84 outputData = artifact.advance(this.readDocument("src/test/ressources/timeseries/timeseries_step_01_advance.xml"), bootstrap.getContext()); | 84 outputData = artifact.advance(this.readDocument("src/test/ressources/timeseries/timeseries_step_01_advance.xml"), null); |
85 this.writeDocument2Log(outputData); | 85 this.writeDocument2Log(outputData); |
86 | 86 |
87 // Zweiter Schritt | 87 // Zweiter Schritt |
88 outputData = artifact.describe(bootstrap.getContext()); | 88 outputData = artifact.describe(null); |
89 this.writeDocument2Log(outputData); | 89 this.writeDocument2Log(outputData); |
90 artifact.feed(this.readDocument("src/test/ressources/timeseries/timeseries_step_02_feed.xml"), bootstrap.getContext()); | 90 artifact.feed(this.readDocument("src/test/ressources/timeseries/timeseries_step_02_feed.xml"), null); |
91 outputData = artifact.advance(this.readDocument("src/test/ressources/timeseries/timeseries_step_02_advance.xml"), bootstrap.getContext()); | 91 outputData = artifact.advance(this.readDocument("src/test/ressources/timeseries/timeseries_step_02_advance.xml"), null); |
92 this.writeDocument2Log(outputData); | 92 this.writeDocument2Log(outputData); |
93 | 93 |
94 // Dritter Schritt | 94 // Dritter Schritt |
95 outputData = artifact.describe(bootstrap.getContext()); | 95 outputData = artifact.describe(null); |
96 this.writeDocument2Log(outputData); | 96 this.writeDocument2Log(outputData); |
97 artifact.feed(this.readDocument("src/test/ressources/timeseries/timeseries_step_03_feed.xml"), bootstrap.getContext()); | 97 artifact.feed(this.readDocument("src/test/ressources/timeseries/timeseries_step_03_feed.xml"), null); |
98 outputData = artifact.advance(this.readDocument("src/test/ressources/timeseries/timeseries_step_03_advance.xml"), bootstrap.getContext()); | 98 outputData = artifact.advance(this.readDocument("src/test/ressources/timeseries/timeseries_step_03_advance.xml"), null); |
99 this.writeDocument2Log(outputData); | 99 this.writeDocument2Log(outputData); |
100 | 100 |
101 | 101 |
102 // Vierter Schritt | 102 // Vierter Schritt |
103 outputData = artifact.describe(bootstrap.getContext()); | 103 outputData = artifact.describe(null); |
104 this.writeDocument2Log(outputData); | 104 this.writeDocument2Log(outputData); |
105 artifact.feed(this.readDocument("src/test/ressources/timeseries/timeseries_step_04_feed.xml"), bootstrap.getContext()); | 105 artifact.feed(this.readDocument("src/test/ressources/timeseries/timeseries_step_04_feed.xml"), null); |
106 outputData = artifact.advance(this.readDocument("src/test/ressources/timeseries/timeseries_step_04_advance.xml"), bootstrap.getContext()); | 106 outputData = artifact.advance(this.readDocument("src/test/ressources/timeseries/timeseries_step_04_advance.xml"), null); |
107 this.writeDocument2Log(outputData); | 107 this.writeDocument2Log(outputData); |
108 | 108 |
109 // Fünfter Schritt | 109 // Fünfter Schritt |
110 outputData = artifact.describe(bootstrap.getContext()); | 110 outputData = artifact.describe(null); |
111 artifact.feed(this.readDocument("src/test/ressources/timeseries/timeseries_step_05_feed.xml"), bootstrap.getContext()); | 111 FileOutputStream fos = null; |
112 byte[] result = artifact.out(this.readDocument("src/test/ressources/timeseries/timeseries_step_05_out.xml"), bootstrap.getContext()); | 112 try{ |
113 this.createFile(result, "src/test/results/timeseriesdiagramm"+System.currentTimeMillis()+".png"); | 113 fos = new FileOutputStream("src/test/results/timeseriesdiagramm"+System.currentTimeMillis()+".png"); |
114 artifact.feed(this.readDocument("src/test/ressources/timeseries/timeseries_step_05_feed.xml"), null); | |
115 artifact.out(this.readDocument("src/test/ressources/timeseries/timeseries_step_05_out.xml"),fos, null); | |
116 } catch (Exception e){ | |
117 log.error(e,e); | |
118 fail(); | |
119 }finally{ | |
120 try { | |
121 fos.flush(); | |
122 fos.close(); | |
123 } catch (Exception e) { | |
124 log.error(e,e); | |
125 } | |
126 } | |
114 } | 127 } |
115 | 128 |
116 protected void createFile(byte[] content, String fileName){ | 129 protected void createFile(byte[] content, String fileName){ |
117 try { | 130 try { |
118 FileOutputStream fos = new FileOutputStream(new File(fileName)); | 131 FileOutputStream fos = new FileOutputStream(new File(fileName)); |