View Javadoc

1   /*
2    * $Id: TransformerTrackerLifecycleTestCase.java 19692 2010-09-21 23:50:35Z aperepel $
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  package org.mule.test.integration.transformer;
11  
12  import org.mule.api.MuleMessage;
13  import org.mule.api.client.MuleClient;
14  import org.mule.tck.FunctionalTestCase;
15  
16  public class TransformerTrackerLifecycleTestCase extends FunctionalTestCase
17  {
18      @Override
19      protected String getConfigResources()
20      {
21          return "org/mule/test/transformers/transformer-lifecycle.xml";
22      }
23  
24      public void testLifecycle() throws Exception
25      {
26  
27          MuleClient muleClient = muleContext.getClient();
28  
29          final MuleMessage result = muleClient.send("vm://EchoService.In", "foo", null);
30  
31          final LifecycleTrackerTransformer ltt = (LifecycleTrackerTransformer) result.getPayload();
32  
33          muleContext.dispose();
34  
35          //TODO MULE-5002 initialise called twice
36          assertEquals("[setProperty, setMuleContext, initialise, setMuleContext, initialise, start, stop]", 
37              ltt.getTracker().toString());
38      }
39  }