Examples of Orange


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

    public void testWriteReadPayload() throws Exception
    {
        // Create orange to send over the wire
        Properties messageProerties = new Properties();
        messageProerties.put("key1", "val1");
        Orange inOrange = new Orange();
        inOrange.setBrand("Walmart");
        inOrange.setMapProperties(messageProerties);

        try
        {
            readWrite(inOrange);
            fail("Expected exception: MuleMessageWireFormat does not support other types");
View Full Code Here

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

    public void testWriteReadPayload() throws Exception
    {
        // Create orange to send over the wire
        Properties messageProerties = new Properties();
        messageProerties.put("key1", "val1");
        Orange inOrange = new Orange();
        inOrange.setBrand("Walmart");
        inOrange.setMapProperties(messageProerties);

        Object outObject = readWrite(inOrange);

        // Test deserialized Fruit
        assertTrue(outObject instanceof Orange);
View Full Code Here

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

        assertEquals(Apple.class, component.getObjectFactory().getObjectClass());
        assertEquals(Apple.class, component.getObjectType());

        try
        {
            component = new SimpleCallableJavaComponent(new Orange());
        }
        catch (Exception e)
        {
            assertSame(DefaultMuleException.class, e.getClass());
        }
View Full Code Here

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

            setReturnDataType(DataTypeFactory.create(Orange.class));
        }

        protected Object doTransform(Object src, String encoding) throws TransformerException
        {
            return new Orange();
        }
View Full Code Here

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

    public void testMapHeadersWithGenerics() throws Exception
    {
        props.put("apple", new Apple());
        props.put("banana", new Banana());
        props.put("orange", new Orange());

        MuleClient client = new MuleClient(muleContext);
        MuleMessage message = client.send("vm://headersWithGenerics", null, props);
        assertNotNull("return message from MuleClient.send() should not be null", message);
        assertTrue("Message payload should be a Map", message.getPayload() instanceof Map);
        Map<?, ?> result = (Map<?, ?>) message.getPayload();
        //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

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

    public void testListHeadersWithGenerics() throws Exception
    {
        Apple apple = new Apple();
        Banana banana = new Banana();
        Orange orange = new Orange();
        props.put("apple", apple);
        props.put("banana", banana);
        props.put("orange", orange);

        MuleClient client = new MuleClient(muleContext);
View Full Code Here

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

        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<Fruit>) response.getResult();
        //We now have an orange
        assertEquals(3, result.size());
View Full Code Here

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

        return new DefaultMuleMessage("Juicy", props, muleContext);
    }

    public Object getResultData()
    {
        return new Orange(14, 5.43, "Juicy");
    }
View Full Code Here

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

        syncSplitter.addRoute((OutboundEndpoint) mockendpoint5.proxy());
        syncSplitter.addRoute((OutboundEndpoint) mockendpoint6.proxy());
        List<Object> payload = new ArrayList<Object>();
        payload.add(new Apple());
        payload.add(new Apple());
        payload.add(new Orange());
        payload.add("");
        MuleMessage message = new DefaultMuleMessage(payload, muleContext);

        assertTrue(asyncSplitter.isMatch(message));
        mockendpoint1.expect("process", RouterTestUtils.getArgListCheckerMuleEvent());
View Full Code Here

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

        router.addRoute((OutboundEndpoint) mockendpoint3.proxy());

        List<Object> payload = new ArrayList<Object>();
        payload.add(new Apple());
        payload.add(new Apple());
        payload.add(new Orange());
        payload.add(new String());
        MuleMessage message = new DefaultMuleMessage(payload, muleContext);

        assertTrue(router.isMatch(message));
        mockendpoint1.expect("process", RouterTestUtils.getArgListCheckerMuleEvent());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.