String schemDesc = "Schema Acte de naissance";
String schemURI = "http://test.apache.com/xap/adn/";
String schemPrefix = "adn";
SchemaDescription desc = schem.createSchemaDescription();
desc.setSchemaValue(schemDesc);
desc.setNameSpaceURIValue(schemURI);
desc.setPrefixValue(schemPrefix);
schem.addSchemaDescription(desc);
Assert.assertEquals(schemDesc, desc.getSchema());
Assert.assertEquals(schemURI, desc.getNameSpaceURI());
Assert.assertEquals(schemPrefix, desc.getPrefix());
String descExpected = "nom de la personne concernée";
desc.addProperty("nom", "Text", "external",
"nom de la personne concernee");
desc.addProperty("nom", "Text", "external", descExpected);
Assert.assertEquals(1, desc.getProperties().size());
Assert.assertEquals(descExpected, desc.getProperties().get(0)
.getDescriptionValue());
desc.addProperty("prénom", "Text", "external",
"prénom de la personne concernée");
List<PDFAPropertyDescription> list = desc.getProperties();
Assert.assertEquals("nom", list.get(0).getNameValue());
Assert.assertEquals("prénom", list.get(1).getNameValue());
// Check retrieve descriptions
Assert.assertEquals(desc, schem.getIteratorOfDescriptions().next());
Assert.assertEquals(desc, schem.getDescriptionSchema().get(0));
// check retrieve this schema in metadata
Assert.assertEquals(schem, metadata.getPDFExtensionSchema());
// Check if no problem when create 2 description and display result
SchemaDescription desc2 = schem.createSchemaDescription();
desc2.setSchemaValue("2eme schema de test");
desc2.setNameSpaceURIValue("http://test.apache.com/xap/test/");
desc2.setPrefixValue("tst");
desc2.addProperty("TestText", "OwnType", "external",
"just a text property");
schem.addSchemaDescription(desc2);
// Check value type
String valType = "OwnType";
String nsType = "http://test.apache.com/xap/test/";
String prefType = "tst";
String descType = "Test Own type";
desc2.addValueType(valType, nsType, prefType, "must be replaced", null);
desc2.addValueType(valType, nsType, prefType, descType, null);
Assert.assertEquals(1, desc2.getValueTypes().size());
PDFAValueTypeDescription value = desc2.getValueTypes().get(0);
Assert.assertEquals(valType, value.getTypeNameValue());
Assert.assertEquals(nsType, value.getNamespaceURIValue());
Assert.assertEquals(prefType, value.getPrefixValue());
Assert.assertEquals(descType, value.getDescriptionValue());