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