use of org.opencastproject.feed.api.Category in project opencast by opencast.
the class FeedImplTest method setterGetterTest.
@Test
public void setterGetterTest() {
instance.setTitle("text");
logger.info(instance.getTitle().getValue());
Assert.assertEquals(instance.getTitle().getValue(), "text");
instance.setLink("http://localhost:8080/feeds/rss/2.0/test");
Assert.assertEquals(instance.getLink(), "http://localhost:8080/feeds/rss/2.0/test");
instance.setCopyright("text");
Assert.assertEquals(instance.getCopyright(), "text");
List<Person> person = new ArrayList<Person>();
instance.setAuthors(person);
Assert.assertEquals(instance.getAuthors(), person);
instance.setContributors(person);
Assert.assertEquals(instance.getContributors(), person);
instance.setUri("http://testuri/");
Assert.assertEquals(instance.getUri(), "http://testuri/");
List<Category> category = new ArrayList<Category>();
instance.setCategories(category);
Assert.assertEquals(instance.getCategories(), category);
instance.setDescription("description");
Assert.assertEquals(instance.getDescription().getValue(), "description");
Content content = new ContentImpl("desciption");
instance.setDescription(content);
Assert.assertEquals(instance.getDescription(), content);
instance.setEncoding("encode");
Assert.assertEquals(instance.getEncoding(), "encode");
List<FeedEntry> feed = new ArrayList<FeedEntry>();
instance.setEntries(feed);
Assert.assertEquals(instance.getEntries(), feed);
Image image = new ImageImpl("http://picture/");
instance.setImage(image);
Assert.assertEquals(instance.getImage(), image);
instance.setLanguage("English");
Assert.assertEquals(instance.getLanguage(), "English");
List<Link> link = new ArrayList<Link>();
instance.setLinks(link);
Assert.assertEquals(instance.getLinks(), link);
List<FeedExtension> feedExtension = new ArrayList<FeedExtension>();
instance.setModules(feedExtension);
Assert.assertEquals(instance.getModules(), feedExtension);
Date date = new Date(21091981);
instance.setPublishedDate(date);
Assert.assertEquals(instance.getPublishedDate(), date);
instance.setUpdatedDate(date);
Assert.assertEquals(instance.getUpdatedDate(), date);
instance.setTitle(content);
Assert.assertEquals(instance.getTitle(), content);
}
use of org.opencastproject.feed.api.Category in project opencast by opencast.
the class RomeAtomFeed method toRomeAtomCategories.
/**
* Converts a list of categories to a <code>ROME</code> category list.
*
* @param categories
* original categories
* @return <code>ROME</code> category list
*/
private List<com.rometools.rome.feed.atom.Category> toRomeAtomCategories(List<Category> categories) {
if (categories == null)
return Collections.emptyList();
List<com.rometools.rome.feed.atom.Category> romeCategories = new ArrayList<com.rometools.rome.feed.atom.Category>(categories.size());
for (Category category : categories) {
com.rometools.rome.feed.atom.Category romeCategory = new com.rometools.rome.feed.atom.Category();
romeCategory.setLabel(category.getName());
romeCategory.setScheme(category.getTaxonomyUri());
romeCategories.add(romeCategory);
}
return romeCategories;
}
use of org.opencastproject.feed.api.Category in project opencast by opencast.
the class RomeRssFeed method toRomeCategories.
/**
* Converts a list of categories to a <code>ROME</code> category list.
*
* @param categories
* original categories
* @return <code>ROME</code> category list
*/
private List<SyndCategory> toRomeCategories(List<Category> categories) {
if (categories == null)
return Collections.emptyList();
List<SyndCategory> romeCategories = new ArrayList<SyndCategory>(categories.size());
for (Category category : categories) {
SyndCategoryImpl romeCategory = new SyndCategoryImpl();
romeCategory.setName(category.getName());
romeCategory.setTaxonomyUri(category.getTaxonomyUri());
romeCategories.add(romeCategory);
}
return romeCategories;
}
Aggregations