Package com.salas.bb.utils.parser

Examples of com.salas.bb.utils.parser.Item


     * Tests normal update sequence with updates to times and retrieval counts.
     */
    public void testUpdateNotNull()
    {
        Channel channel = new Channel();
        channel.addItem(new Item("1"));

        DummyDataFeed feed = new DummyDataFeed();
        feed.setChannel(channel);

        long base = System.currentTimeMillis();
View Full Code Here


        // Adding two articles one by one (two updates) while having limit of 1
        // The second update should call cleaner and remove the last article
        DummyDataFeed feed = new DummyDataFeed();
        feed.setPurgeLimit(1);
        Channel channel1 = new Channel();
        channel1.addItem(new Item("1"));

        // First update
        feed.setChannel(channel1);
        feed.update();

        // A little pause to create a gap between items
        Thread.sleep(100);

        Channel channel2 = new Channel();
        Item item = new Item("2");
        channel2.addItem(item);

        // Second update
        feed.setChannel(channel2);
        feed.update();
View Full Code Here

        // removed because of a pin.
        DummyDataFeed feed = new DummyDataFeed();
        feed.setPurgeLimit(1);
        DataFeed.setGlobalPurgeUnread(false);
        Channel channel1 = new Channel();
        channel1.addItem(new Item("1"));

        // First update
        feed.setChannel(channel1);
        feed.update();
        feed.getArticleAt(0).setPinned(true);

        Channel channel2 = new Channel();
        Item item = new Item("2");
        channel2.addItem(item);

        // Second update
        feed.setChannel(channel2);
        feed.update();
View Full Code Here

     */
    public void testSavingLastUpdateServerTime()
    {
        Channel chan = new Channel();
        chan.setLastUpdateServerTime(-1);
        chan.addItem(new Item("1"));

        DummyDataFeed feed = new DummyDataFeed();
        feed.setChannel(chan);
        feed.update();

        assertEquals("Wrong last update server time.", -1, feed.getLastUpdateServerTime());

        chan.setLastUpdateServerTime(1);
        chan.addItem(new Item("2"));
        feed.update();

        assertEquals("Wrong last update server time.", 1, feed.getLastUpdateServerTime());
    }
View Full Code Here

        channel.setLanguage("en_US");
        channel.setUpdatePeriod(Constants.MILLIS_IN_DAY);

        for (AmazonItem amazonItem : aAmazonItems)
        {
            Item item = amazonItemToChannelItem(amazonItem);
            if (item != null) channel.addItem(item);
        }

        return channel;
    }
View Full Code Here

    {
        String title = aAmazonItem.getAttributeValue("Title");

        if (title == null) return null;

        Item item = new Item(aAmazonItem.toHTML());
        item.setLink(aAmazonItem.getURL());
        item.setTitle(title);

        return item;
    }
View Full Code Here

TOP

Related Classes of com.salas.bb.utils.parser.Item

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.