View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.transport.quartz;
8   
9   import org.mule.api.MuleMessage;
10  import org.mule.module.client.MuleClient;
11  import org.mule.tck.junit4.FunctionalTestCase;
12  import org.mule.transport.NullPayload;
13  
14  import org.junit.Test;
15  
16  import static org.junit.Assert.assertEquals;
17  import static org.junit.Assert.assertFalse;
18  import static org.junit.Assert.assertNotNull;
19  
20  public class QuartzPersistentQueueEventGeneratorTestCase extends FunctionalTestCase
21  {
22  
23      private static final long TIMEOUT = 30000;
24  
25      @Override
26      protected String getConfigResources()
27      {
28          return "quartz-persistent-event-generator.xml";
29      }
30  
31      @Test
32      public void testReceiveEvent() throws Exception
33      {
34          MuleClient client = new MuleClient(muleContext);
35          
36          MuleMessage result = client.request("vm://resultQueue", TIMEOUT);
37          assertNotNull(result);
38          assertFalse(result.getPayload() instanceof NullPayload);
39          assertEquals(TEST_MESSAGE, result.getPayload());
40      }    
41  }
42  
43