SchedulerAdapter { public XmlBuilder triggerToXmlBuilder(Trigger trigger) { XmlBuilder xbRoot = new XmlBuilder("triggerDetail"); TriggerKey triggerKey = trigger.getKey(); xbRoot.addAttribute("fullName", triggerKey.getGroup() + "." + triggerKey.getName()); xbRoot.addAttribute("triggerName", triggerKey.getName()); xbRoot.addAttribute("triggerGroup", triggerKey.getGroup()); String cn = trigger.getCalendarName(); xbRoot.addAttribute("calendarName", (cn == null ? "none" : cn)); xbRoot.addAttribute("endTime", convertDate(trigger.getEndTime())); xbRoot.addAttribute("finalFireTime", convertDate(trigger.getFinalFireTime())); xbRoot.addAttribute("previousFireTime", convertDate(trigger.getPreviousFireTime())); xbRoot.addAttribute("nextFireTime", convertDate(trigger.getNextFireTime())); xbRoot.addAttribute("startTime", convertDate(trigger.getStartTime())); xbRoot.addAttribute("misfireInstruction", Integer.toString(trigger.getMisfireInstruction())); if (trigger instanceof CronTrigger) { xbRoot.addAttribute("triggerType", "cron"); xbRoot.addAttribute("cronExpression", ((CronTrigger)trigger).getCronExpression()); } else if (trigger instanceof SimpleTrigger) { xbRoot.addAttribute("triggerType", "simple"); xbRoot.addAttribute("repeatInterval", ((SimpleTrigger)trigger).getRepeatInterval()); } else { xbRoot.addAttribute("triggerType", "unknown"); } return xbRoot; }  XmlBuilder getJobGroupNamesWithJobsToXml(Scheduler theScheduler, IbisManager ibisManager); XmlBuilder getJobTriggers(List<? extends Trigger> triggers); XmlBuilder getJobMessages(JobDef jobdef); XmlBuilder getJobRunStatistics(JobDef jobdef); XmlBuilder getSchedulerCalendarNamesToXml(Scheduler theScheduler); XmlBuilder getSchedulerMetaDataToXml(Scheduler theScheduler); XmlBuilder jobDataMapToXmlBuilder(JobDataMap jd); XmlBuilder jobDetailToXmlBuilder(JobDetail jobDetail); XmlBuilder triggerToXmlBuilder(Trigger trigger);  }
@Test public void testTriggerToXmlBuilderWithCronSchedule() throws SchedulerException, ParseException { schedulerHelper.scheduleJob(createServiceJob("DummyJob", "DummyGroup"), "0 0 5 * * ?)"); String scheduleXml = schedulerAdapter.triggerToXmlBuilder(schedulerHelper.getTrigger("DummyJob", "DummyGroup")).toXML(); assertTrue(scheduleXml.contains("cronExpression=")); }