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();
}
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();
}
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();
}
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();
}
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();
}
Aggregations