View Javadoc

1   /*
2    * $Id: MethodInvokerDefinitionParserTestCase.java 22414 2011-07-14 13:24:46Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.config.spring.parsers.specific;
12  
13  import org.mule.construct.Flow;
14  import org.mule.tck.junit4.FunctionalTestCase;
15  
16  import org.junit.Test;
17  
18  import static org.junit.Assert.assertEquals;
19  
20  public class MethodInvokerDefinitionParserTestCase extends FunctionalTestCase
21  {
22  
23      @Test
24      public void testPojoFlow() throws Exception
25      {
26          Flow flow = muleContext.getRegistry().lookupObject("pojoFlow");
27          Flow flow2 = muleContext.getRegistry().lookupObject("pojoFlow2");
28  
29          assertEquals("start nullmethod2Arg1Arg2config2Val arg2Valmethod2Arg1Arg2config2Val ", flow.process(
30              getTestEvent("start ")).getMessageAsString());
31  
32          assertEquals("start nullmethod2Arg1Arg2null arg2Valmethod2Arg1Arg2null ", flow2.process(
33              getTestEvent("start ")).getMessageAsString());
34      }
35  
36      @Override
37      protected String getConfigResources()
38      {
39          return "pojo-invoke-test.xml";
40      }
41  
42  }