jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject svn commit: r1868067 - in /jackrabbit/commons/filevault/trunk: vault-doc/src/site/markdown/ vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/ vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/ vault-validati...
Date Sun, 06 Oct 2019 16:37:31 GMT
Author: kwin
Date: Sun Oct  6 16:37:31 2019
New Revision: 1868067

URL: http://svn.apache.org/viewvc?rev=1868067&view=rev
Log:
JCRVLT-345 dedicated option for uncovered filter root ancestors

make all option constants public
tweak some javadoc

Modified:
    jackrabbit/commons/filevault/trunk/vault-doc/src/site/markdown/validation.md
    jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/ValidationExecutorFactory.java
    jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/ValidationMessageSeverity.java
    jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/AdvancedFilterValidator.java
    jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/AdvancedFilterValidatorFactory.java
    jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/DependencyValidatorFactory.java
    jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/PackageTypeValidatorFactory.java
    jackrabbit/commons/filevault/trunk/vault-validation/src/test/java/org/apache/jackrabbit/vault/validation/spi/impl/AdvancedFilterValidatorTest.java

Modified: jackrabbit/commons/filevault/trunk/vault-doc/src/site/markdown/validation.md
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-doc/src/site/markdown/validation.md?rev=1868067&r1=1868066&r2=1868067&view=diff
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-doc/src/site/markdown/validation.md (original)
+++ jackrabbit/commons/filevault/trunk/vault-doc/src/site/markdown/validation.md Sun Oct 
6 16:37:31 2019
@@ -45,7 +45,7 @@ Each validator settings are set for a sp
 
 ID  |  Description | Options
 --- | --- | ---
-`jackrabbit-filter` |  Checks for validity of the [filter.xml](./filter.html]) (according
to a predefined  XML schema). In addition checks that every [docview xml node](./docview.html)
is contained in the filter. For packages of type `application` (or when option `severityForUncoveredAncestorNodes`
is set to an according severity) it also makes sure that all filter root's ancestors are either
known/valid roots or are contained in the package dependencies. Also it makes sure that `pattern`
values for includes/excludes as well as `root` values for each filter entry are valid. Orphaned
filter rules (i.e. ones not being necessary) lead to validation issues as well. | *severityForUncoveredAncestorNodes*:
severity of validation messages for uncovered ancestor nodes. Only relevant for package type
!= application (default = info)<br/>*severityForOrphanedFilterRules*: severity of validation
messages for orphaned filter rules (default = info)<br/>*validRoots*: comma-separated
list of valid ro
 ots (default = `"/,/libs,/apps,/etc,/var,/tmp,/content"`)
+`jackrabbit-filter` |  Checks for validity of the [filter.xml](./filter.html]) (according
to a predefined  XML schema). In addition checks that every [docview xml node](./docview.html)
is contained in the filter. It also makes sure that all filter root's ancestors are either
known/valid roots or are contained in the package dependencies. For ancestor nodes which are
not covered by a filter at least a `warn` is emitted. Also it makes sure that `pattern` values
for includes/excludes as well as `root` values for each filter entry are valid. Orphaned filter
rules (i.e. ones not being necessary) lead to validation issues as well. | *severityForUncoveredAncestorNodes*:
severity of validation messages for uncovered ancestor nodes.<br/>*severityForUncoveredFilterRootAncestors*:
severity of validation messages for uncovered filter root ancestors. Only relevant for package
type != application (default = warn)<br/>*severityForOrphanedFilterRules*: severity
of validation messages for orphaned f
 ilter rules (default = info)<br/>*validRoots*: comma-separated list of valid roots
(default = `"/,/libs,/apps,/etc,/var,/tmp,/content"`)
 `jackrabbit-properties ` | Checks for validity of the  [properties.xml](./properties.html)
| none
 `jackrabbit-dependencies` | Checks for overlapping filter roots of the referenced package
dependencies as well as for valid package dependency references (i.e. references which can
be resolved). | *severityForUnresolvedDependencies*: severity of validation messages for unresolved
dependencies (default = warn)
 `jackrabbit-docviewparser` | Checks if all docview files in the package are compliant with
the [(extended) Document View Format](docview.html). This involves checking for XML validity
as well as checking for correct property types. | none

Modified: jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/ValidationExecutorFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/ValidationExecutorFactory.java?rev=1868067&r1=1868066&r2=1868067&view=diff
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/ValidationExecutorFactory.java
(original)
+++ jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/ValidationExecutorFactory.java
Sun Oct  6 16:37:31 2019
@@ -73,7 +73,7 @@ public class ValidationExecutorFactory {
      * @param validatorSettingsById a map of {@link ValidatorSettings}. The key is the validator
id. May be {@code null}.
      * @return either {@code null} or an executor (if at least one validator is registered)
      */
-    public @CheckForNull ValidationExecutor createValidationExecutor(@Nonnull ValidationContext
context, boolean isSubPackage, boolean enforceSubpackageValidation, Map<String, ValidatorSettings>
validatorSettingsById) {
+    public @CheckForNull ValidationExecutor createValidationExecutor(@Nonnull ValidationContext
context, boolean isSubPackage, boolean enforceSubpackageValidation, Map<String, ? extends
ValidatorSettings> validatorSettingsById) {
         Map<String, Validator> validatorsById = createValidators(context, isSubPackage,
enforceSubpackageValidation, validatorSettingsById != null ? validatorSettingsById : Collections.emptyMap());
         if (validatorsById.isEmpty()) {
             return null;
@@ -81,7 +81,7 @@ public class ValidationExecutorFactory {
         return new ValidationExecutor(validatorsById);
     }
 
-    private @Nonnull Map<String, Validator> createValidators(@Nonnull ValidationContext
context, boolean isSubPackage, boolean enforceSubpackageValidation, Map<String, ValidatorSettings>
validatorSettingsById) {
+    private @Nonnull Map<String, Validator> createValidators(@Nonnull ValidationContext
context, boolean isSubPackage, boolean enforceSubpackageValidation, Map<String, ? extends
ValidatorSettings> validatorSettingsById) {
         Map<String, Validator> validatorsById = new LinkedHashMap<>();
         Set<String> validatorSettingsIds = new HashSet<>(validatorSettingsById.keySet());
         for (ValidatorFactory validatorFactory : validatorFactories) {

Modified: jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/ValidationMessageSeverity.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/ValidationMessageSeverity.java?rev=1868067&r1=1868066&r2=1868067&view=diff
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/ValidationMessageSeverity.java
(original)
+++ jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/ValidationMessageSeverity.java
Sun Oct  6 16:37:31 2019
@@ -17,12 +17,12 @@
 package org.apache.jackrabbit.vault.validation.spi;
 
 public enum ValidationMessageSeverity {
-    /** only emitted in case debug build is enabled, not a real violation */
+    /** should only be emitted in case a debug option is enabled, not a real violation */
     DEBUG, 
     /** only for informational purposes, not a real violation */
     INFO, 
-    /** a violation which will not make the build fail */
+    /** a violation which might lead to unintended side-effects during package installation
*/
     WARN, 
-    /** a violation which will make the build fail */
+    /** a severe violation which very likely leads to unintended side-effects during package
installation */
     ERROR
 }

Modified: jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/AdvancedFilterValidator.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/AdvancedFilterValidator.java?rev=1868067&r1=1868066&r2=1868067&view=diff
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/AdvancedFilterValidator.java
(original)
+++ jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/AdvancedFilterValidator.java
Sun Oct  6 16:37:31 2019
@@ -80,13 +80,12 @@ public final class AdvancedFilterValidat
     protected static final String MESSAGE_ANCESTOR_NODE_NOT_COVERED_BUT_VALID_ROOT = "Ancestor
node '%s' is not covered by any of the filter rules but that node is a given root (either
by a dependency or by the known roots). Remove that node!";
     protected static final String MESSAGE_NODE_BELOW_CLEANUP_FILTER = "Node '%s' is covered
by a 'cleanup' filter rule. That filter type is only supposed to be used for removing nodes
during import!";
     
-    public static final ValidationMessageSeverity DEFAULT_SEVERITY_FOR_UNCOVERED_ANCESTOR_NODES
= ValidationMessageSeverity.INFO;
-
     static final Path FILTER_XML_PATH = Paths.get(Constants.VAULT_DIR, Constants.FILTER_XML);
 
     private final Collection<String> validRoots;
     private final ValidationMessageSeverity defaultSeverity;
     private final ValidationMessageSeverity severityForUncoveredAncestorNode;
+    private final ValidationMessageSeverity severityForUncoveredFilterRootAncestors;
     private final ValidationMessageSeverity severityForOrphanedFilterEntries;
     private final Collection<PackageInfo> dependenciesMetaInfo;
     private final WorkspaceFilter filter;
@@ -94,11 +93,11 @@ public final class AdvancedFilterValidat
     private final Collection<String> danglingNodePaths;
     private final Map<PathFilterSet, List<Entry<PathFilter>>> orphanedFilterSets;
 
-    public AdvancedFilterValidator(@Nonnull ValidationMessageSeverity defaultSeverity, @Nonnull
ValidationMessageSeverity severityForUncoveredAncestorNodes, @Nonnull ValidationMessageSeverity
severityForOrphanedFilterEntries, @Nonnull Collection<PackageInfo> dependenciesMetaInfo,
@Nonnull WorkspaceFilter filter, @Nonnull Collection<String> validRoots) {
-        
+    public AdvancedFilterValidator(@Nonnull ValidationMessageSeverity defaultSeverity, @Nonnull
ValidationMessageSeverity severityForUncoveredAncestorNodes, @Nonnull ValidationMessageSeverity
severityForUncoveredFilterRootAncestors, @Nonnull ValidationMessageSeverity severityForOrphanedFilterEntries,
@Nonnull Collection<PackageInfo> dependenciesMetaInfo, @Nonnull WorkspaceFilter filter,
@Nonnull Collection<String> validRoots) {
         this.filterValidators = new HashMap<>();
         this.defaultSeverity = defaultSeverity;
         this.severityForUncoveredAncestorNode = severityForUncoveredAncestorNodes;
+        this.severityForUncoveredFilterRootAncestors = severityForUncoveredFilterRootAncestors;
         this.severityForOrphanedFilterEntries = severityForOrphanedFilterEntries;
         this.dependenciesMetaInfo = dependenciesMetaInfo;
         this.filter = filter;
@@ -181,7 +180,7 @@ public final class AdvancedFilterValidat
         }
         // then check for each ancestor
         for (String root : ancestors) {
-            String isCovered = null;
+            String coveringPackageId = null;
             boolean isContained = false;
             for (PackageInfo dependencyInfo : dependenciesMetaInfo) {
                 WorkspaceFilter dependencyFilter = dependencyInfo.getFilter();
@@ -189,17 +188,17 @@ public final class AdvancedFilterValidat
                     isContained = true;
                 }
                 if (dependencyFilter.covers(root)) {
-                    isCovered = dependencyInfo.getId().toString();
+                    coveringPackageId = dependencyInfo.getId().toString();
                 }
             }
             if (!isContained) {
                 String msg;
-                if (isCovered == null) {
+                if (coveringPackageId == null) {
                     msg = String.format(MESSAGE_FILTER_ROOT_ANCESTOR_UNCOVERED, root);
                 } else {
-                    msg = String.format(MESSAGE_FILTER_ROOT_ANCESTOR_COVERED_BUT_EXCLUDED,
root, isCovered);
+                    msg = String.format(MESSAGE_FILTER_ROOT_ANCESTOR_COVERED_BUT_EXCLUDED,
root, coveringPackageId);
                 }
-                messages.add(new ValidationMessage(severityForUncoveredAncestorNode, msg));
+                messages.add(new ValidationMessage(severityForUncoveredFilterRootAncestors,
msg));
             }
         }
         return messages;

Modified: jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/AdvancedFilterValidatorFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/AdvancedFilterValidatorFactory.java?rev=1868067&r1=1868066&r2=1868067&view=diff
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/AdvancedFilterValidatorFactory.java
(original)
+++ jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/AdvancedFilterValidatorFactory.java
Sun Oct  6 16:37:31 2019
@@ -23,44 +23,69 @@ import java.util.LinkedList;
 import java.util.Set;
 
 import org.apache.jackrabbit.vault.packaging.PackageType;
+import org.apache.jackrabbit.vault.validation.ValidationExecutorFactory;
 import org.apache.jackrabbit.vault.validation.spi.ValidationContext;
 import org.apache.jackrabbit.vault.validation.spi.ValidationMessageSeverity;
 import org.apache.jackrabbit.vault.validation.spi.Validator;
 import org.apache.jackrabbit.vault.validation.spi.ValidatorFactory;
 import org.apache.jackrabbit.vault.validation.spi.ValidatorSettings;
 import org.kohsuke.MetaInfServices;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 @MetaInfServices
 public final class AdvancedFilterValidatorFactory implements ValidatorFactory {
 
-    protected static final String OPTION_SEVERITY_FOR_UNCOVERED_ANCESTOR_NODES = "severityForUncoveredAncestorNodes";
-    protected static final String OPTION_SEVERITY_FOR_ORPHANED_FILTER_RULES = "severityForOrphanedFilterRules";
+    public static final String ID = PREFIX_JACKRABBIT + "filter";
+
+    public static final String OPTION_SEVERITY_FOR_UNCOVERED_ANCESTOR_NODES = "severityForUncoveredAncestorNodes";
+    private static final Object OPTION_SEVERITY_FOR_UNCOVERED_FILTER_ROOT_ANCESTORS = "severityForUncoveredFilterRootAncestors";
+    public static final String OPTION_SEVERITY_FOR_ORPHANED_FILTER_RULES = "severityForOrphanedFilterRules";
     // should take comma-separated list of valid root paths
-    protected static final String OPTION_VALID_ROOTS = "validRoots";
+    public static final String OPTION_VALID_ROOTS = "validRoots";
     
-    protected static final ValidationMessageSeverity DEFAULT_SEVERITY_FOR_UNCOVERED_ANCESTOR_NODES
= ValidationMessageSeverity.INFO;
-    protected static final ValidationMessageSeverity DEFAULT_SEVERITY_FOR_ORPHANED_FILTER_RULES
= ValidationMessageSeverity.INFO;
-    protected static final Collection<String> DEFAULT_VALID_ROOTS = new LinkedList<>(Arrays.asList("/","/libs","/apps","/etc","/var","/tmp","/content"));
+    static final ValidationMessageSeverity DEFAULT_SEVERITY_FOR_UNCOVERED_ANCESTOR_NODES
= ValidationMessageSeverity.INFO;
+    private static final ValidationMessageSeverity DEFAULT_SEVERITY_FOR_UNCOVERED_FILTER_ROOT_ANCESTORS
= ValidationMessageSeverity.WARN;
+    static final ValidationMessageSeverity DEFAULT_SEVERITY_FOR_ORPHANED_FILTER_RULES = ValidationMessageSeverity.INFO;
+    static final Collection<String> DEFAULT_VALID_ROOTS = new LinkedList<>(Arrays.asList("/","/libs","/apps","/etc","/var","/tmp","/content"));
+
+    /**
+     * the default logger
+     */
+    private static final Logger log = LoggerFactory.getLogger(ValidationExecutorFactory.class);
 
     @Override
     public Validator createValidator(ValidationContext context, ValidatorSettings settings)
{
-        final ValidationMessageSeverity messageSeverityForUncoveredAncestorNode;
+        final ValidationMessageSeverity severityForUncoveredAncestorNode;
+        if (settings.getOptions().containsKey(OPTION_SEVERITY_FOR_UNCOVERED_ANCESTOR_NODES))
{
+            String optionValue = settings.getOptions().get(OPTION_SEVERITY_FOR_UNCOVERED_ANCESTOR_NODES);
+            severityForUncoveredAncestorNode = ValidationMessageSeverity.valueOf(optionValue.toUpperCase());
+        } else {
+            severityForUncoveredAncestorNode = DEFAULT_SEVERITY_FOR_UNCOVERED_ANCESTOR_NODES;
+        }
+        // severity for ancestor of filter rules
+        final ValidationMessageSeverity severityForUncoveredFilterRootAncestors;
         if (PackageType.APPLICATION.equals(context.getProperties().getPackageType())) {
-            messageSeverityForUncoveredAncestorNode = ValidationMessageSeverity.ERROR;
+            log.debug("Due to package type 'application' emit error for every uncovered filter
root ancestor");
+            severityForUncoveredFilterRootAncestors = ValidationMessageSeverity.ERROR;
+            if (settings.getOptions().containsKey(OPTION_SEVERITY_FOR_UNCOVERED_FILTER_ROOT_ANCESTORS))
{
+                log.warn("Disregard option '{}' as package type is application which sets
this violation to severity 'error'", OPTION_SEVERITY_FOR_UNCOVERED_FILTER_ROOT_ANCESTORS);
+            }
         } else {
-            if (settings.getOptions().containsKey(OPTION_SEVERITY_FOR_UNCOVERED_ANCESTOR_NODES))
{
-                String optionValue = settings.getOptions().get(OPTION_SEVERITY_FOR_UNCOVERED_ANCESTOR_NODES);
-                messageSeverityForUncoveredAncestorNode = ValidationMessageSeverity.valueOf(optionValue.toUpperCase());
+            if (settings.getOptions().containsKey(OPTION_SEVERITY_FOR_UNCOVERED_FILTER_ROOT_ANCESTORS))
{
+                String optionValue = settings.getOptions().get(OPTION_SEVERITY_FOR_UNCOVERED_FILTER_ROOT_ANCESTORS);
+                severityForUncoveredFilterRootAncestors = ValidationMessageSeverity.valueOf(optionValue.toUpperCase());
             } else {
-                messageSeverityForUncoveredAncestorNode = DEFAULT_SEVERITY_FOR_UNCOVERED_ANCESTOR_NODES;
+                severityForUncoveredFilterRootAncestors = DEFAULT_SEVERITY_FOR_UNCOVERED_FILTER_ROOT_ANCESTORS;
             }
         }
-        final ValidationMessageSeverity messageSeverityForOrphanedFilterRules;
+        
+        final ValidationMessageSeverity severityForOrphanedFilterRules;
         if (settings.getOptions().containsKey(OPTION_SEVERITY_FOR_ORPHANED_FILTER_RULES))
{
             String optionValue = settings.getOptions().get(OPTION_SEVERITY_FOR_ORPHANED_FILTER_RULES);
-            messageSeverityForOrphanedFilterRules = ValidationMessageSeverity.valueOf(optionValue.toUpperCase());
+            severityForOrphanedFilterRules = ValidationMessageSeverity.valueOf(optionValue.toUpperCase());
         } else {
-            messageSeverityForOrphanedFilterRules = DEFAULT_SEVERITY_FOR_ORPHANED_FILTER_RULES;
+            severityForOrphanedFilterRules = DEFAULT_SEVERITY_FOR_ORPHANED_FILTER_RULES;
         }
         Set<String> validRoots = new HashSet<>();
         validRoots.add("");
@@ -70,8 +95,7 @@ public final class AdvancedFilterValidat
         } else {
             validRoots.addAll(DEFAULT_VALID_ROOTS);
         }
-        
-        return new AdvancedFilterValidator(settings.getDefaultSeverity(), messageSeverityForUncoveredAncestorNode,
messageSeverityForOrphanedFilterRules, context.getDependenciesMetaInfo(), context.getFilter(),
validRoots);
+        return new AdvancedFilterValidator(settings.getDefaultSeverity(), severityForUncoveredAncestorNode,
severityForUncoveredFilterRootAncestors, severityForOrphanedFilterRules, context.getDependenciesMetaInfo(),
context.getFilter(), validRoots);
     }
 
     @Override
@@ -81,7 +105,7 @@ public final class AdvancedFilterValidat
 
     @Override
     public String getId() {
-        return ValidatorFactory.PREFIX_JACKRABBIT + "filter";
+        return ID;
     }
 
     @Override

Modified: jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/DependencyValidatorFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/DependencyValidatorFactory.java?rev=1868067&r1=1868066&r2=1868067&view=diff
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/DependencyValidatorFactory.java
(original)
+++ jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/DependencyValidatorFactory.java
Sun Oct  6 16:37:31 2019
@@ -29,7 +29,7 @@ public final class DependencyValidatorFa
     public static final String ID = PREFIX_JACKRABBIT + "dependencies";
     
     public static final String OPTION_SEVERITY_FOR_UNRESOLVED_DEPENDENCIES = "severityForUnresolvedDependencies";
-    public static final ValidationMessageSeverity DEFAULT_SEVERITY_FOR_UNRESOLVED_DEPENDENCIES
= ValidationMessageSeverity.WARN;
+    private static final ValidationMessageSeverity DEFAULT_SEVERITY_FOR_UNRESOLVED_DEPENDENCIES
= ValidationMessageSeverity.WARN;
     
     @Override
     public Validator createValidator(ValidationContext context, ValidatorSettings settings)
{

Modified: jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/PackageTypeValidatorFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/PackageTypeValidatorFactory.java?rev=1868067&r1=1868066&r2=1868067&view=diff
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/PackageTypeValidatorFactory.java
(original)
+++ jackrabbit/commons/filevault/trunk/vault-validation/src/main/java/org/apache/jackrabbit/vault/validation/spi/impl/PackageTypeValidatorFactory.java
Sun Oct  6 16:37:31 2019
@@ -36,7 +36,7 @@ public final class PackageTypeValidatorF
      */
     public static final String OPTION_JCR_INSTALLER_NODE_PATH_REGEX = "jcrInstallerNodePathRegex";
 
-    public static final Pattern DEFAULT_JCR_INSTALLER_NODE_PATH_REGEX = Pattern.compile("/([^/]*/){0,4}?(install|config)(\\.[^/]*)*/(\\d{1,3}/)?.+?\\.(jar|config|cfg|cfg\\.json|xml)$");
+    static final Pattern DEFAULT_JCR_INSTALLER_NODE_PATH_REGEX = Pattern.compile("/([^/]*/){0,4}?(install|config)(\\.[^/]*)*/(\\d{1,3}/)?.+?\\.(jar|config|cfg|cfg\\.json|xml)$");
 
     @Override
     public @CheckForNull Validator createValidator(ValidationContext context, ValidatorSettings
settings) {

Modified: jackrabbit/commons/filevault/trunk/vault-validation/src/test/java/org/apache/jackrabbit/vault/validation/spi/impl/AdvancedFilterValidatorTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-validation/src/test/java/org/apache/jackrabbit/vault/validation/spi/impl/AdvancedFilterValidatorTest.java?rev=1868067&r1=1868066&r2=1868067&view=diff
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-validation/src/test/java/org/apache/jackrabbit/vault/validation/spi/impl/AdvancedFilterValidatorTest.java
(original)
+++ jackrabbit/commons/filevault/trunk/vault-validation/src/test/java/org/apache/jackrabbit/vault/validation/spi/impl/AdvancedFilterValidatorTest.java
Sun Oct  6 16:37:31 2019
@@ -102,6 +102,7 @@ public class AdvancedFilterValidatorTest
                     ValidationMessageSeverity.WARN,
                     AdvancedFilterValidatorFactory.DEFAULT_SEVERITY_FOR_UNCOVERED_ANCESTOR_NODES,
                     ValidationMessageSeverity.ERROR,
+                    ValidationMessageSeverity.ERROR,
                     dependenciesMetaInfo,
                     filter, // this is per test
                     validRoots);
@@ -135,6 +136,7 @@ public class AdvancedFilterValidatorTest
                 ValidationMessageSeverity.WARN,
                 AdvancedFilterValidatorFactory.DEFAULT_SEVERITY_FOR_UNCOVERED_ANCESTOR_NODES,
                 ValidationMessageSeverity.ERROR,
+                ValidationMessageSeverity.ERROR,
                 dependenciesMetaInfo,
                 filter, // this is per test
                 validRoots);
@@ -155,6 +157,7 @@ public class AdvancedFilterValidatorTest
                 ValidationMessageSeverity.WARN,
                 AdvancedFilterValidatorFactory.DEFAULT_SEVERITY_FOR_UNCOVERED_ANCESTOR_NODES,
                 ValidationMessageSeverity.ERROR,
+                ValidationMessageSeverity.ERROR,
                 dependenciesMetaInfo,
                 filter, // this is per test
                 validRoots);
@@ -177,6 +180,7 @@ public class AdvancedFilterValidatorTest
                 ValidationMessageSeverity.ERROR,
                 AdvancedFilterValidatorFactory.DEFAULT_SEVERITY_FOR_UNCOVERED_ANCESTOR_NODES,
                 ValidationMessageSeverity.ERROR,
+                ValidationMessageSeverity.ERROR,
                 dependenciesMetaInfo,
                 filter, // this is per test
                 validRoots);
@@ -194,6 +198,7 @@ public class AdvancedFilterValidatorTest
                 ValidationMessageSeverity.ERROR,
                 ValidationMessageSeverity.ERROR,
                 ValidationMessageSeverity.ERROR,
+                ValidationMessageSeverity.ERROR,
                 dependenciesMetaInfo,
                 filter, // this is per test
                 validRoots);
@@ -209,6 +214,7 @@ public class AdvancedFilterValidatorTest
                 ValidationMessageSeverity.ERROR,
                 ValidationMessageSeverity.WARN,
                 ValidationMessageSeverity.ERROR,
+                ValidationMessageSeverity.ERROR,
                 dependenciesMetaInfo,
                 filter, // this is per test
                 Collections.emptyList());
@@ -234,6 +240,7 @@ public class AdvancedFilterValidatorTest
                 ValidationMessageSeverity.ERROR,
                 ValidationMessageSeverity.ERROR,
                 ValidationMessageSeverity.ERROR,
+                ValidationMessageSeverity.ERROR,
                 dependenciesMetaInfo,
                 filter, // this is per test
                 validRoots);
@@ -257,6 +264,7 @@ public class AdvancedFilterValidatorTest
                 ValidationMessageSeverity.INFO,
                 AdvancedFilterValidatorFactory.DEFAULT_SEVERITY_FOR_UNCOVERED_ANCESTOR_NODES,
                 ValidationMessageSeverity.ERROR,
+                ValidationMessageSeverity.ERROR,
                 dependenciesMetaInfo,
                 filter, // this is per test
                 validRoots);
@@ -282,6 +290,7 @@ public class AdvancedFilterValidatorTest
         validator = new AdvancedFilterValidator(
                 ValidationMessageSeverity.INFO,
                 AdvancedFilterValidatorFactory.DEFAULT_SEVERITY_FOR_UNCOVERED_ANCESTOR_NODES,
+                ValidationMessageSeverity.INFO,
                 ValidationMessageSeverity.ERROR,
                 dependenciesMetaInfo,
                 filter, // this is per test
@@ -301,6 +310,7 @@ public class AdvancedFilterValidatorTest
                     ValidationMessageSeverity.WARN,
                     AdvancedFilterValidatorFactory.DEFAULT_SEVERITY_FOR_UNCOVERED_ANCESTOR_NODES,
                     ValidationMessageSeverity.ERROR,
+                    ValidationMessageSeverity.ERROR,
                     dependenciesMetaInfo,
                     filter,
                     validRoots);
@@ -325,6 +335,7 @@ public class AdvancedFilterValidatorTest
                 ValidationMessageSeverity.WARN,
                 AdvancedFilterValidatorFactory.DEFAULT_SEVERITY_FOR_UNCOVERED_ANCESTOR_NODES,
                 ValidationMessageSeverity.ERROR,
+                ValidationMessageSeverity.ERROR,
                 dependenciesMetaInfo,
                 filter, // this is per test
                 validRoots);
@@ -370,6 +381,7 @@ public class AdvancedFilterValidatorTest
                 ValidationMessageSeverity.WARN,
                 AdvancedFilterValidatorFactory.DEFAULT_SEVERITY_FOR_UNCOVERED_ANCESTOR_NODES,
                 ValidationMessageSeverity.ERROR,
+                ValidationMessageSeverity.ERROR,
                 dependenciesMetaInfo,
                 filter, // this is per test
                 validRoots);



Mime
View raw message