Package com.salas.bbutilities.opml.objects

Examples of com.salas.bbutilities.opml.objects.OPMLGuide


    /**
     * @see ImportGuidesAction#countFeeds
     */
    public void testCountChannels()
    {
        final OPMLGuide emptyGuide = new OPMLGuide("test", null, false, null, null, false, 0, false, false, false);

        final OPMLGuide guide1 = new OPMLGuide("guide1", null, false, null, null, false, 0, false, false, false);
        final ArrayList<DefaultOPMLFeed> al1 = new ArrayList<DefaultOPMLFeed>();
        al1.add(new DirectOPMLFeed("1", "1", "1", 0, null, null, -1, null, null, null, null, null, null, false, 1, false, 0, false, 0));
        guide1.setFeeds(al1);

        final OPMLGuide[] guides = {emptyGuide, guide1};

        assertEquals(1, ImportGuidesAction.countFeeds(guides));
    }
View Full Code Here


        throws Exception
    {
        initDB();

        // Setup guides for appending
        final OPMLGuide g1, g2;
        final ArrayList<DefaultOPMLFeed> a1, a2;

        g1 = new OPMLGuide("g1", "icon1", false, null, null, false, 0, false, false, false);
        a1 = new ArrayList<DefaultOPMLFeed>();
        a1.add(new DirectOPMLFeed("1", "file://1", "file://1", 0, null, null, -1, null, null, null, null, null, null, false, 1, false, 0, false, 0));
        a1.add(new DirectOPMLFeed("2", "file://2", "file://2", 0, null, null, -1, null, null, null, null, null, null, false, 1, false, 0, false, 0));
        g1.setFeeds(a1);

        g2 = new OPMLGuide("g2", null, false, null, null, false, 0, false, false, false);
        a2 = new ArrayList<DefaultOPMLFeed>();
        a2.add(new DirectOPMLFeed("3", "file://3", "file://3", 0, null, null, -1, null, null, null, null, null, null, false, 1, false, 0, false, 0));
        a2.add(new DirectOPMLFeed("4", "file://4", "file://4", 0, null, null, -1, null, null, null, null, null, null, false, 1, false, 0, false, 0));
        g2.setFeeds(a2);
View Full Code Here

        throws Exception
    {
        initDB();

        // Setup guides for replacing
        final OPMLGuide g1, g2;
        final ArrayList<DefaultOPMLFeed> a1, a2;

        g1 = new OPMLGuide("g1", "icon1", false, null, null, false, 0, false, false, false);
        a1 = new ArrayList<DefaultOPMLFeed>();
        a1.add(new DirectOPMLFeed("1", "file://1", "file://1", 0, null, null, -1, null, null, null, null, null, null, false, 1, false, 0, false, 0));
        a1.add(new DirectOPMLFeed("2", "file://2", "file://2", 0, null, null, -1, null, null, null, null, null, null, false, 1, false, 0, false, 0));
        g1.setFeeds(a1);

        g2 = new OPMLGuide("g1", null, false, null, null, false, 0, false, false, false);
        a2 = new ArrayList<DefaultOPMLFeed>();
        a2.add(new DirectOPMLFeed("3", "file://3", "file://3", 0, null, null, -1, null, null, null, null, null, null, false, 1, false, 0, false, 0));
        a2.add(new DirectOPMLFeed("4", "file://4", "file://4", 0, null, null, -1, null, null, null, null, null, null, false, 1, false, 0, false, 0));
        g2.setFeeds(a2);
View Full Code Here

    public void testReplaceGuidesEmpty()
    {
        initDB();

        // Setup guides for replacing
        final OPMLGuide g1, g2;
        final ArrayList<DefaultOPMLFeed> a1, a2;

        g1 = new OPMLGuide("g1", "icon1", false, null, null, false, 0, false, false, false);
        a1 = new ArrayList<DefaultOPMLFeed>();
        a1.add(new DirectOPMLFeed("1", "file://1", "file://1", 0, null, null, -1, null, null, null, null, null, null, false, 1, false, 0, false, 0));
        a1.add(new DirectOPMLFeed("2", "file://2", "file://2", 0, null, null, -1, null, null, null, null, null, null, false, 1, false, 0, false, 0));
        g1.setFeeds(a1);

        g2 = new OPMLGuide("g1", null, false, null, null, false, 0, false, false, false);
        a2 = new ArrayList<DefaultOPMLFeed>();
        a2.add(new DirectOPMLFeed("3", "file://3", "file://3", 0, null, null, -1, null, null, null, null, null, null, false, 1, false, 0, false, 0));
        a2.add(new DirectOPMLFeed("4", "file://4", "file://4", 0, null, null, -1, null, null, null, null, null, null, false, 1, false, 0, false, 0));
        g2.setFeeds(a2);
View Full Code Here

        feedStat.setBaseTitle("stat");
        feedStat.setXmlURL(new URL("file://stat"));
        guide.add(feedStat);

        // Checking
        OPMLGuide opmlGuide = Converter.convertToOPML(guide);
        OPMLReadingList[] lists = opmlGuide.getReadingLists();
        assertEquals(1, lists.length);

        OPMLReadingList lst = lists[0];
        List feeds = lst.getFeeds();
        assertEquals(1, feeds.size());
        DirectOPMLFeed feed = (DirectOPMLFeed)feeds.get(0);
        assertEquals("dyn", feed.getTitle());

        feeds = opmlGuide.getFeeds();
        assertEquals(1, feeds.size());
        feed = (DirectOPMLFeed)feeds.get(0);
        assertEquals("stat", feed.getTitle());
    }
View Full Code Here

        guide.setPublishingTags("a b c");
        guide.setPublishingTitle("abc");
        guide.setPublishingRating(2);

        // Checking
        OPMLGuide opmlGuide = Converter.convertToOPML(guide);
        assertEquals(guide.isPublishingEnabled(), opmlGuide.isPublishingEnabled());
        assertEquals(guide.isPublishingPublic(), opmlGuide.isPublishingPublic());
        assertEquals(guide.getPublishingTags(), opmlGuide.getPublishingTags());
        assertEquals(guide.getPublishingTitle(), opmlGuide.getPublishingTitle());
        assertEquals(guide.getPublishingRating(), opmlGuide.getPublishingRating());
    }
View Full Code Here

    public void testAppendGuide()
        throws Exception
    {
        initDB();

        final OPMLGuide guide = new OPMLGuide("g1", "icon", false, null, null, false, 0, false, false, false);
        final ArrayList<DefaultOPMLFeed> a1 = new ArrayList<DefaultOPMLFeed>();
        a1.add(new DirectOPMLFeed("1", "file://1", "file://1", 0, null, null, -1, null, null, null, null, null, null, false, 1, false, 0, false, 0));
        a1.add(new DirectOPMLFeed("2", "file://2", "file://2", 0, null, null, 1, "A", "B", "C", "D", "E", "F", false, 1, false, 0, false, 0));
        guide.setFeeds(a1);

        // Put in GuidesSet guide with duplicate name to check how dedupe works
        GuidesSet cgs = GlobalModel.SINGLETON.getGuidesSet();
        final StandardGuide g = new StandardGuide();
        g.setTitle("g1");
View Full Code Here

            null, null, null, null, null, null, false, 0, false, 1, false, 0);

        OPMLReadingList opmlRL = new OPMLReadingList("ReadingList", "file://test");
        opmlRL.setFeeds(Arrays.asList(opmlFeed));

        OPMLGuide opmlGuide = new OPMLGuide("Guide", "", false, null, null, false, 0, false, false, false);
        opmlGuide.add(opmlRL);

        // Checking
        StandardGuide guide = (StandardGuide)Helper.createGuide(null, opmlGuide, new Date());
        assertEquals(1, guide.getReadingLists().length);
        assertEquals(1, guide.getFeedsCount());
View Full Code Here

    /**
     * Tests converting OPML guide into domain object moving publication properties.
     */
    public void testCreateGuideWithPublicationProperties()
    {
        OPMLGuide opmlGuide = new OPMLGuide("Guide", "", true, "title", "tags", true, 2, false, false, true);

        // Checking
        StandardGuide guide = (StandardGuide)Helper.createGuide(null, opmlGuide, new Date());
        assertEquals(opmlGuide.isPublishingEnabled(), guide.isPublishingEnabled());
        assertEquals(opmlGuide.isPublishingPublic(), guide.isPublishingPublic());
        assertEquals(opmlGuide.getPublishingTitle(), guide.getPublishingTitle());
        assertEquals(opmlGuide.getPublishingTags(), guide.getPublishingTags());
        assertEquals(opmlGuide.getPublishingRating(), guide.getPublishingRating());
        assertEquals(opmlGuide.isMobile(), guide.isMobile());
    }
View Full Code Here

    /**
     * Tests converting OPML guide into domain object moving notification properties.
     */
    public void testCreateGuideWithNotificationProperties()
    {
        OPMLGuide opmlGuide = new OPMLGuide("Guide", "", true, "title", "tags", true, 0, false, false, false);

        // Checking
        StandardGuide guide = (StandardGuide)Helper.createGuide(null, opmlGuide, new Date());
        assertEquals(opmlGuide.isNotificationsAllowed(), guide.isNotificationsAllowed());

        opmlGuide = new OPMLGuide("Guide", "", true, "title", "tags", true, 0, false, true, false);

        // Checking
        guide = (StandardGuide)Helper.createGuide(null, opmlGuide, new Date());
        assertEquals(opmlGuide.isNotificationsAllowed(), guide.isNotificationsAllowed());
    }
View Full Code Here

TOP

Related Classes of com.salas.bbutilities.opml.objects.OPMLGuide

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.