* Test lookup mechanisms ... id, ping target, weblog
*/
public void testAutoPingLookups() throws Exception {
AutoPingManager mgr = WebloggerFactory.getWeblogger().getAutopingManager();
PingTargetManager ptmgr = WebloggerFactory.getWeblogger().getPingTargetManager();
AutoPing autoPing = null;
// create autoPing target to use for tests
PingTarget pingTarget = TestUtils.setupPingTarget("fooPing", "http://foo/null");
TestUtils.endSession(true);
// create autoPing
testWeblog = TestUtils.getManagedWebsite(testWeblog);
pingTarget = ptmgr.getPingTarget(pingTarget.getId());
autoPing = new AutoPing(null, pingTarget, testWeblog);
mgr.saveAutoPing(autoPing);
String id = autoPing.getId();
TestUtils.endSession(true);
// lookup by id
autoPing = null;
autoPing = mgr.getAutoPing(id);
assertNotNull(autoPing);
assertEquals(pingTarget, autoPing.getPingTarget());
// lookup by ping target
pingTarget = ptmgr.getPingTarget(pingTarget.getId());
List autoPings = mgr.getAutoPingsByTarget(pingTarget);
assertNotNull(autoPings);
assertEquals(1, autoPings.size());
// lookup by weblog