Search in sources :

Example 1 with Person

use of org.opencastproject.feed.api.Person 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);
}
Also used : FeedExtension(org.opencastproject.feed.api.FeedExtension) Category(org.opencastproject.feed.api.Category) ArrayList(java.util.ArrayList) Image(org.opencastproject.feed.api.Image) Date(java.util.Date) FeedEntry(org.opencastproject.feed.api.FeedEntry) Content(org.opencastproject.feed.api.Content) Person(org.opencastproject.feed.api.Person) Link(org.opencastproject.feed.api.Link) Test(org.junit.Test)

Example 2 with Person

use of org.opencastproject.feed.api.Person in project opencast by opencast.

the class RomeAtomFeed method toRomeAtomPersons.

/**
 * Converts a list of persons to a <code>ROME</code> person list.
 *
 * @param persons
 *          original persons
 * @return <code>ROME</code> person list
 */
private List<SyndPerson> toRomeAtomPersons(List<Person> persons) {
    if (persons == null)
        return Collections.emptyList();
    List<SyndPerson> romePersons = new ArrayList<SyndPerson>(persons.size());
    for (Person person : persons) {
        com.rometools.rome.feed.atom.Person romePerson = new com.rometools.rome.feed.atom.Person();
        romePerson.setEmail(person.getEmail());
        romePerson.setName(person.getName());
        romePerson.setUri(person.getUri());
        romePersons.add(romePerson);
    }
    return romePersons;
}
Also used : SyndPerson(com.rometools.rome.feed.synd.SyndPerson) ArrayList(java.util.ArrayList) SyndPerson(com.rometools.rome.feed.synd.SyndPerson) Person(org.opencastproject.feed.api.Person)

Example 3 with Person

use of org.opencastproject.feed.api.Person in project opencast by opencast.

the class RomeRssFeed method toRomePersons.

/**
 * Converts a list of persons to a <code>ROME</code> person list.
 *
 * @param persons
 *          original persons
 * @return <code>ROME</code> person list
 */
private List<SyndPerson> toRomePersons(List<Person> persons) {
    if (persons == null)
        return Collections.emptyList();
    List<SyndPerson> romePersons = new ArrayList<SyndPerson>(persons.size());
    for (Person person : persons) {
        SyndPersonImpl romePerson = new SyndPersonImpl();
        romePerson.setEmail(person.getEmail());
        romePerson.setName(person.getName());
        romePerson.setUri(person.getUri());
        romePersons.add(romePerson);
    }
    return romePersons;
}
Also used : SyndPerson(com.rometools.rome.feed.synd.SyndPerson) SyndPersonImpl(com.rometools.rome.feed.synd.SyndPersonImpl) ArrayList(java.util.ArrayList) Person(org.opencastproject.feed.api.Person) SyndPerson(com.rometools.rome.feed.synd.SyndPerson)

Aggregations

ArrayList (java.util.ArrayList)3 Person (org.opencastproject.feed.api.Person)3 SyndPerson (com.rometools.rome.feed.synd.SyndPerson)2 SyndPersonImpl (com.rometools.rome.feed.synd.SyndPersonImpl)1 Date (java.util.Date)1 Test (org.junit.Test)1 Category (org.opencastproject.feed.api.Category)1 Content (org.opencastproject.feed.api.Content)1 FeedEntry (org.opencastproject.feed.api.FeedEntry)1 FeedExtension (org.opencastproject.feed.api.FeedExtension)1 Image (org.opencastproject.feed.api.Image)1 Link (org.opencastproject.feed.api.Link)1