protected void runSnapshotRemover(String name,
boolean deleteImmediately)
throws Exception
{
ScheduledServicePropertyResource repositoryProp = new ScheduledServicePropertyResource();
repositoryProp.setKey(SnapshotRemovalTaskDescriptor.REPO_OR_GROUP_FIELD_ID);
repositoryProp.setValue(getTestRepositoryId());
ScheduledServicePropertyResource keepSnapshotsProp = new ScheduledServicePropertyResource();
keepSnapshotsProp.setKey(SnapshotRemovalTaskDescriptor.MIN_TO_KEEP_FIELD_ID);
keepSnapshotsProp.setValue("-1");
ScheduledServicePropertyResource ageProp = new ScheduledServicePropertyResource();
ageProp.setKey(SnapshotRemovalTaskDescriptor.KEEP_DAYS_FIELD_ID);
ageProp.setValue("-1");
ScheduledServicePropertyResource removeReleasedProp = new ScheduledServicePropertyResource();
removeReleasedProp.setKey(SnapshotRemovalTaskDescriptor.REMOVE_WHEN_RELEASED_FIELD_ID);
removeReleasedProp.setValue(Boolean.toString(true));
ScheduledServicePropertyResource deleteImmediatelyProp = new ScheduledServicePropertyResource();
deleteImmediatelyProp.setKey(SnapshotRemovalTaskDescriptor.DELETE_IMMEDIATELY);
deleteImmediatelyProp.setValue(Boolean.toString(deleteImmediately));
TaskScheduleUtil.runTask(name, SnapshotRemovalTaskDescriptor.ID, repositoryProp,
keepSnapshotsProp, ageProp,
removeReleasedProp, deleteImmediatelyProp);
TaskScheduleUtil.waitForAllTasksToStop();