From 5e9c9fa87cf0825d2445c6ef9cf5442a4417e50c Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Wed, 20 May 2020 10:29:57 +0200 Subject: [PATCH] tests --- .../dhp/actionmanager/project/PrepareProgrammeTest.java | 2 +- .../dhp/actionmanager/project/SparkUpdateProjectTest.java | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/PrepareProgrammeTest.java b/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/PrepareProgrammeTest.java index 50804f75e0..e9755c8584 100644 --- a/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/PrepareProgrammeTest.java +++ b/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/PrepareProgrammeTest.java @@ -73,7 +73,7 @@ public class PrepareProgrammeTest { "-isSparkSessionManaged", Boolean.FALSE.toString(), "-programmePath", - getClass().getResource("/eu/dnetlib/dhp/actionmanager/whole_programme.json").getPath(), + getClass().getResource("/eu/dnetlib/dhp/actionmanager/whole_programme.json.gz").getPath(), "-outputPath", workingDir.toString() + "/preparedProgramme" }); diff --git a/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/SparkUpdateProjectTest.java b/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/SparkUpdateProjectTest.java index d488848429..c41daf2ccb 100644 --- a/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/SparkUpdateProjectTest.java +++ b/dhp-workflows/dhp-aggregation/src/test/java/eu/dnetlib/dhp/actionmanager/project/SparkUpdateProjectTest.java @@ -9,8 +9,6 @@ import org.apache.commons.io.FileUtils; import org.apache.spark.SparkConf; import org.apache.spark.api.java.JavaRDD; import org.apache.spark.api.java.JavaSparkContext; -import org.apache.spark.sql.Dataset; -import org.apache.spark.sql.Encoders; import org.apache.spark.sql.SparkSession; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Assertions; @@ -72,7 +70,7 @@ public class SparkUpdateProjectTest { "-isSparkSessionManaged", Boolean.FALSE.toString(), "-programmePath", - getClass().getResource("/eu/dnetlib/dhp/actionmanager/preparedProgramme_whole.json").getPath(), + getClass().getResource("/eu/dnetlib/dhp/actionmanager/preparedProgramme_whole.json.gz").getPath(), "-projectPath", getClass().getResource("/eu/dnetlib/dhp/actionmanager/projects_subset.json").getPath(), "-outputPath", @@ -85,7 +83,7 @@ public class SparkUpdateProjectTest { .textFile(workingDir.toString() + "/actionSet") .map(item -> OBJECT_MAPPER.readValue(item, Project.class)); - Assertions.assertEquals(14, tmp.count()); + Assertions.assertEquals(16, tmp.count()); // Dataset verificationDataset = spark.createDataset(tmp.rdd(), Encoders.bean(CSVProgramme.class)); //