sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1649500 - /sling/trunk/installer/it/src/test/java/org/apache/sling/installer/it/UpdateHandlerTest.java
Date Mon, 05 Jan 2015 11:06:33 GMT
Author: cziegeler
Date: Mon Jan  5 11:06:33 2015
New Revision: 1649500

URL: http://svn.apache.org/r1649500
Log:
Add testing of delete to update handler test

Modified:
    sling/trunk/installer/it/src/test/java/org/apache/sling/installer/it/UpdateHandlerTest.java

Modified: sling/trunk/installer/it/src/test/java/org/apache/sling/installer/it/UpdateHandlerTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/it/src/test/java/org/apache/sling/installer/it/UpdateHandlerTest.java?rev=1649500&r1=1649499&r2=1649500&view=diff
==============================================================================
--- sling/trunk/installer/it/src/test/java/org/apache/sling/installer/it/UpdateHandlerTest.java
(original)
+++ sling/trunk/installer/it/src/test/java/org/apache/sling/installer/it/UpdateHandlerTest.java
Mon Jan  5 11:06:33 2015
@@ -143,6 +143,7 @@ public class UpdateHandlerTest extends O
                 final Map<String, Object> attributes) {
             if ( resourceType.equals(TYPE)) {
                 final UpdateResult ur = new UpdateResult(TYPE + ":/resource/b/" + id + "."
+ resourceType);
+                ur.setPriority(InstallableResource.DEFAULT_PRIORITY * 2);
                 this.result = ur;
                 this.barrier.block();
 
@@ -151,9 +152,14 @@ public class UpdateHandlerTest extends O
             return null;
         }
 
-        public UpdateResult handleRemoval(String resourceType, String id, String url) {
-            // TODO Auto-generated method stub
-            return null;
+        public UpdateResult handleRemoval(final String resourceType,
+                final String id,
+                final String url) {
+            final UpdateResult ur = new UpdateResult(url);
+            this.result = ur;
+            this.barrier.block();
+
+            return ur;
         }
 
         public UpdateResult waitForUpdate() {
@@ -209,6 +215,11 @@ public class UpdateHandlerTest extends O
         final UpdateResult ur = up.waitForUpdate();
         assertNotNull(ur);
         assertEquals(TYPE + ":/resource/b/a." + TYPE, ur.getURL());
+
+        rcl.resourceRemoved(TYPE, "a");
+        final UpdateResult r2 = up.waitForUpdate();
+        assertNotNull(r2);
+        assertEquals(TYPE + ":/resource/b/a." + TYPE, r2.getURL());
     }
 
     /** Simplified version of the cyclic barrier class for testing. */



Mime
View raw message