2020-05-11 09:38:27 +02:00
|
|
|
package eu.dnetlib.doiboost.mag
|
|
|
|
|
|
|
|
import org.codehaus.jackson.map.ObjectMapper
|
|
|
|
import org.junit.jupiter.api.Test
|
|
|
|
import org.slf4j.{Logger, LoggerFactory}
|
2020-05-13 10:38:04 +02:00
|
|
|
import org.junit.jupiter.api.Assertions._
|
|
|
|
import scala.io.Source
|
2020-05-11 09:38:27 +02:00
|
|
|
|
|
|
|
|
|
|
|
class MAGMappingTest {
|
|
|
|
|
|
|
|
val logger: Logger = LoggerFactory.getLogger(getClass)
|
|
|
|
val mapper = new ObjectMapper()
|
|
|
|
|
|
|
|
|
2020-05-11 14:35:14 +02:00
|
|
|
//@Test
|
2020-05-11 09:38:27 +02:00
|
|
|
def testMAGCSV(): Unit = {
|
2020-05-13 10:38:04 +02:00
|
|
|
SparkPreProcessMAG.main("-m local[*] -s /data/doiboost/mag/datasets -t /data/doiboost/mag/datasets/preprocess".split(" "))
|
|
|
|
}
|
|
|
|
|
2020-05-11 09:38:27 +02:00
|
|
|
|
2020-05-13 10:38:04 +02:00
|
|
|
@Test
|
|
|
|
def buildInvertedIndexTest() :Unit = {
|
|
|
|
val json_input = Source.fromInputStream(getClass.getResourceAsStream("invertedIndex.json")).mkString
|
|
|
|
val description = ConversionUtil.convertInvertedIndexString(json_input)
|
|
|
|
assertNotNull(description)
|
|
|
|
assertTrue(description.nonEmpty)
|
2020-05-11 09:38:27 +02:00
|
|
|
|
2020-05-13 10:38:04 +02:00
|
|
|
logger.debug(description)
|
2020-05-11 09:38:27 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|