Revision 61487
Added by Michele Artini over 2 years ago
ProjectTest.java | ||
---|---|---|
8 | 8 |
|
9 | 9 |
import org.junit.Test; |
10 | 10 |
|
11 |
import eu.dnetlib.data.utils.XsltFunctions; |
|
12 |
|
|
11 | 13 |
public class ProjectTest { |
12 | 14 |
|
13 | 15 |
@Test |
14 | 16 |
public void testNewInstanceString_1() { |
15 |
final Project p = Project.newInstance( |
|
16 |
"info:eu-repo/grantAgreement/EC/FP7/231167//Emergent Connectors for Eternal Software Intensive Networked Systems/CONNECT"); |
|
17 |
final String longId = "info:eu-repo/grantAgreement/EC/FP7/231167//Emergent Connectors for Eternal Software Intensive Networked Systems/CONNECT"; |
|
18 |
|
|
19 |
final Project p = Project.newInstance(longId); |
|
17 | 20 |
assertNotNull(p); |
18 | 21 |
assertEquals(p.getFunder(), "EC"); |
19 | 22 |
assertEquals(p.getProgram(), "FP7"); |
... | ... | |
22 | 25 |
assertEquals(p.getName(), "Emergent Connectors for Eternal Software Intensive Networked Systems"); |
23 | 26 |
assertEquals(p.getAcronym(), "CONNECT"); |
24 | 27 |
assertEquals(p.getOpenaireId(), ""); |
28 |
|
|
29 |
assertEquals(longId, XsltFunctions.projectLongId(p.getFunder(), p.getProgram(), p.getCode(), p.getJurisdiction(), p.getName(), p.getAcronym())); |
|
25 | 30 |
} |
26 | 31 |
|
27 | 32 |
@Test |
28 | 33 |
public void testNewInstanceString_2() { |
29 |
final Project p = Project.newInstance( |
|
30 |
"info:eu-repo/grantAgreement/EC/FP7/231167/EU/Emergent Connectors for Eternal Software Intensive Networked Systems/CONNECT"); |
|
34 |
final String longId = "info:eu-repo/grantAgreement/EC/FP7/231167/EU/Emergent Connectors for Eternal Software Intensive Networked Systems/CONNECT"; |
|
35 |
|
|
36 |
final Project p = Project.newInstance(longId); |
|
31 | 37 |
assertNotNull(p); |
32 | 38 |
assertEquals(p.getFunder(), "EC"); |
33 | 39 |
assertEquals(p.getProgram(), "FP7"); |
... | ... | |
36 | 42 |
assertEquals(p.getName(), "Emergent Connectors for Eternal Software Intensive Networked Systems"); |
37 | 43 |
assertEquals(p.getAcronym(), "CONNECT"); |
38 | 44 |
assertEquals(p.getOpenaireId(), ""); |
45 |
|
|
46 |
assertEquals(longId, XsltFunctions.projectLongId(p.getFunder(), p.getProgram(), p.getCode(), p.getJurisdiction(), p.getName(), p.getAcronym())); |
|
39 | 47 |
} |
40 | 48 |
|
41 | 49 |
@Test |
42 | 50 |
public void testNewInstanceString_3() { |
51 |
final String longId = |
|
52 |
"info:eu-repo/grantAgreement/EC/H2020/871793//Adaptive edge%2Fcloud compute and network continuum over a heterogeneous sparse edge infrastructure to support nextgen applications/ACCORDION"; |
|
53 |
|
|
54 |
final Project p = Project.newInstance(longId); |
|
55 |
assertNotNull(p); |
|
56 |
assertEquals(p.getFunder(), "EC"); |
|
57 |
assertEquals(p.getProgram(), "H2020"); |
|
58 |
assertEquals(p.getCode(), "871793"); |
|
59 |
assertEquals(p.getJurisdiction(), ""); |
|
60 |
assertEquals(p.getName(), |
|
61 |
"Adaptive edge/cloud compute and network continuum over a heterogeneous sparse edge infrastructure to support nextgen applications"); |
|
62 |
assertEquals(p.getAcronym(), "ACCORDION"); |
|
63 |
assertEquals(p.getOpenaireId(), ""); |
|
64 |
|
|
65 |
assertEquals(longId, XsltFunctions.projectLongId(p.getFunder(), p.getProgram(), p.getCode(), p.getJurisdiction(), p.getName(), p.getAcronym())); |
|
66 |
} |
|
67 |
|
|
68 |
@Test |
|
69 |
public void testNewInstanceString_4() { |
|
43 | 70 |
final Project p = Project.newInstance( |
44 | 71 |
"info:eu-repo/grantAgreement/EC/FP4/FMBI983160//Algorithms for analysis of cosmic microwave background data from the very small array and the Planck surveyor satellite/"); |
45 | 72 |
System.out.println(p); |
Also available in: Unified diff
project ID with /