use of org.opencastproject.mediapackage.MediaPackageElementBuilderFactory in project opencast by opencast.
the class AttachmentTest method testFromURL.
/**
* Test method for {@link org.opencastproject.mediapackage.attachment.AttachmentImpl#fromURI(java.net.URI)}.
*/
@Test
public void testFromURL() {
MediaPackageElementBuilderFactory factory = MediaPackageElementBuilderFactory.newInstance();
MediaPackageElementBuilder builder = factory.newElementBuilder();
MediaPackageElement packageElement = null;
// Create the element
try {
packageElement = builder.elementFromURI(coverFile.toURI());
} catch (UnsupportedElementException e) {
fail("Attachment is unsupported: " + e.getMessage());
}
// Type test
assertTrue("Type mismatch", packageElement instanceof Attachment);
}
Aggregations