1
|
package eu.dnetlib.resolver;
|
2
|
|
3
|
import eu.dnetlib.dli.resolver.DataciteResolver;
|
4
|
import eu.dnetlib.dli.resolver.NCBINParser;
|
5
|
import eu.dnetlib.dli.resolver.NCBINResolver;
|
6
|
import java.net.URI;
|
7
|
|
8
|
import org.apache.commons.io.IOUtils;
|
9
|
import org.apache.commons.logging.Log;
|
10
|
import org.apache.commons.logging.LogFactory;
|
11
|
import org.junit.Test;
|
12
|
|
13
|
import java.io.IOException;
|
14
|
import java.io.InputStream;
|
15
|
import java.net.URISyntaxException;
|
16
|
|
17
|
/**
|
18
|
* Created by sandro on 9/8/16.
|
19
|
*/
|
20
|
|
21
|
public class DLIResolverTest extends DLIAbstractTest {
|
22
|
|
23
|
private static final Log log = LogFactory.getLog(DLIResolverTest.class);
|
24
|
|
25
|
|
26
|
@Test
|
27
|
public void TestNCBIResolver() throws IOException, URISyntaxException {
|
28
|
InputStream s = this.getClass().getResourceAsStream("/eu/dnetlib/dli/parser/ncbi-p.xml");
|
29
|
|
30
|
URI url = new URI("https://www.ncbi.nlm.nih.gov/sviewer/viewer.fcgi?db=nuccore&val=aeb32453&page_size=5&fmt_mask=0&report=gbx&retmode=text&page=1&page_size=1");
|
31
|
|
32
|
|
33
|
NCBINParser parser = new NCBINParser();
|
34
|
|
35
|
System.out.println(IOUtils.toString(url));
|
36
|
|
37
|
System.out.println(parser.parseRecord(IOUtils.toString(url)));
|
38
|
}
|
39
|
|
40
|
@Test
|
41
|
public void testDataciteResolver() {
|
42
|
DataciteResolver resolver = new DataciteResolver();
|
43
|
System.out.println(resolver.resolve("10.5438/0012", "doi"));
|
44
|
|
45
|
|
46
|
|
47
|
}
|
48
|
|
49
|
}
|
50
|
|