Search in sources :

Example 1 with JobType

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());
}
Also used : JobType(org.apache.xmpbox.type.JobType) XMPMetadata(org.apache.xmpbox.XMPMetadata) ByteArrayOutputStream(java.io.ByteArrayOutputStream) StructuredType(org.apache.xmpbox.type.StructuredType) Test(org.junit.Test)

Example 2 with JobType

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);
}
Also used : JobType(org.apache.xmpbox.type.JobType)

Example 3 with JobType

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());
}
Also used : JobType(org.apache.xmpbox.type.JobType) XMPMetadata(org.apache.xmpbox.XMPMetadata) ByteArrayOutputStream(java.io.ByteArrayOutputStream) Test(org.junit.Test)

Aggregations

JobType (org.apache.xmpbox.type.JobType)3 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 XMPMetadata (org.apache.xmpbox.XMPMetadata)2 Test (org.junit.Test)2 StructuredType (org.apache.xmpbox.type.StructuredType)1