Package com.rometools.rome.feed

Examples of com.rometools.rome.feed.WireFeed


     *             underlying parsers.
     * @throws FeedException if the feed could not be parsed
     *
     */
    public WireFeed build(final File file) throws FileNotFoundException, IOException, IllegalArgumentException, FeedException {
        WireFeed feed;
        Reader reader = new FileReader(file);
        if (xmlHealerOn) {
            reader = new XmlFixerReader(reader);
        }
        feed = this.build(reader);
View Full Code Here


     * parser is a phantom.
     *
     */
    @Override
    protected WireFeed parseChannel(final Element rssRoot, final Locale locale) {
        final WireFeed wFeed = super.parseChannel(rssRoot, locale);
        wFeed.setFeedType("rss_2.0");
        return wFeed;
    }
View Full Code Here

        super(feedType + ".xml");
    }

    // 1.2a
    public void testWireFeedEquals() throws Exception {
        final WireFeed feed1 = getCachedWireFeed();
        final WireFeed feed2 = getWireFeed();
        assertTrue(feed1.equals(feed2));
    }
View Full Code Here

        assertTrue(feed1.equals(feed2));
    }

    // 1.2b
    public void testWireFeedNotEqual() throws Exception {
        final WireFeed feed1 = getCachedWireFeed();
        final WireFeed feed2 = getWireFeed();
        feed2.setFeedType("dummy");
        assertFalse(feed1.equals(feed2));
    }
View Full Code Here

        assertFalse(feed1.equals(feed2));
    }

    // 1.3
    public void testWireFeedCloning() throws Exception {
        final WireFeed feed1 = getCachedWireFeed();
        final WireFeed feed2 = (WireFeed) feed1.clone();
        ;
        assertTrue(feed1.equals(feed2));
    }
View Full Code Here

        assertTrue(feed1.equals(feed2));
    }

    // 1.4
    public void testWireFeedSerialization() throws Exception {
        final WireFeed feed1 = getCachedWireFeed();

        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 WireFeed feed2 = (WireFeed) ois.readObject();
        ois.close();

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

    }

    // 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

            assertEquals("rss_2.0.channel.item[0].comments", item.getComments());
        }
    }

    public void testPreserveWireFeedComments() throws Exception {
        final WireFeed wf = this.getCachedSyndFeed(true).originalWireFeed();
        assertNotNull(wf);
        assertTrue(wf instanceof Channel);
        if (wf instanceof Channel) {
            final Channel channel = (Channel) wf;
            assertEquals("rss_2.0.channel.item[0].comments", channel.getItems().get(0).getComments());
View Full Code Here

TOP

Related Classes of com.rometools.rome.feed.WireFeed

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.