parent = new XMPMetadata();
}
@Test
public void testCreateOnePdfaProperty() throws TransformerException {
PDFAValueTypeDescription pdfvalueType = new PDFAValueTypeDescription(
parent);
String type = "value Test";
String namespaceURI = "Text";
String prefix = "test";
String description = "it's a test property";
String fieldName1 = "field1";
String fieldValueType1 = "Text";
String fieldDescription1 = "Field one";
String fieldName2 = "field2";
String fieldValueType2 = "Text";
String fieldDescription2 = "Field two";
pdfvalueType.setTypeNameValue(type);
pdfvalueType.setNamespaceURIValue(namespaceURI);
pdfvalueType.setPrefixValue(prefix);
pdfvalueType.setDescriptionValue(description);
Assert.assertEquals("pdfaType:type", pdfvalueType.getTypeName()
.getQualifiedName());
Assert.assertEquals(type, pdfvalueType.getTypeNameValue());
Assert.assertEquals("pdfaType:namespaceURI", pdfvalueType
.getNamespaceURI().getQualifiedName());
Assert.assertEquals(namespaceURI, pdfvalueType.getNamespaceURIValue());
Assert.assertEquals("pdfaType:prefix", pdfvalueType.getPrefix()
.getQualifiedName());
Assert.assertEquals(prefix, pdfvalueType.getPrefixValue());
Assert.assertEquals("pdfaType:description", pdfvalueType
.getDescription().getQualifiedName());
Assert.assertEquals(description, pdfvalueType.getDescriptionValue());
pdfvalueType.addField(fieldName1, fieldValueType1, fieldDescription1);
pdfvalueType.addField(fieldName2, fieldValueType2, fieldDescription2);
PDFAFieldDescription field1, field2;
Assert.assertEquals(2, pdfvalueType.getFields().size());
field1 = pdfvalueType.getFields().get(0);
field2 = pdfvalueType.getFields().get(1);
Assert.assertEquals("pdfaField:name", field1.getName()
.getQualifiedName());
Assert.assertEquals(fieldName1, field1.getNameValue());
Assert.assertEquals("pdfaField:valueType", field1.getValueType()
.getQualifiedName());
Assert.assertEquals(fieldValueType1, field1.getValueTypeValue());
Assert.assertEquals("pdfaField:description", field1.getDescription()
.getQualifiedName());
Assert.assertEquals(fieldDescription1, field1.getDescriptionValue());
Assert.assertEquals("pdfaField:name", field2.getName()
.getQualifiedName());
Assert.assertEquals(fieldName2, field2.getNameValue());
Assert.assertEquals("pdfaField:valueType", field2.getValueType()
.getQualifiedName());
Assert.assertEquals(fieldValueType2, field2.getValueTypeValue());
Assert.assertEquals("pdfaField:description", field2.getDescription()
.getQualifiedName());
Assert.assertEquals(fieldDescription2, field2.getDescriptionValue());
// test add same field
pdfvalueType.addField(field1);
/*
* 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#");