use of org.olat.modules.webFeed.Item in project OpenOLAT by OpenOLAT.
the class FeedFileStorgeTest method loadItemFromXML.
@Test
public void loadItemFromXML() {
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);
sut.saveItemAsXML(item);
VFSContainer itemContainer = sut.getOrCreateItemContainer(item);
Item reloaded = sut.loadItemFromXML(itemContainer);
assertThat(reloaded).isNotNull();
assertThat(reloaded.getAuthor()).isEqualTo(autor);
fileResourceManager.deleteFileResource(resource);
}
use of org.olat.modules.webFeed.Item in project OpenOLAT by OpenOLAT.
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.Item in project OpenOLAT by OpenOLAT.
the class FeedFileStorgeTest method getOrCreateItemContainer_Feed_null.
@Test
public void getOrCreateItemContainer_Feed_null() {
Item item = new ItemImpl(null);
item.setGuid("guid");
VFSContainer itemContainer = sut.getOrCreateItemContainer(item);
assertThat(itemContainer).isNull();
}
use of org.olat.modules.webFeed.Item in project OpenOLAT by OpenOLAT.
the class FeedFileStorgeTest method getOrCreateItemMediaContainer_Guid_empty.
@Test
public void getOrCreateItemMediaContainer_Guid_empty() {
BlogFileResource resource = new BlogFileResource();
Feed feed = new FeedImpl(resource);
Item item = new ItemImpl(feed);
item.setGuid("");
VFSContainer itemMediaContainer = sut.getOrCreateItemMediaContainer(item);
assertThat(itemMediaContainer).isNull();
fileResourceManager.deleteFileResource(resource);
}
use of org.olat.modules.webFeed.Item in project OpenOLAT by OpenOLAT.
the class FeedFileStorgeTest method deleteItemContainer.
@Test
public void deleteItemContainer() {
BlogFileResource resource = new BlogFileResource();
Feed feed = new FeedImpl(resource);
Item item1 = new ItemImpl(feed);
item1.setGuid("guid 1");
sut.getOrCreateItemContainer(item1);
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);
}
Aggregations