Package org.mule.tck.testmodels.fruit

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


    }

    public void testBeanPropertiesOnAProxy() throws Exception
    {
        OrangeInterface o = (OrangeInterface)Proxy.newProxyInstance(getClass().getClassLoader(),
                new Class[]{OrangeInterface.class}, new OrangeInvocationHandler(new Orange()));

        BeanUtils.populateWithoutFail(o, map, true);

        assertNotNull(o);
        assertEquals("Juicy!", o.getBrand());
View Full Code Here


        assertEquals(new Integer(22), o.getSegments());
    }

    public void testBeanPropertiesWithoutFail() throws Exception
    {
        Orange o = new Orange();

        BeanUtils.populateWithoutFail(o, map, true);

        assertNotNull(o);
        assertEquals("Juicy!", o.getBrand());
        assertEquals(new Double(2.32), o.getRadius());
        assertEquals(new Integer(22), o.getSegments());
    }
View Full Code Here

    public void testBeanPropertiesWithFail() throws Exception
    {
        try
        {
            BeanUtils.populate(new Orange(), map);
            fail("Trombones is not a valid property");
        }
        catch (IllegalArgumentException e)
        {
            //expected
View Full Code Here

     */
    public void testTransientRegistryPrecedence() throws Exception
    {
        MuleContext context = new DefaultMuleContextFactory().createMuleContext();
       
        context.getRegistry().registerObject("orange", new Orange(12, 5.5, "Tutti Frutti"));
       
        ApplicationContext appContext = new ClassPathXmlApplicationContext("application-context.xml");
        ConfigurationBuilder builder = new SpringConfigurationBuilder(appContext);
        builder.configure(context);

View Full Code Here

    public void testSplitAggregateFlow() throws MuleException, Exception
    {
        final Apple apple = new Apple();
        final Banana banana = new Banana();
        final Orange orange = new Orange();
        final FruitBowl fruitBowl = new FruitBowl(apple, banana);
        fruitBowl.addFruit(orange);

        muleContext.getClient().send("vm://split-aggregate-in",
            new DefaultMuleMessage(fruitBowl, muleContext));

        final MuleMessage result = muleContext.getClient().request("vm://split-aggregate-out",
            RECEIVE_TIMEOUT);

        assertNotNull(result);
        assertTrue(result instanceof MuleMessageCollection);
        final MuleMessageCollection coll = (MuleMessageCollection) result;
        assertEquals(3, coll.size());
        final List<?> results = (List<?>) coll.getPayload();

        assertTrue(apple.isBitten());
        assertTrue(banana.isBitten());
        assertTrue(orange.isBitten());

        assertTrue(results.contains(apple));
        assertTrue(results.contains(banana));
        assertTrue(results.contains(orange));
    }
View Full Code Here

    public void testSplitAggregateListFlow() throws MuleException, Exception
    {
        final Apple apple = new Apple();
        final Banana banana = new Banana();
        final Orange orange = new Orange();
        final FruitBowl fruitBowl = new FruitBowl(apple, banana);
        fruitBowl.addFruit(orange);

        muleContext.getClient().send("vm://split-aggregate-list-in",
            new DefaultMuleMessage(fruitBowl.getFruit(), muleContext));

        final MuleMessage result = muleContext.getClient().request("vm://split-aggregate-list-out",
            RECEIVE_TIMEOUT);

        assertNotNull(result);
        assertTrue(result instanceof MuleMessageCollection);
        final MuleMessageCollection coll = (MuleMessageCollection) result;
        assertEquals(3, coll.size());
        final List<?> results = (List<?>) coll.getPayload();

        assertTrue(apple.isBitten());
        assertTrue(banana.isBitten());
        assertTrue(orange.isBitten());

        assertTrue(results.contains(apple));
        assertTrue(results.contains(banana));
        assertTrue(results.contains(orange));
    }
View Full Code Here

    public void testSplitAggregateMapFlow() throws MuleException, Exception
    {
        Map map = new HashMap<String, Fruit>();
        final Apple apple = new Apple();
        final Banana banana = new Banana();
        final Orange orange = new Orange();
        map.put("apple", apple);
        map.put("banana", banana);
        map.put("orange", orange);

        MuleEvent result = ((Flow) muleContext.getRegistry().lookupFlowConstruct("split-map")).process(getTestEvent(map));

        assertNotNull(result);
        assertTrue(result.getMessage() instanceof MuleMessageCollection);

        final MuleMessageCollection coll = (MuleMessageCollection) result.getMessage();
        assertEquals(3, coll.size());
        final MuleMessage[] results = coll.getMessagesAsArray();

        assertTrue(apple.isBitten());
        assertTrue(banana.isBitten());
        assertTrue(orange.isBitten());

        assertNotNull(results[0].getProperty("key", PropertyScope.INVOCATION));
        assertNotNull(results[1].getProperty("key", PropertyScope.INVOCATION));
        assertNotNull(results[2].getProperty("key", PropertyScope.INVOCATION));
    }
View Full Code Here

   
    public void testSplitFilterAggregateFlow() throws MuleException, Exception
    {
        final Apple apple = new Apple();
        final Banana banana = new Banana();
        final Orange orange = new Orange();
        final FruitBowl fruitBowl = new FruitBowl(apple, banana);
        fruitBowl.addFruit(orange);

        muleContext.getClient().send("vm://split-filter-aggregate-in",
            new DefaultMuleMessage(fruitBowl, muleContext));
View Full Code Here

    }

    public void testSplitter() throws Exception
    {
        FruitBowl fruitBowl = new FruitBowl(new Apple(), new Banana());
        fruitBowl.addFruit(new Orange());

        MuleClient client = new MuleClient(muleContext);
        client.dispatch("vm://distributor.queue", fruitBowl, null);

        List<Object> results = new ArrayList<Object>(3);
View Full Code Here

    }

    public void testRecipientList() throws Exception
    {
        FruitBowl fruitBowl = new FruitBowl(new Apple(), new Banana());
        fruitBowl.addFruit(new Orange());

        MuleClient client = new MuleClient(muleContext);
        MuleMessage result = client.send("vm://distributor.queue", fruitBowl, null);

        assertNotNull(result);
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.