jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1360591 - /jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
Date Thu, 12 Jul 2012 09:11:39 GMT
Author: thomasm
Date: Thu Jul 12 09:11:38 2012
New Revision: 1360591

URL: http://svn.apache.org/viewvc?rev=1360591&view=rev
Log:
OAK-179 Tests should not fail if there is a jcr:system node

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java?rev=1360591&r1=1360590&r2=1360591&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
Thu Jul 12 09:11:38 2012
@@ -223,9 +223,13 @@ public class RepositoryTest extends Abst
         root.getNode("bar").remove();  // transiently removed and...
         root.addNode("bar");           // ... added again
         NodeIterator nodes = root.getNodes();
-        assertEquals(3, nodes.getSize());
+        int expected = 3 + (root.hasNode("jcr:system") ? 1 : 0);
+        assertEquals(expected, nodes.getSize());
         while (nodes.hasNext()) {
-            assertTrue(nodeNames.remove(nodes.nextNode().getName()));
+        		String name = nodes.nextNode().getName();
+        		if (!name.equals("jcr:system")) {
+        			assertTrue(nodeNames.remove(name));
+        		}
         }
 
         assertTrue(nodeNames.isEmpty());
@@ -1491,29 +1495,34 @@ public class RepositoryTest extends Abst
                     while (events.hasNext()) {
                         Event event = events.nextEvent();
                         try {
+                            String path = event.getPath();
+                            if (path.startsWith("/jcr:system")) {
+                            		// ignore changes in jcr:system
+                            		continue;
+                            }
                             switch (event.getType()) {
                                 case Event.NODE_ADDED:
-                                    if (!addNodes.remove(event.getPath())) {
+                                    if (!addNodes.remove(path)) {
                                         failedEvents.add(event);
                                     }
                                     break;
                                 case Event.NODE_REMOVED:
-                                    if (!removeNodes.remove(event.getPath())) {
+                                    if (!removeNodes.remove(path)) {
                                         failedEvents.add(event);
                                     }
                                     break;
                                 case Event.PROPERTY_ADDED:
-                                    if (!addProperties.remove(event.getPath())) {
+                                    if (!addProperties.remove(path)) {
                                         failedEvents.add(event);
                                     }
                                     break;
                                 case Event.PROPERTY_CHANGED:
-                                    if (!setProperties.remove(event.getPath())) {
+                                    if (!setProperties.remove(path)) {
                                         failedEvents.add(event);
                                     }
                                     break;
                                 case Event.PROPERTY_REMOVED:
-                                    if (!removeProperties.remove(event.getPath())) {
+                                    if (!removeProperties.remove(path)) {
                                         failedEvents.add(event);
                                     }
                                     break;
@@ -1584,24 +1593,29 @@ public class RepositoryTest extends Abst
                     while (events.hasNext()) {
                         Event event = events.nextEvent();
                         try {
+                            String path = event.getPath();
+                            if (path.startsWith("/jcr:system")) {
+                            		// ignore changes in jcr:system
+                            		continue;
+                            }
                             switch (event.getType()) {
                                 case Event.NODE_ADDED:
-                                    if (!addNodes.remove(event.getPath())) {
+                                    if (!addNodes.remove(path)) {
                                         failedEvents.add(event);
                                     }
                                     break;
                                 case Event.NODE_REMOVED:
-                                    if (!removeNodes.remove(event.getPath())) {
+                                    if (!removeNodes.remove(path)) {
                                         failedEvents.add(event);
                                     }
                                     break;
                                 case Event.PROPERTY_ADDED:
-                                    if (!addProperties.remove(event.getPath())) {
+                                    if (!addProperties.remove(path)) {
                                         failedEvents.add(event);
                                     }
                                     break;
                                 case Event.PROPERTY_REMOVED:
-                                    if (!removeProperties.remove(event.getPath())) {
+                                    if (!removeProperties.remove(path)) {
                                         failedEvents.add(event);
                                     }
                                     break;



Mime
View raw message