Search in sources :

Example 6 with XMPMeta

use of com.adobe.xmp.XMPMeta in project tika by apache.

the class TikaToXMPTest method convert_OOXMLMetadataWithMimetype_everythingConverted.

// --- TESTS ---
@Test
public void convert_OOXMLMetadataWithMimetype_everythingConverted() throws XMPException, TikaException {
    setupOOXMLMetadata(tikaMetadata);
    tikaMetadata.set(Metadata.CONTENT_TYPE, OOXML_MIMETYPE);
    XMPMeta xmp = TikaToXMP.convert(tikaMetadata);
    checkOOXMLMetadata(xmp);
}
Also used : XMPMeta(com.adobe.xmp.XMPMeta) Test(org.junit.Test)

Example 7 with XMPMeta

use of com.adobe.xmp.XMPMeta in project tika by apache.

the class XMPMetadataTest method process_genericConversion_ok.

// --- TESTS ---
@Test
public void process_genericConversion_ok() throws TikaException, XMPException {
    xmpMeta.process(tikaMetadata, GENERIC_MIMETYPE);
    XMPMeta xmp = xmpMeta.getXMPData();
    // check simple property
    XMPProperty prop = xmp.getProperty(XMPConst.NS_DC, "format");
    assertNotNull(prop);
    assertEquals(GENERIC_MIMETYPE, prop.getValue());
    // check lang alt
    prop = xmp.getLocalizedText(XMPConst.NS_DC, "title", null, XMPConst.X_DEFAULT);
    assertNotNull(prop);
    assertEquals("title", prop.getValue());
    // check array
    prop = xmp.getArrayItem(XMPConst.NS_DC, "subject", 1);
    assertNotNull(prop);
    assertEquals("keyword1", prop.getValue());
    prop = xmp.getArrayItem(XMPConst.NS_DC, "subject", 2);
    assertNotNull(prop);
    assertEquals("keyword2", prop.getValue());
}
Also used : XMPMeta(com.adobe.xmp.XMPMeta) XMPProperty(com.adobe.xmp.properties.XMPProperty) Test(org.junit.Test)

Aggregations

XMPMeta (com.adobe.xmp.XMPMeta)7 Test (org.junit.Test)6 XMPProperty (com.adobe.xmp.properties.XMPProperty)3 XMPException (com.adobe.xmp.XMPException)1 XMPIterator (com.adobe.xmp.XMPIterator)1 TikaException (org.apache.tika.exception.TikaException)1