use of org.olat.fileresource.types.BlogFileResource in project OpenOLAT by OpenOLAT.
the class FeedFileStorgeTest method getOrCreateFeedItemsContainer_create.
@Test
public void getOrCreateFeedItemsContainer_create() {
FeedFileResource ores = new BlogFileResource();
VFSContainer feedItemsContainer = sut.getOrCreateFeedItemsContainer(ores);
assertThat(feedItemsContainer).isNotNull();
fileResourceManager.deleteFileResource(ores);
}
use of org.olat.fileresource.types.BlogFileResource in project OpenOLAT by OpenOLAT.
the class FeedFileStorgeTest method saveItemAsXML_new.
@Test
public void saveItemAsXML_new() {
BlogFileResource resource = new BlogFileResource();
Feed feed = new FeedImpl(resource);
Item item = new ItemImpl(feed);
item.setGuid("123");
item.setAuthor("autor");
sut.saveItemAsXML(item);
// check if there is one file in the item container
assertThat(sut.getOrCreateItemContainer(item).getItems().size()).isEqualTo(1);
fileResourceManager.deleteFileResource(resource);
}
use of org.olat.fileresource.types.BlogFileResource in project openolat by klemens.
the class FeedFileStorgeTest method deleteFeedXML_not_existing.
@Test
public void deleteFeedXML_not_existing() {
BlogFileResource resource = new BlogFileResource();
Feed feed = new FeedImpl(resource);
feed.setAuthor("initialAuthor");
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.fileresource.types.BlogFileResource in project openolat by klemens.
the class FeedFileStorgeTest method loadItemFromXML_not_existing.
@Test
public void loadItemFromXML_not_existing() {
BlogFileResource resource = new BlogFileResource();
Feed feed = new FeedImpl(resource);
Item item = new ItemImpl(feed);
String guid = "guid öüä";
item.setGuid(guid);
String autor = "autor";
item.setAuthor(autor);
VFSContainer itemContainer = sut.getOrCreateItemContainer(item);
Item reloaded = sut.loadItemFromXML(itemContainer);
assertThat(reloaded).isNull();
fileResourceManager.deleteFileResource(resource);
}
use of org.olat.fileresource.types.BlogFileResource in project openolat by klemens.
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);
}
Aggregations