1   /*
2    * $Id: PersistentUnaddressedVmQueueTestCase.java 11946 2008-06-04 08:16:33Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.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.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  public class PersistentUnaddressedVmQueueTestCase extends FunctionalTestCase
18  {
19      private static final int RECEIVE_TIMEOUT = 5000;
20  
21      protected String getConfigResources()
22      {
23          return "vm/persistent-unaddressed-vm-queue-test.xml";
24      }
25  
26      public void testAsynchronousDispatching() throws Exception
27      {
28          MuleClient client = new MuleClient();
29          client.dispatch("vm://receiver1?connector=Connector1", "Test", null);
30          MuleMessage result = client.request("vm://out?connector=Connector2", RECEIVE_TIMEOUT);
31  	    assertNotNull(result);
32  	    assertEquals(result.getPayloadAsString(),"Test");
33      }
34  
35  }