Package org.milyn.delivery.ordering.testvisitors

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


        originalList.clear();
    }

    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));
        assertEquals(originalList.get(8), sortList.get(2));
View Full Code Here


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

    public void test_sort_02_producer_first() {
        addVisitor(new TestProducerConsumer().setProducts("h").setConsumes("g"));
        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"));
View Full Code Here

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

    public void test_sort_01_consumers_first() {
        addVisitor(new TestProducerConsumer().setProducts("h").setConsumes("g"));
        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"));
View Full Code Here

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

    public void test_sort_2way_dependency_01() {
        addVisitor(new TestProducerConsumer().setProducts("a").setConsumes("b"));
        addVisitor(new TestProducerConsumer().setProducts("b").setConsumes("a"));

        try {
            Sorter.sort(sortList, Sorter.SortOrder.PRODUCERS_FIRST);
            fail("Expected SmooksConfigurationException");
        } catch(SmooksConfigurationException e) {
View Full Code Here

                    "\t\t\tdepends-on: Target Profile: [[org.milyn.profile.Profile#default_profile]], Selector: [0], Selector Namespace URI: [null], Resource: [org.milyn.delivery.ordering.testvisitors.TestProducerConsumer], Num Params: [0]").trim(), e.getMessage().trim());
        }
    }

    public void test_sort_2way_dependency_02() {
        addVisitor(new TestProducerConsumer().setProducts("a").setConsumes("b"));
        addVisitor(new TestProducerConsumer().setProducts("b").setConsumes("c"));
        addVisitor(new TestProducerConsumer().setProducts("c").setConsumes("d"));
        addVisitor(new TestProducerConsumer().setProducts("d").setConsumes("a"));

        try {
            Sorter.sort(sortList, Sorter.SortOrder.PRODUCERS_FIRST);
            fail("Expected SmooksConfigurationException");
        } catch(SmooksConfigurationException e) {
View Full Code Here

TOP

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

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.