sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jus...@apache.org
Subject svn commit: r988134 - in /sling/trunk/installer/jcr/jcrinstall/src: main/java/org/apache/sling/jcr/jcrinstall/impl/RootFolderListener.java test/java/org/apache/sling/jcr/jcrinstall/impl/FolderDetectionTest.java
Date Mon, 23 Aug 2010 14:39:47 GMT
Author: justin
Date: Mon Aug 23 14:39:47 2010
New Revision: 988134

URL: http://svn.apache.org/viewvc?rev=988134&view=rev
Log:
update test for JR 2.1 issues

Modified:
    sling/trunk/installer/jcr/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/impl/RootFolderListener.java
    sling/trunk/installer/jcr/jcrinstall/src/test/java/org/apache/sling/jcr/jcrinstall/impl/FolderDetectionTest.java

Modified: sling/trunk/installer/jcr/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/impl/RootFolderListener.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/jcr/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/impl/RootFolderListener.java?rev=988134&r1=988133&r2=988134&view=diff
==============================================================================
--- sling/trunk/installer/jcr/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/impl/RootFolderListener.java
(original)
+++ sling/trunk/installer/jcr/jcrinstall/src/main/java/org/apache/sling/jcr/jcrinstall/impl/RootFolderListener.java
Mon Aug 23 14:39:47 2010
@@ -84,6 +84,8 @@ class RootFolderListener implements Even
         try {
             while(it.hasNext()) {
                 final Event e = it.nextEvent();
+
+                log.debug("Got event {}", e);
                 // Rescan on all NODE_REMOVED events, to be on the safe side:
                 // an install folder might have been removed, and (I think) this is
                 // the safest way of finding out.

Modified: sling/trunk/installer/jcr/jcrinstall/src/test/java/org/apache/sling/jcr/jcrinstall/impl/FolderDetectionTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/jcr/jcrinstall/src/test/java/org/apache/sling/jcr/jcrinstall/impl/FolderDetectionTest.java?rev=988134&r1=988133&r2=988134&view=diff
==============================================================================
--- sling/trunk/installer/jcr/jcrinstall/src/test/java/org/apache/sling/jcr/jcrinstall/impl/FolderDetectionTest.java
(original)
+++ sling/trunk/installer/jcr/jcrinstall/src/test/java/org/apache/sling/jcr/jcrinstall/impl/FolderDetectionTest.java
Mon Aug 23 14:39:47 2010
@@ -57,14 +57,26 @@ public class FolderDetectionTest extends
         contentHelper.createFolder("/libs/foo/install");
         MiscUtil.waitAfterContentChanges(eventHelper, installer);
 
+        assertFalse("/foo must not exist when test starts", session.itemExists("/foo"));
+        contentHelper.createFolder("/foo");
+
         contentHelper.createOrUpdateFile(res);
         MiscUtil.waitAfterContentChanges(eventHelper, installer);
 
         assertRegistered("After creating libs and test file", res, true);
 
-        session.move("/libs", "/foo");
+        session.move("/libs/foo", "/foo/bar");
+        session.save();
+        assertFalse(session.itemExists("/libs/foo/install"));
+
         MiscUtil.waitAfterContentChanges(eventHelper, installer);
         assertRegistered("After moving /libs to /foo", res, false);
+
+        contentHelper.delete("/foo");
+        MiscUtil.waitAfterContentChanges(eventHelper, installer);
+
+        contentHelper.delete("/libs");
+        MiscUtil.waitAfterContentChanges(eventHelper, installer);
     }
 
     public void testMoveLibsToApps() throws Exception {
@@ -78,15 +90,25 @@ public class FolderDetectionTest extends
         contentHelper.createFolder("/libs/foo/install");
         MiscUtil.waitAfterContentChanges(eventHelper, installer);
 
+        assertFalse("/apps must not exist when test starts", session.itemExists("/apps"));
+        contentHelper.createFolder("/apps");
+
         contentHelper.createOrUpdateFile(res);
         MiscUtil.waitAfterContentChanges(eventHelper, installer);
 
         assertRegistered("After creating libs and test file", res, true);
 
-        session.move("/libs", "/apps");
+        session.move("/libs/foo", "/apps/foo");
+        session.save();
         MiscUtil.waitAfterContentChanges(eventHelper, installer);
         MiscUtil.waitAfterContentChanges(eventHelper, installer);
         assertRegistered("/apps resource must be registered", appsRes, true);
         assertRegistered("/libs resource must be gone", res, false);
+
+        contentHelper.delete("/apps");
+        MiscUtil.waitAfterContentChanges(eventHelper, installer);
+
+        contentHelper.delete("/libs");
+        MiscUtil.waitAfterContentChanges(eventHelper, installer);
     }
 }



Mime
View raw message