use of org.apache.xmpbox.xml.DomXmpParser in project pdfbox by apache.
the class DeserializationTest method testWithRDFRootAsText.
@Test
public void testWithRDFRootAsText() throws Exception {
InputStream fis = DomXmpParser.class.getResourceAsStream("/invalidxmp/invalidroot.xml");
DomXmpParser xdb = new DomXmpParser();
try {
xdb.parse(fis);
Assert.fail("Should fail during parse");
} catch (XmpParsingException e) {
Assert.assertEquals(ErrorType.Format, e.getErrorType());
}
}
use of org.apache.xmpbox.xml.DomXmpParser in project pdfbox by apache.
the class DeserializationTest method testStructuredRecursive.
@Test
public void testStructuredRecursive() throws Exception {
InputStream fis = DomXmpParser.class.getResourceAsStream("/org/apache/xmpbox/parser/structured_recursive.xml");
DomXmpParser xdb = new DomXmpParser();
xdb.parse(fis);
}
use of org.apache.xmpbox.xml.DomXmpParser in project pdfbox by apache.
the class DeserializationTest method testEmptyLi2.
@Test
public void testEmptyLi2() throws Exception {
InputStream fis = DomXmpParser.class.getResourceAsStream("/validxmp/emptyli.xml");
DomXmpParser xdb = new DomXmpParser();
XMPMetadata meta = xdb.parse(fis);
DublinCoreSchema dc = meta.getDublinCoreSchema();
dc.getCreatorsProperty();
}
use of org.apache.xmpbox.xml.DomXmpParser in project pdfbox by apache.
the class DeserializationTest method testRdfAboutFound.
@Test
public void testRdfAboutFound() throws Exception {
InputStream fis = DomXmpParser.class.getResourceAsStream("/validxmp/emptyli.xml");
DomXmpParser xdb = new DomXmpParser();
XMPMetadata meta = xdb.parse(fis);
List<XMPSchema> schemas = meta.getAllSchemas();
for (XMPSchema xmpSchema : schemas) {
Assert.assertNotNull(xmpSchema.getAboutAttribute());
}
}
use of org.apache.xmpbox.xml.DomXmpParser in project pdfbox by apache.
the class DeserializationTest method testWithNoRDFElement.
@Test
public void testWithNoRDFElement() throws Exception {
InputStream fis = DomXmpParser.class.getResourceAsStream("/invalidxmp/noroot.xml");
DomXmpParser xdb = new DomXmpParser();
try {
xdb.parse(fis);
Assert.fail("Should fail during parse");
} catch (XmpParsingException e) {
Assert.assertEquals(ErrorType.Format, e.getErrorType());
}
}
Aggregations