SLING-5153 - MockProperty.isMultiple returns always false

* Return the same for prop.getDefinition().isMultiple() and prop.isMultiple()

Submitted-By: Joel Richard <joelrich@adobe.com>

git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1708927 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/java/org/apache/sling/commons/testing/jcr/MockProperty.java b/src/main/java/org/apache/sling/commons/testing/jcr/MockProperty.java
index d9866fb..8e519a1 100644
--- a/src/main/java/org/apache/sling/commons/testing/jcr/MockProperty.java
+++ b/src/main/java/org/apache/sling/commons/testing/jcr/MockProperty.java
@@ -67,7 +67,7 @@
     }
 
     public PropertyDefinition getDefinition() throws RepositoryException {
-        return new MockPropertyDefinition(values.length > 1);
+        return new MockPropertyDefinition(isMultiple());
     }
 
     public double getDouble() throws ValueFormatException, RepositoryException {
@@ -267,8 +267,7 @@
     }
 
     public boolean isMultiple() throws RepositoryException {
-        // TODO Auto-generated method stub
-        return false;
+        return values.length > 1;
     }
 
     public void setValue(BigDecimal value) throws ValueFormatException,
diff --git a/src/test/java/org/apache/sling/commons/testing/jcr/MockPropertyTest.java b/src/test/java/org/apache/sling/commons/testing/jcr/MockPropertyTest.java
new file mode 100644
index 0000000..6cad207
--- /dev/null
+++ b/src/test/java/org/apache/sling/commons/testing/jcr/MockPropertyTest.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.commons.testing.jcr;
+
+import org.junit.Test;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+public class MockPropertyTest {
+
+    @Test
+    public void testIsMultipleFalse() throws Exception {
+        MockProperty prop = new MockProperty("prop");
+        prop.setValue(new String[] {"val"});
+
+        assertFalse(prop.isMultiple());
+        assertFalse(prop.getDefinition().isMultiple());
+    }
+
+    @Test
+    public void testIsMultipleTrue() throws Exception {
+        MockProperty prop = new MockProperty("prop");
+        prop.setValue(new String[] {"val1", "val2"});
+
+        assertTrue(prop.isMultiple());
+        assertTrue(prop.getDefinition().isMultiple());
+    }
+
+}