Package org.mule.tck.testmodels.fruit

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


    {
        ExpressionTransformer transformer = (ExpressionTransformer) muleContext.getRegistry().lookupTransformer("testTransformer2");
        Map<String, Object> props = new HashMap<String, Object>();
        props.put("foo", "moo");

        MuleMessage message = new DefaultMuleMessage(new FruitBowl(new Apple(), new Banana()), props, muleContext);

        transformer.transform(message);
        fail("Not all headers present, the transform should have failed");
    }
View Full Code Here


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

    @Test
    public void testMapHeadersWithGenerics() throws Exception
    {
        eventContext.getMessage().setProperty("apple", new Apple(), PropertyScope.INBOUND);
        eventContext.getMessage().setProperty("banana", new Banana(), PropertyScope.INBOUND);
        eventContext.getMessage().setProperty("orange", new Orange(), PropertyScope.INBOUND);

        eventContext.getMessage().setProperty(MuleProperties.MULE_ENCODING_PROPERTY, "UTF-8", PropertyScope.INBOUND);
        InvocationResult response = invokeResolver("processHeadersWithGenerics", eventContext);
        assertTrue("Message payload should be a Map", response.getResult() instanceof Map);
View Full Code Here

    @Test
    public void testListHeadersWithGenerics() throws Exception
    {
        Apple apple = new Apple();
        Banana banana = new Banana();
        Orange orange = new Orange();
        eventContext.getMessage().setProperty("apple", apple, PropertyScope.INBOUND);
        eventContext.getMessage().setProperty("banana", banana, PropertyScope.INBOUND);
        eventContext.getMessage().setProperty("orange", orange, PropertyScope.INBOUND);
View Full Code Here

        RedApple redApple = new RedApple();
        redApple.wash();

        muleContext.getRegistry().registerObject("redApple", redApple);
        muleContext.getRegistry().registerObject("anotherRedApple", new RedApple());
        muleContext.getRegistry().registerObject("aBanana", new Banana());

        InvocationResult response = invokeResolver("listFruit", eventContext);
        assertTrue("Message payload should be a List", response.getResult() instanceof List);
        List<?> result = (List<?>) response.getResult();
        assertEquals(2, result.size());
View Full Code Here

    @Test
    public void testBean()
    {
        Apple apple = new Apple();
        apple.wash();
        FruitBowl payload = new FruitBowl(apple, new Banana());
        DefaultMuleMessage msg = new DefaultMuleMessage(payload, muleContext);

        JXPathExpressionEvaluator e = new JXPathExpressionEvaluator();
        Object value = e.evaluate("apple/washed", msg);
        assertNotNull(value);
View Full Code Here

TOP

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

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.