jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1136103 - /jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/RepositoryTest.java
Date Wed, 15 Jun 2011 16:12:15 GMT
Author: mduerig
Date: Wed Jun 15 16:12:15 2011
New Revision: 1136103

URL: http://svn.apache.org/viewvc?rev=1136103&view=rev
Log:
spi2microkernel prototype (WIP)
tests

Modified:
    jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/RepositoryTest.java

Modified: jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/RepositoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/RepositoryTest.java?rev=1136103&r1=1136102&r2=1136103&view=diff
==============================================================================
--- jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/RepositoryTest.java
(original)
+++ jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/RepositoryTest.java
Wed Jun 15 16:12:15 2011
@@ -257,7 +257,7 @@ public class RepositoryTest {
             Property property = session2.getProperty(testPath + "/multi string");
             assertTrue(property.isMultiple());
             Value[] values2 = property.getValues();
-            assertEquals(2, values.length);
+            assertEquals(values.length, values2.length);
             assertEquals(values[0], values2[0]);
             assertEquals(values[1], values2[1]);
         }
@@ -287,7 +287,7 @@ public class RepositoryTest {
             Property property = session2.getProperty(testPath + "/multi long");
             assertTrue(property.isMultiple());
             Value[] values2 = property.getValues();
-            assertEquals(2, values.length);
+            assertEquals(values.length, values2.length);
             assertEquals(values[0], values2[0]);
             assertEquals(values[1], values2[1]);
         }
@@ -318,7 +318,7 @@ public class RepositoryTest {
             Property property = session2.getProperty(testPath + "/multi double");
             assertTrue(property.isMultiple());
             Value[] values2 = property.getValues();
-            assertEquals(2, values.length);
+            assertEquals(values.length, values2.length);
             assertEquals(values[0], values2[0]);
             assertEquals(values[1], values2[1]);
         }
@@ -348,7 +348,7 @@ public class RepositoryTest {
             Property property = session2.getProperty(testPath + "/multi boolean");
             assertTrue(property.isMultiple());
             Value[] values2 = property.getValues();
-            assertEquals(2, values.length);
+            assertEquals(values.length, values2.length);
             assertEquals(values[0], values2[0]);
             assertEquals(values[1], values2[1]);
         }
@@ -378,7 +378,7 @@ public class RepositoryTest {
             Property property = session2.getProperty(testPath + "/multi decimal");
             assertTrue(property.isMultiple());
             Value[] values2 = property.getValues();
-            assertEquals(2, values.length);
+            assertEquals(values.length, values2.length);
             assertEquals(values[0], values2[0]);
             assertEquals(values[1], values2[1]);
         }
@@ -410,7 +410,7 @@ public class RepositoryTest {
             Property property = session2.getProperty(testPath + "/multi date");
             assertTrue(property.isMultiple());
             Value[] values2 = property.getValues();
-            assertEquals(2, values.length);
+            assertEquals(values.length, values2.length);
             assertEquals(values[0], values2[0]);
             assertEquals(values[1], values2[1]);
         }
@@ -440,7 +440,7 @@ public class RepositoryTest {
             Property property = session2.getProperty(testPath + "/multi uri");
             assertTrue(property.isMultiple());
             Value[] values2 = property.getValues();
-            assertEquals(2, values.length);
+            assertEquals(values.length, values2.length);
             assertEquals(values[0], values2[0]);
             assertEquals(values[1], values2[1]);
         }
@@ -470,7 +470,7 @@ public class RepositoryTest {
             Property property = session2.getProperty(testPath + "/multi name");
             assertTrue(property.isMultiple());
             Value[] values2 = property.getValues();
-            assertEquals(2, values.length);
+            assertEquals(values.length, values2.length);
             assertEquals(values[0], values2[0]);
             assertEquals(values[1], values2[1]);
         }
@@ -500,7 +500,7 @@ public class RepositoryTest {
             Property property = session2.getProperty(testPath + "/multi path");
             assertTrue(property.isMultiple());
             Value[] values2 = property.getValues();
-            assertEquals(2, values.length);
+            assertEquals(values.length, values2.length);
             assertEquals(values[0], values2[0]);
             assertEquals(values[1], values2[1]);
         }
@@ -538,7 +538,7 @@ public class RepositoryTest {
             Property property = session2.getProperty(testPath + "/multi binary");
             assertTrue(property.isMultiple());
             Value[] values2 = property.getValues();
-            assertEquals(2, values.length);
+            assertEquals(values.length, values2.length);
             assertEquals(values[0], values2[0]);
             assertEquals(values[1], values2[1]);
         }
@@ -562,7 +562,30 @@ public class RepositoryTest {
             assertTrue(property.isMultiple());
             assertEquals(PropertyType.BOOLEAN, property.getType());
             Value[] values2 = property.getValues();
-            assertEquals(0, values.length);
+            assertEquals(0, values2.length);
+        }
+        finally {
+            session2.logout();
+        }
+    }
+
+    @Test
+    public void addMultiValuedStringWithNull() throws RepositoryException {
+        Node parentNode = getNode(testPath);
+        Value[] values = new Value[3];
+        values[0] = getSession().getValueFactory().createValue(true);
+        values[2] = getSession().getValueFactory().createValue(false);
+
+        parentNode.setProperty("multi with null", values);
+        parentNode.getSession().save();
+
+        Session session2 = getRepository().login();
+        try {
+            Property property = session2.getProperty(testPath + "/multi with null");
+            assertTrue(property.isMultiple());
+            assertEquals(PropertyType.BOOLEAN, property.getType());
+            Value[] values2 = property.getValues();
+            assertEquals(values.length - 1, values2.length);
         }
         finally {
             session2.logout();



Mime
View raw message