use of org.olat.modules.webFeed.model.FeedImpl in project openolat by klemens.
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.modules.webFeed.model.FeedImpl in project openolat by klemens.
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.modules.webFeed.model.FeedImpl in project openolat by klemens.
the class FeedFileStorgeTest method deleteItemContainer_null.
@Test
public void deleteItemContainer_null() {
BlogFileResource resource = new BlogFileResource();
Feed feed = new FeedImpl(resource);
Item item1 = new ItemImpl(feed);
item1.setGuid("guid 1");
sut.getOrCreateItemContainer(item1);
sut.deleteItemContainer(null);
// check if there is one item container left
assertThat(sut.getOrCreateFeedItemsContainer(feed).getItems().size()).isEqualTo(1);
fileResourceManager.deleteFileResource(resource);
}
use of org.olat.modules.webFeed.model.FeedImpl in project openolat by klemens.
the class FeedFileStorgeTest method deleteItemContainer_not_existing.
@Test
public void deleteItemContainer_not_existing() {
BlogFileResource resource = new BlogFileResource();
Feed feed = new FeedImpl(resource);
Item item1 = new ItemImpl(feed);
item1.setGuid("guid 1");
Item item2 = new ItemImpl(feed);
item2.setGuid("guid 2");
sut.getOrCreateItemContainer(item2);
sut.deleteItemContainer(item1);
// check if there is only one item container left
assertThat(sut.getOrCreateFeedItemsContainer(feed).getItems().size()).isEqualTo(1);
fileResourceManager.deleteFileResource(resource);
}
use of org.olat.modules.webFeed.model.FeedImpl in project openolat by klemens.
the class FeedFileStorgeTest method loadItemsFromXML_missing_XML.
@Test
public void loadItemsFromXML_missing_XML() {
BlogFileResource resource = new BlogFileResource();
Feed feed = new FeedImpl(resource);
Item item1 = new ItemImpl(feed);
String guid1 = "guid 1";
item1.setGuid(guid1);
sut.saveItemAsXML(item1);
Item item2 = new ItemImpl(feed);
String guid2 = "guid 2";
item2.setGuid(guid2);
sut.saveItemAsXML(item2);
sut.deleteItemXML(item1);
List<Item> items = sut.loadItemsFromXML(feed);
assertThat(items.size()).isEqualTo(1);
fileResourceManager.deleteFileResource(resource);
}
Aggregations