View Javadoc

1   /*
2    * $Id: SessionPropertyChainingRouterTestCase.java 23054 2011-10-02 05:31:18Z dirk.olmes $
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.junit4.FunctionalTestCase;
16  import org.mule.tck.NonSerializableObject;
17  
18  import org.junit.Test;
19  
20  import static org.junit.Assert.assertNotNull;
21  import static org.junit.Assert.assertTrue;
22  
23  /**
24   * see EE-2307
25   *
26   * Non serializable session properties won't be serialized with the mule session
27   * but neither it will be lost in the flow were it was stored
28   */
29  public class SessionPropertyChainingRouterTestCase extends FunctionalTestCase
30  {
31      @Override
32      protected String getConfigResources()
33      {
34          return "org/mule/test/integration/messaging/session-property-chaining-router.xml";
35      }
36  
37      @Test
38      public void testRouter() throws Exception
39      {
40          MuleClient client = new MuleClient(muleContext);
41          MuleMessage response = client.send("vm://in", "test message", null);
42          assertNotNull(response);
43          assertTrue("Response is " + response.getPayload(), response.getPayload() instanceof NonSerializableObject);
44      }
45  }
46  
47