use of org.olat.modules.webFeed.model.FeedImpl in project OpenOLAT by OpenOLAT.
the class FeedFileStorgeTest method loadFeedFromXML_Ores.
@Test
public void loadFeedFromXML_Ores() {
BlogFileResource resource = new BlogFileResource();
Feed feed = new FeedImpl(resource);
String autor = "autor";
feed.setAuthor(autor);
sut.saveFeedAsXML(feed);
Feed reloaded = sut.loadFeedFromXML(resource);
assertThat(reloaded).isNotNull();
assertThat(reloaded.getAuthor()).isEqualTo(autor);
fileResourceManager.deleteFileResource(resource);
}
use of org.olat.modules.webFeed.model.FeedImpl in project OpenOLAT by OpenOLAT.
the class FeedFileStorgeTest method deleteFeedXML.
@Test
public void deleteFeedXML() {
BlogFileResource resource = new BlogFileResource();
Feed feed = new FeedImpl(resource);
feed.setAuthor("initialAuthor");
sut.saveFeedAsXML(feed);
sut.deleteFeedXML(feed);
// check if there is no file in the feed container
assertThat(sut.getOrCreateFeedContainer(feed).getItems().size()).isEqualTo(0);
fileResourceManager.deleteFileResource(resource);
}
use of org.olat.modules.webFeed.model.FeedImpl in project OpenOLAT by OpenOLAT.
the class FeedFileStorgeTest method loadFeedFromXML_Path.
@Test
public void loadFeedFromXML_Path() {
BlogFileResource resource = new BlogFileResource();
Feed feed = new FeedImpl(resource);
String autor = "autor";
feed.setAuthor(autor);
sut.saveFeedAsXML(feed);
Path feedDir = fileResourceManager.getFileResource(resource).toPath();
Feed reloaded = FeedManager.getInstance().loadFeedFromXML(feedDir);
assertThat(reloaded).isNotNull();
assertThat(reloaded.getAuthor()).isEqualTo(autor);
fileResourceManager.deleteFileResource(resource);
}
use of org.olat.modules.webFeed.model.FeedImpl in project OpenOLAT by OpenOLAT.
the class FeedFileStorgeTest method deleteItemXML_not_existing.
@Test
public void deleteItemXML_not_existing() {
BlogFileResource resource = new BlogFileResource();
Feed feed = new FeedImpl(resource);
Item item = new ItemImpl(feed);
item.setGuid("123");
item.setAuthor("autor");
sut.deleteItemXML(item);
// check if there is no file in the item container
assertThat(sut.getOrCreateItemContainer(item).getItems().size()).isEqualTo(0);
fileResourceManager.deleteFileResource(resource);
}
use of org.olat.modules.webFeed.model.FeedImpl in project OpenOLAT by OpenOLAT.
the class FeedFileStorgeTest method getOrCreateItemContainer_guid_get.
@Test
public void getOrCreateItemContainer_guid_get() {
BlogFileResource resource = new BlogFileResource();
Feed feed = new FeedImpl(resource);
String guid = "guid 123";
sut.getOrCreateItemContainer(feed, guid);
VFSContainer itemContainer = sut.getOrCreateItemContainer(feed, guid);
assertThat(itemContainer).isNotNull();
fileResourceManager.deleteFileResource(resource);
}
Aggregations