1
|
package test;
|
2
|
|
3
|
import data.DataLoader;
|
4
|
import org.apache.log4j.BasicConfigurator;
|
5
|
import org.apache.log4j.Level;
|
6
|
import org.apache.log4j.Logger;
|
7
|
import org.junit.BeforeClass;
|
8
|
import org.junit.Test;
|
9
|
|
10
|
import static org.junit.Assert.assertEquals;
|
11
|
|
12
|
public class testDataLoader {
|
13
|
|
14
|
private static final Logger log = Logger.getLogger(testJDFCaskodyRecord.class);
|
15
|
private static String[] testRecord;
|
16
|
|
17
|
@BeforeClass
|
18
|
public static void setUpBeforeClass() {
|
19
|
|
20
|
BasicConfigurator.configure();
|
21
|
Logger.getRootLogger().setLevel(Level.INFO);
|
22
|
testRecord = DataLoader.parseLine("\"000004\",\"1\",\"1\",\"34\",\"4\",\"09022018\",\"09082020\",\"\",\"1\"");
|
23
|
}
|
24
|
|
25
|
/*****
|
26
|
* testovací metoda, která zkontroluje spravnost zpracovani
|
27
|
*/
|
28
|
@Test
|
29
|
public void testProcessData(){
|
30
|
|
31
|
assertEquals(0,testRecord[0].compareToIgnoreCase("000004"));
|
32
|
assertEquals(0,testRecord[1].compareToIgnoreCase("1"));
|
33
|
assertEquals(0,testRecord[2].compareToIgnoreCase("1"));
|
34
|
assertEquals(0,testRecord[3].compareToIgnoreCase("34"));
|
35
|
assertEquals(0,testRecord[4].compareToIgnoreCase("4"));
|
36
|
assertEquals(0,testRecord[5].compareToIgnoreCase("09022018"));
|
37
|
assertEquals(0,testRecord[6].compareToIgnoreCase("09082020"));
|
38
|
}
|
39
|
}
|