Project

General

Profile

« Previous | Next » 

Revision 50380

new tests for added methods in WDSUtils

View differences:

modules/dnet-wds-domain/trunk/src/test/java/eu/dnetlib/wds/utils/WDSUtilsTest.java
29 29

  
30 30

  
31 31
    }
32

  
33
    @Test
34
    public void testPID(){
35
        final String pid = "http://doi.org/10.3886/ICPSR09700.v1";
36
        String obtained_pid = WDSUtils.getDOI(pid);
37
        assert obtained_pid != "";
38
        assertEquals(obtained_pid,"10.3886/ICPSR09700.v1");
39
    }
40

  
41
    @Test
42
    public void testDate(){
43
        String pid = "1995";
44
        boolean date = WDSUtils.isDate(pid);
45
        assertEquals(date,true);
46

  
47
        pid = "2015-23";
48
        date = WDSUtils.isDate(pid);
49
        assertEquals(date,true);
50

  
51
        pid = "2015-23--2015-23";
52
        date = WDSUtils.isDate(pid);
53
        assertEquals(date,true);
54

  
55
        pid = "2015--2017";
56
        date = WDSUtils.isDate(pid);
57
        assertEquals(date,true);
58
    }
32 59
}

Also available in: Unified diff