Project

General

Profile

1
import java.util.Calendar;
2

    
3
import org.junit.BeforeClass;
4
import org.junit.Test;
5

    
6
import eu.dnetlib.data.utility.resource_discovery.crawler.Crawler;
7
import eu.dnetlib.data.utility.resource_discovery.crawler.ResourceExtractor;
8
import eu.dnetlib.data.utility.resource_discovery.plugin.crawler.ResourceDiscoverer;
9

    
10

    
11
public class TestResourceDiscoverer {
12

    
13
	@BeforeClass
14
	public static void Config() {
15
		//BasicConfigurator.configure();
16
	}
17
	
18
	@Test
19
	public void test() throws Exception {
20
		String url = "http://elib.uni-stuttgart.de/opus/volltexte/1999/1/";
21
		Calendar cal = Calendar.getInstance();
22
		System.out.println(cal.getTime());
23
		ResourceDiscoverer discoverer = new ResourceDiscoverer();
24
		System.out.println(discoverer.getResources(url));
25
		cal = Calendar.getInstance();
26
		System.out.println(cal.getTime());
27
		Crawler crawler = new Crawler();
28
		ResourceExtractor extractor = new ResourceExtractor();
29
		System.out.println(extractor.extractResource(crawler.getLinks(url)));
30
		cal = Calendar.getInstance();
31
		System.out.println(cal.getTime());
32
	}
33
}
(5-5/14)