Mercurial > lada > lada-server
comparison src/test/java/de/intevation/lada/ImporterTest.java @ 311:eeb5d3a5e194
JUnit test cases and small test application for LAF importer.
!! Currently the tests are ignored when running with maven.
!! Some system properties are still missing in maven (coming soon ;))
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Tue, 20 Aug 2013 16:19:20 +0200 |
parents | |
children | 9b4d417f1064 |
comparison
equal
deleted
inserted
replaced
310:821557a17e5e | 311:eeb5d3a5e194 |
---|---|
1 package de.intevation.lada; | |
2 | |
3 import java.util.ArrayList; | |
4 import java.util.List; | |
5 | |
6 import org.junit.Ignore; | |
7 | |
8 import de.intevation.lada.auth.AuthenticationResponse; | |
9 import de.intevation.lada.importer.TestLAFImporter; | |
10 | |
11 | |
12 @Ignore | |
13 public class ImporterTest | |
14 { | |
15 @Ignore | |
16 public static void main(String[] args) { | |
17 System.setProperty( | |
18 "de_intevation_lada_test_singleprobe", | |
19 "/home/rrenkert/single.laf"); | |
20 System.setProperty( | |
21 "de_intevation_lada_test_incompleteprobe", | |
22 "/home/rrenkert/incomplete.laf"); | |
23 System.setProperty( | |
24 "de_intevation_lada_import", | |
25 "/opt/lada/config/import.json"); | |
26 System.out.println("ImporterTest started."); | |
27 TestLAFImporter test = new TestLAFImporter(); | |
28 test.loadLafFiles(); | |
29 | |
30 System.out.print("Testing config file not found: "); | |
31 test.testConfigFileNotFound(); | |
32 System.out.print("success.\n"); | |
33 | |
34 System.out.print("Testing config file: "); | |
35 test.testConfigFileLoading(); | |
36 System.out.print("success.\n"); | |
37 | |
38 System.out.print("Testing Parser:\n 1. Wrong header: "); | |
39 test.testProbeHeaderFail(); | |
40 System.out.print("success.\n 2. Complete probe: "); | |
41 test.testCompleteParser(); | |
42 System.out.print("success.\n"); | |
43 | |
44 //Prepare simulated authorization. | |
45 List<String> netzbetreiber = new ArrayList<String>(); | |
46 netzbetreiber.add("0611"); | |
47 List<String> mst = new ArrayList<String>(); | |
48 mst.add("06110"); | |
49 mst.add("06112"); | |
50 AuthenticationResponse auth = new AuthenticationResponse(); | |
51 auth.setUser("testeins"); | |
52 auth.setNetzbetreiber(netzbetreiber); | |
53 auth.setMst(mst); | |
54 auth.setNetzbetreiber(netzbetreiber); | |
55 | |
56 | |
57 System.out.println("end."); | |
58 return; | |
59 } | |
60 } |