2022-01-04 11:26:56 +01:00
|
|
|
|
|
|
|
package eu.dnetlib.dhp.oa.graph.raw;
|
|
|
|
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertFalse;
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
import org.apache.commons.io.IOUtils;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
|
|
|
|
public class CopyHdfsOafSparkApplicationTest {
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void testIsOafType() throws IOException {
|
|
|
|
assertTrue(
|
|
|
|
CopyHdfsOafSparkApplication
|
|
|
|
.isOafType(
|
|
|
|
IOUtils
|
|
|
|
.toString(
|
|
|
|
getClass().getResourceAsStream("/eu/dnetlib/dhp/oa/graph/raw/publication_1.json")),
|
|
|
|
"publication"));
|
|
|
|
assertTrue(
|
|
|
|
CopyHdfsOafSparkApplication
|
|
|
|
.isOafType(
|
|
|
|
IOUtils
|
|
|
|
.toString(
|
|
|
|
getClass().getResourceAsStream("/eu/dnetlib/dhp/oa/graph/raw/dataset_1.json")),
|
|
|
|
"dataset"));
|
|
|
|
assertTrue(
|
|
|
|
CopyHdfsOafSparkApplication
|
|
|
|
.isOafType(
|
|
|
|
IOUtils
|
|
|
|
.toString(
|
|
|
|
getClass().getResourceAsStream("/eu/dnetlib/dhp/oa/graph/raw/relation_1.json")),
|
|
|
|
"relation"));
|
|
|
|
|
|
|
|
assertFalse(
|
|
|
|
CopyHdfsOafSparkApplication
|
|
|
|
.isOafType(
|
|
|
|
IOUtils
|
|
|
|
.toString(
|
|
|
|
getClass().getResourceAsStream("/eu/dnetlib/dhp/oa/graph/raw/publication_1.json")),
|
|
|
|
"dataset"));
|
|
|
|
assertFalse(
|
|
|
|
CopyHdfsOafSparkApplication
|
|
|
|
.isOafType(
|
|
|
|
IOUtils
|
|
|
|
.toString(
|
|
|
|
getClass().getResourceAsStream("/eu/dnetlib/dhp/oa/graph/raw/dataset_1.json")),
|
|
|
|
"publication"));
|
|
|
|
|
|
|
|
assertTrue(
|
|
|
|
CopyHdfsOafSparkApplication
|
|
|
|
.isOafType(
|
|
|
|
IOUtils
|
|
|
|
.toString(
|
|
|
|
getClass()
|
|
|
|
.getResourceAsStream(
|
|
|
|
"/eu/dnetlib/dhp/oa/graph/raw/publication_2_unknownProperty.json")),
|
|
|
|
"publication"));
|
2024-02-07 17:02:05 +01:00
|
|
|
}
|
2022-01-04 11:26:56 +01:00
|
|
|
|
2024-02-07 17:02:05 +01:00
|
|
|
@Test
|
|
|
|
void isOafType_Datacite_ORP() throws IOException {
|
|
|
|
assertTrue(
|
2024-04-19 17:06:41 +02:00
|
|
|
CopyHdfsOafSparkApplication
|
|
|
|
.isOafType(
|
|
|
|
IOUtils
|
|
|
|
.toString(
|
|
|
|
getClass()
|
|
|
|
.getResourceAsStream(
|
|
|
|
"/eu/dnetlib/dhp/oa/graph/raw/datacite_orp.json")),
|
|
|
|
"otherresearchproduct"));
|
2022-01-04 11:26:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|