comparison gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java @ 240:76897b73db4e

Added ODV-Export-Support to TimeSeries Mesh gnv-artifacts/trunk@308 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Mon, 09 Nov 2009 14:20:27 +0000
parents 3d6d89bcbf42
children 8500529d82af
comparison
equal deleted inserted replaced
239:75da91eca29f 240:76897b73db4e
95 95
96 int steps = 5; 96 int steps = 5;
97 97
98 for (int i = 1; i <= steps; i++){ 98 for (int i = 1; i <= steps; i++){
99 99
100 this.doNextStep( 100 this.doNextStep(
101 artifact, 101 artifact,
102 cc, 102 cc,
103 "src/test/ressources/timeseries/" + 103 "src/test/ressources/timeseries/" +
104 "timeseries_step_0"+i+"_feed.xml", 104 "timeseries_step_0"+i+"_feed.xml",
105 "src/test/ressources/timeseries/" + 105 "src/test/ressources/timeseries/" +
106 "timeseries_step_0"+i+"_advance.xml", 106 "timeseries_step_0"+i+"_advance.xml",
107 describeDocument); 107 describeDocument);
108
109 } 108 }
110 109
111 Document outputData = artifact.describe(describeDocument,cc); 110 Document outputData = artifact.describe(describeDocument,cc);
112 FileOutputStream fos = null; 111 FileOutputStream fos = null;
113 FileOutputStream fos2 = null; 112 FileOutputStream fos2 = null;
203 log.debug("TimeSeriesMesh-Artifact is available"); 202 log.debug("TimeSeriesMesh-Artifact is available");
204 203
205 CallContext cc = createCallContext(); 204 CallContext cc = createCallContext();
206 205
207 Document describeDocument = this.readDocument("src/test/ressources/timeseries_mesh/timeseries_describe.xml"); 206 Document describeDocument = this.readDocument("src/test/ressources/timeseries_mesh/timeseries_describe.xml");
208 // Erster Schritt 207
209 this 208 int steps = 7;
210 .doNextStep( 209
211 artifact, 210 for (int i = 1; i <= steps; i++){
212 cc, 211 this.doNextStep(
213 "src/test/ressources/timeseries_mesh/timeseries_step_01_feed.xml", 212 artifact,
214 "src/test/ressources/timeseries_mesh/timeseries_step_01_advance.xml", describeDocument); 213 cc,
215 214 "src/test/ressources/timeseries_mesh/" +
216 // Zweiter Schritt 215 "timeseries_step_0"+i+"_feed.xml",
217 this 216 "src/test/ressources/timeseries_mesh/" +
218 .doNextStep( 217 "timeseries_step_0"+i+"_advance.xml",
219 artifact, 218 describeDocument);
220 cc, 219 }
221 "src/test/ressources/timeseries_mesh/timeseries_step_02_feed.xml",
222 "src/test/ressources/timeseries_mesh/timeseries_step_02_advance.xml", describeDocument);
223
224 // Dritter Schritt
225 this
226 .doNextStep(
227 artifact,
228 cc,
229 "src/test/ressources/timeseries_mesh/timeseries_step_03_feed.xml",
230 "src/test/ressources/timeseries_mesh/timeseries_step_03_advance.xml", describeDocument);
231
232 // Vierter Schritt
233 this
234 .doNextStep(
235 artifact,
236 cc,
237 "src/test/ressources/timeseries_mesh/timeseries_step_04_feed.xml",
238 "src/test/ressources/timeseries_mesh/timeseries_step_04_advance.xml", describeDocument);
239
240 // Fünfter Schritt
241 this
242 .doNextStep(
243 artifact,
244 cc,
245 "src/test/ressources/timeseries_mesh/timeseries_step_05_feed.xml",
246 "src/test/ressources/timeseries_mesh/timeseries_step_05_advance.xml", describeDocument);
247
248 // Sechster Schritt
249 this
250 .doNextStep(
251 artifact,
252 cc,
253 "src/test/ressources/timeseries_mesh/timeseries_step_06_feed.xml",
254 "src/test/ressources/timeseries_mesh/timeseries_step_06_advance.xml", describeDocument);
255
256 // Siebter Schritt
257 this
258 .doNextStep(
259 artifact,
260 cc,
261 "src/test/ressources/timeseries_mesh/timeseries_step_07_feed.xml",
262 "src/test/ressources/timeseries_mesh/timeseries_step_07_advance.xml", describeDocument);
263
264 // Achter Schritt 220 // Achter Schritt
265 Document outputData = artifact.describe(describeDocument,cc); 221 Document outputData = artifact.describe(describeDocument,cc);
266 FileOutputStream fos = null; 222 FileOutputStream fos = null;
267 FileOutputStream fos2 = null; 223 FileOutputStream fos2 = null;
268 FileOutputStream fos3 = null; 224 FileOutputStream fos3 = null;
225 FileOutputStream fos4 = null;
269 try { 226 try {
270 fos = new FileOutputStream("src/test/results/timeseries_mesh" 227 fos = new FileOutputStream("src/test/results/timeseries_mesh"
271 + System.currentTimeMillis() 228 + System.currentTimeMillis()
272 + ".png"); 229 + ".png");
273 fos2 = new FileOutputStream("src/test/results/timeseries_mesh" 230 fos2 = new FileOutputStream("src/test/results/timeseries_mesh"
274 + System.currentTimeMillis() 231 + System.currentTimeMillis()
275 + ".xml"); 232 + ".xml");
276 fos3 = new FileOutputStream("src/test/results/timeseries_mesh" 233 fos3 = new FileOutputStream("src/test/results/timeseries_mesh"
277 + System.currentTimeMillis() 234 + System.currentTimeMillis()
278 + ".csv"); 235 + ".csv");
236 fos4 = new FileOutputStream("src/test/results/timeseries_mesh"
237 + System.currentTimeMillis()
238 + ".odv");
279 artifact 239 artifact
280 .feed( 240 .feed(
281 this 241 this
282 .readDocument("src/test/ressources/timeseries_mesh/timeseries_step_08_feed.xml"), 242 .readDocument("src/test/ressources/timeseries_mesh/timeseries_step_08_feed.xml"),
283 cc); 243 cc);
294 artifact 254 artifact
295 .out( 255 .out(
296 this 256 this
297 .readDocument("src/test/ressources/timeseries_mesh/timeseries_step_08_out_csv.xml"), 257 .readDocument("src/test/ressources/timeseries_mesh/timeseries_step_08_out_csv.xml"),
298 fos3, cc); 258 fos3, cc);
259 artifact
260 .out(
261 this
262 .readDocument("src/test/ressources/timeseries_mesh/timeseries_step_08_out_odv.xml"),
263 fos4, cc);
299 } catch (Exception e) { 264 } catch (Exception e) {
300 log.error(e, e); 265 log.error(e, e);
301 fail(); 266 fail();
302 } finally { 267 } finally {
303 try { 268 try {

http://dive4elements.wald.intevation.org