1
2
3
4
5
6
7
8
9
10
11 package org.mule.transport.http.functional;
12
13 import org.mule.api.MuleMessage;
14 import org.mule.module.client.MuleClient;
15 import org.mule.tck.FunctionalTestCase;
16 import org.mule.transport.http.HttpConnector;
17
18 public class HttpStemTestCase extends FunctionalTestCase
19 {
20
21 protected String getConfigResources()
22 {
23 return "http-stem-test.xml";
24 }
25
26 public void testStemMatchingHttp() throws Exception
27 {
28 MuleClient client = new MuleClient();
29 doTest(client, "http://localhost:60200/foo");
30 doTest(client, "http://localhost:60200/foo/bar");
31 }
32
33 public void testStemMatchingJetty() throws Exception
34 {
35 MuleClient client = new MuleClient();
36 doTest(client, "http://localhost:60201/foo");
37 doTest(client, "http://localhost:60201/foo/bar");
38 }
39
40 protected void doTest(MuleClient client, String url) throws Exception
41 {
42 MuleMessage result = client.send(url, "Hello World", null);
43 assertEquals("Hello World", result.getPayloadAsString());
44 assertEquals(200, result.getIntProperty(HttpConnector.HTTP_STATUS_PROPERTY, 0));
45 }
46
47 }
48
49