1
|
package eu.dnetlib.download.plugin;
|
2
|
|
3
|
import eu.dnetlib.data.download.rmi.DownloadPlugin;
|
4
|
import org.junit.Assert;
|
5
|
import org.junit.Ignore;
|
6
|
import org.junit.Test;
|
7
|
import org.springframework.beans.factory.annotation.Autowired;
|
8
|
|
9
|
import java.util.ArrayList;
|
10
|
import java.util.List;
|
11
|
|
12
|
/**
|
13
|
* Created by sandro on 5/15/17.
|
14
|
*/
|
15
|
@Ignore
|
16
|
public class DSpacePDFLinkPluginsTest {
|
17
|
|
18
|
@Autowired
|
19
|
DSpacePDFLinkPlugins dp;
|
20
|
|
21
|
|
22
|
@Test
|
23
|
public void extractUrl(){
|
24
|
final DSpacePDFLinkPlugins plugin = new DSpacePDFLinkPlugins();
|
25
|
final String url = plugin.extractURL("http://dx.doi.org/10.1155/2006/690694"); //https://www.annalsofgeophysics.eu/index.php/annals/article/view/7507");
|
26
|
Assert.assertEquals(url, "http://downloads.hindawi.com/journals/sp/2006/690694.pdf"); //https://www.annalsofgeophysics.eu/index.php/annals/article/download/7507/6808");
|
27
|
}
|
28
|
|
29
|
@Test
|
30
|
public void testURL () {
|
31
|
final DSpacePDFLinkPlugins plugin = new DSpacePDFLinkPlugins();
|
32
|
|
33
|
final String s1 = plugin.extractURL("http://acikerisim.baskent.edu.tr/handle/11727/2340");
|
34
|
Assert.assertEquals(s1, "http://acikerisim.baskent.edu.tr/bitstream/11727/2340/1/10008302.pdf");
|
35
|
}
|
36
|
|
37
|
// @Test
|
38
|
// public void testDOI() {
|
39
|
// final DSpacePDFLinkPlugins plugin = new DSpacePDFLinkPlugins();
|
40
|
//
|
41
|
// final String s1 = plugin.extractURL("http://hdl.handle.net/10017/29866");
|
42
|
// // Assert.assertEquals(s1, "http://acikerisim.baskent.edu.tr/bitstream/11727/2340/1/10008302.pdf");
|
43
|
// System.out.println(s1);
|
44
|
// }
|
45
|
|
46
|
|
47
|
@Test
|
48
|
public void testURLUniTO(){
|
49
|
final DSpacePDFLinkPlugins plugin = new DSpacePDFLinkPlugins();
|
50
|
// List<String> lst = new ArrayList<>();
|
51
|
// lst.add("^http.*pdf$");
|
52
|
// plugin.setRegularExpression(lst);
|
53
|
final String s1 = plugin.extractURL("http://hdl.handle.net/2318/37517");
|
54
|
Assert.assertEquals("https://iris.unito.it/bitstream/2318/37517/1/2002%20JBC%20-%20Integrin-induced%20epidermal%20growth%20factor%20%28EGF%29%20receptor%20activation%20requires%20c-Src%20and%20p130Cas.pdf",s1);
|
55
|
}
|
56
|
|
57
|
@Test
|
58
|
public void downloadTest(){
|
59
|
|
60
|
}
|
61
|
|
62
|
|
63
|
|
64
|
}
|