Package org.milyn.delivery.ordering.testvisitors

Examples of org.milyn.delivery.ordering.testvisitors.TestVisitor


    public void test_sort_01_producer_first() {
        addVisitor(new TestConsumer("e", "f"));
        addVisitor(new TestProducerConsumer().setProducts("h").setConsumes("g"));
        addVisitor(new TestProducer("a", "b", "c"));
        addVisitor(new TestVisitor());
        addVisitor(new TestConsumer("d", "g"));
        addVisitor(new TestProducer("d", "e"));
        addVisitor(new TestConsumer("b"));
        addVisitor(new TestVisitor());
        addVisitor(new TestProducerConsumer().setProducts("g").setConsumes("c"));

        Sorter.sort(sortList, Sorter.SortOrder.PRODUCERS_FIRST);
        assertEquals(originalList.get(5), sortList.get(0));
        assertEquals(originalList.get(2), sortList.get(1));
View Full Code Here


        addVisitor(new TestConsumer("e", "f"));
        addVisitor(new TestConsumer("b"));
        addVisitor(new TestProducer("d", "e"));
        addVisitor(new TestProducerConsumer().setProducts("g").setConsumes("c"));
        addVisitor(new TestConsumer("d", "g"));
        addVisitor(new TestVisitor());
        addVisitor(new TestVisitor());
        addVisitor(new TestProducer("a", "b", "c"));

        Sorter.sort(sortList, Sorter.SortOrder.PRODUCERS_FIRST);
        assertEquals(originalList.get(8), sortList.get(0));
        assertEquals(originalList.get(3), sortList.get(1));
View Full Code Here

        addVisitor(new TestConsumer("e", "f"));
        addVisitor(new TestConsumer("b"));
        addVisitor(new TestProducer("d", "e"));
        addVisitor(new TestProducerConsumer().setProducts("g").setConsumes("c"));
        addVisitor(new TestConsumer("d", "g"));
        addVisitor(new TestVisitor());
        addVisitor(new TestVisitor());
        addVisitor(new TestProducer("a", "b", "c"));

        Sorter.sort(sortList, Sorter.SortOrder.CONSUMERS_FIRST);
        assertEquals(originalList.get(8), sortList.get(8));
        assertEquals(originalList.get(3), sortList.get(7));
View Full Code Here

        assertEquals(originalList.get(2), sortList.get(1));
        assertEquals(originalList.get(5), sortList.get(0));
    }

    public void test_sort_no_producers_consumers_producersfirst() {
        addVisitor(new TestVisitor());
        addVisitor(new TestVisitor());
        addVisitor(new TestVisitor());
        addVisitor(new TestVisitor());
        addVisitor(new TestVisitor());
        addVisitor(new TestVisitor());
        addVisitor(new TestVisitor());
        addVisitor(new TestVisitor());
        addVisitor(new TestVisitor());

        Sorter.sort(sortList, Sorter.SortOrder.PRODUCERS_FIRST);
        assertEquals(originalList.get(0), sortList.get(0));
        assertEquals(originalList.get(1), sortList.get(1));
        assertEquals(originalList.get(2), sortList.get(2));
View Full Code Here

        assertEquals(originalList.get(7), sortList.get(7));
        assertEquals(originalList.get(8), sortList.get(8));
    }

    public void test_sort_no_producers_consumers_consumersfirst() {
        addVisitor(new TestVisitor());
        addVisitor(new TestVisitor());
        addVisitor(new TestVisitor());
        addVisitor(new TestVisitor());
        addVisitor(new TestVisitor());
        addVisitor(new TestVisitor());
        addVisitor(new TestVisitor());
        addVisitor(new TestVisitor());
        addVisitor(new TestVisitor());

        Sorter.sort(sortList, Sorter.SortOrder.CONSUMERS_FIRST);
        assertEquals(originalList.get(0), sortList.get(8));
        assertEquals(originalList.get(1), sortList.get(7));
        assertEquals(originalList.get(2), sortList.get(6));
View Full Code Here

TOP

Related Classes of org.milyn.delivery.ordering.testvisitors.TestVisitor

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.