Package org.mule.tck.testmodels.fruit

Examples of org.mule.tck.testmodels.fruit.FruitBowl


        assertTrue(fb.hasApple());
    }

    public void testMessagePayloadWithMoreComplexTransformUsingManager() throws Exception
    {
        MuleMessage message = new DefaultMuleMessage(new FruitBowl(new Apple(), new Banana()), muleContext);

        //Lets register our transformer so Mule can find it
        muleContext.getRegistry().registerTransformer(new FruitBowlToFruitBasket());

        //i.e. ${payload:org.mule.tck.testmodels.fruit.FruitBasket}
View Full Code Here


        assertEquals("/replyEndpoint", message.getReplyTo());
    }
   
    public void testNonMapNonJsonPayload() throws Exception
    {
        FruitBowl payload = new FruitBowl(new Apple(), new Banana());
        MuleMessageFactory factory = createMuleMessageFactory();
        MuleMessage message = factory.create(payload, encoding);
        assertNotNull(message);
        assertEquals(payload, message.getPayload());
    }
View Full Code Here

        {
            if (fruit == null || fruit.length == 0)
            {
                throw new IllegalArgumentException("fruit[]");
            }
            return new FruitBowl(fruit);
        }
View Full Code Here

        splitter.setMuleContext(muleContext);

        Apple apple = new Apple();
        Banana banana = new Banana();
        Orange orange = new Orange();
        FruitBowl fruitBowl = new FruitBowl();
        fruitBowl.addFruit(apple);
        fruitBowl.addFruit(banana);
        fruitBowl.addFruit(orange);

        MuleEvent inEvent = new DefaultMuleEvent(new DefaultMuleMessage(fruitBowl, muleContext),
            getTestEvent(""));

        MuleEvent resultEvent = splitter.process(inEvent);
View Full Code Here

    private static class TestSplitter extends AbstractSplitter
    {
        @Override
        protected List<MuleMessage> splitMessage(MuleEvent event)
        {
            FruitBowl bowl = (FruitBowl) event.getMessage().getPayload();
            List<MuleMessage> parts = new ArrayList<MuleMessage>();
            for (Fruit fruit : bowl.getFruit())
            {
                parts.add(new DefaultMuleMessage(fruit, muleContext));
            }
            return parts;
        }
View Full Code Here

    @Test
    public void testMessagePayloadWithMoreComplexTransform() throws Exception
    {
        MuleExpressionEvaluator eval = new MuleExpressionEvaluator();
        eval.setMuleContext(muleContext);
        MuleMessage message = new DefaultMuleMessage(new FruitBowl(new Apple(), new Banana()), muleContext);

        //Lets register our transformer so Mule can find it
        muleContext.getRegistry().registerTransformer(new FruitBowlToFruitBasket());

        //i.e. ${payload:org.mule.tck.testmodels.fruit.FruitBasket}
View Full Code Here

    }

    @Test
    public void testMessagePayloadWithMoreComplexTransformUsingManager() throws Exception
    {
        MuleMessage message = new DefaultMuleMessage(new FruitBowl(new Apple(), new Banana()), muleContext);

        //Lets register our transformer so Mule can find it
        muleContext.getRegistry().registerTransformer(new FruitBowlToFruitBasket());

        //i.e. ${payload:org.mule.tck.testmodels.fruit.FruitBasket}
View Full Code Here

    @Test
    public void testWithMoreComplexTransform() throws Exception
    {
        MessagePayloadExpressionEvaluator eval = new MessagePayloadExpressionEvaluator();
        MuleMessage message = new DefaultMuleMessage(new FruitBowl(new Apple(), new Banana()), muleContext);

        //Lets register our transformer so Mule can find it
        muleContext.getRegistry().registerTransformer(new FruitBowlToFruitBasket());

        //i.e. ${payload:org.mule.tck.testmodels.fruit.FruitBasket}
View Full Code Here

    public void testExplicitMethodMatchComplexObject() throws Exception
    {
        try
        {
            LegacyEntryPointResolverSet resolver = new LegacyEntryPointResolverSet();
            resolver.invoke(new FruitBowl(), getTestEventContext(new FruitLover("Mmmm")));
        }
        catch (MuleException e)
        {
            fail("Test should have passed: " + e);
        }
View Full Code Here

    public void testExplicitMethodMatchSetArrayFail() throws Exception
    {
        try
        {
            LegacyEntryPointResolverSet resolver = new LegacyEntryPointResolverSet();
            resolver.invoke(new FruitBowl(), getTestEventContext(new Fruit[]{new Apple(), new Orange()}));
            fail("Test should have failed because the arguments were not wrapped properly: ");
        }
        catch (MuleException e)
        {
            //expected
View Full Code Here

TOP

Related Classes of org.mule.tck.testmodels.fruit.FruitBowl

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.