2019-12-06 13:38:00 +01:00
|
|
|
package eu.dnetlib.dedup;
|
|
|
|
|
2019-12-10 14:57:16 +01:00
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
2019-12-11 15:43:24 +01:00
|
|
|
import eu.dnetlib.dhp.application.ArgumentApplicationParser;
|
2019-12-10 14:57:16 +01:00
|
|
|
import eu.dnetlib.dhp.schema.oaf.Publication;
|
2019-12-06 13:38:00 +01:00
|
|
|
import org.apache.commons.io.FileUtils;
|
|
|
|
import org.apache.commons.io.IOUtils;
|
|
|
|
import org.junit.Before;
|
|
|
|
import org.junit.Ignore;
|
|
|
|
import org.junit.Test;
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.IOException;
|
2019-12-10 14:57:16 +01:00
|
|
|
import java.util.List;
|
2019-12-06 13:38:00 +01:00
|
|
|
|
|
|
|
public class SparkCreateDedupTest {
|
|
|
|
|
2019-12-10 14:57:16 +01:00
|
|
|
String configuration;
|
2019-12-13 12:20:35 +01:00
|
|
|
String entity = "publication";
|
2019-12-06 13:38:00 +01:00
|
|
|
|
|
|
|
@Before
|
|
|
|
public void setUp() throws IOException {
|
2019-12-13 12:20:35 +01:00
|
|
|
configuration = IOUtils.toString(getClass().getResourceAsStream("/eu/dnetlib/dedup/conf/pub_dt.curr.conf.json"));
|
2019-12-06 13:38:00 +01:00
|
|
|
|
2019-12-10 14:57:16 +01:00
|
|
|
}
|
2019-12-06 13:38:00 +01:00
|
|
|
|
|
|
|
@Test
|
|
|
|
@Ignore
|
2019-12-10 14:57:16 +01:00
|
|
|
public void createSimRelsTest() throws Exception {
|
2019-12-06 13:38:00 +01:00
|
|
|
SparkCreateSimRels.main(new String[] {
|
|
|
|
"-mt", "local[*]",
|
2019-12-11 15:43:24 +01:00
|
|
|
"-s", "/home/sandro/betadump",
|
2019-12-11 16:57:37 +01:00
|
|
|
"-e", entity,
|
2019-12-11 15:43:24 +01:00
|
|
|
"-c", ArgumentApplicationParser.compressArgument(configuration),
|
2019-12-06 13:38:00 +01:00
|
|
|
"-t", "/tmp/dedup",
|
|
|
|
});
|
2019-12-10 14:57:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Ignore
|
|
|
|
public void createCCTest() throws Exception {
|
2019-12-06 13:38:00 +01:00
|
|
|
|
|
|
|
SparkCreateConnectedComponent.main(new String[] {
|
|
|
|
"-mt", "local[*]",
|
2019-12-11 15:43:24 +01:00
|
|
|
"-s", "/home/sandro/betadump",
|
2019-12-11 16:57:37 +01:00
|
|
|
"-e", entity,
|
2019-12-11 15:43:24 +01:00
|
|
|
"-c", ArgumentApplicationParser.compressArgument(configuration),
|
2019-12-06 13:38:00 +01:00
|
|
|
"-t", "/tmp/dedup",
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Ignore
|
|
|
|
public void dedupRecordTest() throws Exception {
|
|
|
|
SparkCreateDedupRecord.main(new String[] {
|
|
|
|
"-mt", "local[*]",
|
2019-12-11 15:43:24 +01:00
|
|
|
"-s", "/home/sandro/betadump",
|
2019-12-11 16:57:37 +01:00
|
|
|
"-e", entity,
|
2019-12-11 15:43:24 +01:00
|
|
|
"-c", ArgumentApplicationParser.compressArgument(configuration),
|
|
|
|
"-d", "/tmp/dedup",
|
2019-12-06 13:38:00 +01:00
|
|
|
});
|
|
|
|
}
|
2019-12-11 15:43:24 +01:00
|
|
|
|
|
|
|
@Test
|
|
|
|
public void printCC() throws Exception {
|
|
|
|
System.out.println(ArgumentApplicationParser.compressArgument(configuration));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-12-06 13:38:00 +01:00
|
|
|
}
|