use of org.olat.modules.webFeed.model.ItemImpl 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.modules.webFeed.model.ItemImpl in project OpenOLAT by OpenOLAT.
the class FeedFileStorgeTest method deleteItemXML.
@Test
public void deleteItemXML() {
BlogFileResource resource = new BlogFileResource();
Feed feed = new FeedImpl(resource);
Item item = new ItemImpl(feed);
item.setGuid("123");
item.setAuthor("autor");
sut.saveItemAsXML(item);
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.ItemImpl in project OpenOLAT by OpenOLAT.
the class FeedFileStorgeTest method loadItemsFromXML.
@Test
public void loadItemsFromXML() {
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);
Item item3 = new ItemImpl(feed);
String guid3 = "guid 3";
item3.setGuid(guid3);
sut.saveItemAsXML(item3);
List<Item> items = sut.loadItemsFromXML(feed);
assertThat(items.size()).isEqualTo(3);
fileResourceManager.deleteFileResource(resource);
}
use of org.olat.modules.webFeed.model.ItemImpl in project OpenOLAT by OpenOLAT.
the class FeedFileStorgeTest method getOrCreateItemContainer_get.
@Test
public void getOrCreateItemContainer_get() {
BlogFileResource resource = new BlogFileResource();
Feed feed = new FeedImpl(resource);
Item item = new ItemImpl(feed);
item.setGuid("guid");
sut.getOrCreateItemContainer(item);
VFSContainer itemContainer = sut.getOrCreateItemContainer(item);
assertThat(itemContainer).isNotNull();
fileResourceManager.deleteFileResource(resource);
}
use of org.olat.modules.webFeed.model.ItemImpl in project OpenOLAT by OpenOLAT.
the class FeedFileStorgeTest method getOrCreateItemMediaContainer_Feed_null.
@Test
public void getOrCreateItemMediaContainer_Feed_null() {
Item item = new ItemImpl(null);
item.setGuid("guid");
VFSContainer itemMediaContainer = sut.getOrCreateItemMediaContainer(item);
assertThat(itemMediaContainer).isNull();
}
Aggregations