1   /*
2    * $Id: SxcFilterTestCase.java 12264 2008-07-09 22:24:04Z dandiep $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.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.module.sxc;
12  
13  import org.mule.api.MuleMessage;
14  import org.mule.module.client.MuleClient;
15  import org.mule.tck.FunctionalTestCase;
16  
17  import java.io.ByteArrayOutputStream;
18  
19  import org.apache.commons.io.IOUtils;
20  
21  public class HttpRoutingTestCase extends FunctionalTestCase
22  {
23      int finished = 0;
24  
25      public void testBasicXPath() throws Exception
26      {
27          final MuleClient client = new MuleClient();
28  
29          final ByteArrayOutputStream out = new ByteArrayOutputStream();
30          IOUtils.copy(getClass().getResourceAsStream("/purchase-order.xml"), out);
31  
32          MuleMessage res = client.send("http://localhost:63081/proxy", out.toByteArray(), null);
33          System.out.println(res.getPayloadAsString());
34          assertTrue(res.getPayloadAsString().contains("purchaseOrder"));
35          assertTrue(res.getPayloadAsString().contains("Alice"));
36      }
37  
38      @Override
39      protected String getConfigResources()
40      {
41          return "http-routing-conf.xml";
42      }
43  
44  }