1
2
3
4
5
6
7
8
9
10
11 package org.mule.test.integration.message;
12
13 import org.mule.api.MuleMessage;
14 import org.mule.module.client.MuleClient;
15 import org.mule.tck.AbstractServiceAndFlowTestCase;
16 import org.mule.transport.NullPayload;
17
18 import java.util.Arrays;
19 import java.util.Collection;
20
21 import org.junit.Ignore;
22 import org.junit.Test;
23 import org.junit.runners.Parameterized.Parameters;
24
25 import static org.junit.Assert.assertEquals;
26 import static org.junit.Assert.assertNotNull;
27 import static org.junit.Assert.assertTrue;
28
29 public class MessagePropertyScopesTestCase extends AbstractServiceAndFlowTestCase
30 {
31 @Parameters
32 public static Collection<Object[]> parameters()
33 {
34 return Arrays.asList(new Object[][]{
35 {ConfigVariant.SERVICE, "org/mule/test/integration/messaging/message-property-scopes-config-service.xml"},
36 {ConfigVariant.FLOW, "org/mule/test/integration/messaging/message-property-scopes-config-flow.xml"}
37 });
38 }
39
40 public MessagePropertyScopesTestCase(ConfigVariant variant, String configResources)
41 {
42 super(variant, configResources);
43 }
44
45 @Test
46 public void testSessionProperty() throws Exception {
47
48 MuleClient client = new MuleClient(muleContext);
49 MuleMessage response = client.send("vm://in1", "Hello World", null);
50 assertNotNull(response);
51 String payload = response.getPayloadAsString();
52 assertNotNull(payload);
53 assertEquals("java.util.Date", payload);
54 }
55
56 @Ignore
57 @Test
58 public void testInvocationProperty() throws Exception
59 {
60 MuleClient client = new MuleClient(muleContext);
61 MuleMessage response = client.send("vm://in2", "Hello World", null);
62
63 assertTrue(response.getPayload() instanceof NullPayload);
64 }
65 }