1
2
3
4
5
6
7
8
9
10
11 package org.mule.transport.vm.functional;
12
13 import org.mule.api.MuleMessage;
14 import org.mule.module.client.MuleClient;
15 import org.mule.tck.FunctionalTestCase;
16
17 import java.util.Collections;
18
19 public class SessionPropertiesTestCase extends FunctionalTestCase
20 {
21
22 @Override
23 protected String getConfigResources()
24 {
25 return "vm/session-properties.xml";
26 }
27
28 public void testVmToVmSessionPropertiesTestCase() throws Exception
29 {
30 final MuleClient client = new MuleClient(muleContext);
31 MuleMessage response = client.send("vm://Flow1s1", "some message", Collections.emptyMap(), 1200000);
32 assertNotNullAndNotExceptionResponse(response);
33 }
34
35 public void testVm1ToVm2ThenVm1ToVm2SessionPropertiesTestCase() throws Exception
36 {
37 final MuleClient client = new MuleClient(muleContext);
38 MuleMessage response = client.send("vm://Flow1s2", "some message", Collections.emptyMap(), 1200000);
39 assertNotNullAndNotExceptionResponse(response);
40 }
41
42 private void assertNotNullAndNotExceptionResponse(MuleMessage response)
43 {
44 assertNotNull(response);
45 if (response.getExceptionPayload() != null)
46 {
47 fail(response.getExceptionPayload().getException().getCause().toString());
48 }
49 }
50
51
52 }