use of org.apache.xmpbox.type.TextType in project pdfbox by apache.
the class AbstractXMPSchemaTest method testGetSetTextProperty.
protected void testGetSetTextProperty() throws Exception {
String setName = setMethod(property);
String getName = getMethod(property);
TextType tt = metadata.getTypeMapping().createText(null, schema.getPrefix(), property, (String) value);
Method setMethod = schemaClass.getMethod(setName, TextType.class);
Method getMethod = schemaClass.getMethod(getName);
setMethod.invoke(schema, tt);
String found = ((TextType) getMethod.invoke(schema)).getStringValue();
Assert.assertEquals(value, found);
}
use of org.apache.xmpbox.type.TextType in project pdfbox by apache.
the class TestExifXmp method testNonStrict.
@Test
public void testNonStrict() throws Exception {
InputStream is = this.getClass().getResourceAsStream("/validxmp/exif.xmp");
DomXmpParser builder = new DomXmpParser();
builder.setStrictParsing(false);
XMPMetadata rxmp = builder.parse(is);
ExifSchema schema = (ExifSchema) rxmp.getSchema(ExifSchema.class);
TextType ss = (TextType) schema.getProperty(ExifSchema.SPECTRAL_SENSITIVITY);
Assert.assertNotNull(ss);
Assert.assertEquals("spectral sens value", ss.getValue());
}
Aggregations