SchedulerAdapter { public XmlBuilder jobDataMapToXmlBuilder(JobDataMap jd) { XmlBuilder xbRoot = new XmlBuilder("jobDataMap"); String[] keys = jd.getKeys(); for (int i = 0; i < keys.length; i++) { String name = keys[i]; String value=""; Object obj = jd.get(keys[i]); if (obj!=null) { value = obj.toString(); } XmlBuilder ds = new XmlBuilder("property"); ds.addAttribute("key", name); if (obj!=null){ ds.addAttribute("className", obj.getClass().getName()); } else { ds.addAttribute("className", "null"); } ds.setValue(value); xbRoot.addSubElement(ds); } 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 testJobDataMapToXmlBuilder() throws SchedulerException { JobDataMap jobDataMap = new JobDataMap(); jobDataMap.put(JAVALISTENER, "javaListener"); jobDataMap.put(CORRELATIONID, "correlationId"); jobDataMap.put(MESSAGE, "message"); assertEquals("<jobMessages />", schedulerAdapter.getJobMessages(null).toXML().trim()); }