- Update dependencies.

- Optimize imports.
This commit is contained in:
Lampros Smyrnaios 2023-03-17 17:37:23 +02:00
parent fcd183d354
commit 1ece17e0a7
23 changed files with 23 additions and 52 deletions

12
pom.xml
View File

@ -17,25 +17,25 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
<version>2.11.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>29.0-jre</version>
<version>31.1-jre</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.13.3</version>
<version>2.20.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.13.3</version>
<version>2.20.0</version>
<scope>test</scope>
</dependency>
<dependency>
@ -50,7 +50,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<version>3.11.0</version>
<configuration>
<!-- or whatever version you use -->
<source>1.8</source>
@ -60,7 +60,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<version>3.3.2</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>

View File

@ -3,9 +3,7 @@ package eu.dnetlib.validator2.engine;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;
import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import java.util.stream.Stream;

View File

@ -5,7 +5,6 @@ import eu.dnetlib.validator2.engine.RuleContext;
import eu.dnetlib.validator2.engine.RuleEvaluationException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.w3c.dom.NodeList;
import java.util.function.Predicate;

View File

@ -9,7 +9,6 @@ import org.w3c.dom.NodeList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Function;
import java.util.function.Predicate;
class StandardNodeListActionProperty extends StandardRuleProperty implements NodeListActionProperty {

View File

@ -5,8 +5,6 @@ import eu.dnetlib.validator2.engine.contexts.XPathExpressionProperty;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import javax.xml.xpath.XPathExpression;
public class StandardXPathExpressionProperty extends StandardRuleProperty implements XPathExpressionProperty {
public StandardXPathExpressionProperty(String name) {

View File

@ -1,6 +1,5 @@
package eu.dnetlib.validator2.engine.builtins;
import eu.dnetlib.validator2.engine.RuleEvaluationException;
import eu.dnetlib.validator2.engine.contexts.TermsProperty;
import eu.dnetlib.validator2.engine.contexts.XMLCrisClassSchemeContextWithVocabulary;
import org.w3c.dom.NodeList;

View File

@ -1,10 +1,7 @@
package eu.dnetlib.validator2.engine.builtins;
import eu.dnetlib.validator2.engine.Helper;
import eu.dnetlib.validator2.engine.Rule;
import eu.dnetlib.validator2.engine.RuleEvaluationException;
import eu.dnetlib.validator2.engine.contexts.XMLContext;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import java.util.Map;

View File

@ -1,9 +1,7 @@
package eu.dnetlib.validator2.engine.builtins;
import eu.dnetlib.validator2.engine.RuleEvaluationException;
import eu.dnetlib.validator2.engine.contexts.RegularExpressionProperty;
import eu.dnetlib.validator2.engine.contexts.XMLContextWithRegularExpression;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import java.util.Map;

View File

@ -2,7 +2,6 @@ package eu.dnetlib.validator2.engine.contexts;
import eu.dnetlib.validator2.engine.Helper;
import eu.dnetlib.validator2.engine.RuleContext;
import eu.dnetlib.validator2.engine.RuleProperty;
import java.util.function.Predicate;

View File

@ -4,8 +4,6 @@ import eu.dnetlib.validator2.engine.RuleProperty;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import javax.xml.xpath.XPathExpressionException;
public interface XPathExpressionProperty extends RuleProperty {
NodeList evaluate(Document doc);

View File

@ -1,17 +1,10 @@
package eu.dnetlib.validator2.validation;
import eu.dnetlib.validator2.engine.Rule;
import eu.dnetlib.validator2.engine.Status;
import eu.dnetlib.validator2.engine.builtins.XMLCardinalityRule;
import eu.dnetlib.validator2.validation.guideline.ElementSpec;
import eu.dnetlib.validator2.validation.guideline.Guideline;
import eu.dnetlib.validator2.validation.guideline.SyntheticGuideline;
import org.w3c.dom.Document;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
/**
* An application-specific collection of guidelines

View File

@ -15,7 +15,6 @@ import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import javax.xml.xpath.XPathExpression;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Function;

View File

@ -1,7 +1,6 @@
package eu.dnetlib.validator2.validation.guideline;
import eu.dnetlib.validator2.engine.*;
import eu.dnetlib.validator2.engine.Helper;
import eu.dnetlib.validator2.engine.builtins.StandardRuleDiagnostics;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;

View File

@ -2,7 +2,6 @@ package eu.dnetlib.validator2.validation.guideline;
import eu.dnetlib.validator2.engine.Status;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

View File

@ -3,19 +3,19 @@ package eu.dnetlib.validator2.validation.guideline.openaire;
import eu.dnetlib.validator2.engine.Helper;
import eu.dnetlib.validator2.engine.Rule;
import eu.dnetlib.validator2.engine.Status;
import eu.dnetlib.validator2.engine.builtins.*;
import eu.dnetlib.validator2.engine.builtins.StandardXMLContext;
import eu.dnetlib.validator2.engine.builtins.XMLCardinalityRule;
import eu.dnetlib.validator2.engine.builtins.XMLRule;
import eu.dnetlib.validator2.validation.StandardValidationResult;
import eu.dnetlib.validator2.validation.XMLApplicationProfile;
import eu.dnetlib.validator2.validation.guideline.ElementSpec;
import eu.dnetlib.validator2.validation.guideline.Guideline;
import eu.dnetlib.validator2.validation.guideline.SyntheticGuideline;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
public abstract class AbstractOpenAireProfile implements XMLApplicationProfile {

View File

@ -2,11 +2,7 @@ package eu.dnetlib.validator2.validation.guideline.openaire;
import eu.dnetlib.validator2.engine.Rule;
import eu.dnetlib.validator2.engine.builtins.XMLCardinalityRule;
import eu.dnetlib.validator2.validation.guideline.Builders;
import eu.dnetlib.validator2.validation.guideline.ElementPosition;
import eu.dnetlib.validator2.validation.guideline.ElementSpec;
import eu.dnetlib.validator2.validation.guideline.Guideline;
import eu.dnetlib.validator2.validation.guideline.SyntheticGuideline;
import eu.dnetlib.validator2.validation.guideline.*;
import eu.dnetlib.validator2.validation.utils.ISO639ValuePredicate;
import eu.dnetlib.validator2.validation.utils.RegexValuePredicate;
import org.w3c.dom.Document;
@ -14,8 +10,10 @@ import org.w3c.dom.Document;
import java.util.*;
import java.util.stream.Collectors;
import static eu.dnetlib.validator2.validation.guideline.Cardinality.*;
import static eu.dnetlib.validator2.validation.utils.SupportedRegExs.*;
import static eu.dnetlib.validator2.validation.guideline.Cardinality.ONE;
import static eu.dnetlib.validator2.validation.guideline.Cardinality.ONE_TO_N;
import static eu.dnetlib.validator2.validation.utils.SupportedRegExs.COMPILED_ISO_8601_DATE_REG_EX;
import static eu.dnetlib.validator2.validation.utils.SupportedRegExs.COMPILED_YEAR_YYYY_REG_EX;
public class DataArchiveGuidelinesV2Profile extends AbstractOpenAireProfile {

View File

@ -4,7 +4,6 @@ import eu.dnetlib.validator2.validation.guideline.Builders;
import eu.dnetlib.validator2.validation.guideline.ElementSpec;
import eu.dnetlib.validator2.validation.guideline.Guideline;
import eu.dnetlib.validator2.validation.guideline.SyntheticGuideline;
//import eu.dnetlib.validator2.validation.utils.PIDCheckValuePredicate;
import org.w3c.dom.Document;
import java.util.*;

View File

@ -1,16 +1,17 @@
package eu.dnetlib.validator2.validation.guideline.openaire;
//import com.google.gson.Gson;
import eu.dnetlib.validator2.engine.Status;
import eu.dnetlib.validator2.validation.XMLApplicationProfile;
import eu.dnetlib.validator2.validation.guideline.*;
//import eu.dnetlib.validator2.validation.utils.PIDCheckValuePredicate;
import org.w3c.dom.Document;
import java.util.*;
import java.util.stream.Collectors;
import static eu.dnetlib.validator2.validation.guideline.Cardinality.*;
import static eu.dnetlib.validator2.validation.guideline.Cardinality.ONE;
import static eu.dnetlib.validator2.validation.guideline.Cardinality.ONE_TO_N;
public final class FAIR_Data_GuidelinesProfile extends AbstractOpenAireProfile {

View File

@ -8,8 +8,6 @@ import org.w3c.dom.Document;
import java.util.Collection;
import static eu.dnetlib.validator2.validation.utils.SupportedRegExs.COMPILED_YYYY_MM_DD_REGEX;
public class CrisEventV111Profile extends AbstractCrisProfile {
private static final Builders.ElementSpecBuilder TYPE_SPEC = Builders.

View File

@ -8,8 +8,6 @@ import org.w3c.dom.Document;
import java.util.Collection;
import static eu.dnetlib.validator2.validation.utils.SupportedRegExs.COMPILED_YYYY_MM_DD_REGEX;
public class CrisProjectV111Profile extends AbstractCrisProfile {
private static final Builders.ElementSpecBuilder TYPE_SPEC = Builders.

View File

@ -2,7 +2,7 @@ package eu.dnetlib.validator2.validation.utils;
import java.util.function.Predicate;
import static eu.dnetlib.validator2.validation.utils.SupportedRegExs.*;
import static eu.dnetlib.validator2.validation.utils.SupportedRegExs.COMPILED_EMBARGOED_END_DATE_REG_EX;
public class EmbargoedEndDateValuePredicate implements Predicate<String> {

View File

@ -4,12 +4,14 @@ import eu.dnetlib.validator2.engine.Helper
import eu.dnetlib.validator2.engine.XMLHelper
import eu.dnetlib.validator2.engine.builtins.AlwaysFailRule
import eu.dnetlib.validator2.engine.builtins.AlwaysSucceedRule
import static eu.dnetlib.validator2.validation.guideline.RequirementLevel.*
import static eu.dnetlib.validator2.validation.guideline.Cardinality.*
import org.w3c.dom.Document
import spock.lang.Shared
import spock.lang.Specification
import static eu.dnetlib.validator2.validation.guideline.Cardinality.ONE
import static eu.dnetlib.validator2.validation.guideline.Cardinality.ONE_TO_N
import static eu.dnetlib.validator2.validation.guideline.RequirementLevel.*
//TODO: Test occurrence
class ElementSpecCompilerSpecification extends Specification {

View File

@ -1,12 +1,12 @@
package eu.dnetlib.validator2.validation.guideline
import eu.dnetlib.validator2.engine.Rule
import eu.dnetlib.validator2.engine.Status
import eu.dnetlib.validator2.engine.XMLHelper
import eu.dnetlib.validator2.engine.builtins.XMLCardinalityRule
import org.w3c.dom.Document
import spock.lang.Shared
import spock.lang.Specification
import eu.dnetlib.validator2.engine.Rule
import spock.lang.Unroll
import spock.util.concurrent.AsyncConditions