String feed_url1 = "http://rollerweblogger.org/rss/roller";
String feed_url2 = "http://linuxintegrators.com/acoliver/?flavor=rss2";
{
PlanetGroupData group = new PlanetGroupData();
group.setDescription("test_group_desc");
group.setHandle("test_handle");
group.setTitle("test_title");
planet.saveGroup(group);
PlanetSubscriptionData sub1 = new PlanetSubscriptionData();
sub1.setFeedUrl(feed_url1);
planet.saveSubscription(sub1);
PlanetSubscriptionData sub2 = new PlanetSubscriptionData();
sub2.setFeedUrl(feed_url2);
planet.saveSubscription(sub2);
group.addSubscription(sub1);
group.addSubscription(sub2);
planet.saveGroup(group);
TestUtils.endSession(true);
}
{
planet.refreshEntries();
TestUtils.endSession(true);
int count = 0;
Iterator subs = planet.getAllSubscriptions();
while (subs.hasNext()) {
PlanetSubscriptionData sub= (PlanetSubscriptionData)subs.next();
count += sub.getEntries().size();
}
PlanetSubscriptionData sub1 = planet.getSubscription(feed_url1);
assertTrue(sub1.getEntries().size() > 0);
PlanetSubscriptionData sub2 = planet.getSubscription(feed_url2);
assertTrue(sub2.getEntries().size() > 0);
assertEquals(count, sub1.getEntries().size() + sub2.getEntries().size());
PlanetGroupData group = planet.getGroup("test_handle");
assertNotNull(group);
List bigag = planet.getAggregation(group, 30);
assertEquals(30, bigag.size());