Package org.mule.tck.testmodels.fruit

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


        assertEquals("true", message.getOutboundProperty("boolean", ""));

        assertEquals(apple, message.getOutboundProperty("apple"));
        try
        {
            message.getOutboundProperty("apple", new Orange());
            fail("Orange is not assignable to Apple");
        }
        catch (IllegalArgumentException e)
        {
            //expected
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);
        Map<?, ?> result = (Map<?, ?>) response.getResult();
        //Will match all Mule headers
        assertEquals(2, result.size());

        assertEquals(new Apple(), result.get("apple"));
        assertEquals(new Orange(), result.get("orange"));
        assertNull(result.get("banana"));
    }
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);

        eventContext.getMessage().setProperty(MuleProperties.MULE_ENCODING_PROPERTY, "UTF-8", PropertyScope.INBOUND);
View Full Code Here

        assertEquals(2, result.size());

        assertEquals(redApple, result.get(1));

        //Add optional Orange
        muleContext.getRegistry().registerObject("orange", new Orange());
        response = invokeResolver("listFruit", eventContext);
        assertTrue("Message payload should be a List", response.getResult() instanceof List);
        result = (List<?>) response.getResult();
        //We now have an orange
        assertEquals(3, result.size());
View Full Code Here

    {
        jsonString = "{\"apple\":{\"bitten\":true,\"washed\":false},\"orange\":{\"brand\":\""
            +  getBrandOfOrange(Locale.JAPAN)
            + "\",\"segments\":8,\"radius\":3.45,\"listProperties\":null,\"mapProperties\":null,\"arrayProperties\":null}}";

        jsonObject = new FruitCollection(new Apple(true), null, new Orange(8, 3.45, getBrandOfOrange(Locale.JAPAN)));
    }
View Full Code Here

TOP

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

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.