1 |
b8f9ade0
|
Jan Jirman
|
package test;
|
2 |
|
|
|
3 |
27ba3ec6
|
Daniel Stuš
|
import data.DataLoader;
|
4 |
|
|
import data.JDFSpojeRecord;
|
5 |
b8f9ade0
|
Jan Jirman
|
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 |
27ba3ec6
|
Daniel Stuš
|
import static org.junit.Assert.assertEquals;
|
12 |
b8f9ade0
|
Jan Jirman
|
|
13 |
|
|
public class testJDFSpojeRecord {
|
14 |
|
|
|
15 |
17168608
|
Daniel Stuš
|
private static JDFSpojeRecord spojeRecord;
|
16 |
b8f9ade0
|
Jan Jirman
|
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 |
27ba3ec6
|
Daniel Stuš
|
testRecord = DataLoader.parseLine("\"445011\",\"15\",\"2\",\"8\",\"1\",\"14\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"1\";");
|
25 |
b8f9ade0
|
Jan Jirman
|
}
|
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 |
17168608
|
Daniel Stuš
|
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 |
b8f9ade0
|
Jan Jirman
|
}
|
40 |
|
|
|
41 |
|
|
}
|