@Test
public void testUpdateSimpleJob() throws SchedulerException {
long start = System.currentTimeMillis() + 1000;
long end = System.currentTimeMillis() + 1000 + 5*60*60*100;
SimpleJobTrigger jobTrigger = new SimpleJobTrigger();
jobTrigger.setStartTime( new Date(start) );
jobTrigger.setEndTime( new Date(end) );
jobTrigger.setRepeatInterval( 10 );
jobTrigger.setRepeatCount( 20 );
System.out.println( jobTrigger.toString() );
String jobId = schedulerSvc.createSimpleJob( "test job", jobParams, jobTrigger );
Assert.assertEquals( 1, schedulerSvc.getJobs().length );
jobTrigger = new SimpleJobTrigger();
start = System.currentTimeMillis() + 1000;
end = System.currentTimeMillis() + 1000 + 5*60*60*100;
jobTrigger.setStartTime( new Date(start));
jobTrigger.setEndTime( new Date(end) );
jobTrigger.setRepeatInterval( 40 );
jobTrigger.setRepeatCount( 50 );
System.out.println( jobTrigger.toString() );
HashMap<String, ParamValue> newJobParams = new HashMap<String, ParamValue>( jobParams );
newJobParams.put( "newKey", new StringParamValue( "" ) );
schedulerSvc.updateJobToUseSimpleTrigger( jobId, newJobParams, jobTrigger );
Assert.assertEquals( 1, schedulerSvc.getJobs().length );
Job job = schedulerSvc.getJobs()[0];
jobTrigger = (SimpleJobTrigger) job.getJobTrigger();
Assert.assertEquals( 40, jobTrigger.getRepeatInterval() );
Assert.assertEquals( 50, jobTrigger.getRepeatCount() );
Assert.assertTrue( job.getJobParams().containsKey( "newKey" ) );
jobTrigger.getStartTime() ;
Assert.assertEquals( new Date(start), jobTrigger.getStartTime());
Assert.assertEquals( new Date(end), jobTrigger.getEndTime() );
}