Search in sources :

Example 36 with Feed

use of org.olat.modules.webFeed.Feed in project OpenOLAT by OpenOLAT.

the class FeedFileStorgeTest method loadFeedFromXML_Path_not_existing.

@Test
public void loadFeedFromXML_Path_not_existing() {
    Path feedDir = Paths.get("abc");
    Feed reloaded = FeedManager.getInstance().loadFeedFromXML(feedDir);
    assertThat(reloaded).isNull();
}
Also used : Path(java.nio.file.Path) Feed(org.olat.modules.webFeed.Feed) Test(org.junit.Test)

Example 37 with Feed

use of org.olat.modules.webFeed.Feed in project OpenOLAT by OpenOLAT.

the class ItemDAOTest method loadItemByGuid_guidTwoTimes.

@Test
public void loadItemByGuid_guidTwoTimes() {
    OLATResource resource = JunitTestHelper.createRandomResource();
    Feed feed = feedDao.createFeedForResourcable(resource);
    OLATResource resource2 = JunitTestHelper.createRandomResource();
    Feed feed2 = feedDao.createFeedForResourcable(resource2);
    dbInstance.commitAndCloseSession();
    // create an item
    String guid = "guid-123";
    Item tempItem = new ItemImpl(feed);
    tempItem.setGuid(guid);
    itemDao.createItem(feed, tempItem);
    Item tempItem2 = new ItemImpl(feed2);
    tempItem2.setGuid(guid);
    itemDao.createItem(feed2, tempItem2);
    dbInstance.commitAndCloseSession();
    // reload the item from the database
    Item item = itemDao.loadItemByGuid(feed.getKey(), guid);
    // check values
    assertThat(item).isNotNull();
}
Also used : Item(org.olat.modules.webFeed.Item) ItemImpl(org.olat.modules.webFeed.model.ItemImpl) OLATResource(org.olat.resource.OLATResource) Feed(org.olat.modules.webFeed.Feed) Test(org.junit.Test)

Example 38 with Feed

use of org.olat.modules.webFeed.Feed in project OpenOLAT by OpenOLAT.

the class ItemDAOTest method copyItem_Feed_null.

@Test
public void copyItem_Feed_null() {
    OLATResource resource = JunitTestHelper.createRandomResource();
    Feed feed = feedDao.createFeedForResourcable(resource);
    dbInstance.commitAndCloseSession();
    Item item = itemDao.createItem(feed);
    dbInstance.commitAndCloseSession();
    Item copy = itemDao.copyItem(null, item);
    dbInstance.commitAndCloseSession();
    // check values
    assertThat(copy).isNull();
}
Also used : Item(org.olat.modules.webFeed.Item) OLATResource(org.olat.resource.OLATResource) Feed(org.olat.modules.webFeed.Feed) Test(org.junit.Test)

Example 39 with Feed

use of org.olat.modules.webFeed.Feed in project OpenOLAT by OpenOLAT.

the class ItemDAOTest method loadItemByGuid.

@Test
public void loadItemByGuid() {
    OLATResource resource = JunitTestHelper.createRandomResource();
    Feed feed = feedDao.createFeedForResourcable(resource);
    dbInstance.commitAndCloseSession();
    // create an item
    String guid = "guid-123";
    Item tempItem = new ItemImpl(feed);
    tempItem.setGuid(guid);
    itemDao.createItem(feed, tempItem);
    dbInstance.commitAndCloseSession();
    // reload the item from the database
    Item item = itemDao.loadItemByGuid(feed.getKey(), guid);
    // check values
    assertThat(item).isNotNull();
}
Also used : Item(org.olat.modules.webFeed.Item) ItemImpl(org.olat.modules.webFeed.model.ItemImpl) OLATResource(org.olat.resource.OLATResource) Feed(org.olat.modules.webFeed.Feed) Test(org.junit.Test)

Example 40 with Feed

use of org.olat.modules.webFeed.Feed in project OpenOLAT by OpenOLAT.

the class ItemDAOTest method copyItem_Feed_Item_null.

@Test
public void copyItem_Feed_Item_null() {
    OLATResource resource = JunitTestHelper.createRandomResource();
    Feed feed = feedDao.createFeedForResourcable(resource);
    dbInstance.commitAndCloseSession();
    Item copy = itemDao.copyItem(feed, null);
    dbInstance.commitAndCloseSession();
    // check values
    assertThat(copy).isNull();
}
Also used : Item(org.olat.modules.webFeed.Item) OLATResource(org.olat.resource.OLATResource) Feed(org.olat.modules.webFeed.Feed) Test(org.junit.Test)

Aggregations

Feed (org.olat.modules.webFeed.Feed)216 Test (org.junit.Test)162 Item (org.olat.modules.webFeed.Item)98 FeedImpl (org.olat.modules.webFeed.model.FeedImpl)76 OLATResource (org.olat.resource.OLATResource)72 BlogFileResource (org.olat.fileresource.types.BlogFileResource)60 ItemImpl (org.olat.modules.webFeed.model.ItemImpl)52 SyndFeed (com.rometools.rome.feed.synd.SyndFeed)36 VFSContainer (org.olat.core.util.vfs.VFSContainer)28 RSSFeed (org.olat.modules.webFeed.RSSFeed)24 Date (java.util.Date)22 RepositoryEntry (org.olat.repository.RepositoryEntry)12 OLATResourceable (org.olat.core.id.OLATResourceable)8 Path (java.nio.file.Path)6 LocalDate (java.time.LocalDate)6 VFSItem (org.olat.core.util.vfs.VFSItem)6 VFSLeaf (org.olat.core.util.vfs.VFSLeaf)6 FeedItemDocument (org.olat.modules.webFeed.search.document.FeedItemDocument)6 OlatDocument (org.olat.search.model.OlatDocument)6 IOException (java.io.IOException)4