sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject svn commit: r1684841 [4/4] - in /sling/trunk/bundles/extensions/validation: api/src/main/java/org/apache/sling/validation/ api/src/main/java/org/apache/sling/validation/api/ api/src/main/java/org/apache/sling/validation/api/exceptions/ api/src/main/jav...
Date Thu, 11 Jun 2015 09:33:42 GMT
Added: sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/resourcemodel/ResourceValidationModelProviderImplTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/resourcemodel/ResourceValidationModelProviderImplTest.java?rev=1684841&view=auto
==============================================================================
--- sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/resourcemodel/ResourceValidationModelProviderImplTest.java
(added)
+++ sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/resourcemodel/ResourceValidationModelProviderImplTest.java
Thu Jun 11 09:33:41 2015
@@ -0,0 +1,363 @@
+package org.apache.sling.validation.impl.resourcemodel;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.annotation.Nonnull;
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.apache.jackrabbit.JcrConstants;
+import org.apache.jackrabbit.util.Text;
+import org.apache.sling.api.resource.LoginException;
+import org.apache.sling.api.resource.ModifiableValueMap;
+import org.apache.sling.api.resource.PersistenceException;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.api.resource.ResourceUtil;
+import org.apache.sling.jcr.resource.JcrResourceConstants;
+import org.apache.sling.testing.mock.jcr.MockJcr;
+import org.apache.sling.testing.mock.jcr.MockQuery;
+import org.apache.sling.testing.mock.jcr.MockQueryResult;
+import org.apache.sling.testing.mock.jcr.MockQueryResultHandler;
+import org.apache.sling.testing.mock.sling.ResourceResolverType;
+import org.apache.sling.testing.mock.sling.junit.SlingContext;
+import org.apache.sling.validation.Validator;
+import org.apache.sling.validation.impl.Constants;
+import org.apache.sling.validation.impl.model.ChildResourceImpl;
+import org.apache.sling.validation.impl.model.ResourcePropertyBuilder;
+import org.apache.sling.validation.impl.model.ValidationModelBuilder;
+import org.apache.sling.validation.impl.validators.RegexValidator;
+import org.apache.sling.validation.model.ChildResource;
+import org.apache.sling.validation.model.ParameterizedValidator;
+import org.apache.sling.validation.model.ResourceProperty;
+import org.apache.sling.validation.model.ValidationModel;
+import org.hamcrest.Matchers;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+public class ResourceValidationModelProviderImplTest {
+
+    private final static class PrefixAndResourceType {
+        private final String prefix;
+        private final String resourceType;
+
+        public PrefixAndResourceType(String prefix, String resourceType) {
+            super();
+            this.prefix = prefix;
+            this.resourceType = resourceType;
+        }
+
+        @Override
+        public int hashCode() {
+            final int prime = 31;
+            int result = 1;
+            result = prime * result + ((prefix == null) ? 0 : prefix.hashCode());
+            result = prime * result + ((resourceType == null) ? 0 : resourceType.hashCode());
+            return result;
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj)
+                return true;
+            if (obj == null)
+                return false;
+            if (getClass() != obj.getClass())
+                return false;
+            PrefixAndResourceType other = (PrefixAndResourceType) obj;
+            if (prefix == null) {
+                if (other.prefix != null)
+                    return false;
+            } else if (!prefix.equals(other.prefix))
+                return false;
+            if (resourceType == null) {
+                if (other.resourceType != null)
+                    return false;
+            } else if (!resourceType.equals(other.resourceType))
+                return false;
+            return true;
+        }
+
+    }
+
+    /**
+     * Assume the validation models are stored under (/libs|/apps) + / + VALIDATION_MODELS_RELATIVE_PATH.
+     */
+    private static final String VALIDATION_MODELS_RELATIVE_PATH = "sling/validation/models";
+    private static final String APPS = "/apps";
+    private static final String LIBS = "/libs";
+    private Resource appsValidatorsRoot;
+    private Resource libsValidatorsRoot;
+    private static Map<String, Object> primaryTypeUnstructuredMap;
+    private ResourceValidationModelProviderImpl modelProvider;
+    private ResourceResolver rr;
+    private MockQueryResultHandler prefixBasedResultHandler;
+    private Map<PrefixAndResourceType, List<Node>> validatorModelNodesPerPrefixAndResourceType;
+    private Map<String, Validator<?>> validatorMap;
+    private Map<String, Object> regexValdidatorParametrization;
+    private ValidationModelBuilder modelBuilder;
+
+    // extract resource type from strings like
+    // "/jcr:root/apps//validation//*[@sling:resourceType="sling/validation/model" and @validatedResourceType="<some-resource-type>"]"
+    private static final Pattern RESOURCE_TYPE_PATTERN = Pattern.compile(".*@validatedResourceType=\"([^\"]*)\".*");
+
+    @Rule
+    public SlingContext context = new SlingContext(ResourceResolverType.JCR_MOCK); // search
capability necessary
+
+    @Before
+    public void setUp() throws LoginException, PersistenceException, RepositoryException
{
+        primaryTypeUnstructuredMap = new HashMap<String, Object>();
+        primaryTypeUnstructuredMap.put(JcrConstants.JCR_PRIMARYTYPE, JcrConstants.NT_UNSTRUCTURED);
+        
+        modelProvider = new ResourceValidationModelProviderImpl();
+        validatorMap = new HashMap<String, Validator<?>>();
+        validatorMap.put("org.apache.sling.validation.impl.validators.RegexValidator", new
RegexValidator());
+
+        // one default model
+        modelBuilder = new ValidationModelBuilder();
+        modelBuilder.setApplicablePath("/content/site1");
+        ResourcePropertyBuilder propertyBuilder = new ResourcePropertyBuilder();
+        propertyBuilder.validator(new RegexValidator(), RegexValidator.REGEX_PARAM, "prefix.*");
+        ResourceProperty property = propertyBuilder.build("field1");
+        modelBuilder.resourceProperty(property);
+
+        prefixBasedResultHandler = new MockQueryResultHandler() {
+            @Override
+            public MockQueryResult executeQuery(MockQuery query) {
+                if (!"xpath".equals(query.getLanguage())) {
+                    return null;
+                }
+                String statement = query.getStatement();
+                // query looks like /jcr:root/apps//validation//*[@sling:resourceType="sling/validation/model"
and
+                // @validatedResourceType="<some-resource-type>"]
+                if (statement.startsWith("/jcr:root/")) {
+                    statement = statement.substring("/jcr:root/".length() - 1);
+                }
+                // extract the prefix from the statement
+                String prefix = Text.getAbsoluteParent(statement, 0);
+
+                // extract the resource type from the statement
+                Matcher matcher = RESOURCE_TYPE_PATTERN.matcher(statement);
+                if (!matcher.matches()) {
+                    throw new IllegalArgumentException(
+                            "Can only process query statements which contain a validatedResourceType
but the statement is: "
+                                    + statement);
+                }
+                String resourceType = matcher.group(1);
+
+                PrefixAndResourceType prefixAndResourceType = new PrefixAndResourceType(prefix,
resourceType);
+                if (validatorModelNodesPerPrefixAndResourceType.keySet().contains(prefixAndResourceType))
{
+                    return new MockQueryResult(validatorModelNodesPerPrefixAndResourceType.get(prefixAndResourceType));
+                }
+                return null;
+            }
+        };
+        rr = context.resourceResolver();
+        MockJcr.addQueryResultHandler(rr.adaptTo(Session.class), prefixBasedResultHandler);
+
+        validatorModelNodesPerPrefixAndResourceType = new HashMap<PrefixAndResourceType,
List<Node>>();
+
+        appsValidatorsRoot = ResourceUtil.getOrCreateResource(rr, APPS + "/" + VALIDATION_MODELS_RELATIVE_PATH,
+                (Map<String, Object>) null, "sling:Folder", true);
+        libsValidatorsRoot = ResourceUtil.getOrCreateResource(rr, LIBS + "/" + VALIDATION_MODELS_RELATIVE_PATH,
+                (Map<String, Object>) null, "sling:Folder", true);
+    }
+
+    @After
+    public void tearDown() throws PersistenceException {
+        if (appsValidatorsRoot != null) {
+            rr.delete(appsValidatorsRoot);
+        }
+        if (libsValidatorsRoot != null) {
+            rr.delete(libsValidatorsRoot);
+        }
+        rr.commit();
+    }
+
+    @Test
+    public void testGetValidationModel() throws Exception {
+        // build two models manually (which are identical except for the applicable path)
+        ValidationModel model1 = modelBuilder.build("sling/validation/test");
+        modelBuilder.setApplicablePath("/content/site2");
+        ValidationModel model2 = modelBuilder.build("sling/validation/test");
+
+        // build models in JCR
+        createValidationModelResource(rr, libsValidatorsRoot.getPath(), "testValidationModel1",
model1);
+        createValidationModelResource(rr, libsValidatorsRoot.getPath(), "testValidationModel2",
model2);
+
+        // check that both models are returned
+        Collection<ValidationModel> models = modelProvider.getModel(rr, "sling/validation/test",
validatorMap);
+        Assert.assertThat(models, Matchers.containsInAnyOrder(model1, model2));
+    }
+
+    @Test
+    public void testGetValidationModelWithChildren() throws Exception {
+        // build two models manually (which are identical except for the applicable path)
+        ResourcePropertyBuilder resourcePropertyBuilder = new ResourcePropertyBuilder();
+        resourcePropertyBuilder.multiple();
+        resourcePropertyBuilder.optional();
+        ResourceProperty childproperty = resourcePropertyBuilder.build("child1property");
+        modelBuilder.childResource(new ChildResourceImpl("child1", null, true,
+                Collections.singletonList(childproperty), Collections.<ChildResource>
emptyList()));
+        ValidationModel model1 = modelBuilder.build("sling/validation/test");
+
+        // build models in JCR
+        createValidationModelResource(rr, libsValidatorsRoot.getPath(), "testValidationModel1",
model1);
+
+        // compare both models
+        Collection<ValidationModel> models = modelProvider.getModel(rr, "sling/validation/test",
validatorMap);
+        Assert.assertThat(models, Matchers.contains(model1));
+    }
+
+    @Test
+    public void testGetValidationModelWithOverlay() throws Exception {
+        // create two models manually (which are identical except for the applicable path)
+        ValidationModel model1 = modelBuilder.build("sling/validation/test");
+        modelBuilder.setApplicablePath("/content/site2");
+        ValidationModel model2 = modelBuilder.build("sling/validation/test");
+
+        // create two models in the JCR: one in libs and one in apps (distinguishable via
applicablePath)
+        createValidationModelResource(rr, libsValidatorsRoot.getPath(), "testValidationModel1",
model1);
+        createValidationModelResource(rr, appsValidatorsRoot.getPath(), "testValidationModel1",
model2);
+
+        // only the apps model should be returned
+        Collection<ValidationModel> models = modelProvider.getModel(rr, "sling/validation/test",
validatorMap);
+        Assert.assertThat(models, Matchers.contains(model2));
+    }
+
+    @Test(expected = IllegalStateException.class)
+    public void testGetValidationModelWithInvalidValidator() throws Exception {
+        // create one default model
+        ValidationModel model1 = modelBuilder.build("sling/validation/test");
+        createValidationModelResource(rr, libsValidatorsRoot.getPath(), "testValidationModel1",
model1);
+
+        // clear validator map to make the referenced validator unknown
+        validatorMap.clear();
+        modelProvider.getModel(rr, "sling/validation/test", validatorMap);
+    }
+    
+    @Test(expected = IllegalStateException.class)
+    public void testGetValidationModelWithMissingChildrenAndProperties() throws Exception
{
+        // create a model with neither children nor properties
+        modelBuilder = new ValidationModelBuilder();
+        modelBuilder.addApplicablePath("content/site1");
+        ValidationModel model1 = modelBuilder.build("sling/validation/test");
+        
+        createValidationModelResource(rr, libsValidatorsRoot.getPath(), "testValidationModel1",
model1);
+
+        modelProvider.getModel(rr, "sling/validation/test", validatorMap);
+    }
+
+    private Resource createValidationModelResource(ResourceResolver rr, String root, String
name, ValidationModel model)
+            throws Exception {
+        Map<String, Object> modelProperties = new HashMap<String, Object>();
+        modelProperties.put(Constants.VALIDATED_RESOURCE_TYPE, model.getValidatedResourceType());
+        modelProperties.put(Constants.APPLICABLE_PATHS, model.getApplicablePaths());
+        modelProperties
+                .put(JcrResourceConstants.SLING_RESOURCE_TYPE_PROPERTY, Constants.VALIDATION_MODEL_RESOURCE_TYPE);
+        modelProperties.put(JcrConstants.JCR_PRIMARYTYPE, JcrConstants.NT_UNSTRUCTURED);
+        Resource modelResource = ResourceUtil.getOrCreateResource(rr, root + "/" + name,
modelProperties,
+                JcrResourceConstants.NT_SLING_FOLDER, true);
+        if (model != null) {
+            createValidationModelProperties(modelResource, model.getResourceProperties());
+            for (ChildResource child : model.getChildren()) {
+                createValidationModelChildResource(modelResource, child);
+            }
+            // add to search handler (with root path)
+            String prefix = Text.getAbsoluteParent(root, 0);
+            PrefixAndResourceType prefixAndResourceType = new PrefixAndResourceType(prefix,
+                    model.getValidatedResourceType());
+            List<Node> nodes;
+            nodes = validatorModelNodesPerPrefixAndResourceType.get(prefixAndResourceType);
+            if (nodes == null) {
+                nodes = new ArrayList<Node>();
+                validatorModelNodesPerPrefixAndResourceType.put(prefixAndResourceType, nodes);
+            }
+            nodes.add(modelResource.adaptTo(Node.class));
+        }
+        return modelResource;
+    }
+
+    private void createValidationModelProperties(Resource model, @Nonnull List<ResourceProperty>
properties)
+            throws PersistenceException {
+        ResourceResolver rr = model.getResourceResolver();
+        if (properties.isEmpty()) {
+            return;
+        }
+        Resource propertiesResource = ResourceUtil.getOrCreateResource(rr,
+                model.getPath() + "/" + Constants.PROPERTIES, JcrConstants.NT_UNSTRUCTURED,
null, true);
+        for (ResourceProperty property : properties) {
+            Map<String, Object> modelPropertyJCRProperties = new HashMap<String,
Object>();
+            modelPropertyJCRProperties.put(JcrConstants.JCR_PRIMARYTYPE, JcrConstants.NT_UNSTRUCTURED);
+            Resource propertyResource = ResourceUtil.getOrCreateResource(rr, propertiesResource.getPath()
+ "/"
+                    + property.getName(), modelPropertyJCRProperties, null, true);
+            if (propertyResource != null) {
+                ModifiableValueMap values = propertyResource.adaptTo(ModifiableValueMap.class);
+                Pattern pattern = property.getNamePattern();
+                if (pattern != null) {
+                    values.put(Constants.NAME_REGEX, pattern.pattern());
+                }
+                values.put(Constants.PROPERTY_MULTIPLE, property.isMultiple());
+                values.put(Constants.OPTIONAL, !property.isRequired());
+                Resource validators = ResourceUtil.getOrCreateResource(rr, propertyResource.getPath()
+ "/"
+                        + Constants.VALIDATORS, JcrConstants.NT_UNSTRUCTURED, null, true);
+                if (validators != null) {
+                    for (ParameterizedValidator validator : property.getValidators()) {
+                        Map<String, Object> validatorProperties = new HashMap<String,
Object>();
+                        validatorProperties.put(JcrConstants.JCR_PRIMARYTYPE, JcrConstants.NT_UNSTRUCTURED);
+                        Map<String, Object> parameters = validator.getParameters();
+                        if (!parameters.isEmpty()) {
+                            // convert to right format
+                            validatorProperties.put(Constants.VALIDATOR_ARGUMENTS,
+                                    convertMapToJcrValidatorArguments(parameters));
+                        }
+                        ResourceUtil.getOrCreateResource(rr, validators.getPath() + "/"
+                                + validator.getValidator().getClass().getName(), validatorProperties,
null, true);
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * Convert to right format : String array of "<key>=<value>"
+     * 
+     * @param map
+     * @return
+     */
+    private String[] convertMapToJcrValidatorArguments(Map<String, Object> map) {
+        List<String> parametersForJcr = new ArrayList<String>();
+        for (Map.Entry<String, Object> entry : map.entrySet()) {
+            parametersForJcr.add(entry.getKey() + "=" + entry.getValue());
+        }
+        return parametersForJcr.toArray(new String[0]);
+    }
+
+    private Resource createValidationModelChildResource(Resource parentResource, ChildResource
child) throws PersistenceException {
+        ResourceResolver rr = parentResource.getResourceResolver();
+        Resource modelChildren = rr.create(parentResource, Constants.CHILDREN, primaryTypeUnstructuredMap);
+        Resource modelResource = rr.create(modelChildren, child.getName(), primaryTypeUnstructuredMap);
+        ModifiableValueMap mvm = modelResource.adaptTo(ModifiableValueMap.class);
+        if (child.getNamePattern() != null) {
+            mvm.put(Constants.NAME_REGEX, child.getNamePattern() );
+        }
+        mvm.put(Constants.OPTIONAL, !child.isRequired());
+        createValidationModelProperties(modelResource, child.getProperties());
+        // recursion for all childs
+        for (ChildResource grandChild : child.getChildren()) {
+            createValidationModelChildResource(modelResource, grandChild);
+        }
+        return modelResource;
+    }
+}

Modified: sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/ValidatorTypeUtilTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/ValidatorTypeUtilTest.java?rev=1684841&r1=1684840&r2=1684841&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/ValidatorTypeUtilTest.java
(original)
+++ sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/ValidatorTypeUtilTest.java
Thu Jun 11 09:33:41 2015
@@ -23,8 +23,8 @@ import java.util.Collection;
 import javax.annotation.Nonnull;
 
 import org.apache.sling.api.resource.ValueMap;
-import org.apache.sling.validation.api.Validator;
-import org.apache.sling.validation.api.exceptions.SlingValidationException;
+import org.apache.sling.validation.Validator;
+import org.apache.sling.validation.exceptions.SlingValidationException;
 import org.apache.sling.validation.impl.util.examplevalidators.DerivedStringValidator;
 import org.apache.sling.validation.impl.util.examplevalidators.ExtendedStringValidator;
 import org.apache.sling.validation.impl.util.examplevalidators.GenericTypeParameterBaseClass;

Modified: sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/AbstractValidatorWithAdditionalType.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/AbstractValidatorWithAdditionalType.java?rev=1684841&r1=1684840&r2=1684841&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/AbstractValidatorWithAdditionalType.java
(original)
+++ sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/AbstractValidatorWithAdditionalType.java
Thu Jun 11 09:33:41 2015
@@ -18,7 +18,7 @@
  */
 package org.apache.sling.validation.impl.util.examplevalidators;
 
-import org.apache.sling.validation.api.Validator;
+import org.apache.sling.validation.Validator;
 
 public abstract class AbstractValidatorWithAdditionalType<A,T,B> implements Validator<T>{
     public abstract A getA();

Modified: sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/DateValidator.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/DateValidator.java?rev=1684841&r1=1684840&r2=1684841&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/DateValidator.java
(original)
+++ sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/DateValidator.java
Thu Jun 11 09:33:41 2015
@@ -23,8 +23,8 @@ import java.util.Date;
 import javax.annotation.Nonnull;
 
 import org.apache.sling.api.resource.ValueMap;
-import org.apache.sling.validation.api.Validator;
-import org.apache.sling.validation.api.exceptions.SlingValidationException;
+import org.apache.sling.validation.Validator;
+import org.apache.sling.validation.exceptions.SlingValidationException;
 
 public class DateValidator implements Validator<Date> {
 

Modified: sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/ExtendedStringValidator.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/ExtendedStringValidator.java?rev=1684841&r1=1684840&r2=1684841&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/ExtendedStringValidator.java
(original)
+++ sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/ExtendedStringValidator.java
Thu Jun 11 09:33:41 2015
@@ -21,7 +21,7 @@ package org.apache.sling.validation.impl
 import javax.annotation.Nonnull;
 
 import org.apache.sling.api.resource.ValueMap;
-import org.apache.sling.validation.api.exceptions.SlingValidationException;
+import org.apache.sling.validation.exceptions.SlingValidationException;
 
 public class ExtendedStringValidator extends AbstractValidatorWithAdditionalType<Boolean,
String, Integer> {
 

Modified: sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/IntegerValidator.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/IntegerValidator.java?rev=1684841&r1=1684840&r2=1684841&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/IntegerValidator.java
(original)
+++ sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/IntegerValidator.java
Thu Jun 11 09:33:41 2015
@@ -21,8 +21,8 @@ package org.apache.sling.validation.impl
 import javax.annotation.Nonnull;
 
 import org.apache.sling.api.resource.ValueMap;
-import org.apache.sling.validation.api.Validator;
-import org.apache.sling.validation.api.exceptions.SlingValidationException;
+import org.apache.sling.validation.Validator;
+import org.apache.sling.validation.exceptions.SlingValidationException;
 
 public class IntegerValidator implements Validator<Integer> {
 

Modified: sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/StringArrayValidator.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/StringArrayValidator.java?rev=1684841&r1=1684840&r2=1684841&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/StringArrayValidator.java
(original)
+++ sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/StringArrayValidator.java
Thu Jun 11 09:33:41 2015
@@ -21,8 +21,8 @@ package org.apache.sling.validation.impl
 import javax.annotation.Nonnull;
 
 import org.apache.sling.api.resource.ValueMap;
-import org.apache.sling.validation.api.Validator;
-import org.apache.sling.validation.api.exceptions.SlingValidationException;
+import org.apache.sling.validation.Validator;
+import org.apache.sling.validation.exceptions.SlingValidationException;
 
 public class StringArrayValidator implements Validator<String[]> {
 

Modified: sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/StringValidator.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/StringValidator.java?rev=1684841&r1=1684840&r2=1684841&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/StringValidator.java
(original)
+++ sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/StringValidator.java
Thu Jun 11 09:33:41 2015
@@ -21,8 +21,8 @@ package org.apache.sling.validation.impl
 import javax.annotation.Nonnull;
 
 import org.apache.sling.api.resource.ValueMap;
-import org.apache.sling.validation.api.Validator;
-import org.apache.sling.validation.api.exceptions.SlingValidationException;
+import org.apache.sling.validation.Validator;
+import org.apache.sling.validation.exceptions.SlingValidationException;
 
 public class StringValidator implements Validator<String> {
 

Modified: sling/trunk/bundles/extensions/validation/examples/src/main/java/org/apache/sling/validation/examples/models/UserModel.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/examples/src/main/java/org/apache/sling/validation/examples/models/UserModel.java?rev=1684841&r1=1684840&r2=1684841&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/validation/examples/src/main/java/org/apache/sling/validation/examples/models/UserModel.java
(original)
+++ sling/trunk/bundles/extensions/validation/examples/src/main/java/org/apache/sling/validation/examples/models/UserModel.java
Thu Jun 11 09:33:41 2015
@@ -27,9 +27,9 @@ import javax.inject.Inject;
 
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.models.annotations.Model;
-import org.apache.sling.validation.api.ValidationModel;
-import org.apache.sling.validation.api.ValidationResult;
-import org.apache.sling.validation.api.ValidationService;
+import org.apache.sling.validation.ValidationResult;
+import org.apache.sling.validation.ValidationService;
+import org.apache.sling.validation.model.ValidationModel;
 
 @Model(adaptables = Resource.class)
 public class UserModel {

Modified: sling/trunk/bundles/extensions/validation/examples/src/main/java/org/apache/sling/validation/examples/servlets/ModifyUserServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/examples/src/main/java/org/apache/sling/validation/examples/servlets/ModifyUserServlet.java?rev=1684841&r1=1684840&r2=1684841&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/validation/examples/src/main/java/org/apache/sling/validation/examples/servlets/ModifyUserServlet.java
(original)
+++ sling/trunk/bundles/extensions/validation/examples/src/main/java/org/apache/sling/validation/examples/servlets/ModifyUserServlet.java
Thu Jun 11 09:33:41 2015
@@ -34,9 +34,9 @@ import org.apache.sling.api.servlets.Sli
 import org.apache.sling.commons.json.JSONArray;
 import org.apache.sling.commons.json.JSONException;
 import org.apache.sling.commons.json.JSONObject;
-import org.apache.sling.validation.api.ValidationModel;
-import org.apache.sling.validation.api.ValidationResult;
-import org.apache.sling.validation.api.ValidationService;
+import org.apache.sling.validation.ValidationResult;
+import org.apache.sling.validation.ValidationService;
+import org.apache.sling.validation.model.ValidationModel;
 
 @SlingServlet(
         resourceTypes = "/apps/validationdemo/components/user",

Modified: sling/trunk/bundles/extensions/validation/it-http/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/it-http/pom.xml?rev=1684841&r1=1684840&r2=1684841&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/validation/it-http/pom.xml (original)
+++ sling/trunk/bundles/extensions/validation/it-http/pom.xml Thu Jun 11 09:33:41 2015
@@ -275,7 +275,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.testing.tools</artifactId>
-            <version>1.0.8</version>
+            <version>1.0.10</version>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>

Modified: sling/trunk/bundles/extensions/validation/test-services/src/main/java/org/apache/sling/validation/testservices/ValidationPostOperation.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/test-services/src/main/java/org/apache/sling/validation/testservices/ValidationPostOperation.java?rev=1684841&r1=1684840&r2=1684841&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/validation/test-services/src/main/java/org/apache/sling/validation/testservices/ValidationPostOperation.java
(original)
+++ sling/trunk/bundles/extensions/validation/test-services/src/main/java/org/apache/sling/validation/testservices/ValidationPostOperation.java
Thu Jun 11 09:33:41 2015
@@ -31,9 +31,9 @@ import org.apache.sling.servlets.post.Ab
 import org.apache.sling.servlets.post.Modification;
 import org.apache.sling.servlets.post.PostOperation;
 import org.apache.sling.servlets.post.PostResponse;
-import org.apache.sling.validation.api.ValidationModel;
-import org.apache.sling.validation.api.ValidationResult;
-import org.apache.sling.validation.api.ValidationService;
+import org.apache.sling.validation.ValidationResult;
+import org.apache.sling.validation.ValidationService;
+import org.apache.sling.validation.model.ValidationModel;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Modified: sling/trunk/bundles/extensions/validation/test-services/src/main/java/org/apache/sling/validation/testservices/ValidationPostResponse.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/test-services/src/main/java/org/apache/sling/validation/testservices/ValidationPostResponse.java?rev=1684841&r1=1684840&r2=1684841&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/validation/test-services/src/main/java/org/apache/sling/validation/testservices/ValidationPostResponse.java
(original)
+++ sling/trunk/bundles/extensions/validation/test-services/src/main/java/org/apache/sling/validation/testservices/ValidationPostResponse.java
Thu Jun 11 09:33:41 2015
@@ -18,19 +18,20 @@
  */
 package org.apache.sling.validation.testservices;
 
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletResponse;
+
 import org.apache.sling.commons.json.JSONException;
 import org.apache.sling.commons.json.JSONObject;
 import org.apache.sling.servlets.post.AbstractPostResponse;
-import org.apache.sling.validation.api.ValidationResult;
+import org.apache.sling.validation.ValidationResult;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.List;
-import java.util.Map;
-
 public class ValidationPostResponse extends AbstractPostResponse {
 
     private ValidationResult validationResult;



Mime
View raw message