@Test(expected = IllegalArgumentException.class) public void testDefectMetadata() throws Exception { MediaPackage mp = newMediaPackage("/manifest-simple-defect.xml"); StaticMetadataServiceDublinCoreImpl ms = newStaticMetadataService(); ms.getMetadata(mp); }
@Override public StaticMetadata getMetadata(final MediaPackage mp) { return mlist(list(mp.getCatalogs(DublinCoreCatalog.ANY_DUBLINCORE))) .find(flavorPredicate(MediaPackageElements.EPISODE)) .flatMap(loader) .map(new Function<DublinCoreCatalog, StaticMetadata>() { @Override public StaticMetadata apply(DublinCoreCatalog episode) { return newStaticMetadataFromEpisode(episode); } }) .getOrElse((StaticMetadata) null); }
StaticMetadataServiceDublinCoreImpl implements StaticMetadataService { @Override public StaticMetadata getMetadata(final MediaPackage mp) { return mlist(list(mp.getCatalogs(DublinCoreCatalog.ANY_DUBLINCORE))) .find(flavorPredicate(MediaPackageElements.EPISODE)) .flatMap(loader) .map(new Function<DublinCoreCatalog, StaticMetadata>() { @Override public StaticMetadata apply(DublinCoreCatalog episode) { return newStaticMetadataFromEpisode(episode); } }) .getOrElse((StaticMetadata) null); } }
StaticMetadataServiceDublinCoreImpl implements StaticMetadataService { @Override public StaticMetadata getMetadata(final MediaPackage mp) { return mlist(list(mp.getCatalogs(DublinCoreCatalog.ANY_DUBLINCORE))) .find(flavorPredicate(MediaPackageElements.EPISODE)) .flatMap(loader) .map(new Function<DublinCoreCatalog, StaticMetadata>() { @Override public StaticMetadata apply(DublinCoreCatalog episode) { return newStaticMetadataFromEpisode(episode); } }) .getOrElse((StaticMetadata) null); }  }
StaticMetadataServiceDublinCoreImpl implements StaticMetadataService { @Override public StaticMetadata getMetadata(final MediaPackage mp) { return mlist(list(mp.getCatalogs(DublinCoreCatalog.ANY_DUBLINCORE))) .find(flavorPredicate(MediaPackageElements.EPISODE)) .flatMap(loader) .map(new Function<DublinCoreCatalog, StaticMetadata>() { @Override public StaticMetadata apply(DublinCoreCatalog episode) { return newStaticMetadataFromEpisode(episode); } }) .getOrElse((StaticMetadata) null); }  void setWorkspace(Workspace workspace); void activate(@SuppressWarnings("rawtypes") Map properties); @Override StaticMetadata getMetadata(final MediaPackage mp); @Override int getPriority(); }
StaticMetadataServiceDublinCoreImpl implements StaticMetadataService { @Override public StaticMetadata getMetadata(final MediaPackage mp) { return mlist(list(mp.getCatalogs(DublinCoreCatalog.ANY_DUBLINCORE))) .find(flavorPredicate(MediaPackageElements.EPISODE)) .flatMap(loader) .map(new Function<DublinCoreCatalog, StaticMetadata>() { @Override public StaticMetadata apply(DublinCoreCatalog episode) { return newStaticMetadataFromEpisode(episode); } }) .getOrElse((StaticMetadata) null); }  void setWorkspace(Workspace workspace); void activate(@SuppressWarnings("rawtypes") Map properties); @Override StaticMetadata getMetadata(final MediaPackage mp); @Override int getPriority();  }