use of org.opencastproject.job.api.JobImpl in project opencast by opencast.
the class JobTest method testMarshallingWithXmlPayload.
@Test
public void testMarshallingWithXmlPayload() throws Exception {
final String payload = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<random xmlns:ns2=\"http://mediapackage.opencastproject.org\" xmlns:ns3=\"http://job.opencastproject.org/\">something</random>";
Job job = new JobImpl();
job.setPayload(payload);
String marshalledJob = JobParser.toXml(new JaxbJob(job));
Job unmarshalledJob = JobParser.parseJob(marshalledJob);
assertEquals("xml from unmarshalled job should remain unchanged", StringUtils.trim(payload), StringUtils.trim(unmarshalledJob.getPayload()));
}
Aggregations