1
0
Fork 0

changed the project test according to the newly introduced join with the db project codes

This commit is contained in:
Miriam Baglioni 2020-05-28 23:53:24 +02:00
parent 782984d8e5
commit 6989fb9c8a
1 changed files with 6 additions and 3 deletions

View File

@ -67,7 +67,7 @@ public class PrepareProjectTest {
} }
@Test @Test
public void numberDistinctProgrammeTest() throws Exception { public void numberDistinctProjectTest() throws Exception {
PrepareProjects PrepareProjects
.main( .main(
new String[] { new String[] {
@ -76,7 +76,10 @@ public class PrepareProjectTest {
"-projectPath", "-projectPath",
getClass().getResource("/eu/dnetlib/dhp/actionmanager/project/projects_subset.json").getPath(), getClass().getResource("/eu/dnetlib/dhp/actionmanager/project/projects_subset.json").getPath(),
"-outputPath", "-outputPath",
workingDir.toString() + "/preparedProjects" workingDir.toString() + "/preparedProjects",
"-dbProjectPath",
getClass().getResource("/eu/dnetlib/dhp/actionmanager/project/dbProject").getPath(),
}); });
final JavaSparkContext sc = new JavaSparkContext(spark.sparkContext()); final JavaSparkContext sc = new JavaSparkContext(spark.sparkContext());
@ -85,7 +88,7 @@ public class PrepareProjectTest {
.textFile(workingDir.toString() + "/preparedProjects") .textFile(workingDir.toString() + "/preparedProjects")
.map(item -> OBJECT_MAPPER.readValue(item, CSVProject.class)); .map(item -> OBJECT_MAPPER.readValue(item, CSVProject.class));
Assertions.assertEquals(20, tmp.count()); Assertions.assertEquals(8, tmp.count());
Dataset<CSVProject> verificationDataset = spark.createDataset(tmp.rdd(), Encoders.bean(CSVProject.class)); Dataset<CSVProject> verificationDataset = spark.createDataset(tmp.rdd(), Encoders.bean(CSVProject.class));