2018-10-02 10:37:54 +02:00
|
|
|
package eu.dnetlib.pace.config;
|
|
|
|
|
|
|
|
import eu.dnetlib.pace.AbstractPaceTest;
|
|
|
|
import org.junit.Test;
|
|
|
|
|
2018-10-26 14:55:59 +02:00
|
|
|
import static org.junit.Assert.assertEquals;
|
2018-10-02 10:37:54 +02:00
|
|
|
import static org.junit.Assert.assertNotNull;
|
|
|
|
|
|
|
|
public class ConfigTest extends AbstractPaceTest {
|
|
|
|
|
|
|
|
@Test
|
2018-10-29 16:16:11 +01:00
|
|
|
public void dedupConfigSerializationTest() {
|
2019-10-08 15:13:45 +02:00
|
|
|
final DedupConfig cfgFromClasspath = DedupConfig.load(readFromClasspath("org.curr.conf"));
|
2018-10-02 10:37:54 +02:00
|
|
|
|
2018-10-29 16:16:11 +01:00
|
|
|
final String conf = cfgFromClasspath.toString();
|
|
|
|
|
|
|
|
// System.out.println("*****SERIALIZED*****");
|
|
|
|
// System.out.println(conf);
|
|
|
|
// System.out.println("*****FROM CLASSPATH*****");
|
|
|
|
// System.out.println(readFromClasspath("result.pace.conf.json"));
|
|
|
|
|
|
|
|
final DedupConfig cfgFromSerialization = DedupConfig.load(conf);
|
|
|
|
|
|
|
|
assertEquals(cfgFromClasspath.toString(), cfgFromSerialization.toString());
|
|
|
|
|
2018-10-26 14:55:59 +02:00
|
|
|
assertNotNull(cfgFromClasspath);
|
2018-10-29 16:16:11 +01:00
|
|
|
assertNotNull(cfgFromSerialization);
|
2018-10-26 14:55:59 +02:00
|
|
|
|
2018-10-02 10:37:54 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2018-10-29 11:13:55 +01:00
|
|
|
@Test
|
|
|
|
public void dedupConfigTest() {
|
|
|
|
|
2019-04-03 09:40:14 +02:00
|
|
|
DedupConfig load = DedupConfig.load(readFromClasspath("org.curr.conf"));
|
2018-10-29 11:13:55 +01:00
|
|
|
|
|
|
|
System.out.println(load.toString());
|
|
|
|
}
|
|
|
|
|
2019-10-08 15:13:45 +02:00
|
|
|
@Test
|
|
|
|
public void translationMapTest() {
|
|
|
|
|
|
|
|
DedupConfig load = DedupConfig.load(readFromClasspath("org.curr.conf"));
|
|
|
|
|
|
|
|
System.out.println("translationMap = " + load.getPace().translationMap().toString());
|
|
|
|
}
|
|
|
|
|
2018-10-02 10:37:54 +02:00
|
|
|
}
|