Examples of Banana


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

    public void testWithExpressions()
    {
        Apple apple = new Apple();
        apple.wash();
        Banana banana = new Banana();
        banana.bite();
        FruitBowl payload = new FruitBowl(apple, banana);
        DefaultMuleMessage msg = new DefaultMuleMessage(payload, muleContext);
        OgnlExpressionEvaluator e = new OgnlExpressionEvaluator();
        Object value = e.evaluate("apple.washed", msg);
        assertNotNull(value);
View Full Code Here

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

    // TODO MULE-1088: currently fails, therefore disabled
    public void testArrayArgumentResolution() throws Exception
    {
        EntryPointResolverSet resolverSet = new LegacyEntryPointResolverSet();

        Object payload = new Object[]{new Fruit[]{new Apple(), new Banana()}};
        RequestContext.setEvent(getTestEvent(payload));

        FruitBowl bowl = new FruitBowl();
        assertFalse(bowl.hasApple());
        assertFalse(bowl.hasBanana());
View Full Code Here

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

    /** Test for proper resolution of a method that takes a List as argument. */
    public void testListArgumentResolution() throws Exception
    {
        EntryPointResolverSet resolverSet = new LegacyEntryPointResolverSet();
        Object payload = Arrays.asList(new Fruit[]{new Apple(), new Banana()});
        RequestContext.setEvent(getTestEvent(payload));

        FruitBowl bowl = new FruitBowl();
        assertFalse(bowl.hasApple());
        assertFalse(bowl.hasBanana());
View Full Code Here

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

    /** Test for proper resolution of an existing method specified as override */
    public void testExplicitOverride() throws Exception
    {
        EntryPointResolverSet resolverSet = new LegacyEntryPointResolverSet();

        Object payload = Arrays.asList(new Fruit[]{new Apple(), new Banana()});
        RequestContext.setEvent(getTestEvent(payload));

        final String methodName = "setFruit";
        final String propertyName = MuleProperties.MULE_METHOD_PROPERTY;
        RequestContext.getEventContext().getMessage().setOutboundProperty(propertyName, methodName);
View Full Code Here

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

        return "org/mule/test/integration/routing/outbound/multicaster-sync-with-transformers-test.xml";
    }

    public void testSyncMulticast() 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);
View Full Code Here

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

        return "org/mule/test/integration/routing/outbound/expression-splitter-sync-test.xml";
    }

    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);
View Full Code Here

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

    {
        Object object = ClassUtils.instanciateClass("org.mule.tck.testmodels.fruit.Orange");
        assertNotNull(object);
        assertTrue(object instanceof Orange);

        object = ClassUtils.instanciateClass("org.mule.tck.testmodels.fruit.FruitBowl", new Apple(), new Banana());
        assertNotNull(object);
        assertTrue(object instanceof FruitBowl);

        FruitBowl bowl = (FruitBowl) object;
View Full Code Here

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

        return "org/mule/test/integration/routing/outbound/multicaster-async-with-transformers-test.xml";
    }

    public void testSyncMulticast() 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);
View Full Code Here

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

    }

    public void testMethodMatchWithArguments() throws Exception
    {
        ReflectionEntryPointResolver resolver = new ReflectionEntryPointResolver();
        InvocationResult result = resolver.invoke(new FruitBowl(), getTestEventContext(new Object[]{new Apple(), new Banana()}));
        assertEquals(result.getState(), InvocationResult.State.SUCCESSFUL);
        assertTrue(result.getResult() instanceof Fruit[]);
        //test that the correct methd was called
        assertTrue(((Fruit[]) result.getResult())[0] instanceof Apple);
        assertTrue(((Fruit[]) result.getResult())[1] instanceof Banana);
        assertEquals("addAppleAndBanana", result.getMethodCalled());

        result = resolver.invoke(new FruitBowl(), getTestEventContext(new Object[]{new Banana(), new Apple()}));
        assertEquals(result.getState(), InvocationResult.State.SUCCESSFUL);
        assertTrue(result.getResult() instanceof Fruit[]);
        assertTrue(((Fruit[]) result.getResult())[0] instanceof Banana);
        assertTrue(((Fruit[]) result.getResult())[1] instanceof Apple);
        assertEquals("addBananaAndApple", result.getMethodCalled());
View Full Code Here

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

    public void testInboundAutoTransform() throws Exception
    {
        latch = new Latch();
        MuleClient client = new MuleClient(muleContext);
        client.dispatch("vm://in", new FruitBowl(new Apple(), new Banana()), null);

        assertTrue(latch.await(3000, TimeUnit.MILLISECONDS));
    }
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.