ServerBaseFeed feed = new ServerBaseFeed();
ProvidedServiceConfig conf = new ProvidedServiceConfig();
conf.setName(SERVICENAME);
feed.setId(FEEDID);
feed.setServiceConfig(conf);
Storage storage = this.controller.getStorage();
GDataAccount account = new GDataAccount();
account.setName(ACCOUNTNAME);
account.setPassword("somePass");
container.set(account);
container.commit();
container.close();
storage.storeFeed(feed, ACCOUNTNAME);
assertNull(feed.getTitle());
ServerBaseFeed feedU = new ServerBaseFeed();
feedU.setServiceConfig(conf);
feedU.setId(FEEDID);
feedU.setTitle(new PlainTextConstruct("someText"));
feedU.setServiceType(SERVICENAME);
storage.updateFeed(feedU, ACCOUNTNAME);
ServerBaseFeed requestFeed = new ServerBaseFeed();
requestFeed.setId(FEEDID);
requestFeed.setServiceType(SERVICENAME);
assertNotNull(storage.getFeed(requestFeed));
assertEquals(feedU.getTitle(), storage.getFeed(requestFeed).getTitle());
try {
storage.updateFeed(null, ACCOUNTNAME);
fail("feed is null");
} catch (Exception e) {
//
}
try {
storage.updateFeed(feedU, null);
fail("accountname is null");
} catch (Exception e) {
//
}
try {
feedU.setServiceType(null);
storage.updateFeed(feedU, ACCOUNTNAME);
fail("servicetype is null");
} catch (Exception e) {
//
}