use of org.olat.fileresource.types.BlogFileResource in project OpenOLAT by OpenOLAT.
the class FeedFileStorgeTest method saveItemAsXML_overwrite.
@Test
public void saveItemAsXML_overwrite() {
BlogFileResource resource = new BlogFileResource();
Feed feed = new FeedImpl(resource);
Item item = new ItemImpl(feed);
item.setGuid("123");
item.setAuthor("autor");
sut.saveItemAsXML(item);
item.setAuthor("secondAuthor");
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 OpenOLAT.
the class FeedFileStorgeTest method getOrCreateItemMediaContainer_create.
@Test
public void getOrCreateItemMediaContainer_create() {
BlogFileResource resource = new BlogFileResource();
Feed feed = new FeedImpl(resource);
Item item = new ItemImpl(feed);
item.setGuid("guid");
VFSContainer itemMediaContainer = sut.getOrCreateItemMediaContainer(item);
assertThat(itemMediaContainer).isNotNull();
fileResourceManager.deleteFileResource(resource);
}
use of org.olat.fileresource.types.BlogFileResource in project OpenOLAT by OpenOLAT.
the class FeedFileStorgeTest method loadItemsFromXML_empty.
@Test
public void loadItemsFromXML_empty() {
BlogFileResource resource = new BlogFileResource();
Feed feed = new FeedImpl(resource);
List<Item> items = sut.loadItemsFromXML(feed);
assertThat(items.size()).isEqualTo(0);
fileResourceManager.deleteFileResource(resource);
}
use of org.olat.fileresource.types.BlogFileResource in project OpenOLAT by OpenOLAT.
the class FeedFileStorgeTest method getOrCreateItemContainer_Guid_empty.
@Test
public void getOrCreateItemContainer_Guid_empty() {
BlogFileResource resource = new BlogFileResource();
Feed feed = new FeedImpl(resource);
Item item = new ItemImpl(feed);
item.setGuid("");
VFSContainer itemContainer = sut.getOrCreateItemContainer(item);
assertThat(itemContainer).isNull();
fileResourceManager.deleteFileResource(resource);
}
use of org.olat.fileresource.types.BlogFileResource in project OpenOLAT by OpenOLAT.
the class FeedFileStorgeTest method saveFeedAsXML_overwrite.
@Test
public void saveFeedAsXML_overwrite() {
BlogFileResource resource = new BlogFileResource();
Feed feed = new FeedImpl(resource);
feed.setAuthor("initialAuthor");
sut.saveFeedAsXML(feed);
feed.setAuthor("secondAuthor");
sut.saveFeedAsXML(feed);
// check if there is one file in the feed container
assertThat(sut.getOrCreateFeedContainer(feed).getItems().size()).isEqualTo(1);
fileResourceManager.deleteFileResource(resource);
}
Aggregations