Package org.rssowl.ui.internal.editors.feed

Examples of org.rssowl.ui.internal.editors.feed.NewsComparator.sort()


    /* By Title */
    comp.setSortBy(NewsColumn.TITLE);
    comp.setAscending(true);
    Object[] elements = new Object[] { news1, news2, news3 };
    comp.sort(null, elements);

    assertEquals("A News", ((INews) elements[0]).getTitle());
    assertEquals("B News", ((INews) elements[1]).getTitle());
    assertEquals("C News", ((INews) elements[2]).getTitle());

View Full Code Here


    /* By Date */
    comp.setSortBy(NewsColumn.DATE);
    comp.setAscending(false);

    comp.sort(null, elements);

    assertEquals("C News", ((INews) elements[0]).getTitle());
    assertEquals("B News", ((INews) elements[1]).getTitle());
    assertEquals("A News", ((INews) elements[2]).getTitle());

View Full Code Here

    assertEquals("A News", ((INews) elements[2]).getTitle());

    /* By Label */
    comp.setSortBy(NewsColumn.LABELS);

    comp.sort(null, elements);

    assertEquals("C News", ((INews) elements[0]).getTitle());
    assertEquals("B News", ((INews) elements[1]).getTitle());
    assertEquals("A News", ((INews) elements[2]).getTitle());

View Full Code Here

    label3.setOrder(2);

    news1.addLabel(label1);
    comp.setAscending(true);

    comp.sort(null, elements);

    /*
     * News 1: Label_1
     * News 3: -
     * News 2: -
View Full Code Here

    assertEquals("C News", ((INews) elements[1]).getTitle());
    assertEquals("B News", ((INews) elements[2]).getTitle());

    news1.addLabel(label2);

    comp.sort(null, elements);

    /*
     * News 1: Label_1, Label_2
     * News 3: -
     * News 2: -
View Full Code Here

    assertEquals("C News", ((INews) elements[1]).getTitle());
    assertEquals("B News", ((INews) elements[2]).getTitle());

    news2.addLabel(label1);

    comp.sort(null, elements);

    /*
     * News 1: Label_1, Label_2
     * News 2: Label_1
     * News 3: -
View Full Code Here

    assertEquals("A News", ((INews) elements[0]).getTitle());
    assertEquals("B News", ((INews) elements[1]).getTitle());
    assertEquals("C News", ((INews) elements[2]).getTitle());

    comp.setAscending(false);
    comp.sort(null, elements);

    /*
     * News 3: -
     * News 2: Label_1
     * News 1: Label_1, Label_2
View Full Code Here

    assertEquals("A News", ((INews) elements[2]).getTitle());

    news3.addLabel(label2);

    comp.setAscending(true);
    comp.sort(null, elements);

    /*
     * News 1: Label_1, Label_2
     * News 2: Label_1
     * News 3: Label_2
View Full Code Here

    assertEquals("B News", ((INews) elements[1]).getTitle());
    assertEquals("C News", ((INews) elements[2]).getTitle());

    news3.addLabel(label1);

    comp.sort(null, elements);

    /*
     * News 3: Label_1, Label_2
     * News 1: Label_1, Label_2
     * News 2: Label_1
View Full Code Here

    assertEquals("A News", ((INews) elements[1]).getTitle());
    assertEquals("B News", ((INews) elements[2]).getTitle());

    news3.addLabel(label3);

    comp.sort(null, elements);

    /*
     * News 3: Label_1, Label_2, Label_3
     * News 1: Label_1, Label_2
     * News 2: Label_1
View Full Code Here

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.