View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.test.transformers;
8   
9   import org.mule.api.MuleMessage;
10  import org.mule.api.client.LocalMuleClient;
11  import org.mule.tck.junit4.FunctionalTestCase;
12  
13  import org.custommonkey.xmlunit.XMLAssert;
14  import org.junit.Test;
15  
16  public class TransformerWeightingFunctionalTestCase extends FunctionalTestCase
17  {
18  
19      private static final String XML_REQUEST = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
20                                                "<catalog>\n" +
21                                                "    <cd>\n" +
22                                                "        <title>Empire Burlesque</title>\n" +
23                                                "        <artist>Bob Dylan</artist>\n" +
24                                                "        <country>USA</country>\n" +
25                                                "        <company>Columbia</company>\n" +
26                                                "        <price>10.90</price>\n" +
27                                                "        <year>1985</year>\n" +
28                                                "    </cd>\n" +
29                                                "</catalog>";
30  
31      @Override
32      protected String getConfigResources()
33      {
34          return "org/mule/test/transformers/transformer-weighting-functional-config.xml";
35      }
36  
37      @Test
38      public void findTwoTransformers() throws Exception
39      {
40          LocalMuleClient client = muleContext.getClient();
41  
42          MuleMessage response = client.send("vm://testInput", XML_REQUEST, null);
43  
44          XMLAssert.assertXMLEqual(XML_REQUEST, response.getPayloadAsString());
45      }
46  }