Projekt

Obecné

Profil

Stáhnout (1.62 KB) Statistiky
| Větev: | Revize:
1
package test;
2

    
3
import data.DataLoader;
4
import data.JDFCaskodyRecord;
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
    Trida na testovani zpracovaní zaznamu ve tride JDFCaskodyRecord
14
    -issue #7447
15
 */
16
public class testJDFCaskodyRecord {
17
    static JDFCaskodyRecord caskodyRecord;
18
    private static final Logger log = Logger.getLogger(testJDFCaskodyRecord.class);
19
    private static String[] testRecord;
20

    
21
    @BeforeClass
22
    public static void setUpBeforeClass() {
23

    
24
        BasicConfigurator.configure();
25
        Logger.getRootLogger().setLevel(Level.INFO);
26
        testRecord = DataLoader.parseLine("\"000004\",\"1\",\"1\",\"34\",\"4\",\"09022018\",\"09082020\",\"\",\"1\"");
27
    }
28

    
29
    /*****
30
     * testovací metoda, která zkontroluje spravnost zpracovani
31
     */
32
    @Test
33
    public void testProcessData(){
34
        caskodyRecord = new JDFCaskodyRecord(testRecord);
35
        assertEquals(0,caskodyRecord.getNumberLine().compareToIgnoreCase("000004"));
36
        assertEquals(0,caskodyRecord.getNumberJoin().compareToIgnoreCase("1"));
37
        assertEquals(0,caskodyRecord.getNumberTimeCode().compareToIgnoreCase("1"));
38
        assertEquals(0,caskodyRecord.getTimeCode().compareToIgnoreCase("34"));
39
        assertEquals(0,caskodyRecord.getTypeTimeCode().compareToIgnoreCase("4"));
40
        assertEquals(0, caskodyRecord.getStartDate().compareToIgnoreCase("09022018"));
41
        assertEquals(0, caskodyRecord.getEndDate().compareToIgnoreCase("09082020"));
42
    }
43

    
44
}
(3-3/5)