code formatting

This commit is contained in:
Claudio Atzori 2022-12-07 10:45:38 +01:00
parent cd1b58483e
commit 1b8488976b
5 changed files with 32 additions and 31 deletions

View File

@ -26,9 +26,9 @@ public class QueryInformationSystem {
+ " return " + " return "
+ " <community> " + " <community> "
+ " { $x//CONFIGURATION/context/@id} " + " { $x//CONFIGURATION/context/@id} "
+ " <advancedConstraints>" + + " <advancedConstraints>" +
"{$x//CONFIGURATION/context/param[./@name='advancedConstraints']/text() }" + "{$x//CONFIGURATION/context/param[./@name='advancedConstraints']/text() }" +
"</advancedConstraints>" "</advancedConstraints>"
+ " <subjects> " + " <subjects> "
+ " {for $y in tokenize($subj,',') " + " {for $y in tokenize($subj,',') "
+ " return " + " return "

View File

@ -9,16 +9,16 @@ import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
import eu.dnetlib.dhp.schema.common.ModelConstants;
import eu.dnetlib.dhp.schema.common.ModelSupport;
import eu.dnetlib.dhp.schema.oaf.utils.OafMapperUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.jayway.jsonpath.DocumentContext; import com.jayway.jsonpath.DocumentContext;
import com.jayway.jsonpath.JsonPath; import com.jayway.jsonpath.JsonPath;
import eu.dnetlib.dhp.schema.common.ModelConstants;
import eu.dnetlib.dhp.schema.common.ModelSupport;
import eu.dnetlib.dhp.schema.oaf.*; import eu.dnetlib.dhp.schema.oaf.*;
import eu.dnetlib.dhp.schema.oaf.utils.OafMapperUtils;
/** Created by miriam on 02/08/2018. */ /** Created by miriam on 02/08/2018. */
public class ResultTagger implements Serializable { public class ResultTagger implements Serializable {

View File

@ -48,7 +48,7 @@ public class BulkTagJobTest {
+ " \"description\" : \"$['description'][*]['value']\", " + " \"description\" : \"$['description'][*]['value']\", "
+ " \"subject\" :\"$['subject'][*]['value']\" , " + + " \"subject\" :\"$['subject'][*]['value']\" , " +
"\"fos\" : \"$['subject'][?(@['qualifier']['classid']=='subject:fos')].value\"} "; "\"fos\" : \"$['subject'][?(@['qualifier']['classid']=='subject:fos')].value\"} ";
private static SparkSession spark; private static SparkSession spark;

View File

@ -86,32 +86,32 @@ class CommunityConfigurationFactoryTest {
@Test @Test
void loadSelCriteriaTest2() throws DocumentException, IOException, SAXException { void loadSelCriteriaTest2() throws DocumentException, IOException, SAXException {
String xml = IOUtils String xml = IOUtils
.toString( .toString(
getClass() getClass()
.getResourceAsStream( .getResourceAsStream(
"/eu/dnetlib/dhp/bulktag/communityconfiguration/community_configuration_selcrit2.xml")); "/eu/dnetlib/dhp/bulktag/communityconfiguration/community_configuration_selcrit2.xml"));
final CommunityConfiguration cc = CommunityConfigurationFactory.newInstance(xml); final CommunityConfiguration cc = CommunityConfigurationFactory.newInstance(xml);
Map<String, List<String>> param = new HashMap<>(); Map<String, List<String>> param = new HashMap<>();
param.put("author", new ArrayList<>(Collections.singletonList("Pippo Pippi"))); param.put("author", new ArrayList<>(Collections.singletonList("Pippo Pippi")));
param param
.put( .put(
"description", "description",
new ArrayList<>( new ArrayList<>(
Collections Collections
.singletonList( .singletonList(
"This work has been partially supported by DARIAH-EU infrastructure"))); "This work has been partially supported by DARIAH-EU infrastructure")));
param param
.put( .put(
"contributor", "contributor",
new ArrayList<>( new ArrayList<>(
Collections Collections
.singletonList( .singletonList(
"Author X helped to write the paper. X works for DARIAH"))); "Author X helped to write the paper. X works for DARIAH")));
List<String> comm = cc List<String> comm = cc
.getCommunityForDatasource( .getCommunityForDatasource(
"openaire____::1cfdb2e14977f31a98e0118283401f32", param); "openaire____::1cfdb2e14977f31a98e0118283401f32", param);
//TODO add more assertions // TODO add more assertions
Assertions.assertEquals(0, comm.size()); Assertions.assertEquals(0, comm.size());
} }

View File

@ -131,37 +131,38 @@ public class IndexRecordTransformerTest {
@Test @Test
public void testForEOSCFutureSoftwareNotebook() throws IOException, TransformerException { public void testForEOSCFutureSoftwareNotebook() throws IOException, TransformerException {
final String record = IOUtils final String record = IOUtils
.toString(getClass().getResourceAsStream("eosc-future/software-justthink.xml")); .toString(getClass().getResourceAsStream("eosc-future/software-justthink.xml"));
testRecordTransformation(record); testRecordTransformation(record);
} }
@Test @Test
public void testForEOSCFutureSoftwareNotebookClaim() throws IOException, TransformerException { public void testForEOSCFutureSoftwareNotebookClaim() throws IOException, TransformerException {
final String record = IOUtils final String record = IOUtils
.toString(getClass().getResourceAsStream("eosc-future/software-justthink-claim.xml")); .toString(getClass().getResourceAsStream("eosc-future/software-justthink-claim.xml"));
testRecordTransformation(record); testRecordTransformation(record);
} }
@Test @Test
public void testForEOSCFutureZenodo7353841() throws IOException, TransformerException { public void testForEOSCFutureZenodo7353841() throws IOException, TransformerException {
final String record = IOUtils final String record = IOUtils
.toString(getClass().getResourceAsStream("eosc-future/zenodo7353841.xml")); .toString(getClass().getResourceAsStream("eosc-future/zenodo7353841.xml"));
testRecordTransformation(record); testRecordTransformation(record);
} }
@Test @Test
public void testForEOSCFutureZenodo7351393() throws IOException, TransformerException { public void testForEOSCFutureZenodo7351393() throws IOException, TransformerException {
final String record = IOUtils final String record = IOUtils
.toString(getClass().getResourceAsStream("eosc-future/zenodo7351393.xml")); .toString(getClass().getResourceAsStream("eosc-future/zenodo7351393.xml"));
testRecordTransformation(record); testRecordTransformation(record);
} }
@Test @Test
public void testForEOSCFutureZenodo7351221() throws IOException, TransformerException { public void testForEOSCFutureZenodo7351221() throws IOException, TransformerException {
final String record = IOUtils final String record = IOUtils
.toString(getClass().getResourceAsStream("eosc-future/zenodo7351221.xml")); .toString(getClass().getResourceAsStream("eosc-future/zenodo7351221.xml"));
testRecordTransformation(record); testRecordTransformation(record);
} }
@Test @Test
void testDoiUrlNormalization() throws MalformedURLException { void testDoiUrlNormalization() throws MalformedURLException {