You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2015/01/05 12:06:33 UTC
svn commit: r1649500 -
/sling/trunk/installer/it/src/test/java/org/apache/sling/installer/it/UpdateHandlerTest.java
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. */