View Javadoc

1   /*
2    * $Id: MessagePropertyScopesTestCase.java 20297 2010-11-22 18:49:18Z aperepel $
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.test.integration.message;
12  
13  import org.mule.api.MuleMessage;
14  import org.mule.module.client.MuleClient;
15  import org.mule.tck.FunctionalTestCase;
16  
17  public class MessagePropertyScopesTestCase extends FunctionalTestCase {
18  
19      @Override
20      protected String getConfigResources()
21      {
22          return "org/mule/test/integration/messaging/message-property-scopes-config.xml";
23      }
24  
25      public void testSessionProperty() throws Exception {
26  
27          MuleClient client = new MuleClient(muleContext);
28          MuleMessage response = client.send("vm://in1", "Hello World", null);
29          assertNotNull(response);
30          String payload = response.getPayloadAsString();
31          assertNotNull(payload);
32          assertEquals("java.util.Date", payload);
33      }
34  
35      /* Test fails
36      public void testInvocationProperty() throws Exception {
37          
38          MuleClient client = new MuleClient();
39          MuleMessage response = client.send("vm://in2", "Hello World", null);
40          // scope = "invocation" should not propagate the property on to the next service
41          assertTrue(response.getPayload() instanceof NullPayload);
42      }
43      */
44  }