this.marshalUnmarchalThenCompare(resourceResponse);
this.validateXmlHasNoPackageNames(resourceResponse);
}
public void onHold() {
ScheduledServiceWeeklyResource scheduledTask = new ScheduledServiceWeeklyResource();
scheduledTask.setSchedule("weekly");
scheduledTask.setEnabled(true);
scheduledTask.setId(null);
scheduledTask.setName("taskOnce");
// A future date
Date startDate = DateUtils.addDays(new Date(), 10);
startDate = DateUtils.round(startDate, Calendar.DAY_OF_MONTH);
scheduledTask.setStartDate(String.valueOf(startDate.getTime()));
scheduledTask.setRecurringTime("03:30");
// scheduledTask.setRecurringDay( Arrays.asList( new String[] { "monday", "wednesday", "friday" } ) );
scheduledTask.addRecurringDay("monday");
scheduledTask.addRecurringDay("wednesday");
scheduledTask.addRecurringDay("friday");
scheduledTask.setTypeId("org.sonatype.nexus.tasks.RepairIndexTask");
scheduledTask.setAlertEmail("foo@bar.org");
ScheduledServicePropertyResource prop = new ScheduledServicePropertyResource();
prop.setKey("repositoryId");
prop.setValue("all_repo");
scheduledTask.addProperty(prop);
ScheduledServiceResourceResponse resourceResponse = new ScheduledServiceResourceResponse();
resourceResponse.setData(scheduledTask);
// System.out.println( "xml:\n"+ this.xstreamXML.toXML( resourceResponse ) );