1
2
3
4
5
6
7
8
9
10
11 package org.mule.test.integration.messaging.meps;
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.NullPayload;
17
18
19
20
21 public class SynchronousResponseExceptionTestCase extends FunctionalTestCase
22 {
23 @Override
24 protected String getConfigResources()
25 {
26 return "org/mule/test/integration/messaging/meps/synchronous-response-exception.xml";
27 }
28
29 public void testComponentException() throws Exception
30 {
31 MuleClient client = new MuleClient(muleContext);
32 MuleMessage reply = client.send("vm://in1", "request", null);
33 assertTrue("Response should be null but is " + reply.getPayload(), reply.getPayload() instanceof NullPayload);
34 }
35
36 public void testOutboundRoutingException() throws Exception
37 {
38 MuleClient client = new MuleClient(muleContext);
39 MuleMessage reply = client.send("vm://in2", "request", null);
40 assertTrue("Response should be null but is " + reply.getPayload(), reply.getPayload() instanceof NullPayload);
41 }
42
43 public void testInboundTransformerException() throws Exception
44 {
45 MuleClient client = new MuleClient(muleContext);
46 MuleMessage reply = client.send("vm://in3", "request", null);
47 assertTrue("Response should be null but is " + reply.getPayload(), reply.getPayload() instanceof NullPayload);
48 }
49
50 public void testOutboundTransformerException() throws Exception
51 {
52 MuleClient client = new MuleClient(muleContext);
53 MuleMessage reply = client.send("vm://in4", "request", null);
54 assertTrue("Response should be null but is " + reply.getPayload(), reply.getPayload() instanceof NullPayload);
55 }
56
57 public void testResponseTransformerException() throws Exception
58 {
59 MuleClient client = new MuleClient(muleContext);
60 MuleMessage reply = client.send("vm://in5", "request", null);
61 assertTrue("Response should be null but is " + reply.getPayload(), reply.getPayload() instanceof NullPayload);
62 }
63 }
64
65