sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o...@apache.org
Subject svn commit: r1733722 - in /sling/trunk/bundles/extensions/validation: api/src/main/java/org/apache/sling/validation/model/spi/ core/src/main/java/org/apache/sling/validation/impl/ core/src/main/java/org/apache/sling/validation/impl/resourcemodel/ core/...
Date Sat, 05 Mar 2016 14:21:27 GMT
Author: olli
Date: Sat Mar  5 14:21:27 2016
New Revision: 1733722

URL: http://svn.apache.org/viewvc?rev=1733722&view=rev
Log:
SLING-5585 Use plural for method ValidationModelProvider#getModel(...):Collection<ValidationModel>

Modified:
    sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/model/spi/ValidationModelProvider.java
    sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationModelRetrieverImpl.java
    sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/resourcemodel/ResourceValidationModelProviderImpl.java
    sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationModelRetrieverImplTest.java
    sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/resourcemodel/ResourceValidationModelProviderImplTest.java

Modified: sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/model/spi/ValidationModelProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/model/spi/ValidationModelProvider.java?rev=1733722&r1=1733721&r2=1733722&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/model/spi/ValidationModelProvider.java
(original)
+++ sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/model/spi/ValidationModelProvider.java
Sat Mar  5 14:21:27 2016
@@ -51,7 +51,7 @@ public interface ValidationModelProvider
      * @throws IllegalStateException
      *             in case a validation model was found but it is invalid
      */
-    public @Nonnull Collection<ValidationModel> getModel(@Nonnull String relativeResourceType,
+    public @Nonnull Collection<ValidationModel> getModels(@Nonnull String relativeResourceType,
             @Nonnull Map<String, Validator<?>> validatorsMap, @Nonnull ResourceResolver
resourceResolver)
             throws IllegalStateException;
 }

Modified: sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationModelRetrieverImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationModelRetrieverImpl.java?rev=1733722&r1=1733721&r2=1733722&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationModelRetrieverImpl.java
(original)
+++ sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationModelRetrieverImpl.java
Sat Mar  5 14:21:27 2016
@@ -83,7 +83,7 @@ public class ValidationModelRetrieverImp
     /*
      * (non-Javadoc)
      * 
-     * @see org.apache.sling.validation.impl.ValidationModelRetriever#getModel(java.lang.String,
java.lang.String)
+     * @see org.apache.sling.validation.impl.ValidationModelRetriever#getModels(java.lang.String,
java.lang.String)
      */
     @Override
     public @CheckForNull ValidationModel getModel(@Nonnull String resourceType, String resourcePath,
@@ -154,7 +154,7 @@ public class ValidationModelRetrieverImp
             // fill trie with data from model providers (all models for the given resource
type, independent of resource
             // path)
             for (ValidationModelProvider modelProvider : modelProviders) {
-                for (ValidationModel model : modelProvider.getModel(resourceType, validators,
resourceResolver)) {
+                for (ValidationModel model : modelProvider.getModels(resourceType, validators,
resourceResolver)) {
                     for (String applicablePath : model.getApplicablePaths()) {
                         modelsForResourceType.insert(applicablePath, model);
                     }

Modified: sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/resourcemodel/ResourceValidationModelProviderImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/resourcemodel/ResourceValidationModelProviderImpl.java?rev=1733722&r1=1733721&r2=1733722&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/resourcemodel/ResourceValidationModelProviderImpl.java
(original)
+++ sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/resourcemodel/ResourceValidationModelProviderImpl.java
Sat Mar  5 14:21:27 2016
@@ -168,7 +168,7 @@ public class ResourceValidationModelProv
      */
     @Override
     @Nonnull
-    public Collection<ValidationModel> getModel(@Nonnull String relativeResourceType,
@Nonnull Map<String, Validator<?>> validatorsMap, @Nonnull ResourceResolver resourceResolver)
{
+    public Collection<ValidationModel> getModels(@Nonnull String relativeResourceType,
@Nonnull Map<String, Validator<?>> validatorsMap, @Nonnull ResourceResolver resourceResolver)
{
         ValidationModelImpl vm;
         Collection<ValidationModel> validationModels = new ArrayList<ValidationModel>();
         String[] searchPaths = resourceResolver.getSearchPath();

Modified: sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationModelRetrieverImplTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationModelRetrieverImplTest.java?rev=1733722&r1=1733721&r2=1733722&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationModelRetrieverImplTest.java
(original)
+++ sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationModelRetrieverImplTest.java
Sat Mar  5 14:21:27 2016
@@ -69,7 +69,7 @@ public class ValidationModelRetrieverImp
         int counter = 0;
 
         @Override
-        public @Nonnull Collection<ValidationModel> getModel(@Nonnull String relativeResourceType,
+        public @Nonnull Collection<ValidationModel> getModels(@Nonnull String relativeResourceType,
                 @Nonnull Map<String, Validator<?>> validatorsMap, @Nonnull ResourceResolver
resourceResolver) {
             // make sure the date validator is passed along
             Assert.assertThat(validatorsMap,

Modified: 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=1733722&r1=1733721&r2=1733722&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/resourcemodel/ResourceValidationModelProviderImplTest.java
(original)
+++ sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/resourcemodel/ResourceValidationModelProviderImplTest.java
Sat Mar  5 14:21:27 2016
@@ -203,7 +203,7 @@ public class ResourceValidationModelProv
     }
 
     @Test
-    public void testGetValidationModel() throws Exception {
+    public void testGetValidationModels() 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");
@@ -214,12 +214,12 @@ public class ResourceValidationModelProv
         createValidationModelResource(rr, libsValidatorsRoot.getPath(), "testValidationModel2",
model2);
 
         // check that both models are returned
-        Collection<ValidationModel> models = modelProvider.getModel("sling/validation/test",
validatorMap, rr);
+        Collection<ValidationModel> models = modelProvider.getModels("sling/validation/test",
validatorMap, rr);
         Assert.assertThat(models, Matchers.containsInAnyOrder(model1, model2));
     }
 
     @Test
-    public void testGetValidationModelOutsideSearchPath() throws Exception {
+    public void testGetValidationModelsOutsideSearchPath() throws Exception {
         // build two models manually (which are identical except for the applicable path)
         ValidationModel model1 = modelBuilder.build("sling/validation/test");
 
@@ -230,7 +230,7 @@ public class ResourceValidationModelProv
             createValidationModelResource(rr, contentValidatorsRoot.getPath(), "testValidationModel1",
model1);
 
             // check that no model is found
-            Collection<ValidationModel> models = modelProvider.getModel("sling/validation/test",
validatorMap, rr);
+            Collection<ValidationModel> models = modelProvider.getModels("sling/validation/test",
validatorMap, rr);
             Assert.assertThat("Model was placed outside resource resolver search path but
still found", models, Matchers.empty());
         } finally {
             rr.delete(contentValidatorsRoot);
@@ -238,7 +238,7 @@ public class ResourceValidationModelProv
     }
 
     @Test
-    public void testGetValidationModelWithChildren() throws Exception {
+    public void testGetValidationModelsWithChildren() throws Exception {
         // build two models manually (which are identical except for the applicable path)
         ResourcePropertyBuilder resourcePropertyBuilder = new ResourcePropertyBuilder();
         resourcePropertyBuilder.multiple();
@@ -252,12 +252,12 @@ public class ResourceValidationModelProv
         createValidationModelResource(rr, libsValidatorsRoot.getPath(), "testValidationModel1",
model1);
 
         // compare both models
-        Collection<ValidationModel> models = modelProvider.getModel("sling/validation/test",
validatorMap, rr);
+        Collection<ValidationModel> models = modelProvider.getModels("sling/validation/test",
validatorMap, rr);
         Assert.assertThat(models, Matchers.contains(model1));
     }
 
     @Test
-    public void testGetValidationModelWithOverlay() throws Exception {
+    public void testGetValidationModelsWithOverlay() 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");
@@ -268,23 +268,23 @@ public class ResourceValidationModelProv
         createValidationModelResource(rr, appsValidatorsRoot.getPath(), "testValidationModel1",
model2);
 
         // only the apps model should be returned
-        Collection<ValidationModel> models = modelProvider.getModel("sling/validation/test",
validatorMap, rr);
+        Collection<ValidationModel> models = modelProvider.getModels("sling/validation/test",
validatorMap, rr);
         Assert.assertThat(models, Matchers.contains(model2));
     }
 
     @Test(expected = IllegalStateException.class)
-    public void testGetValidationModelWithInvalidValidator() throws Exception {
+    public void testGetValidationModelsWithInvalidValidator() 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("sling/validation/test", validatorMap, rr);
+        modelProvider.getModels("sling/validation/test", validatorMap, rr);
     }
     
     @Test(expected = IllegalStateException.class)
-    public void testGetValidationModelWithMissingChildrenAndProperties() throws Exception
{
+    public void testGetValidationModelsWithMissingChildrenAndProperties() throws Exception
{
         // create a model with neither children nor properties
         modelBuilder = new ValidationModelBuilder();
         modelBuilder.addApplicablePath("content/site1");
@@ -292,7 +292,7 @@ public class ResourceValidationModelProv
         
         createValidationModelResource(rr, libsValidatorsRoot.getPath(), "testValidationModel1",
model1);
 
-        modelProvider.getModel("sling/validation/test", validatorMap, rr);
+        modelProvider.getModels("sling/validation/test", validatorMap, rr);
     }
 
     private Resource createValidationModelResource(ResourceResolver rr, String root, String
name, ValidationModel model)



Mime
View raw message