Package com.rometools.rome.feed.synd

Examples of com.rometools.rome.feed.synd.SyndFeed


    public TestSyndFeedAtom10b() {
        super("atom_1.0_b.xml");
    }

    public void testXmlBaseConformance() throws Exception {
        final SyndFeed feed = getSyndFeed(false);
        final List<SyndEntry> entries = feed.getEntries();
        for (int index = 0; index < entries.size(); index++) {
            final SyndEntry entry = entries.get(index);
            assertEquals("Incorrect URI: " + entry.getLink() + " in entry [" + entry.getTitle() + "]", "http://example.org/tests/base/result.html",
                    entry.getLink());
        }
View Full Code Here


    public void testOriginalCategories() throws Exception {
        checkFeed(getCachedSyndFeed());
    }

    public void testCopiedFeedCategories() throws Exception {
        final SyndFeed copiedFeed = new SyndFeedImpl();
        copiedFeed.copyFrom(getCachedSyndFeed());
        checkFeed(copiedFeed);
    }
View Full Code Here

        final Item entry = items.get(i);
        assertProperty(entry.getComments(), "channel.item[" + i + "].comments");
    }

    public void testSyndFeed() throws Exception {
        final SyndFeed feed = this.getCachedSyndFeed();
        assertProperty(feed.getDocs(), "channel.docs");
        assertProperty(feed.getGenerator(), "channel.generator");
        assertProperty(feed.getManagingEditor(), "channel.managingEditor");
        assertProperty(feed.getWebMaster(), "channel.webMaster");
    }
View Full Code Here

    public Issue134Test() {
        super("CDATATestFeed.xml");
    }

    public void testCDataLinks() throws Exception {
        final SyndFeed feed = this.getCachedSyndFeed();
        assertEquals("links differ", feed.getEntries().get(0).getLink(), feed.getEntries().get(1).getLink());
    }
View Full Code Here

    public Issue137Test() {
        super("issue137-rss.xml");
    }

    public void testDescription() throws Exception {
        final SyndFeed feed = this.getCachedSyndFeed();
        assertEquals("<img src=\"http://www.moe.gov.sg/media/spotlight/assets_c/2009/09/spotlight-single-session-thumb-120x80-282.jpg\""
                + " alt=\"Teacher and his students tossing frisbees into the air\" /><p>MOE will be <a href\n"
                + "=\"http://www.moe.gov.sg/media/press/2009/09/moe-to-build-new-primary-schoo.php\">building 11 new primary\n"
                + " schools and upgrading another 28 existing schools from November 2009</a>. This is the first phase of\n"
                + " MOE's plans to enhance primary school infrastructure to facilitate the transition of all primary schools\n"
                + " to a single-session model to support a higher quality primary education.</p>", feed.getEntries().get(0).getDescription().getValue());
        assertEquals("<img src=\"http://www.moe.gov.sg/media/spotlight/assets_c/2009/09/spotlight-wps-thumb-120x80-280\n"
                + ".jpg\" alt=\"Minister speaking at WPS 2009\" /><p>At the Work Plan Seminar 2009, Minister for Education\n"
                + " Dr Ng Eng Hen <a href=\"http://www.moe.gov.sg/media/speeches/2009/09/17/work-plan-seminar.php\">talked\n"
                + " about the importance of language &#38; communication skills and growing a world-class education service\n"
                + "</a>. He spoke of <a href=\"http://www.moe.gov.sg/media/press/2009/09/teachers-the-heart-of-quality.php\"\n"
                + ">strengthening the teaching track and of a teacher-driven culture of professional excellence</a>.</p\n" + ">", feed.getEntries().get(1)
                .getDescription().getValue());
        assertEquals("<img src=\"http://www.moe.gov.sg/media/spotlight/assets_c/2009/09/spotlight-moa-2009-thumb-120x80-278"
                + ".jpg\" alt=\"Students at a podcast session\" />\n <p>A total of 275 schools will <a href=\"http:/"
                + "/www.moe.gov.sg/media/press/2009/09/recognising-school-achievement.php\">receive 580 Special and Level\n"
                + " Two Awards this year under the MOE Masterplan of Awards</a>. These awards will be presented at the 2009\n"
                + " MOE Work Plan Seminar on 17 Sep 09 by the Minister for Education, Dr Ng Eng Hen.</p>", feed.getEntries().get(2).getDescription().getValue());
    }
View Full Code Here

        assertTrue(feed1.equals(feed2));
    }

    // 1.6
    public void testWireFeedSyndFeedConversion() throws Exception {
        final SyndFeed sFeed1 = this.getCachedSyndFeed();
        final WireFeed wFeed1 = sFeed1.createWireFeed();
        final SyndFeed sFeed2 = new SyndFeedImpl(wFeed1);

        assertTrue(sFeed1.equals(sFeed2));
    }
View Full Code Here

        assertTrue(sFeed1.equals(sFeed2));
    }

    // 1.7a
    public void testSyndFeedEquals() throws Exception {
        final SyndFeed feed1 = this.getCachedSyndFeed();
        final SyndFeed feed2 = getSyndFeed(false);
        assertTrue(feed1.equals(feed2));
    }
View Full Code Here

        assertTrue(feed1.equals(feed2));
    }

    // 1.7b
    public void testSyndFeedNotEqual() throws Exception {
        final SyndFeed feed1 = this.getCachedSyndFeed();
        final SyndFeed feed2 = getSyndFeed(false);
        feed2.setFeedType("dummy");
        assertFalse(feed1.equals(feed2));
    }
View Full Code Here

        assertFalse(feed1.equals(feed2));
    }

    // 1.8
    public void testSyndFeedCloning() throws Exception {
        final SyndFeed feed1 = this.getCachedSyndFeed();
        final SyndFeed feed2 = (SyndFeed) feed1.clone();
        ;
        assertTrue(feed1.equals(feed2));
    }
View Full Code Here

        assertTrue(feed1.equals(feed2));
    }

    // 1.9
    public void testSyndFeedSerialization() throws Exception {
        final SyndFeed feed1 = this.getCachedSyndFeed();

        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
        final ObjectOutputStream oos = new ObjectOutputStream(baos);
        oos.writeObject(feed1);
        oos.close();

        final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
        final ObjectInputStream ois = new ObjectInputStream(bais);
        final SyndFeed feed2 = (SyndFeed) ois.readObject();
        ois.close();

        assertTrue(feed1.equals(feed2));
    }
View Full Code Here

TOP

Related Classes of com.rometools.rome.feed.synd.SyndFeed

Copyright © 2018 www.massapicom. 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.