Package org.apache.isis.viewer.dnd.view.collection

Examples of org.apache.isis.viewer.dnd.view.collection.SimpleCollectionSorter


    @Test
    public void testSortByTitle() {
        final ObjectAdapter[] instances = new ObjectAdapter[] { adapterWithTitle("one"), adapterWithTitle("two"), adapterWithTitle("three"), adapterWithTitle("four"), };

        final SimpleCollectionSorter sorter = new SimpleCollectionSorter();
        sorter.sort(instances, new TitleComparator(), CollectionSorter.NORMAL);

        assertEquals("four", instances[0].titleString());
        assertEquals("one", instances[1].titleString());
        assertEquals("three", instances[2].titleString());
        assertEquals("two", instances[3].titleString());
View Full Code Here


    @Test
    public void testSortByTitleReversed() {
        final ObjectAdapter[] instances = new ObjectAdapter[] { adapterWithTitle("one"), adapterWithTitle("two"), adapterWithTitle("three"), adapterWithTitle("four"), };

        final SimpleCollectionSorter sorter = new SimpleCollectionSorter();
        sorter.sort(instances, new TitleComparator(), CollectionSorter.REVERSED);

        assertEquals("two", instances[0].titleString());
        assertEquals("three", instances[1].titleString());
        assertEquals("one", instances[2].titleString());
        assertEquals("four", instances[3].titleString());
View Full Code Here

    }

    public void testSortByTitle() {
        final ObjectAdapter[] instances = new ObjectAdapter[] { object("one"), object("two"), object("three"), object("four"), };

        final SimpleCollectionSorter sorter = new SimpleCollectionSorter();
        sorter.sort(instances, new TitleComparator(), CollectionSorter.NORMAL);

        assertEquals("four", instances[0].titleString());
        assertEquals("one", instances[1].titleString());
        assertEquals("three", instances[2].titleString());
        assertEquals("two", instances[3].titleString());
View Full Code Here

    }

    public void testSortByTitleReversed() {
        final ObjectAdapter[] instances = new ObjectAdapter[] { object("one"), object("two"), object("three"), object("four"), };

        final SimpleCollectionSorter sorter = new SimpleCollectionSorter();
        sorter.sort(instances, new TitleComparator(), CollectionSorter.REVERSED);

        assertEquals("two", instances[0].titleString());
        assertEquals("three", instances[1].titleString());
        assertEquals("one", instances[2].titleString());
        assertEquals("four", instances[3].titleString());
View Full Code Here

    public void testSortByTitle() {
        final ObjectAdapter[] instances =
            new ObjectAdapter[] { object("one"), object("two"), object("three"), object("four"), };

        final SimpleCollectionSorter sorter = new SimpleCollectionSorter();
        sorter.sort(instances, new TitleComparator(), CollectionSorter.NORMAL);

        assertEquals("four", instances[0].titleString());
        assertEquals("one", instances[1].titleString());
        assertEquals("three", instances[2].titleString());
        assertEquals("two", instances[3].titleString());
View Full Code Here

    public void testSortByTitleReversed() {
        final ObjectAdapter[] instances =
            new ObjectAdapter[] { object("one"), object("two"), object("three"), object("four"), };

        final SimpleCollectionSorter sorter = new SimpleCollectionSorter();
        sorter.sort(instances, new TitleComparator(), CollectionSorter.REVERSED);

        assertEquals("two", instances[0].titleString());
        assertEquals("three", instances[1].titleString());
        assertEquals("one", instances[2].titleString());
        assertEquals("four", instances[3].titleString());
View Full Code Here

TOP

Related Classes of org.apache.isis.viewer.dnd.view.collection.SimpleCollectionSorter

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.