View Javadoc

1   /*
2    * $Id: TransformerAttributeTestCase.java 20321 2010-11-24 15:21:24Z dfeist $
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.transport.vm;
12  
13  import org.mule.api.MuleMessage;
14  import org.mule.module.client.MuleClient;
15  import org.mule.tck.FunctionalTestCase;
16  import org.mule.tck.functional.StringAppendTestTransformer;
17  
18  public class TransformerAttributeTestCase extends FunctionalTestCase
19  {
20  
21      public static final String OUTBOUND_MESSAGE = "Test message";
22  
23      protected String getConfigResources()
24      {
25          return "vm/transformer-attribute-test.xml";
26      }
27  
28      public void testSimple() throws Exception
29      {
30          MuleMessage message = new MuleClient(muleContext).send("vm://simple", OUTBOUND_MESSAGE, null);
31          assertNotNull(message);
32          assertEquals(StringAppendTestTransformer.appendDefault(OUTBOUND_MESSAGE)  + " Received",
33                  message.getPayloadAsString());
34      }
35  
36      public void testThrough() throws Exception
37      {
38          MuleMessage message = new MuleClient(muleContext).send("vm://chained", OUTBOUND_MESSAGE, null);
39          assertNotNull(message);
40          assertEquals(StringAppendTestTransformer.appendDefault(OUTBOUND_MESSAGE)  + " Received",
41                  message.getPayloadAsString());
42      }
43  
44  }