From 4d0d9de07e8eb44ec2f32a50fddfeea1168bda8b Mon Sep 17 00:00:00 2001 From: sandro Date: Mon, 20 Apr 2020 10:02:42 +0200 Subject: [PATCH] reorganized package and fixed test --- dhp-workflows/dhp-doiboost/pom.xml | 31 +++++++++++++++++++ .../orcid}/OrcidDSManager.java | 3 +- .../orcid}/SummariesDecompressor.java | 9 +++--- .../orcid}/json/JsonWriter.java | 4 +-- .../orcid}/model/AuthorData.java | 2 +- .../orcid}/xml/XMLRecordParser.java | 5 ++- .../eu/dnetlib/doiboost/DoiBoostTest.java | 2 +- 7 files changed, 42 insertions(+), 14 deletions(-) rename dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/{orciddsmanager => doiboost/orcid}/OrcidDSManager.java (97%) rename dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/{orciddsmanager => doiboost/orcid}/SummariesDecompressor.java (96%) rename dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/{orciddsmanager => doiboost/orcid}/json/JsonWriter.java (83%) rename dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/{orciddsmanager => doiboost/orcid}/model/AuthorData.java (94%) rename dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/{orciddsmanager => doiboost/orcid}/xml/XMLRecordParser.java (97%) diff --git a/dhp-workflows/dhp-doiboost/pom.xml b/dhp-workflows/dhp-doiboost/pom.xml index e37bf370b..06f57de6b 100644 --- a/dhp-workflows/dhp-doiboost/pom.xml +++ b/dhp-workflows/dhp-doiboost/pom.xml @@ -10,6 +10,37 @@ dhp-doiboost + + + + net.alchim31.maven + scala-maven-plugin + 4.0.1 + + + scala-compile-first + initialize + + add-source + compile + + + + scala-test-compile + process-test-resources + + testCompile + + + + + ${scala.version} + + + + + + org.apache.hadoop diff --git a/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/orciddsmanager/OrcidDSManager.java b/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/orcid/OrcidDSManager.java similarity index 97% rename from dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/orciddsmanager/OrcidDSManager.java rename to dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/orcid/OrcidDSManager.java index c5b8f2782..9bc89926d 100644 --- a/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/orciddsmanager/OrcidDSManager.java +++ b/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/orcid/OrcidDSManager.java @@ -1,4 +1,4 @@ -package eu.dnetlib.orciddsmanager; +package eu.dnetlib.doiboost.orcid; import java.io.FileNotFoundException; import java.io.IOException; @@ -6,7 +6,6 @@ import java.net.URI; import java.util.Properties; import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.fs.FSDataInputStream; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.log4j.Logger; diff --git a/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/orciddsmanager/SummariesDecompressor.java b/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/orcid/SummariesDecompressor.java similarity index 96% rename from dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/orciddsmanager/SummariesDecompressor.java rename to dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/orcid/SummariesDecompressor.java index 7b537b2ba..d8eb49013 100644 --- a/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/orciddsmanager/SummariesDecompressor.java +++ b/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/orcid/SummariesDecompressor.java @@ -1,5 +1,8 @@ -package eu.dnetlib.orciddsmanager; +package eu.dnetlib.doiboost.orcid; +import eu.dnetlib.doiboost.orcid.json.JsonWriter; +import eu.dnetlib.doiboost.orcid.model.AuthorData; +import eu.dnetlib.doiboost.orcid.xml.XMLRecordParser; import org.apache.commons.compress.archivers.tar.TarArchiveEntry; import org.apache.commons.compress.archivers.tar.TarArchiveInputStream; import org.apache.hadoop.conf.Configuration; @@ -13,10 +16,6 @@ import org.apache.hadoop.io.compress.CompressionCodecFactory; import org.apache.log4j.Logger; import org.xml.sax.SAXException; -import eu.dnetlib.orciddsmanager.json.JsonWriter; -import eu.dnetlib.orciddsmanager.model.AuthorData; -import eu.dnetlib.orciddsmanager.xml.XMLRecordParser; - import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.IOException; diff --git a/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/orciddsmanager/json/JsonWriter.java b/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/orcid/json/JsonWriter.java similarity index 83% rename from dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/orciddsmanager/json/JsonWriter.java rename to dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/orcid/json/JsonWriter.java index 4263e355c..7e795c1a0 100644 --- a/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/orciddsmanager/json/JsonWriter.java +++ b/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/orcid/json/JsonWriter.java @@ -1,8 +1,8 @@ -package eu.dnetlib.orciddsmanager.json; +package eu.dnetlib.doiboost.orcid.json; import com.google.gson.JsonObject; -import eu.dnetlib.orciddsmanager.model.AuthorData; +import eu.dnetlib.doiboost.orcid.model.AuthorData; public class JsonWriter { diff --git a/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/orciddsmanager/model/AuthorData.java b/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/orcid/model/AuthorData.java similarity index 94% rename from dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/orciddsmanager/model/AuthorData.java rename to dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/orcid/model/AuthorData.java index 65ac3ac6e..66997a57e 100644 --- a/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/orciddsmanager/model/AuthorData.java +++ b/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/orcid/model/AuthorData.java @@ -1,4 +1,4 @@ -package eu.dnetlib.orciddsmanager.model; +package eu.dnetlib.doiboost.orcid.model; public class AuthorData { diff --git a/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/orciddsmanager/xml/XMLRecordParser.java b/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/orcid/xml/XMLRecordParser.java similarity index 97% rename from dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/orciddsmanager/xml/XMLRecordParser.java rename to dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/orcid/xml/XMLRecordParser.java index bef37e08c..54be2f316 100644 --- a/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/orciddsmanager/xml/XMLRecordParser.java +++ b/dhp-workflows/dhp-doiboost/src/main/java/eu/dnetlib/doiboost/orcid/xml/XMLRecordParser.java @@ -1,4 +1,4 @@ -package eu.dnetlib.orciddsmanager.xml; +package eu.dnetlib.doiboost.orcid.xml; import java.io.ByteArrayInputStream; import java.io.IOException; @@ -13,12 +13,11 @@ import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory; +import eu.dnetlib.doiboost.orcid.model.AuthorData; import org.apache.commons.lang.StringUtils; import org.w3c.dom.Document; import org.xml.sax.SAXException; -import eu.dnetlib.orciddsmanager.model.AuthorData; - public class XMLRecordParser { diff --git a/dhp-workflows/dhp-doiboost/src/test/java/eu/dnetlib/doiboost/DoiBoostTest.java b/dhp-workflows/dhp-doiboost/src/test/java/eu/dnetlib/doiboost/DoiBoostTest.java index 774fbd7b8..9041d4488 100644 --- a/dhp-workflows/dhp-doiboost/src/test/java/eu/dnetlib/doiboost/DoiBoostTest.java +++ b/dhp-workflows/dhp-doiboost/src/test/java/eu/dnetlib/doiboost/DoiBoostTest.java @@ -21,7 +21,7 @@ public class DoiBoostTest { Logger logger = LoggerFactory.getLogger(DoiBoostTest.class); - @Test + public void test() throws Exception { //SparkDownloadContentFromCrossref.main(null);