Package com.rometools.rome.unittest

Source Code of com.rometools.rome.unittest.TestSyndFeedRSS092Alt

package com.rometools.rome.unittest;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

import com.rometools.rome.feed.synd.SyndEnclosure;

public class TestSyndFeedRSS092Alt extends TestSyndFeedRSS092 {

    public TestSyndFeedRSS092Alt() {
        this("rss_0.92", "rss_0.92_alt.xml");
    }

    protected TestSyndFeedRSS092Alt(final String feedType, final String feedFileName) {
        super(feedType, feedFileName);
    }

    @Override
    protected void testEnclosures(final List<SyndEnclosure> encs, final String prefix) throws Exception {
        final Set<String> s1 = new HashSet<String>();
        final Set<String> s2 = new HashSet<String>();
        for (int i = 0; i < encs.size(); i++) {
            final SyndEnclosure enc = encs.get(i);
            s1.add(enc.getUrl() + " " + enc.getType() + " " + enc.getLength());
            s2.add(getPrefix() + "." + prefix + ".enclousure[" + i + "]^url" + " " + getPrefix() + "." + prefix + ".enclousure[" + i + "]^type" + " " + "0");
        }
        assertTrue(s1.equals(s2));
    }
}
TOP

Related Classes of com.rometools.rome.unittest.TestSyndFeedRSS092Alt

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.