2018-10-02 10:37:54 +02:00
|
|
|
|
2023-07-06 10:28:53 +02:00
|
|
|
package eu.dnetlib.pace;
|
2019-02-08 12:56:47 +01:00
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.StringWriter;
|
|
|
|
import java.util.List;
|
2018-10-02 10:37:54 +02:00
|
|
|
|
2023-07-06 10:28:53 +02:00
|
|
|
import org.apache.commons.io.IOUtils;
|
|
|
|
|
|
|
|
import eu.dnetlib.pace.common.AbstractPaceFunctions;
|
|
|
|
|
2019-11-07 12:47:12 +01:00
|
|
|
public abstract class AbstractPaceTest extends AbstractPaceFunctions {
|
2018-10-02 10:37:54 +02:00
|
|
|
|
|
|
|
protected String readFromClasspath(final String filename) {
|
|
|
|
final StringWriter sw = new StringWriter();
|
|
|
|
try {
|
2023-07-18 11:38:56 +02:00
|
|
|
IOUtils.copy(getClass().getResourceAsStream(filename), sw);
|
2018-10-02 10:37:54 +02:00
|
|
|
return sw.toString();
|
|
|
|
} catch (final IOException e) {
|
|
|
|
throw new RuntimeException("cannot load resource from classpath: " + filename);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-18 11:38:56 +02:00
|
|
|
protected String title(final String s) {
|
|
|
|
return s;
|
2018-10-02 10:37:54 +02:00
|
|
|
}
|
|
|
|
|
2023-07-18 11:38:56 +02:00
|
|
|
protected String person(final String s) {
|
|
|
|
return s;
|
2018-10-02 10:37:54 +02:00
|
|
|
}
|
|
|
|
|
2023-07-18 11:38:56 +02:00
|
|
|
protected String url(final String s) {
|
|
|
|
return s;
|
2018-11-05 17:22:59 +01:00
|
|
|
}
|
|
|
|
|
2023-07-18 11:38:56 +02:00
|
|
|
protected double[] array(final double[] a) {
|
|
|
|
return a;
|
2023-04-17 11:06:27 +02:00
|
|
|
}
|
|
|
|
|
2023-07-18 11:38:56 +02:00
|
|
|
protected List<String> createFieldList(List<String> strings, String fieldName) {
|
|
|
|
return strings;
|
2019-02-08 12:56:47 +01:00
|
|
|
|
|
|
|
}
|
2018-10-02 10:37:54 +02:00
|
|
|
}
|