Project

General

Profile

1
package eu.dnetlib.msro.openaireplus.api;
2

    
3
import java.util.Map;
4
import java.util.Map.Entry;
5

    
6
import org.junit.Test;
7

    
8
import eu.dnetlib.openaire.directindex.api.OpenAIRESubmitterUtils;
9

    
10
/**
11
 * Created by Alessia Bardi on 26/05/2017.
12
 *
13
 * @author Alessia Bardi
14
 */
15
public class OpenAIRESubmitterUtilsTest {
16

    
17
	private OpenAIRESubmitterUtils utils = new OpenAIRESubmitterUtils();
18

    
19
	final String fullProject = "info:eu-repo/grantAgreement/EC/FP7/244909/EU/Making Capabilities Work/WorkAble";
20
	final String minimalProject = "info:eu-repo/grantAgreement/EC/FP7/244909///WorkAble";
21
	final String onlyId = "info:eu-repo/grantAgreement/EC/FP7/244909/";
22
	final String onlyTitle = "info:eu-repo/grantAgreement/EC/FP7/244909/EU/Making Capabilities Work";
23

    
24
	@Test
25
	public void testCalculateProjectInfoFull() {
26
		final Map<String, String> project = utils.calculateProjectInfo(fullProject);
27
		print(project);
28
	}
29

    
30
	@Test
31
	public void testCalculateProjectInfoOnlyId() {
32
		final Map<String, String> project = utils.calculateProjectInfo(onlyId);
33
		print(project);
34
	}
35

    
36
	@Test
37
	public void testCalculateProjectInfoMinimalAcro() {
38
		final Map<String, String> project = utils.calculateProjectInfo(minimalProject);
39
		print(project);
40
	}
41

    
42
	@Test
43
	public void testCalculateProjectInfoOnlyTitle() {
44
		final Map<String, String> project = utils.calculateProjectInfo(onlyTitle);
45
		print(project);
46
	}
47

    
48
	@Test
49
	public void testJerusalem(){
50
		String s = "info:eu-repo/grantAgreement/EC/FP7/337895/EU/Opening Jerusalem Archives: For a connected History of ‘Citadinité’ in the Holy City (1840-1940)/OPEN-JERUSALEM";
51
		final Map<String, String> project = utils.calculateProjectInfo(s);
52
		print(project);
53
	}
54

    
55
	private void print(final Map<String, String> map) {
56
		for (final Entry e : map.entrySet()) {
57
			System.out.println(e.getKey() + " = " + e.getValue());
58
		}
59
	}
60
}
    (1-1/1)