View Javadoc

1   /*
2    * $Id: JettyHttpFunctionalTestCase.java 19191 2010-08-25 21:05:23Z tcarlson $
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.servlet.jetty;
12  
13  import org.mule.api.MuleMessage;
14  import org.mule.api.client.LocalMuleClient;
15  import org.mule.transport.http.HttpConstants;
16  import org.mule.transport.http.functional.HttpFunctionalTestCase;
17  
18  import java.util.HashMap;
19  import java.util.Map;
20  
21  public class JettyHttpFunctionalTestCase extends HttpFunctionalTestCase
22  {
23  
24      @Override
25      protected String getConfigResources()
26      {
27          return "jetty-http-functional-test.xml";
28      }
29  
30      public void testNonRootUrls() throws Exception
31      {
32          LocalMuleClient client = muleContext.getClient();
33          Map props = new HashMap();
34          props.put(HttpConstants.HEADER_CONTENT_TYPE, "text/plain;charset=UTF-8");
35          MuleMessage result = client.send("anotherClientEndpoint", TEST_MESSAGE, props);
36          assertEquals(TEST_MESSAGE + " Received", result.getPayloadAsString());
37      }
38  
39  
40  }