Examples of PingTarget


Examples of org.apache.roller.weblogger.pojos.PingTarget

        }
       
        // Somewhat awkward, but the two loops save building a separate combined list.
        // Add disabled common ones with FALSE
        for (Iterator i = getCommonPingTargets().iterator(); i.hasNext();) {
            PingTarget pingTarget = (PingTarget) i.next();
            if (isEnabled.get(pingTarget.getId()) == null) {
                isEnabled.put(pingTarget.getId(), Boolean.FALSE);
            }
        }
       
        // Add disabled custom ones with FALSE
        for (Iterator i = getCustomPingTargets().iterator(); i.hasNext();) {
            PingTarget pingTarget = (PingTarget) i.next();
            if (isEnabled.get(pingTarget.getId()) == null) {
                isEnabled.put(pingTarget.getId(), Boolean.FALSE);
            }
        }
       
        if(isEnabled.size() > 0) {
            setPingStatus(isEnabled);
View Full Code Here

Examples of org.apache.roller.weblogger.pojos.PingTarget

     * Convenience method for creating a ping target.
     */
    public static PingTarget setupPingTarget(String name, String url)
            throws Exception {
       
        PingTarget testPing = new PingTarget();
        testPing.setName("testCommonPing");
        testPing.setPingUrl("http://localhost/testCommonPing");
       
        // store ping
        PingTargetManager pingMgr = WebloggerFactory.getWeblogger().getPingTargetManager();
        pingMgr.savePingTarget(testPing);
       
        // flush to db
        WebloggerFactory.getWeblogger().flush();
       
        // query for it
        PingTarget ping = pingMgr.getPingTarget(testPing.getId());
       
        if(ping == null)
            throw new WebloggerException("error setting up ping target");
       
        return ping;
View Full Code Here

Examples of org.apache.roller.weblogger.pojos.PingTarget

     */
    public static void teardownPingTarget(String id) throws Exception {
       
        // query for it
        PingTargetManager pingMgr = WebloggerFactory.getWeblogger().getPingTargetManager();
        PingTarget ping = pingMgr.getPingTarget(id);
       
        // remove the ping
        pingMgr.removePingTarget(ping);
       
        // flush to db
View Full Code Here

Examples of org.apache.roller.weblogger.pojos.PingTarget

    }
   
   
    protected PingTarget createPingTarget() {
       
        return new PingTarget(
                null,
                getBean().getName(),
                getBean().getPingUrl(),
                getActionWeblog(),
                false);
View Full Code Here

Examples of org.apache.roller.weblogger.pojos.PingTarget

    }
   
   
    protected PingTarget createPingTarget() {
       
        return new PingTarget(
                null,
                getBean().getName(),
                getBean().getPingUrl(),
                null,
                false);
View Full Code Here

Examples of org.apache.roller.weblogger.pojos.PingTarget

     * Test lookup mechanisms ... id, all common, all custom for weblog
     */
    public void testPingTargetLookups() throws Exception {
       
        PingTargetManager mgr = WebloggerFactory.getWeblogger().getPingTargetManager();
        PingTarget ping = null;
       
        // create common ping
        mgr.savePingTarget(testCommonPing);
        String commonId = testCommonPing.getId();
        TestUtils.endSession(true);
       
        // create custom ping
        testWeblog = TestUtils.getManagedWebsite(testWeblog);
        testCustomPing.setWebsite(testWeblog);
        mgr.savePingTarget(testCustomPing);
        String customId = testCustomPing.getId();
        TestUtils.endSession(true);
       
        // lookup by id
        ping = null;
        ping = mgr.getPingTarget(commonId);
        assertNotNull(ping);
        assertEquals(testCommonPing.getName(), ping.getName());
       
        // lookup all common pings
        List commonPings = mgr.getCommonPingTargets();
        assertNotNull(commonPings);
        // correct answer is: 6 pings in config + 1 new one = 7
View Full Code Here

Examples of org.apache.roller.weblogger.pojos.PingTarget

       
        AutoPingManager mgr = WebloggerFactory.getWeblogger().getAutopingManager();
        AutoPing autoPing = null;
       
        // create ping target to use for tests
        PingTarget pingTarget = TestUtils.setupPingTarget("fooPing", "http://foo/null");
        PingTarget pingTarget2 = TestUtils.setupPingTarget("blahPing", "http://blah/null");
        TestUtils.endSession(true);
       
        // create autoPing
        autoPing = new AutoPing(null, pingTarget, testWeblog);
        mgr.saveAutoPing(autoPing);
        String id = autoPing.getId();
        TestUtils.endSession(true);
       
        // make sure autoPing was stored
        autoPing = null;
        autoPing = mgr.getAutoPing(id);
        assertNotNull(autoPing);
        assertEquals(pingTarget, autoPing.getPingTarget());
       
        // update autoPing
        autoPing.setPingTarget(pingTarget2);
        mgr.saveAutoPing(autoPing);
        TestUtils.endSession(true);
       
        // make sure autoPing was updated
        autoPing = null;
        autoPing = mgr.getAutoPing(id);
        assertNotNull(autoPing);
        assertEquals(pingTarget2, autoPing.getPingTarget());
       
        // delete autoPing
        mgr.removeAutoPing(autoPing);
        TestUtils.endSession(true);
       
        // make sure common autoPing was deleted
        autoPing = null;
        autoPing = mgr.getAutoPing(id);
        assertNull(autoPing);
       
        // teardown test ping target
        TestUtils.teardownPingTarget(pingTarget.getId());
        TestUtils.teardownPingTarget(pingTarget2.getId());
        TestUtils.endSession(true);
    }
View Full Code Here

Examples of org.apache.roller.weblogger.pojos.PingTarget

        AutoPingManager mgr = WebloggerFactory.getWeblogger().getAutopingManager();
        PingTargetManager ptmgr = WebloggerFactory.getWeblogger().getPingTargetManager();
        AutoPing testAutoPing = null;
       
        // create ping target to use for tests
        PingTarget pingTarget = TestUtils.setupPingTarget("fooPing", "http://foo/null");
        PingTarget pingTarget2 = TestUtils.setupPingTarget("blahPing", "http://blah/null");
        PingTarget pingTarget3 = TestUtils.setupPingTarget("gahPing", "http://gah/null");
       
        try {
       
            // create auto pings for test
            testWeblog = TestUtils.getManagedWebsite(testWeblog);
View Full Code Here

Examples of org.apache.roller.weblogger.pojos.PingTarget

        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
        autoPings = null;
        testWeblog = TestUtils.getManagedWebsite(testWeblog);
        autoPings = mgr.getAutoPingsByWebsite(testWeblog);
        assertNotNull(autoPing);
        assertEquals(1, autoPings.size());
       
        // delete autoPing
        autoPing = mgr.getAutoPing(autoPing.getId());
        mgr.removeAutoPing(autoPing);
        TestUtils.endSession(true);
       
        // teardown test ping target
        TestUtils.teardownPingTarget(pingTarget.getId());
        TestUtils.endSession(true);
    }
View Full Code Here

Examples of org.apache.roller.weblogger.pojos.PingTarget

        } catch (Exception ex) {
            log.error(ex);
            throw new Exception("Test setup failed", ex);
        }
       
        testCommonPing = new PingTarget();
        testCommonPing.setName("testCommonPing");
        testCommonPing.setPingUrl("http://localhost/testCommonPing");
       
        testCustomPing = new PingTarget();
        testCustomPing.setName("testCommonPing");
        testCustomPing.setPingUrl("http://localhost/testCommonPing");
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.