Project

General

Profile

1
package eu.dnetlib.data.claims.migration.parser;
2

    
3
import eu.dnetlib.data.claimsDemo.ContextUtils;
4
import org.junit.Assert;
5
import org.junit.Test;
6

    
7
/**
8
 * Created by argirok on 29/5/2018.
9
 */
10
public class ContextUtilsTest {
11

    
12
    @Test
13
    public void dmf2ContextTest() throws Exception {
14

    
15
        String id= "egi::country::gr";
16

    
17
        Assert.assertEquals("EGI Federation> EGI Countries> Greece", ContextUtils.extractLabel(id, false));
18
        id= "egi";
19
        Assert.assertEquals("EGI Federation", ContextUtils.extractLabel(id, false));
20
        id="egi::classification";
21
        Assert.assertEquals("EGI Federation> EGI classification scheme", ContextUtils.extractLabel(id, false));
22
        id="egi::classification::natsc";
23
        Assert.assertEquals("EGI Federation> EGI classification scheme> Natural Sciences", ContextUtils.extractLabel(id, false));
24
        id="egi::classification::natsc::math";
25
        Assert.assertEquals("EGI Federation> EGI classification scheme> Mathematics", ContextUtils.extractLabel(id, false));
26
        id="egi::classification::natsc::math::applied";
27
        Assert.assertEquals("EGI Federation> EGI classification scheme> Applied Mathematics", ContextUtils.extractLabel(id, false));
28
        id="egi::classification::natsc::math::applied";
29
        Assert.assertEquals("EGI Federation> EGI classification scheme> Applied Mathematics", ContextUtils.extractLabel(id, false));
30
        id="aginfra::projects";
31
        Assert.assertEquals("AGINFRA> AGINFRA+ Projects", ContextUtils.extractLabel(id, false));
32
        id="aginfra::projects::10";
33
        Assert.assertEquals("AGINFRA> AGINFRA+ Projects> Integrated and innovative key actions for mycotoxin management in the food and feed chain", ContextUtils.extractLabel(id, false));
34

    
35
/*
36

    
37
0
38
id	"aginfra::projects"
39
label	"AGINFRA+ Projects"
40
1
41
id	"aginfra::subcommunity"
42
label	"AGINFRA+ communities"
43
0
44
id	"aginfra::projects::1"
45
label	"European Foodbusiness Transfer Laboratory for stimulating entrepreneurial skills, for fostering innovation and for business creation in the Food Sector"
46
concepts
47
 */
48
    }
49
}
(1-1/5)