Package org.apache.padaf.xmpbox.schema

Examples of org.apache.padaf.xmpbox.schema.PDFAPropertyDescription


    parent = new XMPMetadata();
  }

  @Test
  public void testCreateOnePdfaProperty() throws Exception {
    PDFAPropertyDescription pdfprop = new PDFAPropertyDescription(parent);
    String name = "value Test";
    String valueT = "Text";
    String cat = "external";
    String desc = "it's a test property";
    pdfprop.setNameValue(name);
    pdfprop.setValueTypeValue(valueT);
    pdfprop.setCategoryValue(cat);
    pdfprop.setDescriptionValue(desc);

    Assert.assertEquals(name, pdfprop.getNameValue());
    Assert.assertEquals(valueT, pdfprop.getValueTypeValue());
    Assert.assertEquals(cat, pdfprop.getCategoryValue());
    Assert.assertEquals(desc, pdfprop.getDescriptionValue());

    Assert.assertEquals(name, pdfprop.getName().getStringValue());
    Assert.assertEquals(valueT, pdfprop.getValueType().getStringValue());
    Assert.assertEquals(cat, pdfprop.getCategory().getStringValue());
    Assert.assertEquals(desc, pdfprop.getDescription().getStringValue());

    Element e = parent.getFuturOwner().createElement("test");
    e.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:rdf",
        "http://www.w3.org/1999/02/22-rdf-syntax-ns#");
    e.appendChild(pdfprop.getElement());
    parent.getFuturOwner().appendChild(e);
    // XMLUtil.save(parent.getFuturOwner(), System.out, "UTF-8");
  }
View Full Code Here


    // XMLUtil.save(parent.getFuturOwner(), System.out, "UTF-8");
  }

  @Test(expected = BadFieldValueException.class)
  public void testBadFieldCheckForCategory() throws Exception {
    PDFAPropertyDescription pdfprop = new PDFAPropertyDescription(parent);
    String name = "value Test";
    String valueT = "Text";
    String cat = "badvalue";
    String desc = "it's a test property";
    pdfprop.setNameValue(name);
    pdfprop.setValueTypeValue(valueT);
    pdfprop.setCategoryValue(cat);
    pdfprop.setDescriptionValue(desc);

  }
View Full Code Here

    // Check property definition
    List<PDFAPropertyDescription> properties = desc.getProperties();
    Assert.assertTrue(properties.size() == 2);

    // Check properties content
    PDFAPropertyDescription tmpProp = properties.get(0);
    Assert.assertEquals("Delivery-Date", tmpProp.getNameValue());
    Assert.assertEquals("Date", tmpProp.getValueTypeValue());
    Assert.assertEquals("internal", tmpProp.getCategoryValue());
    Assert.assertEquals("date of email delivery", tmpProp
        .getDescriptionValue());

    tmpProp = properties.get(1);
    Assert.assertEquals("From", tmpProp.getNameValue());
    Assert.assertEquals("mailaddress", tmpProp.getValueTypeValue());
    Assert.assertEquals("internal", tmpProp.getCategoryValue());
    Assert.assertEquals("sender email address", tmpProp
        .getDescriptionValue());

    // Check valuetype
    // Check numbers of valuetype defined
    Assert.assertTrue(desc.getValueTypes().size() == 1);
View Full Code Here

    // Check property definition
    List<PDFAPropertyDescription> properties = desc.getProperties();
    Assert.assertTrue(properties.size() == 2);

    // Check properties content
    PDFAPropertyDescription tmpProp = properties.get(0);
    Assert.assertEquals("Delivery-Date", tmpProp.getNameValue());
    Assert.assertEquals("Date", tmpProp.getValueTypeValue());
    Assert.assertEquals("internal", tmpProp.getCategoryValue());
    Assert.assertEquals("date of email delivery", tmpProp
        .getDescriptionValue());

    tmpProp = properties.get(1);
    Assert.assertEquals("From", tmpProp.getNameValue());
    Assert.assertEquals("mailaddress", tmpProp.getValueTypeValue());
    Assert.assertEquals("internal", tmpProp.getCategoryValue());
    Assert.assertEquals("sender email address", tmpProp
        .getDescriptionValue());

    // Check valuetype
    // Check numbers of valuetype defined
    Assert.assertTrue(desc.getValueTypes().size() == 1);
View Full Code Here

TOP

Related Classes of org.apache.padaf.xmpbox.schema.PDFAPropertyDescription

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.