use of org.apache.xmpbox.type.JobType in project pdfbox by apache.
the class BasicJobTicketSchemaTest method testAddWithDefaultPrefix.
@Test
public void testAddWithDefaultPrefix() throws Exception {
XMPBasicJobTicketSchema basic = metadata.createAndAddBasicJobTicketSchema();
basic.addJob("zeid2", "zename2", "zeurl2");
// serializer.serialize(metadata, System.out, true);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
serializer.serialize(metadata, bos, true);
XMPMetadata rxmp = builder.parse(bos.toByteArray());
XMPBasicJobTicketSchema jt = rxmp.getBasicJobTicketSchema();
Assert.assertNotNull(jt);
Assert.assertEquals(1, jt.getJobs().size());
StructuredType stjob = JobType.class.getAnnotation(StructuredType.class);
JobType job = jt.getJobs().get(0);
Assert.assertEquals("zeid2", job.getId());
Assert.assertEquals("zename2", job.getName());
Assert.assertEquals("zeurl2", job.getUrl());
// Assert.assertEquals("Invalid namespace",stjob.namespace(),
// job.getNamespace());
// Assert.assertEquals(stjob.preferedPrefix(), job.getPrefix());
}
use of org.apache.xmpbox.type.JobType in project pdfbox by apache.
the class XMPBasicJobTicketSchema method addJob.
public void addJob(String id, String name, String url, String fieldPrefix) {
JobType job = new JobType(getMetadata(), fieldPrefix);
job.setId(id);
job.setName(name);
job.setUrl(url);
addJob(job);
}
use of org.apache.xmpbox.type.JobType in project pdfbox by apache.
the class BasicJobTicketSchemaTest method testAddWithDefinedPrefix.
@Test
public void testAddWithDefinedPrefix() throws Exception {
XMPBasicJobTicketSchema basic = metadata.createAndAddBasicJobTicketSchema();
basic.addJob("zeid2", "zename2", "zeurl2", "aaa");
// SaveMetadataHelper.serialize(metadata, System.out);
// serializer.serialize(metadata, System.out, true);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
serializer.serialize(metadata, bos, true);
XMPMetadata rxmp = builder.parse(bos.toByteArray());
XMPBasicJobTicketSchema jt = rxmp.getBasicJobTicketSchema();
Assert.assertNotNull(jt);
Assert.assertEquals(1, jt.getJobs().size());
JobType job = jt.getJobs().get(0);
// SaveMetadataHelper.serialize(rxmp, System.out);
// StructuredType stjob =
// JobType.class.getAnnotation(StructuredType.class);
Assert.assertEquals("zeid2", job.getId());
Assert.assertEquals("zename2", job.getName());
Assert.assertEquals("zeurl2", job.getUrl());
// Assert.assertEquals(stjob.namespace(), job.getNamespace());
// Assert.assertEquals("aaa", job.getPrefix());
}
Aggregations