use of ddf.catalog.data.Metacard in project ddf by codice.
the class VideoInputTransformerTest method testMp4Video.
@Test
public void testMp4Video() throws Exception {
InputStream stream = getVideoInputStream();
Metacard metacard = transform(stream);
assertThat(metacard, notNullValue());
assertThat(convertDate(metacard.getModifiedDate()), is("2012-09-01 12:31:21 UTC"));
String metadata = metacard.getMetadata();
assertThat(metadata, notNullValue());
assertThat(metadata, containsString("<meta name=\"tiff:ImageLength\" content=\"360\"/>"));
assertThat(metadata, containsString("<meta name=\"tiff:ImageWidth\" content=\"480\"/>"));
assertThat(metacard.getContentTypeName(), is("video/mp4"));
}
use of ddf.catalog.data.Metacard in project ddf by codice.
the class TikaInputTransformerTest method testMp3.
@Test
public void testMp3() throws Exception {
InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream("testMP3id3v1_v2.mp3");
Metacard metacard = transform(stream);
assertNotNull(metacard);
assertThat(metacard.getTitle(), is("Test Title"));
assertNotNull(metacard.getMetadata());
assertThat(metacard.getMetadata(), containsString("<meta name=\"xmpDM:artist\" content=\"Test Artist\"/>"));
assertThat(metacard.getContentTypeName(), is("audio/mpeg"));
assertThat(metacard.getAttribute(Core.DATATYPE).getValue(), is(SOUND));
}
use of ddf.catalog.data.Metacard in project ddf by codice.
the class TikaInputTransformerTest method testWordDoc.
@Test
public void testWordDoc() throws Exception {
InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream("testWORD.docx");
Metacard metacard = transform(stream);
assertNotNull(metacard);
assertThat(metacard.getTitle(), is("Sample Word Document"));
assertThat(convertDate(metacard.getCreatedDate()), is("2008-12-11 16:04:00 UTC"));
assertThat(convertDate(metacard.getModifiedDate()), is("2010-11-12 16:21:00 UTC"));
assertNotNull(metacard.getMetadata());
assertThat(metacard.getMetadata(), containsString("<p>This is a sample Microsoft Word Document.</p>"));
assertThat(metacard.getContentTypeName(), is("application/vnd.openxmlformats-officedocument.wordprocessingml.document"));
assertThat(metacard.getAttribute(Core.DATATYPE).getValue(), is(DOCUMENT));
}
use of ddf.catalog.data.Metacard in project ddf by codice.
the class TikaInputTransformerTest method testXls.
@Test
public void testXls() throws Exception {
InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream("testEXCEL.xls");
Metacard metacard = transform(stream);
assertNotNull(metacard);
assertThat(metacard.getTitle(), is("Simple Excel document"));
assertThat(convertDate(metacard.getCreatedDate()), is("2007-10-01 16:13:56 UTC"));
assertThat(convertDate(metacard.getModifiedDate()), is("2007-10-01 16:31:43 UTC"));
assertNotNull(metacard.getMetadata());
assertThat(metacard.getMetadata(), containsString("Written and saved in Microsoft Excel X for Mac Service Release 1."));
assertThat(metacard.getContentTypeName(), is("application/vnd.ms-excel"));
assertThat(metacard.getAttribute(Core.DATATYPE).getValue(), is(DOCUMENT));
}
use of ddf.catalog.data.Metacard in project ddf by codice.
the class TikaInputTransformerTest method testZip.
@Test
public void testZip() throws Exception {
InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream("testZIP.zip");
Metacard metacard = transform(stream);
assertNotNull(metacard);
assertThat(metacard.getTitle(), nullValue());
assertNotNull(metacard.getMetadata());
assertThat(metacard.getMetadata(), containsString("<meta name=\"Content-Type\" content=\"application/zip\"/>"));
assertThat(metacard.getContentTypeName(), is("application/zip"));
assertThat(metacard.getAttribute(Core.DATATYPE).getValue(), is(COLLECTION));
}
Aggregations