Mercurial > lada > lada-server
comparison src/test/java/de/intevation/lada/importer/TestLAFImporter.java @ 315:79cbc672d8e4
Updates systemproperty keys and testcases.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Wed, 21 Aug 2013 08:58:28 +0200 |
parents | eeb5d3a5e194 |
children | fab1e6c74044 |
comparison
equal
deleted
inserted
replaced
314:9b4d417f1064 | 315:79cbc672d8e4 |
---|---|
31 private String incompleteProbe; | 31 private String incompleteProbe; |
32 | 32 |
33 @Before | 33 @Before |
34 @Ignore | 34 @Ignore |
35 public void loadLafFiles() { | 35 public void loadLafFiles() { |
36 String single = System.getProperty("de_intevation_lada_test_singleprobe"); | 36 String single = System.getProperty("de.intevation.lada.test.singleprobe"); |
37 String incomplete = | 37 String incomplete = |
38 System.getProperty("de_intevation_lada_test_incompleteprobe"); | 38 System.getProperty("de.intevation.lada.test.incompleteprobe"); |
39 try { | 39 try { |
40 byte[] encodedSingle = Files.readAllBytes(Paths.get(single)); | 40 byte[] encodedSingle = Files.readAllBytes(Paths.get(single)); |
41 byte[] encodedIncomplete = | 41 byte[] encodedIncomplete = |
42 Files.readAllBytes(Paths.get(incomplete)); | 42 Files.readAllBytes(Paths.get(incomplete)); |
43 Charset encoding = Charset.defaultCharset(); | 43 Charset encoding = Charset.defaultCharset(); |
50 singleProbe = ""; | 50 singleProbe = ""; |
51 incompleteProbe = ""; | 51 incompleteProbe = ""; |
52 } | 52 } |
53 } | 53 } |
54 | 54 |
55 @Test(expected = IOException.class) | 55 @Test |
56 @Ignore | |
57 public void testConfigFileNotFound() { | 56 public void testConfigFileNotFound() { |
58 LAFFormat format = new LAFFormat(); | 57 LAFFormat format = new LAFFormat(); |
59 boolean success = format.readConfigFile("/file/not/found"); | 58 boolean success = format.readConfigFile("/file/not/found"); |
59 assertEquals(false, success); | |
60 } | 60 } |
61 | 61 |
62 @Test | 62 @Test |
63 @Ignore | |
64 public void testConfigFileLoading() { | 63 public void testConfigFileLoading() { |
65 String fileName = System.getProperty("de_intevation_lada_import"); | 64 String fileName = System.getProperty("de.intevation.lada.import"); |
66 LAFFormat format = new LAFFormat(); | 65 LAFFormat format = new LAFFormat(); |
67 boolean success = format.readConfigFile(fileName); | 66 boolean success = format.readConfigFile(fileName); |
68 assertEquals(true, success); | 67 assertEquals(true, success); |
69 List<EntryFormat> probeFormat = format.getFormat("probe"); | 68 List<EntryFormat> probeFormat = format.getFormat("probe"); |
70 assertNotNull("No probe format available", probeFormat); | 69 assertNotNull("No probe format available", probeFormat); |
84 "Not enough configuration elements for ort.", | 83 "Not enough configuration elements for ort.", |
85 20, | 84 20, |
86 ortFormat.size()); | 85 ortFormat.size()); |
87 } | 86 } |
88 | 87 |
89 @Test(expected = LAFParserException.class) | 88 @Test |
90 @Ignore | |
91 public void testProbeHeaderFail() { | 89 public void testProbeHeaderFail() { |
92 LAFParser parser = new LAFParser(); | 90 LAFParser parser = new LAFParser(); |
93 parser.setDryRun(true); | 91 parser.setDryRun(true); |
94 try { | 92 try { |
95 parser.parse(PROBE_HEADER_FAIL); | 93 boolean success = parser.parse(PROBE_HEADER_FAIL); |
94 assertEquals(false, success); | |
96 } | 95 } |
97 catch (LAFParserException e) { | 96 catch (LAFParserException e) { |
98 assertEquals( | 97 assertEquals( |
99 "Exception cause not expected: " + e.getMessage(), | 98 "Exception cause not expected: " + e.getMessage(), |
100 "No %PROBE% at the begining.", e.getMessage()); | 99 "No %PROBE% at the begining.", e.getMessage()); |
113 e.printStackTrace(); | 112 e.printStackTrace(); |
114 } | 113 } |
115 } | 114 } |
116 | 115 |
117 @Test | 116 @Test |
118 @Ignore | |
119 public void testCompleteParser() { | 117 public void testCompleteParser() { |
120 LAFParser parser = new LAFParser(); | 118 LAFParser parser = new LAFParser(); |
121 //parser.setDryRun(true); | 119 parser.setDryRun(true); |
122 try { | 120 try { |
123 parser.parse(singleProbe); | 121 parser.parse(singleProbe); |
124 } | 122 } |
125 catch (LAFParserException e) { | 123 catch (LAFParserException e) { |
126 e.printStackTrace(); | 124 e.printStackTrace(); |
127 } | 125 } |
128 } | 126 } |
129 | |
130 @Test | |
131 @Ignore | |
132 public void testMessungParser() { | |
133 fail("Not yet implemented"); | |
134 } | |
135 | |
136 @Test | |
137 @Ignore | |
138 public void testOrtParser() { | |
139 fail("Not yet implemented"); | |
140 } | |
141 } | 127 } |